@wkoutre/teamwork-os 1.0.0 → 1.0.1

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.
Files changed (65) hide show
  1. package/README.md +3 -2
  2. package/cli.jsc +0 -0
  3. package/dist/assets/AnalyticsPage-BoafbdRY.js +1 -0
  4. package/dist/assets/BriefsPage-BsBjNIJT.js +1 -0
  5. package/dist/assets/BriefsPage-C2lUZ05b.css +1 -0
  6. package/dist/assets/Button-BOCZ-tMU.css +1 -0
  7. package/dist/assets/Button-xBBZQ0ie.js +1 -0
  8. package/dist/assets/Card-Q-x7mRn3.css +1 -0
  9. package/dist/assets/Card-u29day7d.js +1 -0
  10. package/dist/assets/ChatPanel-BUNJ-rXp.js +29 -0
  11. package/dist/assets/ChatPanel-CK_zI3mg.css +1 -0
  12. package/dist/assets/ContinuousImprovementPage-DQDtZtX3.css +1 -0
  13. package/dist/assets/ContinuousImprovementPage-F6fizSUr.js +1 -0
  14. package/dist/assets/HeartbeatPanel-D5azjMkJ.css +1 -0
  15. package/dist/assets/HeartbeatPanel-q7mW5VDk.js +1 -0
  16. package/dist/assets/IdeasContainer-Cl1WkgLe.css +1 -0
  17. package/dist/assets/IdeasContainer-DDhsyl1f.js +3 -0
  18. package/dist/assets/Input-C6Eciq4Y.css +1 -0
  19. package/dist/assets/Input-HhV6M0tu.js +1 -0
  20. package/dist/assets/KpiTile-pXTBj77S.js +1 -0
  21. package/dist/assets/MemoryExplore-DXgmdeOp.css +1 -0
  22. package/dist/assets/MemoryExplore-wFiVBkXu.js +1 -0
  23. package/dist/assets/MemoryHygiene-C_lFMujk.js +2 -0
  24. package/dist/assets/MemoryHygiene-D9-lcjQc.css +1 -0
  25. package/dist/assets/MemoryInjections-CG5Jnfc2.css +1 -0
  26. package/dist/assets/MemoryInjections-F6D1_uAX.js +1 -0
  27. package/dist/assets/MemoryOverview-BG2lpis1.js +1 -0
  28. package/dist/assets/MemoryOverview-BuFrUzre.css +1 -0
  29. package/dist/assets/MemoryPage-DS6LWMdS.js +2 -0
  30. package/dist/assets/MemoryPage-DkvxMEXj.css +1 -0
  31. package/dist/assets/MemoryWiki-Mh-mjN1m.css +1 -0
  32. package/dist/assets/MemoryWiki-cypT6R3l.js +3 -0
  33. package/dist/assets/OrgPage-DP2-hcbf.js +33 -0
  34. package/dist/assets/OrgPage-nDdhTt3V.css +1 -0
  35. package/dist/assets/PipelinesPage-BzYkkX-n.js +1 -0
  36. package/dist/assets/PipelinesPage-VXjq7839.css +1 -0
  37. package/dist/assets/RelativeTime-CARWwY-H.js +1 -0
  38. package/dist/assets/ScheduleOptimizerPage-Cmje0CoX.js +10 -0
  39. package/dist/assets/SessionHistory-DwX-i9Io.js +2 -0
  40. package/dist/assets/SettingsPage-C6Xq22uB.js +49 -0
  41. package/dist/assets/SettingsRow-4w9Ab9mk.js +1 -0
  42. package/dist/assets/SupervisorDashboardPage-BEuElLHE.css +1 -0
  43. package/dist/assets/SupervisorDashboardPage-CrsOGBZ8.js +1 -0
  44. package/dist/assets/UsagePage-Cm8NsPw7.js +4 -0
  45. package/dist/assets/UsagePage-DlwHL1zI.css +1 -0
  46. package/dist/assets/dagre-CHpVij2M.css +1 -0
  47. package/dist/assets/dagre.esm-DBOl5nQa.js +7 -0
  48. package/dist/assets/events-CCBP4a9s.js +1 -0
  49. package/dist/assets/generateCategoricalChart-pfORgeJG.js +60 -0
  50. package/dist/assets/index-C57L9wdB.css +1 -0
  51. package/dist/assets/index-tOLuwPW6.js +93 -0
  52. package/dist/assets/jsx-runtime-Bq3x7umQ.js +1 -0
  53. package/dist/assets/lib-osArdP58.js +16 -0
  54. package/dist/assets/react-dom-Cnw6SoYl.js +8 -0
  55. package/dist/assets/shared-CHkcO7VT.css +1 -0
  56. package/dist/assets/shared-wI40KN7Y.js +1 -0
  57. package/dist/assets/styles-Ds5gMQAQ.js +1 -0
  58. package/dist/assets/types-CNhs8RVF.js +1 -0
  59. package/dist/assets/ui-Bx41p7g8.js +1 -0
  60. package/dist/assets/useGet-CU5_p7vA.js +1 -0
  61. package/dist/assets/useWebSocket-Hg3RO6sx.js +1 -0
  62. package/dist/assets/value-A1VqfRmL.js +1 -0
  63. package/dist/index.html +45 -0
  64. package/gateway.jsc +0 -0
  65. package/package.json +3 -2
@@ -0,0 +1,49 @@
1
+ import{n as e,s as t,t as n}from"./jsx-runtime-Bq3x7umQ.js";import{c as r,r as i,s as a}from"./useWebSocket-Hg3RO6sx.js";import{f as o,i as s,n as c,o as l,p as u,s as d}from"./styles-Ds5gMQAQ.js";import{b as f}from"./events-CCBP4a9s.js";import{n as p}from"./types-CNhs8RVF.js";import{t as m}from"./Card-u29day7d.js";import{n as h,r as g}from"./Input-HhV6M0tu.js";import{t as _}from"./Button-xBBZQ0ie.js";import{N as v,Ot as y,P as b,c as x,f as ee,jt as S,kt as C,m as te,n as w,o as ne,p as re,r as ie,t as ae,vt as oe,yt as se}from"./index-tOLuwPW6.js";import{n as ce,t as le}from"./SettingsRow-4w9Ab9mk.js";var T=t(e(),1),E=n(),D={background:`var(--color-bg-raised)`,color:c.text,border:`1px solid ${c.border}`,borderRadius:6,padding:`4px 10px`,fontSize:13,cursor:`pointer`,minWidth:80},O=o,k=u;async function ue(e,t,n){t({status:`loading`});let r=await te(e);n.current=e,t(r.ok?{status:`loaded`,models:r.models}:{status:`error`,message:r.error})}function A(e,t,n){t({engine:{...e?.engine??{default:`claude`,defaultModel:``,maxRetries:2,retryBaseDelayMs:1e3,defaultEffortLevel:``,allowOverage:!0,noProgressTimeoutMs:15e5},...n}})}function de({settings:e,onUpdateSettings:t,runtimeConfig:n}){let r=e?.engine,i=r?.ollama?.host??``,[a,o]=(0,T.useState)(i),[u,f]=(0,T.useState)({status:`idle`}),p=(0,T.useRef)(null);(0,T.useEffect)(()=>{o(e=>e===i?e:i)},[i]),(0,T.useEffect)(()=>{if(!i){p.current=null,f({status:`idle`});return}p.current===i&&u.status!==`idle`||ue(i,f,p)},[i]);function m(n){let a=n.trim();if(a!==i){if(!a){t({engine:{...r??{default:`claude`,defaultModel:``,maxRetries:2,retryBaseDelayMs:1e3,defaultEffortLevel:``,allowOverage:!0,noProgressTimeoutMs:15e5},ollama:null}}),p.current=null,f({status:`idle`});return}A(e,t,{ollama:{host:a,defaultModel:r?.ollama?.defaultModel??``,timeoutMs:r?.ollama?.timeoutMs??3e5,maxToolCalls:r?.ollama?.maxToolCalls??10,maxTurns:r?.ollama?.maxTurns??10}}),ue(a,f,p)}}return(0,E.jsxs)(S,{title:`Engine Configuration`,description:`Configure the Claude CLI engine defaults for all agent sessions.`,children:[(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10},children:[(0,E.jsx)(`div`,{style:O,children:(0,E.jsxs)(`div`,{style:k,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`CLI Binary`}),(0,E.jsx)(`div`,{style:s,children:`Set via CLAUDE_COMMAND environment variable`})]}),(0,E.jsx)(y,{children:n?.claudeCommand??`claude`})]})}),(0,E.jsxs)(`div`,{style:O,children:[(0,E.jsxs)(`div`,{style:{marginBottom:8},children:[(0,E.jsx)(`div`,{style:d,children:`Default Model`}),(0,E.jsx)(`div`,{style:s,children:`Override per-employee, or leave empty for CLI default`})]}),(0,E.jsxs)(`select`,{value:r?.defaultModel??``,onChange:n=>A(e,t,{defaultModel:n.target.value}),style:{...l,cursor:`pointer`},children:[(0,E.jsx)(`option`,{value:``,children:`— use CLI default —`}),r?.defaultModel&&!re(r.defaultModel)&&(0,E.jsxs)(`option`,{value:r.defaultModel,children:[r.defaultModel,` (custom)`]}),ee.map(e=>(0,E.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]}),(0,E.jsxs)(`div`,{style:O,children:[(0,E.jsxs)(`div`,{style:{...k,marginBottom:12},children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Max Retries`}),(0,E.jsx)(`div`,{style:s,children:`Retry on transient errors (rate limits, timeouts)`})]}),(0,E.jsx)(`select`,{value:r?.maxRetries??2,onChange:n=>A(e,t,{maxRetries:Number(n.target.value)}),style:D,children:[0,1,2,3,4,5].map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))})]}),(0,E.jsx)(`div`,{style:{borderTop:`1px solid ${c.border}`,paddingTop:12},children:(0,E.jsxs)(`div`,{style:k,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Retry Base Delay`}),(0,E.jsx)(`div`,{style:s,children:`Exponential backoff base (doubled each retry)`})]}),(0,E.jsxs)(`select`,{value:r?.retryBaseDelayMs??1e3,onChange:n=>A(e,t,{retryBaseDelayMs:Number(n.target.value)}),style:D,children:[(0,E.jsx)(`option`,{value:500,children:`500ms`}),(0,E.jsx)(`option`,{value:1e3,children:`1s`}),(0,E.jsx)(`option`,{value:2e3,children:`2s`}),(0,E.jsx)(`option`,{value:5e3,children:`5s`}),(0,E.jsx)(`option`,{value:1e4,children:`10s`})]})]})})]}),(0,E.jsx)(`div`,{style:O,children:(0,E.jsxs)(`div`,{style:k,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Per-Session Timeout`}),(0,E.jsx)(`div`,{style:s,children:`Wall-clock budget per Claude session (single-shot, not idle-based). Per-job override in the Job edit form takes precedence. 0 disables.`})]}),(0,E.jsxs)(`select`,{value:r?.noProgressTimeoutMs??15e5,onChange:n=>A(e,t,{noProgressTimeoutMs:Number(n.target.value)}),style:D,children:[(0,E.jsx)(`option`,{value:0,children:`Disabled`}),(0,E.jsx)(`option`,{value:6e4,children:`1 min`}),(0,E.jsx)(`option`,{value:18e4,children:`3 min`}),(0,E.jsx)(`option`,{value:3e5,children:`5 min`}),(0,E.jsx)(`option`,{value:6e5,children:`10 min`}),(0,E.jsx)(`option`,{value:9e5,children:`15 min`}),(0,E.jsx)(`option`,{value:12e5,children:`20 min`}),(0,E.jsx)(`option`,{value:15e5,children:`25 min (default)`}),(0,E.jsx)(`option`,{value:18e5,children:`30 min`})]})]})}),(0,E.jsx)(`div`,{style:O,children:(0,E.jsxs)(`div`,{style:k,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Default Effort Level`}),(0,E.jsx)(`div`,{style:s,children:`Applied when employee doesn't specify one`})]}),(0,E.jsxs)(`select`,{value:r?.defaultEffortLevel??``,onChange:n=>A(e,t,{defaultEffortLevel:n.target.value}),style:D,children:[(0,E.jsx)(`option`,{value:``,children:`Auto`}),(0,E.jsx)(`option`,{value:`low`,children:`Low`}),(0,E.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,E.jsx)(`option`,{value:`high`,children:`High`}),(0,E.jsx)(`option`,{value:`xhigh`,children:`Extra High`}),(0,E.jsx)(`option`,{value:`max`,children:`Maximum`})]})]})})]}),(0,E.jsxs)(`div`,{style:{marginTop:20},children:[(0,E.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:c.text,marginBottom:8},children:`Ollama Engine`}),(0,E.jsxs)(`p`,{style:{fontSize:12,color:`var(--color-text-muted)`,margin:`0 0 12px`},children:[`Connect a local or remote Ollama instance. Assign employees to use it with `,(0,E.jsx)(y,{size:`sm`,children:`engine: "ollama"`}),`.`]}),(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10},children:[(0,E.jsxs)(`div`,{style:O,children:[(0,E.jsxs)(`div`,{style:{marginBottom:8},children:[(0,E.jsx)(`div`,{style:d,children:`Host URL`}),(0,E.jsx)(`div`,{style:s,children:`Ollama API endpoint (e.g., http://your-host:11434). Leave empty to disable. Saved + validated on blur.`})]}),(0,E.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),onBlur:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&e.target.blur()},placeholder:`http://hostname:11434`,style:l})]}),r?.ollama?.host&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{style:O,children:[(0,E.jsxs)(`div`,{style:{marginBottom:8},children:[(0,E.jsx)(`div`,{style:d,children:`Default Model`}),(0,E.jsx)(`div`,{style:s,children:u.status===`loading`?`Fetching models from Ollama…`:u.status===`error`?`Could not reach Ollama: ${u.message}`:`Pick a model advertised by the Ollama host (must support tool calling)`})]}),u.status===`loaded`?(0,E.jsxs)(`select`,{value:r.ollama.defaultModel??``,onChange:n=>A(e,t,{ollama:{...r.ollama,defaultModel:n.target.value}}),style:{...l,cursor:`pointer`},children:[(0,E.jsx)(`option`,{value:``,children:`— select a model —`}),r.ollama.defaultModel&&!u.models.includes(r.ollama.defaultModel)&&(0,E.jsxs)(`option`,{value:r.ollama.defaultModel,children:[r.ollama.defaultModel,` (not found on host)`]}),u.models.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]}):(0,E.jsx)(`input`,{type:`text`,value:r.ollama.defaultModel??``,onChange:n=>A(e,t,{ollama:{...r.ollama,defaultModel:n.target.value}}),placeholder:`qwen3:latest`,style:l})]}),(0,E.jsxs)(`div`,{style:O,children:[(0,E.jsxs)(`div`,{style:{...k,marginBottom:12},children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Timeout`}),(0,E.jsx)(`div`,{style:s,children:`Max wall-clock time per session`})]}),(0,E.jsxs)(`select`,{value:r.ollama.timeoutMs??3e5,onChange:n=>A(e,t,{ollama:{...r.ollama,timeoutMs:Number(n.target.value)}}),style:D,children:[(0,E.jsx)(`option`,{value:6e4,children:`1 min`}),(0,E.jsx)(`option`,{value:12e4,children:`2 min`}),(0,E.jsx)(`option`,{value:3e5,children:`5 min`}),(0,E.jsx)(`option`,{value:6e5,children:`10 min`}),(0,E.jsx)(`option`,{value:9e5,children:`15 min`})]})]}),(0,E.jsxs)(`div`,{style:{borderTop:`1px solid ${c.border}`,paddingTop:12,...k,marginBottom:12},children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Max Tool Calls`}),(0,E.jsx)(`div`,{style:s,children:`Per turn (circuit breaker)`})]}),(0,E.jsx)(`select`,{value:r.ollama.maxToolCalls??10,onChange:n=>A(e,t,{ollama:{...r.ollama,maxToolCalls:Number(n.target.value)}}),style:D,children:[5,10,15,20,25,30].map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))})]}),(0,E.jsxs)(`div`,{style:{borderTop:`1px solid ${c.border}`,paddingTop:12,...k},children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Max Turns`}),(0,E.jsx)(`div`,{style:s,children:`Max conversation turns per session`})]}),(0,E.jsx)(`select`,{value:r.ollama.maxTurns??10,onChange:n=>A(e,t,{ollama:{...r.ollama,maxTurns:Number(n.target.value)}}),style:D,children:[5,10,15,20,25,30].map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))})]})]})]})]})]})]})}var j=o,M=u,fe={fontSize:12,color:c.muted};function pe(e,t){switch(e){case`connected`:return{label:`Connected (Socket Mode)`,color:c.green,bg:`rgba(63, 185, 80, 0.1)`};case`connecting`:return{label:`Connecting...`,color:`var(--color-warning)`,bg:`rgba(210, 153, 34, 0.1)`};case`reconnecting`:return{label:`Reconnecting...`,color:`var(--color-warning)`,bg:`rgba(210, 153, 34, 0.1)`};case`error`:return{label:`Connection Error`,color:c.red,bg:`rgba(248, 81, 73, 0.1)`};case`disconnected`:return t?{label:`Disconnected`,color:`var(--color-warning)`,bg:`rgba(210, 153, 34, 0.1)`}:{label:`Not Configured`,color:c.muted,bg:`rgba(139, 148, 158, 0.1)`};default:return t?{label:`Connected (Socket Mode)`,color:c.green,bg:`rgba(63, 185, 80, 0.1)`}:{label:`Not Configured`,color:c.muted,bg:`rgba(139, 148, 158, 0.1)`}}}var me=/^[a-zA-Z][a-zA-Z0-9_-]{0,127}$/;function he({settings:e,onUpdateSettings:t,runtimeConfig:n}){let r=n?.slackConfigured??!1,i=n?.slackConnectionStatus,a=pe(i,r),o=e?.slack?.includeChannelHistory??!0,l=e?.slack?.botMcpName??`slack-bot-mcp`,u=e?.slack?.responderEmployee??``,{employees:f}=x(),p={executive:0,manager:1,senior:2,employee:3},m=[...f].sort((e,t)=>{let n=p[e.rank]??9,r=p[t.rank]??9;return n===r?e.name.localeCompare(t.name):n-r}),g=u===``||m.some(e=>e.name===u),_=e=>{let n=e.trim();n!==l&&(n.length===0||!me.test(n)||t({slack:{includeChannelHistory:o,botMcpName:n}}))},v=e=>{t({slack:{includeChannelHistory:o,botMcpName:l,responderEmployee:e}})};return(0,E.jsx)(S,{title:`Slack Connector`,description:`Slack integration status and configuration. Tokens are set via environment variables.`,children:(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10},children:[(0,E.jsxs)(`div`,{style:j,children:[(0,E.jsxs)(`div`,{style:M,children:[(0,E.jsx)(`div`,{style:d,children:`Connection Status`}),(0,E.jsx)(C,{label:a.label,color:a.color,bg:a.bg})]}),i===`error`&&n?.slackConnectionError&&(0,E.jsx)(`div`,{style:{fontSize:12,color:c.red,padding:`4px 0 2px`,lineHeight:1.4,opacity:.85},children:n.slackConnectionError})]}),(0,E.jsxs)(`div`,{style:j,children:[(0,E.jsxs)(`div`,{style:{...M,borderBottom:`1px solid ${c.border}`,paddingBottom:10},children:[(0,E.jsx)(`div`,{style:d,children:`App Token`}),(0,E.jsx)(`span`,{style:fe,children:r?`••••••••`:`Not set`})]}),(0,E.jsxs)(`div`,{style:{...M,paddingTop:10},children:[(0,E.jsx)(`div`,{style:d,children:`Bot Token`}),(0,E.jsx)(`span`,{style:fe,children:r?`••••••••`:`Not set`})]})]}),(0,E.jsxs)(`div`,{style:j,children:[(0,E.jsxs)(`div`,{style:{marginBottom:8},children:[(0,E.jsx)(`div`,{style:d,children:`Default Responder`}),(0,E.jsx)(`div`,{style:s,children:`Employee that handles incoming Slack DMs and mentions. When unset, falls back to default routing. Per-thread routing rules still apply.`})]}),(0,E.jsxs)(h,{compact:!0,value:u,onChange:e=>v(e.target.value),children:[(0,E.jsx)(`option`,{value:``,children:`— default routing —`}),!g&&(0,E.jsxs)(`option`,{value:u,children:[u,` (not found)`]}),m.map(e=>(0,E.jsxs)(`option`,{value:e.name,children:[e.displayName?`${e.displayName} (${e.name})`:e.name,e.rank===`employee`?``:` — ${e.rank}`]},e.name))]})]}),(0,E.jsxs)(`div`,{style:j,children:[(0,E.jsxs)(`div`,{style:{...M,borderBottom:`1px solid ${c.border}`,paddingBottom:10},children:[(0,E.jsx)(`div`,{style:d,children:`Allowed Users`}),(0,E.jsx)(`span`,{style:fe,children:n?.slackAllowFrom?n.slackAllowFrom.split(`,`).length+` user(s)`:`All users`})]}),(0,E.jsxs)(`div`,{style:{...M,paddingTop:10},children:[(0,E.jsx)(`div`,{style:d,children:`Ignore Old Messages on Boot`}),(0,E.jsx)(`span`,{style:{fontSize:11,fontWeight:500,color:n?.slackIgnoreOldOnBoot===!1?c.muted:c.green},children:n?.slackIgnoreOldOnBoot===!1?`No`:`Yes`})]})]}),(0,E.jsx)(`div`,{style:j,children:(0,E.jsxs)(`div`,{style:M,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Include Channel History`}),(0,E.jsx)(`div`,{style:s,children:`Prepend recent channel messages as context for non-thread messages.`})]}),(0,E.jsx)(b,{checked:o,onChange:e=>t({slack:{includeChannelHistory:e,botMcpName:l}})})]})}),(0,E.jsx)(`div`,{style:j,children:(0,E.jsxs)(`div`,{style:{...M,alignItems:`flex-start`,gap:16},children:[(0,E.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,E.jsx)(`div`,{style:d,children:`Bot MCP Name`}),(0,E.jsxs)(`div`,{style:s,children:[`MCP server name jobs post through (`,` `,(0,E.jsxs)(y,{size:`sm`,children:[`mcp__`,l,`__*`]}),` `,`). Jobs can reference`,` `,(0,E.jsx)(y,{size:`sm`,children:`{{SLACK_BOT_MCP_NAME}}`}),` `,`or`,` `,(0,E.jsx)(y,{size:`sm`,children:`{{SLACK_BOT_MCP_PREFIX}}`}),` `,`in their prompts — these expand to this value at runtime.`]})]}),(0,E.jsx)(`input`,{type:`text`,defaultValue:l,onBlur:e=>_(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,placeholder:`slack-bot-mcp`,"aria-label":`Bot MCP name`,style:{flexShrink:0,width:200,fontFamily:`ui-monospace, monospace`,fontSize:12,padding:`6px 8px`,background:c.darkBg,color:c.text,border:`1px solid ${c.border}`,borderRadius:6,outline:`none`}})]})}),(0,E.jsxs)(`div`,{style:{fontSize:12,color:c.muted,lineHeight:1.5,padding:`8px 12px`,background:`rgba(110,118,129,0.08)`,borderRadius:6,border:`1px solid ${c.border}`},children:[`Slack tokens are configured via environment variables. Set`,` `,(0,E.jsx)(y,{size:`sm`,children:`SLACK_APP_TOKEN`}),` `,`and`,` `,(0,E.jsx)(y,{size:`sm`,children:`SLACK_BOT_TOKEN`}),` `,`in your `,(0,E.jsx)(y,{size:`sm`,children:`.env`}),` file and restart the gateway.`]})]})})}var N=o,ge=u,_e={background:`var(--color-bg-raised)`,color:c.text,border:`1px solid ${c.border}`,borderRadius:6,padding:`4px 10px`,fontSize:13,cursor:`pointer`,minWidth:120},P={background:`none`,border:`none`,color:c.muted,fontSize:13,cursor:`pointer`,minWidth:44,minHeight:44,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,lineHeight:1,transition:`color 0.15s ease`};function F(e,t,n){t({orgDefaults:{...e?.orgDefaults??{defaultRank:`employee`,defaultDepartment:`general`,defaultMaxCostUsd:0,defaultMcpServers:[`gateway`]},...n}})}function ve({settings:e,onUpdateSettings:t}){let[n,r]=(0,T.useState)([]),[i,a]=(0,T.useState)(!0),[o,u]=(0,T.useState)(``),[f,p]=(0,T.useState)(``),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)(null),[v,y]=(0,T.useState)(``),[b,x]=(0,T.useState)(!1),[ee,S]=(0,T.useState)(null),C=(0,T.useCallback)(async()=>{try{let e=await fetch(`/api/org/departments`);e.ok&&r((await e.json()).departments)}catch{u(`Failed to load departments`)}finally{a(!1)}},[]);(0,T.useEffect)(()=>{C()},[C]);async function te(){let e=f.trim().toLowerCase().replace(/\s+/g,`-`);if(e){h(!0),u(``);try{let t=await fetch(`/api/org/departments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e})});if(!t.ok){u((await t.json()).error??`Failed to create department`);return}p(``),await C()}catch{u(`Request failed`)}finally{h(!1)}}}async function w(n){let r=v.trim().toLowerCase().replace(/\s+/g,`-`);if(!r||r===n){_(null);return}x(!0),u(``);try{let i=await fetch(`/api/org/departments/${encodeURIComponent(n)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({newName:r})});if(!i.ok){u((await i.json()).error??`Failed to rename department`);return}_(null),e?.orgDefaults?.defaultDepartment===n&&F(e,t,{defaultDepartment:r}),await C()}catch{u(`Request failed`)}finally{x(!1)}}async function ne(n){x(!0),u(``);try{let r=await fetch(`/api/org/departments/${encodeURIComponent(n)}`,{method:`DELETE`});if(!r.ok){u((await r.json()).error??`Failed to delete department`);return}S(null),e?.orgDefaults?.defaultDepartment===n&&F(e,t,{defaultDepartment:``}),await C()}catch{u(`Request failed`)}finally{x(!1)}}return i?(0,E.jsx)(`div`,{style:N,children:(0,E.jsx)(`div`,{style:{fontSize:12,color:c.muted},children:`Loading departments...`})}):(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10},children:[(0,E.jsxs)(`div`,{style:N,children:[(0,E.jsxs)(`div`,{style:{marginBottom:10},children:[(0,E.jsx)(`div`,{style:d,children:`Departments`}),(0,E.jsx)(`div`,{style:s,children:`Manage organizational departments. Changes propagate to all employees.`})]}),n.length===0?(0,E.jsx)(`div`,{style:{fontSize:12,color:c.muted,padding:`8px 0`},children:`No departments found. Add one below.`}):(0,E.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:n.map(e=>(0,E.jsx)(`div`,{children:g===e?(0,E.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`center`},children:[(0,E.jsx)(`input`,{type:`text`,value:v,onChange:e=>y(e.target.value),onKeyDown:t=>{t.key===`Enter`&&w(e),t.key===`Escape`&&_(null)},autoFocus:!0,style:{...l,flex:1}}),(0,E.jsx)(`button`,{onClick:()=>w(e),disabled:b,style:{...P,color:c.green,fontSize:12,fontWeight:500},children:b?`...`:`Save`}),(0,E.jsx)(`button`,{onClick:()=>_(null),style:P,children:`Cancel`})]}):ee===e?(0,E.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`,padding:`6px 8px`,background:`rgba(248, 81, 73, 0.06)`,borderRadius:6,border:`1px solid rgba(248, 81, 73, 0.2)`},children:[(0,E.jsxs)(`span`,{style:{fontSize:12,color:c.text,flex:1},children:[`Delete `,(0,E.jsx)(`strong`,{children:e}),`? Employees will be unassigned.`]}),(0,E.jsx)(`button`,{onClick:()=>ne(e),disabled:b,style:{...P,color:c.red,fontSize:12,fontWeight:500},children:b?`...`:`Delete`}),(0,E.jsx)(`button`,{onClick:()=>S(null),style:P,children:`Cancel`})]}):(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`6px 8px`,borderRadius:6,transition:`background 0.15s ease`},children:[(0,E.jsx)(`span`,{style:{fontSize:13,color:c.text,fontWeight:500,flex:1},children:e}),(0,E.jsx)(`button`,{onClick:()=>{_(e),y(e)},style:P,onMouseEnter:e=>e.currentTarget.style.color=c.text,onMouseLeave:e=>e.currentTarget.style.color=c.muted,"aria-label":`Rename ${e}`,children:`✎`}),(0,E.jsx)(`button`,{onClick:()=>S(e),style:P,onMouseEnter:e=>e.currentTarget.style.color=c.red,onMouseLeave:e=>e.currentTarget.style.color=c.muted,"aria-label":`Delete ${e}`,children:`×`})]})},e))}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`,marginTop:10,paddingTop:10,borderTop:`1px solid ${c.border}`},children:[(0,E.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&te()},placeholder:`New department name`,style:{...l,flex:1}}),(0,E.jsx)(`button`,{onClick:te,disabled:m||!f.trim(),style:{background:`rgba(63, 185, 80, 0.15)`,border:`1px solid rgba(63, 185, 80, 0.4)`,color:c.green,fontSize:12,fontWeight:500,padding:`6px 14px`,borderRadius:6,cursor:m||!f.trim()?`default`:`pointer`,opacity:m||!f.trim()?.5:1,whiteSpace:`nowrap`,minHeight:32,transition:`all 0.15s ease`},children:m?`...`:`Add`})]}),o&&(0,E.jsx)(`div`,{style:{fontSize:12,color:c.red,marginTop:8},children:o})]}),(0,E.jsx)(`div`,{style:N,children:(0,E.jsxs)(`div`,{style:ge,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Default Department`}),(0,E.jsx)(`div`,{style:s,children:`Assigned to new employees if not specified`})]}),(0,E.jsxs)(`select`,{value:e?.orgDefaults?.defaultDepartment??``,onChange:n=>F(e,t,{defaultDepartment:n.target.value}),style:_e,children:[(0,E.jsx)(`option`,{value:``,children:`None`}),n.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]})]})})]})}function ye({settings:e,onUpdateSettings:t}){let n=e?.orgDefaults;return(0,E.jsx)(S,{title:`Organization Defaults`,description:`Manage departments and set defaults for new employees.`,children:(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10},children:[(0,E.jsx)(`div`,{style:N,children:(0,E.jsxs)(`div`,{style:ge,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Default Rank`}),(0,E.jsx)(`div`,{style:s,children:`Initial rank for newly created employees`})]}),(0,E.jsxs)(`select`,{value:n?.defaultRank??`employee`,onChange:n=>F(e,t,{defaultRank:n.target.value}),style:_e,children:[(0,E.jsx)(`option`,{value:`employee`,children:`Employee`}),(0,E.jsx)(`option`,{value:`senior`,children:`Senior`}),(0,E.jsx)(`option`,{value:`manager`,children:`Manager`}),(0,E.jsx)(`option`,{value:`executive`,children:`Executive`})]})]})}),(0,E.jsx)(ve,{settings:e,onUpdateSettings:t}),(0,E.jsx)(`div`,{style:N,children:(0,E.jsxs)(`div`,{style:ge,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:d,children:`Default Cost Limit (USD)`}),(0,E.jsx)(`div`,{style:s,children:`Per-session budget limit. 0 = unlimited.`})]}),(0,E.jsx)(`input`,{type:`number`,min:0,step:.5,value:n?.defaultMaxCostUsd??0,onChange:n=>F(e,t,{defaultMaxCostUsd:Math.max(0,Number(n.target.value))}),style:{...l,width:100,textAlign:`right`}})]})}),(0,E.jsxs)(`div`,{style:N,children:[(0,E.jsxs)(`div`,{style:{marginBottom:8},children:[(0,E.jsx)(`div`,{style:d,children:`Default MCP Access`}),(0,E.jsx)(`div`,{style:s,children:`Comma-separated list of MCP servers new employees can access`})]}),(0,E.jsx)(`input`,{type:`text`,value:(n?.defaultMcpServers??[`gateway`]).join(`, `),onChange:n=>{F(e,t,{defaultMcpServers:n.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})},placeholder:`e.g. gateway, slack`,style:l})]})]})})}function be({size:e=14,color:t=`currentColor`}){return(0,E.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:t,children:(0,E.jsx)(`path`,{d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z`})})}function xe({size:e=14,color:t=`currentColor`}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 100 100`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M6.017 4.313l55.333-4.087c6.797-.583 8.543-.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277-1.553 6.807-6.99 7.193L24.467 99.967c-4.08.193-6.023-.39-8.16-3.113L3.3 79.94c-2.333-3.113-3.3-5.443-3.3-8.167V11.113c0-3.497 1.553-6.413 6.017-6.8z`,fill:t}),(0,E.jsx)(`path`,{d:`M61.35.227l-55.333 4.087C.573 4.7-.977 7.617-.977 11.113v60.66c0 2.723.967 5.053 3.3 8.167l12.99 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257-3.89c5.433-.387 6.99-2.917 6.99-7.193V20.64c0-2.21-.82-2.873-3.277-4.627L75.753 3.57`,fill:t}),(0,E.jsx)(`path`,{d:`M28.45 26.32c0 2.723-.193 3.113-1.747 4.083L18.28 36.127c-1.553.97-2.327.583-2.327-1.553V16.18c0-2.527 1.163-3.887 3.3-4.08l9.107-.777c2.137-.193 3.09 1.163 3.09 3.5v11.497zm-3.69 53.963V40.597L62.08 38.07v39.3`,fill:`#fff`})]})}function Se({size:e=14,color:t=`currentColor`}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 100 100`,fill:t,children:[(0,E.jsx)(`path`,{d:`M1.22541 61.5228c-.04261-.0915.00702-.1855.08037-.2555L49.2213 13.3509c.0697-.0697.1543-.1084.2441-.1048.104.0042.1936.0664.2496.1572l16.1758 26.2664-14.2742 14.2742L25.8428 80.6176c-.1015.1015-.2741.094-.356-.0171L1.22541 61.5228z`}),(0,E.jsx)(`path`,{d:`M75.4913 43.5228l-8.1697-13.2668L50.4444 47.1332l13.2668 8.1697L75.4913 43.5228z`}),(0,E.jsx)(`path`,{d:`M86.5913 48.5228l-6.1697-10.0168L67.7444 51.1832l10.0168 6.1697L86.5913 48.5228z`})]})}function Ce({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52z`,fill:`#E01E5A`}),(0,E.jsx)(`path`,{d:`M6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z`,fill:`#E01E5A`}),(0,E.jsx)(`path`,{d:`M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834z`,fill:`#36C5F0`}),(0,E.jsx)(`path`,{d:`M8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z`,fill:`#36C5F0`}),(0,E.jsx)(`path`,{d:`M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834z`,fill:`#2EB67D`}),(0,E.jsx)(`path`,{d:`M17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312z`,fill:`#2EB67D`}),(0,E.jsx)(`path`,{d:`M15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52z`,fill:`#ECB22E`}),(0,E.jsx)(`path`,{d:`M15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`,fill:`#ECB22E`})]})}var we=[{key:`github`,label:`GitHub`,icon:be,isActive:e=>!!e.connected,instruction:`Run gh auth login in your terminal`},{key:`notion`,label:`Notion`,icon:xe,isActive:e=>!!e.configured,instruction:`Add Notion MCP server to Claude`},{key:`linear`,label:`Linear`,icon:Se,isActive:e=>!!e.configured,instruction:`Add Linear MCP server to Claude`},{key:`slack`,label:`Slack`,icon:Ce,isActive:e=>!!e.configured,instruction:`Add Slack MCP server to Claude`}];function Te({integrations:e,onVerify:t,verifying:n}){return(0,E.jsxs)(S,{title:`Configured Integrations`,children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,E.jsxs)(`div`,{style:{fontSize:12,color:c.muted,lineHeight:1.5,flex:1,marginRight:12},children:[`Local integrations are detected automatically. To probe cloud-hosted MCP servers, click`,` `,(0,E.jsx)(`strong`,{style:{color:c.textSecondary},children:`Verify connections`}),` above.`]}),(0,E.jsx)(`button`,{onClick:t,disabled:n,style:{background:`rgba(210, 153, 34, 0.15)`,border:`1px solid rgba(210, 153, 34, 0.4)`,color:c.warning,fontSize:11,padding:`4px 12px`,borderRadius:6,cursor:n?`default`:`pointer`,opacity:n?.6:1,whiteSpace:`nowrap`,flexShrink:0,minHeight:32},children:n?`Verifying...`:`Verify connections`})]}),(0,E.jsx)(`div`,{style:{padding:`10px 14px`,background:`var(--color-subtle-bg)`,borderRadius:8,border:`1px solid ${c.border}`},children:(0,E.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:we.map(t=>{let n=e?e[t.key]:void 0,r=n?t.isActive(n):!1,i=n?.verified===!0,a=n?.verifiedAt,o=t.icon;return(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`6px 0`,fontSize:13},children:[(0,E.jsx)(o,{size:15,color:i?c.green:r?c.warning:c.muted}),(0,E.jsx)(`span`,{style:{color:r||i?c.text:c.muted,fontWeight:500,minWidth:56},children:t.label}),i?(0,E.jsxs)(`span`,{style:{fontSize:11},children:[(0,E.jsx)(`span`,{style:{color:c.green},children:`✓ Connected`}),a&&(0,E.jsx)(`span`,{style:{color:c.muted,marginLeft:6},children:new Date(a).toLocaleDateString()})]}):r?(0,E.jsx)(`span`,{style:{color:c.warning,fontSize:11},children:`Installed — verify to check`}):(0,E.jsx)(`span`,{style:{color:c.muted,fontSize:11,opacity:.8},children:`Not detected — verify to check`})]},t.key)})})})]})}function Ee(e){return e==null}function De(e){return typeof e==`object`&&!!e}function Oe(e){return Array.isArray(e)?e:Ee(e)?[]:[e]}function ke(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function Ae(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function je(e){return e===0&&1/e==-1/0}var I={isNothing:Ee,isObject:De,toArray:Oe,repeat:Ae,isNegativeZero:je,extend:ke};function Me(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
2
+
3
+ `+e.mark.snippet),r+` `+n):r}function Ne(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=Me(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}Ne.prototype=Object.create(Error.prototype),Ne.prototype.constructor=Ne,Ne.prototype.toString=function(e){return this.name+`: `+Me(this,e)};var L=Ne;function Pe(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function Fe(e,t){return I.repeat(` `,t-e.length)+e}function Ie(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,o=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var s=``,c,l,u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)l=Pe(e.buffer,r[o-c],i[o-c],e.position-(r[o]-r[o-c]),d),s=I.repeat(` `,t.indent)+Fe((e.line-c+1).toString(),u)+` | `+l.str+`
4
+ `+s;for(l=Pe(e.buffer,r[o],i[o],e.position,d),s+=I.repeat(` `,t.indent)+Fe((e.line+1).toString(),u)+` | `+l.str+`
5
+ `,s+=I.repeat(`-`,t.indent+u+3+l.pos)+`^
6
+ `,c=1;c<=t.linesAfter&&!(o+c>=i.length);c++)l=Pe(e.buffer,r[o+c],i[o+c],e.position-(r[o]-r[o+c]),d),s+=I.repeat(` `,t.indent)+Fe((e.line+c+1).toString(),u)+` | `+l.str+`
7
+ `;return s.replace(/\n$/,``)}var Le=Ie,Re=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],ze=[`scalar`,`sequence`,`mapping`];function Be(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function Ve(e,t){if(t||={},Object.keys(t).forEach(function(t){if(Re.indexOf(t)===-1)throw new L(`Unknown option "`+t+`" is met in definition of "`+e+`" YAML type.`)}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Be(t.styleAliases||null),ze.indexOf(this.kind)===-1)throw new L(`Unknown kind "`+this.kind+`" is specified for "`+e+`" YAML type.`)}var R=Ve;function He(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function Ue(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function We(e){return this.extend(e)}We.prototype.extend=function(e){var t=[],n=[];if(e instanceof R)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new L(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);t.forEach(function(e){if(!(e instanceof R))throw new L(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(e.loadKind&&e.loadKind!==`scalar`)throw new L(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(e.multi)throw new L(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),n.forEach(function(e){if(!(e instanceof R))throw new L(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});var r=Object.create(We.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=He(r,`implicit`),r.compiledExplicit=He(r,`explicit`),r.compiledTypeMap=Ue(r.compiledImplicit,r.compiledExplicit),r};var Ge=We,Ke=new R(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:function(e){return e===null?``:e}}),qe=new R(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:function(e){return e===null?[]:e}}),Je=new R(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:function(e){return e===null?{}:e}}),Ye=new Ge({explicit:[Ke,qe,Je]});function Xe(e){if(e===null)return!0;var t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}function Ze(){return null}function Qe(e){return e===null}var $e=new R(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:Xe,construct:Ze,predicate:Qe,represent:{canonical:function(){return`~`},lowercase:function(){return`null`},uppercase:function(){return`NULL`},camelcase:function(){return`Null`},empty:function(){return``}},defaultStyle:`lowercase`});function et(e){if(e===null)return!1;var t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}function tt(e){return e===`true`||e===`True`||e===`TRUE`}function nt(e){return Object.prototype.toString.call(e)===`[object Boolean]`}var rt=new R(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:et,construct:tt,predicate:nt,represent:{lowercase:function(e){return e?`true`:`false`},uppercase:function(e){return e?`TRUE`:`FALSE`},camelcase:function(e){return e?`True`:`False`}},defaultStyle:`lowercase`});function it(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function at(e){return 48<=e&&e<=55}function ot(e){return 48<=e&&e<=57}function st(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i===`-`||i===`+`)&&(i=e[++n]),i===`0`){if(n+1===t)return!0;if(i=e[++n],i===`b`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(i!==`0`&&i!==`1`)return!1;r=!0}return r&&i!==`_`}if(i===`x`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!it(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}if(i===`o`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!at(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}}if(i===`_`)return!1;for(;n<t;n++)if(i=e[n],i!==`_`){if(!ot(e.charCodeAt(n)))return!1;r=!0}return!(!r||i===`_`)}function ct(e){var t=e,n=1,r;if(t.indexOf(`_`)!==-1&&(t=t.replace(/_/g,``)),r=t[0],(r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function lt(e){return Object.prototype.toString.call(e)===`[object Number]`&&e%1==0&&!I.isNegativeZero(e)}var ut=new R(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:st,construct:ct,predicate:lt,represent:{binary:function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},octal:function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)}},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),dt=RegExp(`^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function ft(e){return!(e===null||!dt.test(e)||e[e.length-1]===`_`)}function pt(e){var t=e.replace(/_/g,``).toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}var mt=/^[-+]?[0-9]+e/;function ht(e,t){var n;if(isNaN(e))switch(t){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(e===1/0)switch(t){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(e===-1/0)switch(t){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(I.isNegativeZero(e))return`-0.0`;return n=e.toString(10),mt.test(n)?n.replace(`e`,`.e`):n}function gt(e){return Object.prototype.toString.call(e)===`[object Number]`&&(e%1!=0||I.isNegativeZero(e))}var _t=new R(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:ft,construct:pt,predicate:gt,represent:ht,defaultStyle:`lowercase`}),vt=Ye.extend({implicit:[$e,rt,ut,_t]}),yt=vt,bt=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),xt=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function St(e){return e===null?!1:bt.exec(e)!==null||xt.exec(e)!==null}function Ct(e){var t,n,r,i,a,o,s,c=0,l=null,u,d,f;if(t=bt.exec(e),t===null&&(t=xt.exec(e)),t===null)throw Error(`Date resolve error`);if(n=+t[1],r=t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+=`0`;c=+c}return t[9]&&(u=+t[10],d=+(t[11]||0),l=(u*60+d)*6e4,t[9]===`-`&&(l=-l)),f=new Date(Date.UTC(n,r,i,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}function wt(e){return e.toISOString()}var Tt=new R(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:St,construct:Ct,instanceOf:Date,represent:wt});function Et(e){return e===`<<`||e===null}var Dt=new R(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:Et}),Ot=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
+ \r`;function kt(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=Ot;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8==0}function At(e){var t,n,r=e.replace(/[\r\n=]/g,``),i=r.length,a=Ot,o=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}function jt(e){var t=``,n=0,r,i,a=e.length,o=Ot;for(r=0;r<a;r++)r%3==0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function Mt(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}var Nt=new R(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:kt,construct:At,predicate:Mt,represent:jt}),Pt=Object.prototype.hasOwnProperty,Ft=Object.prototype.toString;function It(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,Ft.call(i)!==`[object Object]`)return!1;for(a in i)if(Pt.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function Lt(e){return e===null?[]:e}var Rt=new R(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:It,construct:Lt}),zt=Object.prototype.toString;function Bt(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],zt.call(r)!==`[object Object]`||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function Vt(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var Ht=new R(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:Bt,construct:Vt}),Ut=Object.prototype.hasOwnProperty;function Wt(e){if(e===null)return!0;var t,n=e;for(t in n)if(Ut.call(n,t)&&n[t]!==null)return!1;return!0}function Gt(e){return e===null?{}:e}var Kt=new R(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:Wt,construct:Gt}),qt=yt.extend({implicit:[Tt,Dt],explicit:[Nt,Rt,Ht,Kt]}),z=Object.prototype.hasOwnProperty,Jt=1,Yt=2,Xt=3,Zt=4,Qt=1,$t=2,en=3,tn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,nn=/[\x85\u2028\u2029]/,rn=/[,\[\]\{\}]/,an=/^(?:!|!!|![a-z\-]+!)$/i,on=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function sn(e){return Object.prototype.toString.call(e)}function B(e){return e===10||e===13}function V(e){return e===9||e===32}function H(e){return e===9||e===32||e===10||e===13}function U(e){return e===44||e===91||e===93||e===123||e===125}function cn(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ln(e){return e===120?2:e===117?4:e===85?8:0}function un(e){return 48<=e&&e<=57?e-48:-1}function dn(e){return e===48?`\0`:e===97?`\x07`:e===98?`\b`:e===116||e===9?` `:e===110?`
9
+ `:e===118?`\v`:e===102?`\f`:e===114?`\r`:e===101?`\x1B`:e===32?` `:e===34?`"`:e===47?`/`:e===92?`\\`:e===78?`…`:e===95?`\xA0`:e===76?`\u2028`:e===80?`\u2029`:``}function fn(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function pn(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var mn=Array(256),hn=Array(256),W=0;W<256;W++)mn[W]=+!!dn(W),hn[W]=dn(W);function gn(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||qt,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function _n(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Le(n),new L(t,n)}function G(e,t){throw _n(e,t)}function vn(e,t){e.onWarning&&e.onWarning.call(null,_n(e,t))}var yn={YAML:function(e,t,n){var r,i,a;e.version!==null&&G(e,`duplication of %YAML directive`),n.length!==1&&G(e,`YAML directive accepts exactly one argument`),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&G(e,`ill-formed argument of the YAML directive`),i=parseInt(r[1],10),a=parseInt(r[2],10),i!==1&&G(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&vn(e,`unsupported YAML version of the document`)},TAG:function(e,t,n){var r,i;n.length!==2&&G(e,`TAG directive accepts exactly two arguments`),r=n[0],i=n[1],an.test(r)||G(e,`ill-formed tag handle (first argument) of the TAG directive`),z.call(e.tagMap,r)&&G(e,`there is a previously declared suffix for "`+r+`" tag handle`),on.test(i)||G(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{i=decodeURIComponent(i)}catch{G(e,`tag prefix is malformed: `+i)}e.tagMap[r]=i}};function K(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||G(e,`expected valid JSON character`);else tn.test(s)&&G(e,`the stream contains non-printable characters`);e.result+=s}}function bn(e,t,n,r){var i,a,o,s;for(I.isObject(n)||G(e,`cannot merge mappings; the provided source object is unacceptable`),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],z.call(t,a)||(pn(t,a,n[a]),r[a]=!0)}function q(e,t,n,r,i,a,o,s,c){var l,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,u=i.length;l<u;l+=1)Array.isArray(i[l])&&G(e,`nested arrays are not supported inside keys`),typeof i==`object`&&sn(i[l])===`[object Object]`&&(i[l]=`[object Object]`);if(typeof i==`object`&&sn(i)===`[object Object]`&&(i=`[object Object]`),i=String(i),t===null&&(t={}),r===`tag:yaml.org,2002:merge`)if(Array.isArray(a))for(l=0,u=a.length;l<u;l+=1)bn(e,t,a[l],n);else bn(e,t,a,n);else !e.json&&!z.call(n,i)&&z.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,G(e,`duplicated mapping key`)),pn(t,i,a),delete n[i];return t}function xn(e){var t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):G(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function J(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;V(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(B(i))for(xn(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&vn(e,`deficient indentation`),r}function Sn(e){var t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||H(n)))}function Cn(e,t){t===1?e.result+=` `:t>1&&(e.result+=I.repeat(`
10
+ `,t-1))}function wn(e,t,n){var r,i,a,o,s,c,l,u,d=e.kind,f=e.result,p=e.input.charCodeAt(e.position);if(H(p)||U(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),H(i)||n&&U(i)))return!1;for(e.kind=`scalar`,e.result=``,a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),H(i)||n&&U(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),H(r))break}else if(e.position===e.lineStart&&Sn(e)||n&&U(p))break;else if(B(p))if(c=e.line,l=e.lineStart,u=e.lineIndent,J(e,!1,-1),e.lineIndent>=t){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=u;break}s&&=(K(e,a,o,!1),Cn(e,e.line-c),a=o=e.position,!1),V(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return K(e,a,o,!1),e.result?!0:(e.kind=d,e.result=f,!1)}function Tn(e,t){var n=e.input.charCodeAt(e.position),r,i;if(n!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(K(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else B(n)?(K(e,r,i,!0),Cn(e,J(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Sn(e)?G(e,`unexpected end of the document within a single quoted scalar`):(e.position++,i=e.position);G(e,`unexpected end of the stream within a single quoted scalar`)}function En(e,t){var n,r,i,a,o,s=e.input.charCodeAt(e.position);if(s!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===34)return K(e,n,e.position,!0),e.position++,!0;else if(s===92){if(K(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),B(s))J(e,!1,t);else if(s<256&&mn[s])e.result+=hn[s],e.position++;else if((o=ln(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=cn(s))>=0?a=(a<<4)+o:G(e,`expected hexadecimal character`);e.result+=fn(a),e.position++}else G(e,`unknown escape sequence`);n=r=e.position}else B(s)?(K(e,n,r,!0),Cn(e,J(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Sn(e)?G(e,`unexpected end of the document within a double quoted scalar`):(e.position++,r=e.position);G(e,`unexpected end of the stream within a double quoted scalar`)}function Dn(e,t){var n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,p,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)u=93,p=!1,s=[];else if(v===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(J(e,!0,t),v=e.input.charCodeAt(e.position),v===u)return e.position++,e.tag=o,e.anchor=c,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?v===44&&G(e,`expected the node content, but found ','`):G(e,`missed comma between flow collection entries`),g=h=_=null,d=f=!1,v===63&&(l=e.input.charCodeAt(e.position+1),H(l)&&(d=f=!0,e.position++,J(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,Y(e,t,Jt,!1,!0),g=e.tag,h=e.result,J(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),J(e,!0,t),Y(e,t,Jt,!1,!0),_=e.result),p?q(e,s,m,g,h,_,r,i,a):d?s.push(q(e,null,m,g,h,_,r,i,a)):s.push(h),J(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}G(e,`unexpected end of the stream within a flow collection`)}function On(e,t){var n,r,i=Qt,a=!1,o=!1,s=t,c=0,l=!1,u,d=e.input.charCodeAt(e.position);if(d===124)r=!1;else if(d===62)r=!0;else return!1;for(e.kind=`scalar`,e.result=``;d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Qt===i?i=d===43?en:$t:G(e,`repeat of a chomping mode identifier`);else if((u=un(d))>=0)u===0?G(e,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?G(e,`repeat of an indentation width identifier`):(s=t+u-1,o=!0);else break;if(V(d)){do d=e.input.charCodeAt(++e.position);while(V(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!B(d)&&d!==0)}for(;d!==0;){for(xn(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),B(d)){c++;continue}if(e.lineIndent<s){i===en?e.result+=I.repeat(`
11
+ `,a?1+c:c):i===Qt&&a&&(e.result+=`
12
+ `);break}for(r?V(d)?(l=!0,e.result+=I.repeat(`
13
+ `,a?1+c:c)):l?(l=!1,e.result+=I.repeat(`
14
+ `,c+1)):c===0?a&&(e.result+=` `):e.result+=I.repeat(`
15
+ `,c):e.result+=I.repeat(`
16
+ `,a?1+c:c),a=!0,o=!0,c=0,n=e.position;!B(d)&&d!==0;)d=e.input.charCodeAt(++e.position);K(e,n,e.position,!1)}return!0}function kn(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,G(e,`tab characters must not be used in indentation`)),!(c!==45||(o=e.input.charCodeAt(e.position+1),!H(o))));){if(s=!0,e.position++,J(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,Y(e,t,Xt,!1,!0),a.push(e.result),J(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)G(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind=`sequence`,e.result=a,!0):!1}function An(e,t,n){var r,i,a,o,s,c,l=e.tag,u=e.anchor,d={},f=Object.create(null),p=null,m=null,h=null,g=!1,_=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,G(e,`tab characters must not be used in indentation`)),r=e.input.charCodeAt(e.position+1),a=e.line,(v===63||v===58)&&H(r))v===63?(g&&(q(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!0,i=!0):g?(g=!1,i=!0):G(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=r;else{if(o=e.line,s=e.lineStart,c=e.position,!Y(e,n,Yt,!1,!0))break;if(e.line===a){for(v=e.input.charCodeAt(e.position);V(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),H(v)||G(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(q(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!1,i=!1,p=e.tag,m=e.result;else if(_)G(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=l,e.anchor=u,!0}else if(_)G(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=l,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(g&&(o=e.line,s=e.lineStart,c=e.position),Y(e,t,Zt,!0,i)&&(g?m=e.result:h=e.result),g||(q(e,d,f,p,m,h,o,s,c),p=m=h=null),J(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&v!==0)G(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&q(e,d,f,p,m,null,o,s,c),_&&(e.tag=l,e.anchor=u,e.kind=`mapping`,e.result=d),_}function jn(e){var t,n=!1,r=!1,i,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;if(e.tag!==null&&G(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i=`!!`,o=e.input.charCodeAt(++e.position)):i=`!`,t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):G(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!H(o);)o===33&&(r?G(e,`tag suffix cannot contain exclamation marks`):(i=e.input.slice(t-1,e.position+1),an.test(i)||G(e,`named tag handle cannot contain such characters`),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),rn.test(a)&&G(e,`tag suffix cannot contain flow indicator characters`)}a&&!on.test(a)&&G(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{G(e,`tag name is malformed: `+a)}return n?e.tag=a:z.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i===`!`?e.tag=`!`+a:i===`!!`?e.tag=`tag:yaml.org,2002:`+a:G(e,`undeclared tag handle "`+i+`"`),!0}function Mn(e){var t,n=e.input.charCodeAt(e.position);if(n!==38)return!1;for(e.anchor!==null&&G(e,`duplication of an anchor property`),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!H(n)&&!U(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&G(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(t,e.position),!0}function Nn(e){var t,n,r=e.input.charCodeAt(e.position);if(r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!H(r)&&!U(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&G(e,`name of an alias node must contain at least one character`),n=e.input.slice(t,e.position),z.call(e.anchorMap,n)||G(e,`unidentified alias "`+n+`"`),e.result=e.anchorMap[n],J(e,!0,-1),!0}function Y(e,t,n,r,i){var a,o,s,c=1,l=!1,u=!1,d,f,p,m,h,g;if(e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Zt===n||Xt===n,r&&J(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;jn(e)||Mn(e);)J(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&=l||i,(c===1||Zt===n)&&(h=Jt===n||Yt===n?t:t+1,g=e.position-e.lineStart,c===1?s&&(kn(e,g)||An(e,g,h))||Dn(e,h)?u=!0:(o&&On(e,h)||Tn(e,h)||En(e,h)?u=!0:Nn(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&G(e,`alias node should not have any properties`)):wn(e,h,Jt===n)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=s&&kn(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag===`?`){for(e.result!==null&&e.kind!==`scalar`&&G(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`),d=0,f=e.implicitTypes.length;d<f;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!==`!`){if(z.call(e.typeMap[e.kind||`fallback`],e.tag))m=e.typeMap[e.kind||`fallback`][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||`fallback`],d=0,f=p.length;d<f;d+=1)if(e.tag.slice(0,p[d].tag.length)===p[d].tag){m=p[d];break}m||G(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&m.kind!==e.kind&&G(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+m.kind+`", not "`+e.kind+`"`),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):G(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),e.tag!==null||e.anchor!==null||u}function Pn(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(J(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!H(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&G(e,`directive name must not be less than one character in length`);o!==0;){for(;V(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!B(o));break}if(B(o))break;for(n=e.position;o!==0&&!H(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&xn(e),z.call(yn,r)?yn[r](e,r,i):vn(e,`unknown document directive "`+r+`"`)}if(J(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,J(e,!0,-1)):a&&G(e,`directives end mark is expected`),Y(e,e.lineIndent-1,Zt,!1,!0),J(e,!0,-1),e.checkLineBreaks&&nn.test(e.input.slice(t,e.position))&&vn(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&Sn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,J(e,!0,-1));return}if(e.position<e.length-1)G(e,`end of the stream or a document separator is expected`);else return}function Fn(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new gn(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,G(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Pn(n);return n.documents}function In(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);var r=Fn(e,n);if(typeof t!=`function`)return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function Ln(e,t){var n=Fn(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new L(`expected a single document in the stream, but found more`)}}var Rn={loadAll:In,load:Ln},zn=Object.prototype.toString,Bn=Object.prototype.hasOwnProperty,Vn=65279,Hn=9,Un=10,Wn=13,Gn=32,Kn=33,qn=34,Jn=35,Yn=37,Xn=38,Zn=39,Qn=42,$n=44,er=45,tr=58,nr=61,rr=62,ir=63,ar=64,or=91,sr=93,cr=96,lr=123,ur=124,dr=125,X={};X[0]=`\\0`,X[7]=`\\a`,X[8]=`\\b`,X[9]=`\\t`,X[10]=`\\n`,X[11]=`\\v`,X[12]=`\\f`,X[13]=`\\r`,X[27]=`\\e`,X[34]=`\\"`,X[92]=`\\\\`,X[133]=`\\N`,X[160]=`\\_`,X[8232]=`\\L`,X[8233]=`\\P`;var fr=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],pr=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function mr(e,t){var n,r,i,a,o,s,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&Bn.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s;return n}function hr(e){var t=e.toString(16).toUpperCase(),n,r;if(e<=255)n=`x`,r=2;else if(e<=65535)n=`u`,r=4;else if(e<=4294967295)n=`U`,r=8;else throw new L(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+n+I.repeat(`0`,r-t.length)+t}var gr=1,_r=2;function vr(e){this.schema=e.schema||qt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=I.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=mr(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType===`"`?_r:gr,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==`function`?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}function yr(e,t){for(var n=I.repeat(` `,t),r=0,i=-1,a=``,o,s=e.length;r<s;)i=e.indexOf(`
18
+ `,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
19
+ `&&(a+=n),a+=o;return a}function br(e,t){return`
20
+ `+I.repeat(` `,e.indent*t)}function xr(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Sr(e){return e===Gn||e===Hn}function Cr(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Vn||65536<=e&&e<=1114111}function wr(e){return Cr(e)&&e!==Vn&&e!==Wn&&e!==Un}function Tr(e,t,n){var r=wr(e),i=r&&!Sr(e);return(n?r:r&&e!==$n&&e!==or&&e!==sr&&e!==lr&&e!==dr)&&e!==Jn&&!(t===tr&&!i)||wr(t)&&!Sr(t)&&e===Jn||t===tr&&i}function Er(e){return Cr(e)&&e!==Vn&&!Sr(e)&&e!==er&&e!==ir&&e!==tr&&e!==$n&&e!==or&&e!==sr&&e!==lr&&e!==dr&&e!==Jn&&e!==Xn&&e!==Qn&&e!==Kn&&e!==ur&&e!==nr&&e!==rr&&e!==Zn&&e!==qn&&e!==Yn&&e!==ar&&e!==cr}function Dr(e){return!Sr(e)&&e!==tr}function Or(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function kr(e){return/^\n* /.test(e)}var Ar=1,jr=2,Mr=3,Nr=4,Z=5;function Pr(e,t,n,r,i,a,o,s){var c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=Er(Or(e,0))&&Dr(Or(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=Or(e,c),!Cr(l))return Z;h&&=Tr(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=Or(e,c),l===Un)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!Cr(l))return Z;h&&=Tr(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?Ar:a===_r?Z:jr:n>9&&kr(e)?Z:o?a===_r?Z:jr:f?Nr:Mr}function Fr(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===_r?`""`:`''`;if(!e.noCompatMode&&(fr.indexOf(t)!==-1||pr.test(t)))return e.quotingType===_r?`"`+t+`"`:`'`+t+`'`;var a=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function c(t){return xr(e,t)}switch(Pr(t,s,e.indent,o,c,e.quotingType,e.forceQuotes&&!r,i)){case Ar:return t;case jr:return`'`+t.replace(/'/g,`''`)+`'`;case Mr:return`|`+Ir(t,e.indent)+Lr(yr(t,a));case Nr:return`>`+Ir(t,e.indent)+Lr(yr(Rr(t,o),a));case Z:return`"`+Br(t)+`"`;default:throw new L(`impossible error: invalid scalar style`)}}()}function Ir(e,t){var n=kr(e)?String(t):``,r=e[e.length-1]===`
21
+ `;return n+(r&&(e[e.length-2]===`
22
+ `||e===`
23
+ `)?`+`:r?``:`-`)+`
24
+ `}function Lr(e){return e[e.length-1]===`
25
+ `?e.slice(0,-1):e}function Rr(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var r=e.indexOf(`
26
+ `);return r=r===-1?e.length:r,n.lastIndex=r,zr(e.slice(0,r),t)}(),i=e[0]===`
27
+ `||e[0]===` `,a,o;o=n.exec(e);){var s=o[1],c=o[2];a=c[0]===` `,r+=s+(!i&&!a&&c!==``?`
28
+ `:``)+zr(c,t),i=a}return r}function zr(e,t){if(e===``||e[0]===` `)return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
29
+ `+e.slice(i,a),i=a+1),o=s;return c+=`
30
+ `,e.length-i>t&&o>i?c+=e.slice(i,o)+`
31
+ `+e.slice(o+1):c+=e.slice(i),c.slice(1)}function Br(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Or(e,i),r=X[n],!r&&Cr(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||hr(n);return t}function Vr(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(Q(e,t,s,!1,!1)||s===void 0&&Q(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}function Hr(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(Q(e,t+1,c,!0,!0,!1,!0)||c===void 0&&Q(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=br(e,t)),e.dump&&Un===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}function Ur(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),Q(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),Q(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}function Wr(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,u,d,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new L(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)f=``,(!r||i!==``)&&(f+=br(e,t)),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),Q(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,d&&(e.dump&&Un===e.dump.charCodeAt(0)?f+=`?`:f+=`? `),f+=e.dump,d&&(f+=br(e,t)),Q(e,t+1,u,!0,d)&&(e.dump&&Un===e.dump.charCodeAt(0)?f+=`:`:f+=`: `,f+=e.dump,i+=f));e.tag=a,e.dump=i||`{}`}function Gr(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,zn.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(Bn.call(s.represent,c))r=s.represent[c](t,c);else throw new L(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}function Q(e,t,n,r,i,a,o){e.tag=null,e.dump=n,Gr(e,n,!1)||Gr(e,n,!0);var s=zn.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var u=s===`[object Object]`||s===`[object Array]`,d,f;if(u&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!==`?`||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump=`*ref_`+d;else{if(u&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(Wr(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Ur(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Hr(e,t-1,e.dump,i):Hr(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Vr(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&Fr(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new L(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}function Kr(e,t){var n=[],r=[],i,a;for(qr(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}function qr(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)qr(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)qr(e[r[i]],t,n)}function Jr(e,t){t||={};var n=new vr(t);n.noRefs||Kr(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),Q(n,0,r,!0,!0)?n.dump+`
32
+ `:``}var Yr={dump:Jr};function Xr(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}var Zr={Type:R,Schema:Ge,FAILSAFE_SCHEMA:Ye,JSON_SCHEMA:vt,CORE_SCHEMA:yt,DEFAULT_SCHEMA:qt,load:Rn.load,loadAll:Rn.loadAll,dump:Yr.dump,YAMLException:L,types:{binary:Nt,float:_t,map:Je,null:$e,pairs:Ht,set:Kt,timestamp:Tt,bool:rt,int:ut,merge:Dt,omap:Rt,seq:qe,str:Ke},safeLoad:Xr(`safeLoad`,`load`),safeLoadAll:Xr(`safeLoadAll`,`loadAll`),safeDump:Xr(`safeDump`,`dump`)},Qr={name:`name`,light:`light`,backgroundColor:`background-color`,primaryColor:`primary-color`,positiveColor:`positive-color`,negativeColor:`negative-color`,contrastMultiplier:`contrast-multiplier`,textSaturationMultiplier:`text-saturation-multiplier`,customCSS:`custom-css`},$r=(()=>{let e={};for(let[t,n]of Object.entries(Qr))e[n]=t;return e})();function ei(e){let t;try{t=Zr.load(e)}catch(e){return{ok:!1,error:e instanceof Error?e.message:`Invalid YAML`}}if(!t||typeof t!=`object`)return{ok:!1,error:`Expected YAML object`};let n=t.theme??t;if(!n||typeof n!=`object`)return{ok:!1,error:"Missing `theme:` object"};let r={};for(let[e,t]of Object.entries(n)){let n=$r[e];n&&(n===`light`&&typeof t==`boolean`?r.light=t:((n===`contrastMultiplier`||n===`textSaturationMultiplier`)&&typeof t==`number`&&Number.isFinite(t)||typeof t==`string`)&&(r[n]=t))}return{ok:!0,theme:r}}function $(e){let t={};for(let[n,r]of Object.entries(Qr)){let i=e[n];n===`customCSS`&&i===``||(t[r]=i)}return Zr.dump({theme:t},{lineWidth:-1,noRefs:!0})}var ti=`Custom`;function ni(e){let[t,n,r]=e.trim().split(/\s+/).map(e=>Number(e));return{h:Number.isFinite(t)?t:0,sat:Number.isFinite(n)?n:0,l:Number.isFinite(r)?r:0}}function ri(e,t,n){return`${Math.round(e)} ${Math.round(t)} ${Math.round(n)}`}function ii(e){let{h:t,sat:n,l:r}=ni(e);return`hsl(${t} ${n}% ${r}%)`}function ai({preset:e,active:t,onClick:n,onDelete:r}){return(0,E.jsxs)(`div`,{style:{position:`relative`,background:t?`var(--color-primary-soft)`:`var(--color-bg-raised)`,border:`1px solid ${t?`var(--color-primary)`:`var(--color-border)`}`,borderRadius:`var(--radius-lg)`,transition:`border-color 0.15s, background 0.15s`},children:[(0,E.jsxs)(`button`,{onClick:n,style:{width:`100%`,background:`transparent`,border:`none`,borderRadius:`var(--radius-lg)`,padding:10,cursor:`pointer`,textAlign:`left`,display:`flex`,flexDirection:`column`,gap:8,minHeight:60,color:`var(--color-text)`,fontFamily:`inherit`},children:[(0,E.jsx)(`div`,{style:{display:`flex`,gap:4},children:[e.backgroundColor,e.primaryColor,e.positiveColor,e.negativeColor].map((e,t)=>(0,E.jsx)(`span`,{style:{width:18,height:18,borderRadius:`var(--radius-sm)`,background:ii(e),border:`1px solid var(--color-border)`}},t))}),(0,E.jsx)(`div`,{style:{fontSize:12,fontWeight:t?600:500,paddingRight:r?18:0},children:e.name})]}),r&&(0,E.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r()},"aria-label":`Delete ${e.name}`,title:`Delete custom theme`,style:{position:`absolute`,top:6,right:6,width:18,height:18,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`transparent`,border:`none`,color:`var(--color-text-muted)`,cursor:`pointer`,fontSize:14,lineHeight:1,padding:0,borderRadius:`var(--radius-sm)`},children:`×`})]})}function oi({label:e,value:t,onChange:n,min:r,max:i,step:a,hint:o}){return(0,E.jsx)(m,{padding:`sm`,style:{marginBottom:8},children:(0,E.jsxs)(v,{direction:`row`,align:`center`,justify:`between`,gap:12,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:{fontSize:13,color:`var(--color-text)`,fontWeight:500},children:e}),o&&(0,E.jsx)(`div`,{style:{fontSize:11,color:`var(--color-text-muted)`,marginTop:2},children:o})]}),(0,E.jsxs)(v,{direction:`row`,align:`center`,gap:8,children:[(0,E.jsx)(`input`,{type:`range`,min:r,max:i,step:a,value:t,onChange:e=>n(Number(e.target.value)),style:{width:140}}),(0,E.jsx)(`span`,{style:{fontSize:12,color:`var(--color-text-muted)`,fontVariantNumeric:`tabular-nums`,minWidth:32,textAlign:`right`},children:t.toFixed(2)})]})]})})}function si({label:e,value:t,max:n,onChange:r}){return(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`var(--color-text-muted)`},children:[(0,E.jsx)(`span`,{style:{width:10,display:`inline-block`},children:e}),(0,E.jsx)(`input`,{type:`range`,min:0,max:n,step:1,value:t,onChange:e=>r(Number(e.target.value)),style:{width:110}}),(0,E.jsx)(`span`,{style:{fontVariantNumeric:`tabular-nums`,minWidth:26,textAlign:`right`,color:`var(--color-text)`},children:Math.round(t)})]})}function ci({label:e,value:t,onChange:n}){let{h:r,sat:i,l:a}=ni(t);function o(e){n(ri(e.h??r,e.sat??i,e.l??a))}return(0,E.jsx)(m,{padding:`sm`,style:{marginBottom:8},children:(0,E.jsxs)(v,{direction:`row`,align:`center`,justify:`between`,gap:16,wrap:!0,children:[(0,E.jsxs)(v,{direction:`row`,align:`center`,gap:10,style:{minWidth:130},children:[(0,E.jsx)(`span`,{style:{width:22,height:22,borderRadius:`var(--radius-sm)`,background:ii(t),border:`1px solid var(--color-border)`,flexShrink:0}}),(0,E.jsx)(`div`,{style:{fontSize:13,color:`var(--color-text)`,fontWeight:500},children:e})]}),(0,E.jsxs)(v,{direction:`column`,gap:4,children:[(0,E.jsx)(si,{label:`H`,value:r,max:360,onChange:e=>o({h:e})}),(0,E.jsx)(si,{label:`S`,value:i,max:100,onChange:e=>o({sat:e})}),(0,E.jsx)(si,{label:`L`,value:a,max:100,onChange:e=>o({l:e})})]})]})})}function li({label:e,checked:t,onChange:n,hint:r}){return(0,E.jsx)(m,{padding:`sm`,style:{marginBottom:8},children:(0,E.jsxs)(v,{direction:`row`,align:`center`,justify:`between`,gap:12,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:{fontSize:13,color:`var(--color-text)`,fontWeight:500},children:e}),r&&(0,E.jsx)(`div`,{style:{fontSize:11,color:`var(--color-text-muted)`,marginTop:2},children:r})]}),(0,E.jsx)(`input`,{type:`checkbox`,checked:t,onChange:e=>n(e.target.checked),style:{width:18,height:18,cursor:`pointer`}})]})})}function ui({settings:e,onUpdateSettings:t}){let n=e?.appearance??w,r=e?.themePresets??[],[i,a]=(0,T.useState)(n),[o,s]=(0,T.useState)(()=>$(n)),[c,l]=(0,T.useState)(null),[u,d]=(0,T.useState)(null),f=new Set(ie.map(e=>e.name));function p(e,t){return t.name===e.name?!0:!f.has(e.name)&&t.name===ti?e.backgroundColor===t.backgroundColor&&e.primaryColor===t.primaryColor&&e.positiveColor===t.positiveColor&&e.negativeColor===t.negativeColor&&e.light===t.light:!1}let m=(0,T.useRef)(JSON.stringify(n)),h=(0,T.useRef)(null);(0,T.useEffect)(()=>{if(!e?.appearance)return;let t=JSON.stringify(e.appearance);t!==m.current&&(m.current=t,a(e.appearance),s($(e.appearance)))},[e?.appearance]),(0,T.useEffect)(()=>(ae(i),h.current&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{m.current=JSON.stringify(i),t({appearance:i})},400),()=>{h.current&&window.clearTimeout(h.current)}),[i,t]);function y(e){a(t=>({...t,...e,name:ti}))}function b(e){a(e),s($(e)),l(null)}function x(){let e=ei(o);if(!e.ok){l(e.error);return}l(null),a(t=>({...t,...e.theme,name:e.theme.name??ti}))}function ee(){let e=$(i);if(s(e),l(null),!navigator.clipboard){d(`Clipboard API unavailable (use HTTPS or localhost).`);return}navigator.clipboard.writeText(e).then(()=>d(`Copied to clipboard`)).catch(()=>d(`Copy failed`))}function C(){let e=window.prompt(`Name this theme:`,i.name===ti?``:i.name);if(e===null)return;let n=e.trim().slice(0,64);if(!n)return;if(f.has(n)){window.alert(`"${n}" is a built-in preset name. Pick a different name.`);return}let o={...i,name:n};t({themePresets:r.filter(e=>e.name!==n).concat(o),appearance:o}),a(o),s($(o))}function te(e){if(!window.confirm(`Delete "${e}"?`))return;let n={themePresets:r.filter(t=>t.name!==e)};i.name===e&&(n.appearance=w,a(w),s($(w))),t(n)}return(0,T.useEffect)(()=>{if(!u)return;let e=window.setTimeout(()=>d(null),2e3);return()=>window.clearTimeout(e)},[u]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(S,{title:`Theme Presets`,description:`Pick a theme or tune your own. Colors are HSL triplets; multipliers scale text contrast and saturation.`,children:[(0,E.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(180px, 1fr))`,gap:8},children:[ie.map(e=>(0,E.jsx)(ai,{preset:e,active:p(e,i),onClick:()=>b(e)},e.name)),r.map(e=>(0,E.jsx)(ai,{preset:e,active:p(e,i),onClick:()=>b(e),onDelete:()=>te(e.name)},`user:${e.name}`))]}),(0,E.jsxs)(v,{direction:`row`,align:`center`,gap:8,style:{marginTop:10},children:[(0,E.jsx)(_,{size:`sm`,onClick:C,children:`Save current as preset…`}),(0,E.jsx)(`span`,{style:{fontSize:11,color:`var(--color-text-muted)`},children:r.length>0?`${r.length} custom ${r.length===1?`theme`:`themes`} saved`:`Tune the sliders below then save to pin your favorite.`})]})]}),(0,E.jsx)(S,{title:`Mode`,children:(0,E.jsx)(li,{label:`Light mode`,checked:i.light,onChange:e=>y({light:e}),hint:`Inverts surface-lightness derivation so raised surfaces step down rather than up.`})}),(0,E.jsxs)(S,{title:`Colors`,description:`HSL values (H 0–360, S and L 0–100). Live swatches update as you drag.`,children:[(0,E.jsx)(ci,{label:`Background`,value:i.backgroundColor,onChange:e=>y({backgroundColor:e})}),(0,E.jsx)(ci,{label:`Primary`,value:i.primaryColor,onChange:e=>y({primaryColor:e})}),(0,E.jsx)(ci,{label:`Positive`,value:i.positiveColor,onChange:e=>y({positiveColor:e})}),(0,E.jsx)(ci,{label:`Negative`,value:i.negativeColor,onChange:e=>y({negativeColor:e})})]}),(0,E.jsxs)(S,{title:`Adjustments`,description:`Scale text contrast and saturation against the background. 1.0 = neutral.`,children:[(0,E.jsx)(oi,{label:`Contrast`,value:i.contrastMultiplier,onChange:e=>y({contrastMultiplier:e}),min:.5,max:2,step:.05}),(0,E.jsx)(oi,{label:`Text saturation`,value:i.textSaturationMultiplier,onChange:e=>y({textSaturationMultiplier:e}),min:.5,max:2,step:.05})]}),(0,E.jsx)(S,{title:`Custom CSS`,description:`Injected as a <style> tag at the end of <head>. Max 16 KB. Use for tweaks the tokens don't expose.`,children:(0,E.jsx)(g,{value:i.customCSS,onChange:e=>y({customCSS:e.target.value}),placeholder:`/* Your overrides here. Try:\\n.page-content-frame { max-width: 1400px; }\\n*/`,compact:!0,style:{minHeight:120}})}),(0,E.jsxs)(S,{title:`Import / Export YAML`,description:`Paste a theme YAML to try it; use Export to share your current theme.`,children:[(0,E.jsx)(g,{value:o,onChange:e=>s(e.target.value),compact:!0,style:{minHeight:140,borderColor:c?`var(--color-negative)`:void 0}}),c&&(0,E.jsx)(`div`,{style:{fontSize:12,color:`var(--color-negative)`,marginTop:6},children:c}),(0,E.jsxs)(v,{direction:`row`,align:`center`,gap:8,style:{marginTop:8},children:[(0,E.jsx)(_,{size:`sm`,onClick:x,children:`Import`}),(0,E.jsx)(_,{size:`sm`,onClick:ee,children:`Export + Copy`}),u&&(0,E.jsx)(`span`,{style:{fontSize:12,color:`var(--color-text-muted)`},children:u})]})]})]})}function di(e){let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function fi(e){switch(e){case`claude-binary`:return`Claude binary on PATH`;case`teamwork-home-writable`:return`~/.teamwork is writable`;case`sessions-db-readable`:return`sessions.db readable`;case`memory-db-readable`:return`memory.db readable`;case`jobs-dir`:return`Jobs directory`;case`org-scanned`:return`Organization scanned`;default:return e}}function pi(){let[e,t]=(0,T.useState)({status:`loading`}),n=(0,T.useCallback)(async()=>{t({status:`loading`});try{let e=await fetch(`/api/welcome`);if(!e.ok)throw Error(`HTTP ${e.status}`);t({status:`loaded`,data:await e.json(),fetchedAt:Date.now()})}catch(e){t({status:`error`,message:e instanceof Error?e.message:`unknown error`})}},[]);return(0,T.useEffect)(()=>{n()},[n]),(0,E.jsx)(S,{title:`Diagnostics`,description:`Startup health of the gateway — useful on first run and when something feels off.`,children:(0,E.jsxs)(`div`,{style:o,children:[e.status===`loading`&&(0,E.jsx)(`div`,{style:{...s,padding:12},children:`Checking…`}),e.status===`error`&&(0,E.jsxs)(`div`,{style:{padding:12},children:[(0,E.jsxs)(`div`,{style:{color:c.red,fontSize:13},children:[`Failed to load diagnostics: `,e.message]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void n(),style:{marginTop:12,minHeight:44,padding:`0 14px`,background:`var(--color-bg-raised)`,border:`1px solid ${c.border}`,borderRadius:6,color:c.text,fontSize:13,cursor:`pointer`},children:`Retry`})]}),e.status===`loaded`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`12px 14px`,borderBottom:`1px solid ${c.border}`,gap:12,flexWrap:`wrap`},children:[(0,E.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,E.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:e.data.ok?c.green:c.red},children:e.data.ok?`All checks passing`:`One or more checks failing`}),(0,E.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:`0 10px`,fontSize:12,color:c.muted,marginTop:4},children:[(0,E.jsxs)(`span`,{children:[`v`,e.data.version]}),(0,E.jsxs)(`span`,{children:[`port `,e.data.port]}),(0,E.jsxs)(`span`,{children:[`uptime `,di(e.data.uptimeMs)]}),(0,E.jsxs)(`span`,{children:[e.data.jobCount,` job`,e.data.jobCount===1?``:`s`]}),(0,E.jsxs)(`span`,{children:[e.data.employeeCount,` employee`,e.data.employeeCount===1?``:`s`]})]})]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void n(),style:{minHeight:44,padding:`0 14px`,background:`var(--color-bg-raised)`,border:`1px solid ${c.border}`,borderRadius:6,color:c.text,fontSize:13,cursor:`pointer`},children:`Refresh`})]}),(0,E.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:e.data.checks.map(e=>(0,E.jsxs)(`li`,{style:{display:`flex`,alignItems:`flex-start`,gap:10,padding:`10px 14px`,borderBottom:`1px solid ${c.border}`,fontSize:13},children:[(0,E.jsx)(`span`,{"aria-label":e.ok?`passing`:`failing`,style:{minWidth:18,color:e.ok?c.green:c.red,fontWeight:700},children:e.ok?`✓`:`✗`}),(0,E.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,E.jsx)(`div`,{style:{color:c.text},children:fi(e.name)}),e.detail&&(0,E.jsx)(`div`,{style:{fontSize:12,color:c.muted,marginTop:2,overflowWrap:`anywhere`,hyphens:`none`},children:e.detail})]})]},e.name))}),(0,E.jsxs)(`div`,{style:{padding:`10px 14px`,fontSize:11,color:c.muted},children:[`TEAMWORK_HOME: `,(0,E.jsx)(`span`,{style:{fontFamily:`ui-monospace, monospace`},children:e.data.teamworkHome})]})]})]})})}var mi=[{value:216e5,label:`6 hours`},{value:432e5,label:`12 hours`},{value:864e5,label:`24 hours (default)`},{value:1728e5,label:`48 hours`}];function hi(e,t,n){t({memorySteward:{...e?.memorySteward??{enabled:!0,scheduleMs:864e5},...n}})}function gi({settings:e,onUpdateSettings:t}){let n=e?.memorySteward??{enabled:!0,scheduleMs:864e5};return(0,E.jsx)(S,{title:`Memory Steward`,description:`Background process that scans memory files for hygiene issues and queues synthesis proposals.`,children:(0,E.jsxs)(ce,{children:[(0,E.jsx)(le,{label:`Enabled`,hint:`Run the steward on the schedule below.`,children:(0,E.jsx)(`input`,{type:`checkbox`,checked:n.enabled,onChange:n=>hi(e,t,{enabled:n.target.checked}),"aria-label":`Enable memory steward`})}),(0,E.jsx)(le,{label:`Schedule`,hint:`How often the steward scans all memory directories.`,divider:!0,children:(0,E.jsx)(h,{compact:!0,value:n.scheduleMs,disabled:!n.enabled,onChange:n=>hi(e,t,{scheduleMs:Number(n.target.value)}),children:mi.map(e=>(0,E.jsx)(`option`,{value:e.value,children:e.label},e.value))})})]})})}var _i=[{value:60,label:`1 minute`},{value:120,label:`2 minutes`},{value:300,label:`5 minutes (default)`},{value:600,label:`10 minutes`},{value:1800,label:`30 minutes`}],vi=5;function yi(e,t,n){t({prAutoFix:{...e?.prAutoFix??{enabled:!0,intervalSec:300,model:`claude-sonnet-4-6`,maxAttempts:vi},...n}})}function bi({settings:e,onUpdateSettings:t}){let n=e?.prAutoFix??{enabled:!0,intervalSec:300,model:`claude-sonnet-4-6`,maxAttempts:vi},r=n.maxAttempts??vi;return(0,E.jsx)(S,{title:`PR Auto-Fix`,description:`Automatically update branches that fall behind main, and attempt to resolve merge conflicts via a Claude session.`,children:(0,E.jsxs)(ce,{children:[(0,E.jsx)(le,{label:`Enabled`,hint:`Watch open PRs and fix BEHIND or CONFLICTING states automatically.`,children:(0,E.jsx)(`input`,{type:`checkbox`,checked:n.enabled,onChange:n=>yi(e,t,{enabled:n.target.checked}),"aria-label":`Enable PR auto-fix`})}),(0,E.jsx)(le,{label:`Poll interval`,hint:`How often to check PR states.`,divider:!0,children:(0,E.jsx)(h,{compact:!0,value:n.intervalSec,disabled:!n.enabled,onChange:n=>yi(e,t,{intervalSec:Number(n.target.value)}),children:_i.map(e=>(0,E.jsx)(`option`,{value:e.value,children:e.label},e.value))})}),(0,E.jsx)(le,{label:`Model`,hint:`Claude model used for rebase and CI-fix sessions.`,divider:!0,children:(0,E.jsx)(h,{compact:!0,value:n.model??`claude-sonnet-4-6`,disabled:!n.enabled,onChange:n=>yi(e,t,{model:n.target.value}),children:p.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))})}),(0,E.jsx)(le,{label:`Max attempts per push`,hint:`How many fix attempts before pausing and asking for input. A successful push resets the counter.`,divider:!0,children:(0,E.jsx)(h,{compact:!0,value:r,disabled:!n.enabled,onChange:n=>yi(e,t,{maxAttempts:Number(n.target.value)}),children:[1,2,3,4,5,6,7,8,9,10].map(e=>(0,E.jsxs)(`option`,{value:e,children:[e,e===vi?` (default)`:``]},e))})})]})})}var xi={gatewayPasses:[],jobs:[],employees:[]};async function Si(){let e=await fetch(`/api/spawn-profiles/usage`,{credentials:`include`});if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}function Ci(){let e=se(),[t,n]=(0,T.useState)(null),[r,a]=(0,T.useState)(null),[o,s]=(0,T.useState)(0);if(i(f,()=>s(e=>e+1)),(0,T.useEffect)(()=>{let e=!1;return Si().then(t=>{e||(n(t),a(null))}).catch(t=>{e||a(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[o]),e.status===`loading`)return(0,E.jsx)(S,{title:`Spawn Profiles`,children:(0,E.jsx)(`div`,{style:{color:c.muted,fontSize:13},children:`Loading…`})});if(e.status===`error`)return(0,E.jsx)(S,{title:`Spawn Profiles`,children:(0,E.jsxs)(`div`,{style:{color:`var(--color-danger, #ff6b6b)`,fontSize:13},children:[`Failed to load profiles: `,e.error]})});let l=e.status===`ok`?e.data:[];return(0,E.jsxs)(S,{title:`Spawn Profiles`,description:`Each gateway-spawned Claude session can opt into a named SpawnProfile that sets MCP servers, enabled marketplace plugins, claude.ai opt-in, and whether user-folder settings are suppressed. Built-in profiles ship with the gateway; user overrides at ~/.teamwork/profiles/<name>.json win when present.`,children:[r&&(0,E.jsxs)(`div`,{style:{fontSize:12,color:`var(--color-danger, #ff6b6b)`,marginBottom:12},children:[`Failed to load usage map: `,r]}),l.length===0&&(0,E.jsx)(`div`,{style:{color:c.muted,fontSize:13},children:`No profiles found. (This is unexpected — built-ins should always be present.)`}),(0,E.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:24},children:l.map(e=>(0,E.jsx)(wi,{name:e.name,usage:t?.[e.name]??xi},e.name))})]})}function wi({name:e,usage:t}){let n=t.gatewayPasses.length===0&&t.jobs.length===0&&t.employees.length===0;return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{style:{fontSize:11,fontWeight:600,textTransform:`uppercase`,letterSpacing:.5,color:c.muted,marginBottom:6},children:`Used by`}),(0,E.jsxs)(`div`,{style:{fontSize:12,color:n?c.muted:`var(--color-text)`,marginBottom:10,lineHeight:1.6},children:[n&&(0,E.jsx)(`span`,{children:`No active consumers.`}),!n&&(0,E.jsxs)(`ul`,{style:{margin:0,padding:`0 0 0 18px`},children:[t.gatewayPasses.map(e=>(0,E.jsxs)(`li`,{children:[(0,E.jsx)(`span`,{children:e.label}),(0,E.jsxs)(`span`,{style:{color:c.muted,marginLeft:6},children:[`(`,e.file,`)`]})]},`pass-${e.id}`)),t.jobs.map(e=>(0,E.jsxs)(`li`,{children:[`Job: `,(0,E.jsx)(`a`,{href:`#/cron?job=${encodeURIComponent(e.id)}`,style:{color:`var(--color-primary)`,textDecoration:`none`},children:e.name}),(0,E.jsxs)(`span`,{style:{color:c.muted,marginLeft:6},children:[`(`,e.id,`)`]})]},`job-${e.id}`)),t.employees.map(e=>(0,E.jsxs)(`li`,{children:[`Employee: `,(0,E.jsx)(`a`,{href:`#/org?employee=${encodeURIComponent(e.name)}`,style:{color:`var(--color-primary)`,textDecoration:`none`},children:e.displayName??e.name}),(0,E.jsxs)(`span`,{style:{color:c.muted,marginLeft:6},children:[`(`,e.department,`)`]})]},`emp-${e.name}`))]})]}),(0,E.jsx)(oe,{name:e,defaultExpanded:!0})]})}function Ti(){let[e,t]=(0,T.useState)(null);return(0,T.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await fetch(`/api/auth/whoami`,{credentials:`include`});if(!n.ok)return;let r=await n.json();if(e)return;t({authRequired:r.authRequired,exp:r.exp,issuedAt:r.issuedAt,daysRemaining:r.daysRemaining??0})}catch{}})(),()=>{e=!0}},[]),e}function Ei(){return{display:`flex`,alignItems:`center`,gap:10,minHeight:44,padding:`0 12px`,borderRadius:8,border:`1px solid transparent`,background:`transparent`,color:c.muted,fontSize:13,fontWeight:500,cursor:`pointer`,fontFamily:`inherit`,transition:`background 0.15s, color 0.15s, border-color 0.15s`}}function Di(e,t){let n=e.currentTarget;t?(n.style.background=`rgba(255, 107, 107, 0.08)`,n.style.color=`var(--color-danger, #ff6b6b)`,n.style.borderColor=`var(--color-danger, #ff6b6b)`):(n.style.background=`transparent`,n.style.color=c.muted,n.style.borderColor=`transparent`)}function Oi(){let e=Ti(),[t,n]=(0,T.useState)(null);async function i(e){n(null),e===`everywhere`?await r():await a(),window.location.reload()}let o=e?.authRequired===!0,s=o?`Signed in · session expires in ${e.daysRemaining} day${e.daysRemaining===1?``:`s`}`:``,l=t===`everywhere`?`This invalidates every session you've started from any device. Other browsers and devices will also be signed out. You'll need your AUTH_TOKEN to sign in again.`:`You'll need your AUTH_TOKEN to sign back in. This only signs out this browser — other devices stay signed in.`,u=t===`everywhere`?`Sign out everywhere`:`Sign out`;return(0,E.jsxs)(`div`,{style:{marginTop:32,paddingTop:16,borderTop:`1px solid ${c.border}`},children:[(0,E.jsx)(`div`,{"aria-live":`polite`,style:{fontSize:12,color:c.muted,marginBottom:8,minHeight:16},children:s}),(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,alignItems:`flex-start`},children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>n(`this-device`),"aria-label":`Sign out`,style:Ei(),onMouseEnter:e=>Di(e,!0),onMouseLeave:e=>Di(e,!1),children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,style:{fontSize:16,lineHeight:1},children:`⏻`}),(0,E.jsx)(`span`,{children:`Sign out`})]}),o&&(0,E.jsxs)(`button`,{type:`button`,onClick:()=>n(`everywhere`),"aria-label":`Sign out everywhere`,style:Ei(),onMouseEnter:e=>Di(e,!0),onMouseLeave:e=>Di(e,!1),children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,style:{fontSize:16,lineHeight:1},children:`✕`}),(0,E.jsx)(`span`,{children:`Sign out everywhere`})]})]}),(0,E.jsx)(ne,{open:t!==null,title:t===`everywhere`?`Sign out on every device?`:`Sign out?`,body:l,confirmLabel:u,onConfirm:()=>t&&i(t),onCancel:()=>n(null)})]})}var ki=[{id:`appearance`,label:`Appearance`},{id:`engine`,label:`Engine`},{id:`integrations`,label:`Integrations`},{id:`slack`,label:`Slack`},{id:`organization`,label:`Organization`},{id:`memory`,label:`Memory`},{id:`pipeline`,label:`Pipeline`},{id:`spawn-profiles`,label:`Spawn Profiles`},{id:`diagnostics`,label:`Diagnostics`}];function Ai({settings:e,integrations:t,runtimeConfig:n,onUpdateSettings:r,onVerify:i,verifying:a}){let[o,s]=(0,T.useState)(`engine`),l=(0,T.useRef)(null),u=(0,T.useRef)(null);(0,T.useEffect)(()=>{let e=u.current;if(!e)return;let t=e.querySelector(`button[data-tab-id="${o}"]`);t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[o]);function d(e){s(e),l.current?.scrollTo({top:0,behavior:`smooth`})}return(0,E.jsxs)(`div`,{className:`page-content-frame`,style:{padding:`32px 48px`,maxWidth:1100,margin:`0 auto`},children:[(0,E.jsx)(`h1`,{style:{fontSize:22,fontWeight:600,marginBottom:4},children:`Platform Settings`}),(0,E.jsx)(`p`,{style:{fontSize:13,color:c.muted,marginBottom:24},children:`Configure platform-wide settings for TeamworkOS. Cron job settings are in the Cron page header.`}),(0,E.jsx)(`div`,{className:`settings-mobile-tabs`,ref:u,style:{display:`none`,gap:4,marginBottom:20,overflowX:`auto`,WebkitOverflowScrolling:`touch`,scrollbarWidth:`none`,paddingBottom:4},children:ki.map(e=>(0,E.jsx)(`button`,{"data-tab-id":e.id,onClick:()=>d(e.id),style:{background:o===e.id?`rgba(188,140,255,0.12)`:`var(--color-subtle-bg)`,border:`1px solid ${o===e.id?`rgba(188,140,255,0.3)`:c.border}`,color:o===e.id?`var(--color-text)`:c.muted,fontSize:12,fontWeight:500,padding:`6px 14px`,borderRadius:6,cursor:`pointer`,whiteSpace:`nowrap`,minHeight:44,transition:`all 0.15s ease`,flexShrink:0},children:e.label},e.id))}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:32},children:[(0,E.jsx)(`nav`,{style:{width:160,flexShrink:0,position:`sticky`,top:80,alignSelf:`flex-start`,display:`flex`,flexDirection:`column`,gap:2},className:`settings-sidebar-nav`,children:ki.map(e=>(0,E.jsx)(`button`,{onClick:()=>d(e.id),style:{background:o===e.id?`rgba(188,140,255,0.08)`:`transparent`,border:`none`,borderLeft:`2px solid ${o===e.id?`var(--color-primary)`:`transparent`}`,color:o===e.id?`var(--color-text)`:c.muted,fontSize:13,fontWeight:o===e.id?500:400,padding:`8px 14px`,textAlign:`left`,cursor:`pointer`,borderRadius:`0 6px 6px 0`,transition:`all 0.15s ease`,minHeight:36},children:e.label},e.id))}),(0,E.jsxs)(`div`,{ref:l,style:{flex:1,minWidth:0},children:[o===`appearance`&&(0,E.jsx)(ui,{settings:e,onUpdateSettings:r}),o===`engine`&&(0,E.jsx)(de,{settings:e,onUpdateSettings:r,runtimeConfig:n}),o===`integrations`&&(0,E.jsx)(Te,{integrations:t,onVerify:i,verifying:a}),o===`slack`&&(0,E.jsx)(he,{settings:e,onUpdateSettings:r,runtimeConfig:n}),o===`organization`&&(0,E.jsx)(ye,{settings:e,onUpdateSettings:r}),o===`memory`&&(0,E.jsx)(gi,{settings:e,onUpdateSettings:r}),o===`pipeline`&&(0,E.jsx)(bi,{settings:e,onUpdateSettings:r}),o===`spawn-profiles`&&(0,E.jsx)(Ci,{}),o===`diagnostics`&&(0,E.jsx)(pi,{}),(0,E.jsx)(Oi,{})]})]}),(0,E.jsx)(`style`,{children:`
33
+ @media (max-width: 768px) {
34
+ .settings-sidebar-nav {
35
+ display: none !important;
36
+ }
37
+ .settings-mobile-tabs {
38
+ display: flex !important;
39
+ -webkit-mask-image: linear-gradient(90deg, black 0%, black calc(100% - 28px), transparent 100%);
40
+ mask-image: linear-gradient(90deg, black 0%, black calc(100% - 28px), transparent 100%);
41
+ }
42
+ .settings-mobile-tabs::-webkit-scrollbar { display: none; }
43
+ }
44
+ @media (min-width: 769px) {
45
+ .settings-mobile-tabs {
46
+ display: none !important;
47
+ }
48
+ }
49
+ `})]})}export{Ai as SettingsPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-Bq3x7umQ.js";import{f as t,i as n,n as r,p as i,s as a}from"./styles-Ds5gMQAQ.js";var o=e();function s({children:e,style:n}){return(0,o.jsx)(`div`,{style:{...t,...n},children:e})}function c({label:e,hint:t,children:s,divider:c}){return(0,o.jsxs)(`div`,{style:{...i,paddingTop:c?12:void 0,borderTop:c?`1px solid ${r.border}`:void 0},children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`div`,{style:a,children:e}),t&&(0,o.jsx)(`div`,{style:n,children:t})]}),s]})}export{s as n,c as t};
@@ -0,0 +1 @@
1
+ ._grid_xipgd_1{grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;display:grid}._tileLabel_xipgd_6{text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-muted);font-size:12px}._tileValue_xipgd_12{font-variant-numeric:tabular-nums;margin-top:4px;font-size:36px;font-weight:600;line-height:1.1}._tileSub_xipgd_19{color:var(--color-text-muted);flex-wrap:wrap;gap:6px;margin-top:8px;font-size:13px;display:flex}._chip_xipgd_27{background:var(--color-surface-2);border-radius:4px;padding:2px 8px;font-size:12px}._list_ucrmt_1{border:1px solid var(--color-border);border-radius:8px;flex-direction:column;display:flex;overflow:hidden}._empty_ucrmt_8{text-align:center;color:var(--color-text-muted);padding:24px;font-size:14px}._page_1yg4h_1{flex-direction:column;gap:16px;max-width:1280px;margin:0 auto;padding:16px;display:flex}._header_1yg4h_9{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;display:flex}._title_1yg4h_16{margin:0;font-size:20px;font-weight:600}._windowSelector_1yg4h_17{gap:4px;display:flex}._windowBtn_1yg4h_18{min-width:44px}._filterBar_1yg4h_19{flex-wrap:wrap;align-items:center;gap:8px;display:flex}._filterSelect_1yg4h_20{min-height:44px}._error_1yg4h_21{background:var(--color-negative-soft);color:var(--color-negative);border-radius:4px;padding:8px 12px;font-size:13px}
@@ -0,0 +1 @@
1
+ import{n as e,s as t,t as n}from"./jsx-runtime-Bq3x7umQ.js";import{t as r}from"./Card-u29day7d.js";import{n as i}from"./Input-HhV6M0tu.js";import{t as a}from"./Button-xBBZQ0ie.js";import{$ as o,B as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,Q as h,R as g,U as _,V as v,W as ee,X as y,Y as b,Z as x,at as S,ct as C,dt as w,et as T,ft as E,ht as D,it as O,lt as k,mt as te,nt as ne,ot as re,pt as ie,q as ae,rt as A,st as oe,tt as j,ut as M,z as N}from"./index-tOLuwPW6.js";var P=t(e(),1);function F(e){let t=E(()=>x(e)),{isStatic:n}=(0,P.useContext)(w);if(n){let[,n]=(0,P.useState)(e);(0,P.useEffect)(()=>t.on(`change`,n),[])}return t}function I(e,t){let n=F(t()),r=()=>n.set(t());return r(),M(()=>{let t=()=>S.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),O(r)}}),n}var se=e=>e&&typeof e==`object`&&e.mix,ce=e=>se(e)?e.mix:void 0;function le(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=p(i,a,{mixer:ce(a[0]),...o});return t?s(r):s}function ue(e){y.current=[],e();let t=I(y.current,e);return y.current=void 0,t}function de(e,t,n,r){if(typeof e==`function`)return ue(e);let i=typeof t==`function`?t:le(t,n,r);return Array.isArray(e)?L(e,i):L([e],([e])=>i(e))}function L(e,t){let n=E(()=>[]);return I(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}var R=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function z(e,t){return ae(e)?e[R(0,e.length,t)]:e}function B(e){return typeof e==`object`&&!Array.isArray(e)}function V(e,t,n,r){return typeof e==`string`&&B(t)?o(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function H(e,t,n){return e*(t+1)}function U(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:r.get(t)??e}function fe(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(h(e,i),r--)}}function pe(e,t,n,r,i,a){fe(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:b(i,a,r[o]),easing:z(n,o)})}function me(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function he(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var ge=`easeInOut`,_e=20;function ve(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},u=new Map,d=0,f=0,p=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){u.set(o,f);continue}else if(!Array.isArray(o)){u.set(o.name,U(f,o.at,d,u));continue}let[m,h,g={}]=o;g.at!==void 0&&(f=U(f,g.at,d,u));let _=0,v=(e,n,r,o=0,s=0)=>{let c=ye(e),{delay:u=0,times:d=ee(c),type:m=`keyframes`,repeat:h,repeatType:g,repeatDelay:v=0,...y}=n,{ease:b=t.ease||`easeOut`,duration:x}=n,S=typeof u==`function`?u(o,s):u,w=c.length,E=T(m)?m:i?.[m];if(w<=2&&E){let e=100;if(w===2&&Se(c)){let t=c[1]-c[0];e=Math.abs(t)}let t={...y};x!==void 0&&(t.duration=re(x));let n=j(t,e,E);b=n.ease,x=n.duration}x??=a;let D=f+S;d.length===1&&d[0]===0&&(d[1]=1);let O=d.length-c.length;if(O>0&&l(d,O),c.length===1&&c.unshift(null),h){C(h<_e,`Repeat count too high, must be less than 20`),x=H(x,h);let e=[...c],t=[...d];b=Array.isArray(b)?[...b]:[b];let n=[...b];for(let r=0;r<h;r++){c.push(...e);for(let i=0;i<e.length;i++)d.push(t[i]+(r+1)),b.push(i===0?`linear`:z(n,i-1))}me(d,h)}let k=D+x;pe(r,c,b,d,D,k),_=Math.max(S+x,_),p=Math.max(k,p)};if(A(m)){let e=W(m,s);v(h,g,G(`default`,e))}else{let e=V(m,h,r,c),t=e.length;for(let n=0;n<t;n++){h=h,g=g;let r=e[n],i=W(r,s);for(let e in h)v(h[e],be(g,e),G(e,i),n,t)}}d=f,f+=_}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(he);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(oe(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(ge)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s,u.transition[i]={...t,duration:p,ease:l,times:c,...n}}}),o}function W(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function G(e,t){return t[e]||(t[e]=[]),t[e]}function ye(e){return Array.isArray(e)?e:[e]}function be(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var xe=e=>typeof e==`number`,Se=e=>e.every(xe);function Ce(e,t){return e in t}var we=class extends g{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Ce(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return u()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}};function Te(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=s(e)?new d(t):new m(t);n.mount(e),N.set(e,n)}function Ee(e){let t=new we({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),N.set(e,t)}function De(e,t){return A(e)||typeof e==`number`||typeof e==`string`&&!B(t)}function K(e,t,n,r){let i=[];if(De(e,t))i.push(v(e,B(t)&&t.default||t,n&&(n.default||n)));else{let a=V(e,t,r),o=a.length;C(!!o,`No valid elements provided.`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Te:Ee;N.has(r)||s(r);let c=N.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(..._(c,{...t,transition:l},{}))}}return i}function Oe(e,t,n){let r=[];return ve(e,t,n,{spring:f}).forEach(({keyframes:e,transition:t},n)=>{r.push(...K(n,e,t))}),r}function ke(e){return Array.isArray(e)&&e.some(Array.isArray)}function Ae(e){function t(t,n,r){let i=[];i=ke(t)?Oe(t,n,e):K(t,n,r,e);let a=new ne(i);return e&&e.animations.push(a),a}return t}var q=Ae(),J={grid:`_grid_xipgd_1`,tileLabel:`_tileLabel_xipgd_6`,tileValue:`_tileValue_xipgd_12`,tileSub:`_tileSub_xipgd_19`,chip:`_chip_xipgd_27`},Y=n();function X({value:e}){let t=F(0),n=de(t,e=>Math.floor(e).toString());return(0,P.useEffect)(()=>{let n=q(t,e,{duration:.6,ease:`easeOut`});return()=>{n.stop()}},[e,t]),(0,Y.jsx)(c.span,{children:n})}function Z(e,t){return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,t)}function je({metrics:e}){let t=Object.values(e.failuresByKind).reduce((e,t)=>e+t,0),n=Object.values(e.remediationsByAction).reduce((e,t)=>e+t,0),i=Z(e.failuresByKind,3),a=Z(e.remediationsByAction,3);return(0,Y.jsxs)(`div`,{className:J.grid,children:[(0,Y.jsxs)(r,{children:[(0,Y.jsx)(`div`,{className:J.tileLabel,children:`Failures`}),(0,Y.jsx)(`div`,{className:J.tileValue,children:(0,Y.jsx)(X,{value:t})}),(0,Y.jsx)(`div`,{className:J.tileSub,children:i.length===0?`No failures`:i.map(([e,t])=>(0,Y.jsxs)(`span`,{className:J.chip,children:[e,`: `,t]},e))})]}),(0,Y.jsxs)(r,{children:[(0,Y.jsx)(`div`,{className:J.tileLabel,children:`Remediations`}),(0,Y.jsx)(`div`,{className:J.tileValue,children:(0,Y.jsx)(X,{value:n})}),(0,Y.jsx)(`div`,{className:J.tileSub,children:a.length===0?`None dispatched`:a.map(([e,t])=>(0,Y.jsxs)(`span`,{className:J.chip,children:[e,`: `,t]},e))})]}),(0,Y.jsxs)(r,{children:[(0,Y.jsx)(`div`,{className:J.tileLabel,children:`Auto-resolved`}),(0,Y.jsx)(`div`,{className:J.tileValue,children:(0,Y.jsx)(X,{value:e.autoResolved})}),(0,Y.jsx)(`div`,{className:J.tileSub,children:`jobs auto-unpaused`})]}),(0,Y.jsxs)(r,{children:[(0,Y.jsx)(`div`,{className:J.tileLabel,children:`Escalated`}),(0,Y.jsx)(`div`,{className:J.tileValue,children:(0,Y.jsx)(X,{value:e.escalated})}),(0,Y.jsx)(`div`,{className:J.tileSub,children:`awaiting human action`})]})]})}var Q={list:`_list_ucrmt_1`,empty:`_empty_ucrmt_8`},Me=20;function Ne({events:e,onJobClick:t,ideaTitles:n}){return e.length===0?(0,Y.jsx)(`div`,{className:Q.empty,children:`No supervisor activity in this window.`}):(0,Y.jsx)(`div`,{className:Q.list,children:(0,Y.jsx)(k,{initial:!0,children:e.map((e,r)=>(0,Y.jsx)(c.div,{initial:{opacity:0,y:r===0?-8:4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:r===0?.25:.2,delay:Math.min(r,Me)*.03,ease:`easeOut`},children:(0,Y.jsx)(D,{event:e,onJobClick:t,ideaTitles:n})},e.id))})})}var $={page:`_page_1yg4h_1`,header:`_header_1yg4h_9`,title:`_title_1yg4h_16`,windowSelector:`_windowSelector_1yg4h_17`,windowBtn:`_windowBtn_1yg4h_18`,filterBar:`_filterBar_1yg4h_19`,filterSelect:`_filterSelect_1yg4h_20`,error:`_error_1yg4h_21`},Pe=[`retry`,`slack-drafted`,`idea-filed`,`auto-unpaused`,`skipped`,`no-action`];function Fe(){let e=te(),{titles:t}=ie();return(0,Y.jsxs)(`div`,{className:$.page,children:[(0,Y.jsxs)(`header`,{className:$.header,children:[(0,Y.jsx)(`h1`,{className:$.title,children:`Job Health`}),(0,Y.jsx)(`div`,{className:$.windowSelector,children:[`1d`,`7d`,`30d`].map(t=>(0,Y.jsx)(a,{variant:e.timeWindow===t?`default`:`ghost`,onClick:()=>e.setTimeWindow(t),className:$.windowBtn,children:t},t))})]}),(0,Y.jsx)(je,{metrics:e.metrics}),(0,Y.jsxs)(`div`,{className:$.filterBar,children:[(0,Y.jsxs)(i,{value:e.filterAction??``,onChange:t=>e.setFilterAction(t.target.value===``?null:t.target.value),className:$.filterSelect,children:[(0,Y.jsx)(`option`,{value:``,children:`All actions`}),Pe.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))]}),e.filterJobId&&(0,Y.jsxs)(a,{variant:`ghost`,onClick:()=>e.setFilterJobId(null),children:[`Clear job filter (`,e.filterJobId,`)`]})]}),e.error&&(0,Y.jsxs)(`div`,{className:$.error,children:[`Failed to load: `,e.error]}),(0,Y.jsx)(Ne,{events:e.events,onJobClick:e.setFilterJobId,ideaTitles:t})]})}export{Fe as SupervisorDashboardPage};
@@ -0,0 +1,4 @@
1
+ import{n as e,s as t,t as n}from"./jsx-runtime-Bq3x7umQ.js";import{t as r}from"./react-dom-Cnw6SoYl.js";import{r as i}from"./useWebSocket-Hg3RO6sx.js";import{S as a}from"./events-CCBP4a9s.js";import{t as o}from"./Input-HhV6M0tu.js";import{t as s}from"./Button-xBBZQ0ie.js";import"./index-tOLuwPW6.js";import{C as c,D as l,E as u,O as d,S as f,T as p,_ as m,a as h,b as g,c as _,d as v,f as y,g as b,k as ee,l as x,m as S,n as C,p as w,r as T,s as E,t as D,u as te,v as O,w as k,x as A,y as ne}from"./generateCategoricalChart-pfORgeJG.js";import{t as j}from"./KpiTile-pXTBj77S.js";var M=t(e()),N=t(d()),P=t(S()),F=t(l()),re=t(u()),I=t(w()),ie=[`layout`,`type`,`stroke`,`connectNulls`,`isRange`,`ref`],ae=[`key`],L;function R(e){"@babel/helpers - typeof";return R=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},R(e)}function z(e,t){if(e==null)return{};var n=oe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(this,arguments)}function V(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 H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?V(Object(n),!0).forEach(function(t){G(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function se(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,K(r.key),r)}}function le(e,t,n){return t&&ce(e.prototype,t),n&&ce(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function ue(e,t,n){return t=U(t),de(e,pe()?Reflect.construct(t,n||[],U(e).constructor):t.apply(e,n))}function de(e,t){if(t&&(R(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return fe(e)}function fe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pe=function(){return!!e})()}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},U(e)}function me(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&W(e,t)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}function G(e,t,n){return t=K(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K(e){var t=he(e,`string`);return R(t)==`symbol`?t:t+``}function he(e,t){if(R(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(R(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var q=function(e){function t(){var e;se(this,t);var n=[...arguments];return e=ue(this,t,[].concat(n)),G(e,`state`,{isAnimationFinished:!0}),G(e,`id`,p(`recharts-area-`)),G(e,`handleAnimationEnd`,function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),(0,N.default)(t)&&t()}),G(e,`handleAnimationStart`,function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),(0,N.default)(t)&&t()}),e}return me(t,e),le(t,[{key:`renderDots`,value:function(e,n,r){var i=this.props.isAnimationActive,a=this.state.isAnimationFinished;if(i&&!a)return null;var o=this.props,s=o.dot,c=o.points,l=o.dataKey,u=A(this.props,!1),d=A(s,!0),f=c.map(function(e,n){var r=H(H(H({key:`dot-${n}`,r:3},u),d),{},{index:n,cx:e.x,cy:e.y,dataKey:l,value:e.value,payload:e.payload,points:c});return t.renderDotItem(s,r)}),p={clipPath:e?`url(#clipPath-${n?``:`dots-`}${r})`:null};return M.createElement(g,B({className:`recharts-area-dots`},p),f)}},{key:`renderHorizontalRect`,value:function(e){var t=this.props,n=t.baseLine,r=t.points,i=t.strokeWidth,a=r[0].x,o=r[r.length-1].x,s=e*Math.abs(a-o),c=(0,P.default)(r.map(function(e){return e.y||0}));return k(n)&&typeof n==`number`?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max((0,P.default)(n.map(function(e){return e.y||0})),c)),k(c)?M.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}},{key:`renderVerticalRect`,value:function(e){var t=this.props,n=t.baseLine,r=t.points,i=t.strokeWidth,a=r[0].y,o=r[r.length-1].y,s=e*Math.abs(a-o),c=(0,P.default)(r.map(function(e){return e.x||0}));return k(n)&&typeof n==`number`?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max((0,P.default)(n.map(function(e){return e.x||0})),c)),k(c)?M.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}},{key:`renderClipRect`,value:function(e){return this.props.layout===`vertical`?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:`renderAreaStatically`,value:function(e,t,n,r){var i=this.props,a=i.layout,o=i.type,s=i.stroke,c=i.connectNulls,l=i.isRange;i.ref;var u=z(i,ie);return M.createElement(g,{clipPath:n?`url(#clipPath-${r})`:null},M.createElement(x,B({},A(u,!0),{points:e,connectNulls:c,type:o,baseLine:t,layout:a,stroke:`none`,className:`recharts-area-area`})),s!==`none`&&M.createElement(x,B({},A(this.props,!1),{className:`recharts-area-curve`,layout:a,type:o,connectNulls:c,fill:`none`,points:e})),s!==`none`&&l&&M.createElement(x,B({},A(this.props,!1),{className:`recharts-area-curve`,layout:a,type:o,connectNulls:c,fill:`none`,points:t})))}},{key:`renderAreaWithAnimation`,value:function(e,t){var n=this,r=this.props,i=r.points,a=r.baseLine,o=r.isAnimationActive,s=r.animationBegin,l=r.animationDuration,u=r.animationEasing,d=r.animationId,f=this.state,p=f.prevPoints,m=f.prevBaseLine;return M.createElement(_,{begin:s,duration:l,isActive:o,easing:u,from:{t:0},to:{t:1},key:`area-${d}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o=r.t;if(p){var s=p.length/i.length,l=i.map(function(e,t){var n=Math.floor(t*s);if(p[n]){var r=p[n],i=c(r.x,e.x),a=c(r.y,e.y);return H(H({},e),{},{x:i(o),y:a(o)})}return e}),u=k(a)&&typeof a==`number`?c(m,a)(o):(0,F.default)(a)||(0,re.default)(a)?c(m,0)(o):a.map(function(e,t){var n=Math.floor(t*s);if(m[n]){var r=m[n],i=c(r.x,e.x),a=c(r.y,e.y);return H(H({},e),{},{x:i(o),y:a(o)})}return e});return n.renderAreaStatically(l,u,e,t)}return M.createElement(g,null,M.createElement(`defs`,null,M.createElement(`clipPath`,{id:`animationClipPath-${t}`},n.renderClipRect(o))),M.createElement(g,{clipPath:`url(#animationClipPath-${t})`},n.renderAreaStatically(i,a,e,t)))})}},{key:`renderArea`,value:function(e,t){var n=this.props,r=n.points,i=n.baseLine,a=n.isAnimationActive,o=this.state,s=o.prevPoints,c=o.prevBaseLine,l=o.totalLength;return a&&r&&r.length&&(!s&&l>0||!(0,I.default)(s,r)||!(0,I.default)(c,i))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,i,e,t)}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.xAxis,c=e.yAxis,l=e.width,u=e.height,d=e.isAnimationActive,p=e.id;if(t||!r||!r.length)return null;var m=this.state.isAnimationFinished,h=r.length===1,_=ee(`recharts-area`,i),v=s&&s.allowDataOverflow,y=c&&c.allowDataOverflow,b=v||y,x=(0,F.default)(p)?this.id:p,S=A(n,!1)??{r:3,strokeWidth:2},C=S.r,w=C===void 0?3:C,T=S.strokeWidth,E=T===void 0?2:T,D=(f(n)?n:{}).clipDot,O=D===void 0?!0:D,k=w*2+E;return M.createElement(g,{className:_},v||y?M.createElement(`defs`,null,M.createElement(`clipPath`,{id:`clipPath-${x}`},M.createElement(`rect`,{x:v?o:o-l/2,y:y?a:a-u/2,width:v?l:l*2,height:y?u:u*2})),!O&&M.createElement(`clipPath`,{id:`clipPath-dots-${x}`},M.createElement(`rect`,{x:o-k/2,y:a-k/2,width:l+k,height:u+k}))):null,h?null:this.renderArea(b,x),(n||h)&&this.renderDots(b,O,x),(!d||m)&&te.renderCallByParent(this.props,r))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null:{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}}}])}(M.PureComponent);L=q,G(q,`displayName`,`Area`),G(q,`defaultProps`,{stroke:`#3182bd`,fill:`#3182bd`,fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:`line`,connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!O.isSsr,animationBegin:0,animationDuration:1500,animationEasing:`ease`}),G(q,`getBaseValue`,function(e,t,n,r){var i=e.layout,a=e.baseValue,o=t.props.baseValue??a;if(k(o)&&typeof o==`number`)return o;var s=i===`horizontal`?r:n,c=s.scale.domain();if(s.type===`number`){var l=Math.max(c[0],c[1]),u=Math.min(c[0],c[1]);return o===`dataMin`?u:o===`dataMax`||l<0?l:Math.max(Math.min(c[0],c[1]),0)}return o===`dataMin`?c[0]:o===`dataMax`?c[1]:c[0]}),G(q,`getComposedData`,function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,c=e.dataKey,l=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,p=t.layout,m=l&&l.length,h=L.getBaseValue(t,n,r,i),g=p===`horizontal`,_=!1,b=d.map(function(e,t){var n;m?n=l[u+t]:(n=y(e,c),Array.isArray(n)?_=!0:n=[h,n]);var d=n[1]==null||m&&y(e,c)==null;return g?{x:v({axis:r,ticks:a,bandSize:s,entry:e,index:t}),y:d?null:i.scale(n[1]),value:n,payload:e}:{x:d?null:r.scale(n[1]),y:v({axis:i,ticks:o,bandSize:s,entry:e,index:t}),value:n,payload:e}});return H({points:b,baseLine:m||_?b.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:t!=null&&e.y!=null?i.scale(t):null}:{x:t==null?null:r.scale(t),y:e.y}}):g?i.scale(h):r.scale(h),layout:p,isRange:_},f)}),G(q,`renderDotItem`,function(e,t){var n;if(M.isValidElement(e))n=M.cloneElement(e,t);else if((0,N.default)(e))n=e(t);else{var r=ee(`recharts-area-dot`,typeof e==`boolean`?``:e.className),i=t.key,a=z(t,ae);n=M.createElement(E,B({},a,{key:i,className:r}))}return n});var ge=D({chartName:`AreaChart`,GraphicalChild:q,axisComponents:[{axisType:`xAxis`,AxisComp:T},{axisType:`yAxis`,AxisComp:C}],formatAxisMap:h}),J={page:`_page_l9qss_1`,header:`_header_l9qss_2`,title:`_title_l9qss_3`,summary:`_summary_l9qss_4`,kpiGrid:`_kpiGrid_l9qss_5`,banner:`_banner_l9qss_6`,footer:`_footer_l9qss_7`,windowSeg:`_windowSeg_l9qss_8`,empty:`_empty_l9qss_10`,emptyHint:`_emptyHint_l9qss_11`,skeletonTile:`_skeletonTile_l9qss_12`,"usage-shimmer":`_usage-shimmer_l9qss_1`};function _e(e={}){let{window:t=`today`,start:n,end:r}=e,[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(!0),[u,d]=(0,M.useState)(null),f=(0,M.useCallback)(()=>{let e=new URLSearchParams({window:t});return n&&e.set(`start`,n),r&&e.set(`end`,r),`/api/usage/pipeline?${e.toString()}`},[t,n,r]);(0,M.useEffect)(()=>{let e=new AbortController;return l(!0),d(null),fetch(f(),{signal:e.signal}).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status} ${e.statusText||``}`.trim());return await e.json()}).then(e=>{s(e),l(!1)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||(d(e instanceof Error?e.message:String(e)),l(!1))}),()=>e.abort()},[f]);let p=(0,M.useRef)(null);return i(a,(0,M.useCallback)(()=>{p.current?.abort();let e=new AbortController;p.current=e,l(!0),fetch(f(),{signal:e.signal}).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(e=>{s(e),l(!1)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||(d(e instanceof Error?e.message:String(e)),l(!1))})},[f])),i(`ws:reconnected`,(0,M.useCallback)(()=>{p.current?.abort();let e=new AbortController;p.current=e,l(!0),fetch(f(),{signal:e.signal}).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(e=>{s(e),l(!1)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||(d(e instanceof Error?e.message:String(e)),l(!1))})},[f])),(0,M.useEffect)(()=>()=>{p.current?.abort()},[]),{data:o,isLoading:c,error:u}}var Y=n(),ve=[{key:`haiku`,color:`#38b2ac`,dash:`0`,label:`Haiku`},{key:`sonnet`,color:`#667eea`,dash:`4 2`,label:`Sonnet`},{key:`opus`,color:`#ed8936`,dash:`8 2`,label:`Opus`},{key:`other`,color:`#718096`,dash:`2 2`,label:`Other`}];function ye({perDay:e,isMobile:t}){return e.length===0?null:(0,Y.jsx)(b,{width:`100%`,height:280,children:(0,Y.jsxs)(ge,{data:e.map(e=>({date:e.date,...e.perModel})),margin:{top:10,right:16,left:0,bottom:0},children:[(0,Y.jsx)(T,{dataKey:`date`,tickFormatter:e=>t?e.slice(5):e,stroke:`var(--color-muted, #8a8f99)`}),(0,Y.jsx)(C,{tickFormatter:e=>`$${e.toFixed(2)}`,stroke:`var(--color-muted, #8a8f99)`}),(0,Y.jsx)(m,{formatter:e=>`$${e.toFixed(2)}`,contentStyle:{background:`var(--color-card-bg)`,border:`1px solid var(--color-border)`}}),(0,Y.jsx)(ne,{}),ve.map(e=>(0,Y.jsx)(q,{type:`monotone`,dataKey:e.key,stackId:`1`,stroke:e.color,fill:e.color,fillOpacity:.4,strokeDasharray:e.dash,name:e.label},e.key))]})})}var be=t(r(),1);function X(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
2
+ font-size: .6rem;
3
+ font-weight: bold;
4
+ color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function Z(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var xe=(e,t)=>Math.abs(e-t)<1.01,Se=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Ce=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},we=e=>e,Te=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},Ee=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Ce(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Ce(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},De={passive:!0},Oe=typeof window>`u`?!0:`onscrollend`in window,ke=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&Oe?()=>void 0:Se(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,De);let l=e.options.useScrollendEvent&&Oe;return l&&n.addEventListener(`scrollend`,c,De),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},Ae=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},je=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},Me=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:we,rangeExtractor:Te,onChange:()=>{},measureElement:Ae,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=X(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=X(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=X(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let l=this.measurementsCache.slice(0,c),u=Array(a).fill(void 0);for(let e=0;e<c;e++){let t=l[e];t&&(u[t.lane]=e)}for(let i=c;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),c,d,f=o===`estimate`||s.has(e);if(a!==void 0&&this.options.lanes>1){c=a;let e=u[c],r=e===void 0?void 0:l[e];d=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?l[i-1]:this.getFurthestMeasurement(l,i);d=e?e.end+this.options.gap:t+n,c=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,c)}let p=s.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=d+m;l[i]={index:i,start:d,size:m,end:h,key:e,lane:c},u[c]=i}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=X(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?Pe({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=X(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=X(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return Z(t[Ne(0,t.length-1,e=>Z(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&xe(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},Ne=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Pe({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=Ne(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Fe=typeof document<`u`?M.useLayoutEffect:M.useEffect;function Ie({useFlushSync:e=!0,...t}){let n=M.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,be.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=M.useState(()=>new Me(r));return i.setOptions(r),Fe(()=>i._didMount(),[]),Fe(()=>i._willUpdate()),i}function Le(e){return Ie({observeElementRect:Ee,observeElementOffset:ke,scrollToFn:je,...e})}var Q={wrap:`_wrap_y1zsk_1`,controls:`_controls_y1zsk_7`,table:`_table_y1zsk_13`,virtualScroll:`_virtualScroll_y1zsk_18`,virtualInner:`_virtualInner_y1zsk_24`,virtualRow:`_virtualRow_y1zsk_28`,footer:`_footer_y1zsk_35`,tier:`_tier_y1zsk_43`},Re=e=>e.includes(`haiku`)?`[H]`:e.includes(`sonnet`)?`[S]`:e.includes(`opus`)?`[O]`:`[?]`;function ze({rows:e,onIdeaClick:t}){let[n,r]=(0,M.useState)(`cost`),[i,a]=(0,M.useState)(!1),o=(0,M.useMemo)(()=>{let t=[...e];return n===`cost`?t.sort((e,t)=>(t.costUsd??-1)-(e.costUsd??-1)):n===`tokens`?t.sort((e,t)=>(t.tokensIn??0)+(t.tokensOut??0)-((e.tokensIn??0)+(e.tokensOut??0))):t.sort((e,t)=>t.timestamp.localeCompare(e.timestamp)),t},[e,n]),c=i?o:o.slice(0,100),l=(0,M.useRef)(null),u=Le({count:i?c.length:0,getScrollElement:()=>l.current,estimateSize:()=>48}),d=e=>(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:(0,Y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>t(e.ideaId),title:e.ideaId,children:e.ideaId.slice(0,24)})}),(0,Y.jsx)(`td`,{children:e.phase}),(0,Y.jsxs)(`td`,{children:[(0,Y.jsx)(`span`,{className:Q.tier,children:Re(e.model)}),` `,e.model.replace(`claude-`,``)]}),(0,Y.jsx)(`td`,{children:e.tokensIn==null?(0,Y.jsx)(`span`,{"aria-label":`No token data`,children:`—`}):new Intl.NumberFormat(void 0,{notation:`compact`}).format((e.tokensIn??0)+(e.tokensOut??0))}),(0,Y.jsx)(`td`,{children:e.costUsd==null?(0,Y.jsx)(`span`,{"aria-label":`No cost data`,children:`—`}):new Intl.NumberFormat(void 0,{style:`currency`,currency:`USD`}).format(e.costUsd)})]},`${e.ideaId}:${e.phase}:${e.timestamp}`);return(0,Y.jsxs)(`div`,{className:Q.wrap,children:[(0,Y.jsxs)(`div`,{className:Q.controls,children:[(0,Y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>r(`cost`),children:`Sort: Cost`}),(0,Y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>r(`tokens`),children:`Sort: Tokens`}),(0,Y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>r(`date`),children:`Sort: Date`})]}),i?(0,Y.jsx)(`div`,{ref:l,className:Q.virtualScroll,children:(0,Y.jsx)(`div`,{className:Q.virtualInner,style:{height:u.getTotalSize()},children:u.getVirtualItems().map(e=>(0,Y.jsx)(`div`,{className:Q.virtualRow,style:{transform:`translateY(${e.start}px)`},children:(0,Y.jsx)(`table`,{className:Q.table,children:(0,Y.jsx)(`tbody`,{children:d(c[e.index])})})},e.key))})}):(0,Y.jsxs)(`table`,{className:Q.table,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{children:`Idea`}),(0,Y.jsx)(`th`,{children:`Phase`}),(0,Y.jsx)(`th`,{children:`Model`}),(0,Y.jsx)(`th`,{children:`Tokens`}),(0,Y.jsx)(`th`,{children:`Cost`})]})}),(0,Y.jsx)(`tbody`,{children:c.map(d)})]}),!i&&e.length>100&&(0,Y.jsxs)(`div`,{className:Q.footer,children:[`Showing 100 of `,e.length,` rows. `,(0,Y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>a(!0),children:`Show all`})]})]})}var Be=[`today`,`week`,`month`,`all`,`custom`],Ve=`tos.usage.window`,$=`tos.usage.customStart`,He=`tos.usage.customEnd`;function Ue(){let e=localStorage.getItem(Ve);return Be.includes(e??``)?e:`today`}function We(){let[e,t]=(0,M.useState)(typeof window<`u`?window.innerWidth:1024);return(0,M.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var Ge={today:`Today`,week:`Week`,month:`Month`,all:`All`,custom:`Custom`};function Ke({onIdeaClick:e}){let[t,n]=(0,M.useState)(Ue()),[r,i]=(0,M.useState)(()=>localStorage.getItem($)??``),[a,c]=(0,M.useState)(()=>localStorage.getItem(He)??``);(0,M.useEffect)(()=>{localStorage.setItem(Ve,t)},[t]),(0,M.useEffect)(()=>{localStorage.setItem($,r)},[r]),(0,M.useEffect)(()=>{localStorage.setItem(He,a)},[a]);let{data:l,isLoading:u,error:d}=_e({window:t,start:r||void 0,end:a||void 0}),f=We()<=640;return(0,Y.jsxs)(`div`,{className:J.page,children:[(0,Y.jsxs)(`div`,{className:J.header,children:[(0,Y.jsx)(`h1`,{className:J.title,children:`Usage`}),(0,Y.jsx)(`div`,{className:J.windowSeg,children:Be.map(e=>(0,Y.jsx)(s,{onClick:()=>n(e),"aria-pressed":t===e,children:Ge[e]},e))})]}),t===`custom`&&(0,Y.jsxs)(`div`,{className:J.summary,children:[(0,Y.jsx)(o,{type:`date`,value:r,onChange:e=>i(e.target.value),"aria-label":`Start date`}),` `,(0,Y.jsx)(o,{type:`date`,value:a,onChange:e=>c(e.target.value),"aria-label":`End date`})]}),l&&l.pricingMissingFor.length>0&&(0,Y.jsxs)(`div`,{className:J.banner,children:[`Pricing missing for `,l.pricingMissingFor.join(`, `),` (cost shown is a ceiling estimate).`]}),d&&(0,Y.jsxs)(`div`,{className:J.banner,children:[`Error: `,d]}),u&&(0,Y.jsx)(`div`,{className:J.kpiGrid,children:[0,1,2,3].map(e=>(0,Y.jsx)(`div`,{className:J.skeletonTile},e))}),!u&&l&&l.perRow.length===0&&(0,Y.jsxs)(`div`,{className:J.empty,children:[(0,Y.jsx)(`div`,{children:`No usage in this window`}),(0,Y.jsx)(`div`,{className:J.emptyHint,children:`Try widening the range`})]}),!u&&l&&l.perRow.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:J.kpiGrid,children:[(0,Y.jsx)(j,{label:`Total cost`,value:new Intl.NumberFormat(void 0,{style:`currency`,currency:`USD`}).format(l.totalCostUsd)}),(0,Y.jsx)(j,{label:`Total tokens`,value:new Intl.NumberFormat(void 0,{notation:`compact`}).format(l.totalTokens)}),(0,Y.jsx)(j,{label:`Cache hit rate`,value:`${(l.cacheHitRate*100).toFixed(1)}%`}),(0,Y.jsx)(j,{label:`Phases run`,value:String(l.phasesRun)})]}),(0,Y.jsx)(ye,{perDay:l.perDay,isMobile:f}),(0,Y.jsx)(ze,{rows:l.perRow,onIdeaClick:e}),(0,Y.jsxs)(`div`,{className:J.footer,children:[`Override pricing via `,(0,Y.jsx)(`code`,{children:`teamos config set pricing.<model>.<key> <usd>`}),`.`]})]})]})}export{Ke as UsagePage};
@@ -0,0 +1 @@
1
+ ._page_l9qss_1{max-width:1280px;margin:0 auto;padding:24px 32px 96px}._header_l9qss_2{justify-content:space-between;align-items:center;gap:16px;margin-bottom:8px;display:flex}._title_l9qss_3{font-size:22px;font-weight:700}._summary_l9qss_4{color:var(--color-muted,#8a8f99);margin-bottom:16px;font-size:13px}._kpiGrid_l9qss_5{grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:24px;display:grid}._banner_l9qss_6{background:var(--color-warning-bg,#3b2f12);color:var(--color-warning-text,#f5c45e);border:1px solid #735a25;border-radius:6px;margin-bottom:16px;padding:8px 12px;font-size:13px}._footer_l9qss_7{color:var(--color-muted,#8a8f99);margin-top:24px;font-size:12px}._windowSeg_l9qss_8{gap:4px;display:inline-flex}._windowSeg_l9qss_8 button{min-height:36px;padding:6px 10px}._empty_l9qss_10{text-align:center;color:var(--color-muted);padding:48px 16px}._emptyHint_l9qss_11{margin-top:8px;font-size:13px}._skeletonTile_l9qss_12{background:linear-gradient(90deg, var(--color-bg) 25%, var(--color-hover) 50%, var(--color-bg) 75%);background-size:200% 100%;border-radius:10px;height:88px;animation:1.6s linear infinite _usage-shimmer_l9qss_1}@keyframes _usage-shimmer_l9qss_1{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){._skeletonTile_l9qss_12{animation:none}}@media (width<=640px){._page_l9qss_1{padding:16px 12px 96px}._kpiGrid_l9qss_5{grid-template-columns:repeat(2,1fr)}._header_l9qss_2{flex-direction:column;align-items:stretch}}._wrap_y1zsk_1{flex-direction:column;gap:8px;display:flex}._controls_y1zsk_7{flex-wrap:wrap;gap:8px;display:flex}._table_y1zsk_13{border-collapse:collapse;width:100%}._virtualScroll_y1zsk_18{height:min(600px,80vh);position:relative;overflow:auto}._virtualInner_y1zsk_24{position:relative}._virtualRow_y1zsk_28{width:100%;position:absolute;top:0;left:0}._footer_y1zsk_35{color:var(--color-text-secondary,#888);align-items:center;gap:8px;font-size:.85rem;display:flex}._tier_y1zsk_43{font-family:monospace;font-size:.75rem}
@@ -0,0 +1 @@
1
+ .react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;background-color:var(--xy-background-color,var(--xy-background-color-default));--xy-node-color-default:inherit;--xy-node-border-default:1px solid #1a192b;--xy-node-background-color-default:#fff;--xy-node-group-background-color-default:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #00000014;--xy-node-boxshadow-selected-default:0 0 0 .5px #1a192b;--xy-node-border-radius-default:3px;--xy-handle-background-color-default:#1a192b;--xy-handle-border-color-default:#fff;--xy-selection-background-color-default:#0059dc14;--xy-selection-border-default:1px dotted #0059dccc;--xy-controls-button-background-color-default:#fefefe;--xy-controls-button-background-color-hover-default:#f4f4f4;--xy-controls-button-color-default:inherit;--xy-controls-button-color-hover-default:inherit;--xy-controls-button-border-color-default:#eee;--xy-controls-box-shadow-default:0 0 2px 1px #00000014;--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#777;--xy-background-pattern-lines-color-default:#777;--xy-background-pattern-cross-color-default:#777;--xy-node-color-default:#f8f8f8;--xy-node-border-default:1px solid #3c3c3c;--xy-node-background-color-default:#1e1e1e;--xy-node-group-background-color-default:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #ffffff14;--xy-node-boxshadow-selected-default:0 0 0 .5px #999;--xy-handle-background-color-default:#bebebe;--xy-handle-border-color-default:#1e1e1e;--xy-selection-background-color-default:#c8c8dc14;--xy-selection-border-default:1px dotted #c8c8dccc;--xy-controls-button-background-color-default:#2b2b2b;--xy-controls-button-background-color-hover-default:#3e3e3e;--xy-controls-button-color-default:#f8f8f8;--xy-controls-button-color-hover-default:#fff;--xy-controls-button-border-color-default:#5b5b5b;--xy-controls-box-shadow-default:0 0 2px 1px #00000014;--xy-edge-label-background-color-default:#141414;--xy-edge-label-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color,var(--xy-handle-border-color-default));border-radius:100%;width:6px;min-width:5px;height:6px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{z-index:5;margin:15px;position:absolute}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px)translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px)translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__minimap{background:var(--xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default)))}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(--xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default)));stroke:var(--xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default)));stroke-width:var(--xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default)))}.react-flow__minimap-node{fill:var(--xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default)));stroke:var(--xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default)));stroke-width:var(--xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default)))}.react-flow__background-pattern.dots{fill:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default)))}.react-flow__background-pattern.lines{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default)))}.react-flow__background-pattern.cross{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default)))}.react-flow__controls{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)));width:26px;height:26px;color:var(--xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default)));cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));width:150px;color:var(--xy-node-color,var(--xy-node-color-default));text-align:center;border:var(--xy-node-border,var(--xy-node-border-default));background-color:var(--xy-node-background-color,var(--xy-node-background-color-default));padding:10px;font-size:12px}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover,var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected,var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color,var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var(--xy-controls-button-background-color-hover-props,var(--xy-controls-button-background-color-hover,var(--xy-controls-button-background-color-hover-default)));color:var(--xy-controls-button-color-hover-props,var(--xy-controls-button-color-hover,var(--xy-controls-button-color-hover-default)))}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)))}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color,var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color,var(--xy-edge-label-color-default))}