dsh-context 0.66.0 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -1,32 +1,20 @@
1
1
  /**
2
- * dsh-context v0.66.0
2
+ * dsh-context v0.67.0
3
3
  * A DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understanding how the context is made of, and how it evolves.
4
4
  * @author bowenliang123
5
5
  * @license Apache-2.0
6
6
  * @homepage https://github.com/bowenliang123/dsh-context
7
- * @built 2026-10-08T17:44:49+00:00
8
- * @commit f60e1a56439b
9
- * @commit-date 2026-10-09T01:41:58+08:00
7
+ * @built 2026-10-10T10:12:42+00:00
8
+ * @commit df136da57dac
9
+ * @commit-date 2026-10-10T18:10:23+08:00
10
10
  */
11
11
 
12
- window.__ModuleLoader__.load({id:`dsh-context`,factory:e=>{var t={exports:{}};t.exports;var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},l=(e,t,i)=>(i=e==null?{}:n(o(e)),c(t||!e||!e.__esModule||!s.call(e,`default`)?r(i,`default`,{value:e,enumerable:!0}):i,e));let u=e("react"),d=e("react/jsx-runtime"),f=e("@deepseek-ai/dsh-client-ui-primitives");f=l(f,1);let p=e("react-dom"),m={tab:`上下文`,"sidebar.guideDescription":`查看上下文的构成、统计、演变。`,"cat.system":`系统提示词`,"cat.tools":`工具定义`,"cat.user":`用户消息`,"cat.inject":`注入内容`,"cat.skill":`技能注入`,"cat.assistant":`助手消息`,"cat.tool":`工具结果`,"overview.title":`当前上下文`,"overview.estimate":`tokens(估算)`,"overview.free":`剩余窗口`,"overview.used":`上下文已用`,"overview.ofUsed":`占已用上下文`,"overview.compactReserve":`自动压缩预留:占用达 {pct}% 窗口时触发压缩,此区域一般不实际占用`,"stats.title":`上下文统计`,"stats.session":`当前会话`,"stats.turns":`轮次`,"stats.steps":`步数`,"stats.answers":`模型回复`,"stats.skills":`技能加载`,"stats.skillsJump":`在上下文浏览器中展开技能注入`,"stats.answersJump":`在上下文浏览器中筛选回答`,"stats.humanInputs":`用户输入`,"stats.humanInputsTip":`当前会话中的用户消息与问题回答次数。`,"stats.io":`输入输出`,"stats.events":`上下文事件`,"stats.toolCalls":`工具调用`,"stats.toolsMore":`其他 +{n}`,"stats.cacheHit":`缓存命中`,"stats.cacheHitTip":`整个会话累计的缓存读取占计费输入的比例。`,"stats.cost":`费用`,"stats.costTip":`估算的费用,含当前智能体及所有层级的子智能体,仅供参考。`,"stats.costTipDeepseek":`DeepSeek 高峰时段(北京时间工作日 9:00–12:00、14:00–18:00)按挂牌价计费,其余时段半价。`,"stats.costTipCny":`人民币按 1 元 = 0.15 美元换算。`,"stats.currentAgent":`当前 Agent`,"stats.teamSubs":`子 Agent × {n}`,"stats.billedTip":`Token 用量为计费合计:未缓存输入、缓存读取、缓存写入与输出。`,"stats.subCostTip":`全部层级的子 Agent 会话各自累计费用(同口径估算)的合计,不含当前 Agent 自身。`,"stats.costPriceHead":`每百万 Token 价格:`,"stats.costPriceBy":`按 {p} · {m} 在 models.dev 的刊登价格如上。`,"stats.costHit":`缓存输入`,"stats.costMiss":`未缓存输入`,"stats.costWrite":`缓存写入`,"stats.costOut":`输出`,"stats.costUnavailable":`模型价格暂不可用(自动重试中),费用暂无法估算。`,"timing.title":`耗时统计`,"timing.total":`活跃时长`,"timing.ttft":`模型等待`,"timing.gen":`模型生成`,"timing.reasoning":`模型思考`,"timing.text":`模型输出`,"timing.toolArgs":`工具参数`,"timing.tools":`工具执行`,"timing.other":`其他开销`,"timing.callTimes":`{n}次`,"timing.toolTimes":`{n}次`,"timing.blockTimes":`{n}次`,"timing.empty":`暂无耗时数据 · 对话开始后这里会显示时长分布`,"timing.tps":`输出速度 {tps} tok/s`,"timing.tpsTip":`输出速度(TPS):累计解码输出 tokens ÷ 累计解码时长,与 DeepSeek Harness 会话统计同口径。`,"timing.strip":`耗时时间轴:各段按发生次序紧凑铺排,宽度为耗时占比,刻度为零、四分位与全程`,"tokens.title":`Token 统计`,"tokens.total":`总用量`,"tokens.output":`输出`,"tokens.outputNote":`含思考`,"plugin.title":`插件信息`,"plugin.hint":`The best DSH context plugin ⭐`,"plugin.name":`插件`,"plugin.github":`GitHub`,"plugin.settings":`插件设置`,"plugin.settingsOpen":`打开插件设置`,"trend.title":`上下文趋势`,"gran.step":`步骤`,"gran.turn":`轮次`,"settings.placement":`入口位置`,"placement.tab":`标签页`,"placement.sidebar":`侧边栏`,"placement.all":`全部`,"settings.insightsEntry":`上下文洞察入口`,"insightsEntry.show":`显示`,"insightsEntry.hide":`隐藏`,"settings.gran":`趋势图 · 默认粒度`,"settings.mode":`趋势图 · 默认展示方式`,"settings.durationCurve":`趋势图 · 耗时曲线`,"settings.deltaBase":`上下文浏览器 · 对比基线`,"settings.toolSort":`工具定义 · 默认排序`,"settings.fileSort":`文件活动 · 默认排序`,"settings.readOnly":`当前环境的设置为只读`,"gran.total":`全量`,"gran.delta":`增量`,"gran.modeHint":`全量:累计构成;增量:相对上一条请求的变化量`,"trend.adaptive":`自适应`,"trend.adaptiveHint":`按当前可视范围内的柱子重新缩放高度,滚动时随之变化`,"trend.duration":`耗时`,"trend.durationTip":`在柱子上叠加每步的活跃耗时曲线(步骤开始至结束,含模型与工具调用,不含等待你决策或回答的时间),按图中右侧的四分位坐标轴读数;轮次粒度下为一轮各步耗时之和`,"trend.dna":`DNA 模式`,"trend.dnaTip":`把每根柱子画成该次请求的上下文指纹:按模型读取顺序逐条铺色,配合增量模式逐条展示每次请求的增减;悬停查看条目,点击让上下文浏览器定位到该条目,同一条目在所有柱子中亮出其存续变化`,"trend.dnaItem":`{label}:{n}`,"trend.empty":`发起一轮对话后,这里会展示每次模型请求的上下文构成`,"detail.step":`第 {t} 轮 · 第 {s} 步 (共 {n} 步)`,"detail.turn":`第 {t} 轮 · 共 {n} 步`,"detail.lastStep":`末步`,"detail.estTotal":`估算合计 ≈ {n}`,"detail.actual":`实际 {n}`,"detail.output":`输出 {n}`,"detail.cache":`缓存 {n}%`,"brief.turn":`本轮`,"brief.input":`输入`,"brief.reply":`回复`,"brief.more":`+{n}`,"brief.noInputs":`(无新增)`,"brief.locate":`在上下文浏览器中查看`,"jump.title":`在上下文视图中查看此轮`,"brief.turnTip":`这一轮开场时用户发送的消息;回合内的每一步都会回显同一条`,"brief.inputTip":`上一步回复之后、本次请求发出前新进入上下文的内容——通常是上一步所调工具的结果;每轮的第一步无新增`,"brief.replyTip":`这一步模型返回的内容(文本回复或工具调用);此步发起的调用,其结果会出现在下一柱的「输入」行`,"events.title":`上下文事件`,"events.empty":`暂无上下文事件(压缩、注入、模型切换会出现在这里)`,"events.at":`第 {t} 轮 · 第 {s} 步`,"events.range":`第 {t} 轮 · 第 {a}→{b} 步`,"events.rangeTo":`第 {a} 轮 · 第 {as} 步 → 第 {b} 轮 · 第 {bs} 步`,"kind.inject":`注入`,"kind.compaction":`压缩`,"kind.prune":`剪枝`,"kind.model":`切换`,"kind.mode":`模式`,"files.title":`文件活动`,"files.scopeLatest":`截至最新 · 跟随趋势图的选择`,"files.kind.all":`全部`,"files.kind.read":`读取`,"files.kind.write":`写入`,"files.kind.search":`搜索`,"files.kind.image":`图片`,"files.chipTip":`{files} 个文件 · {ops} 次操作`,"files.search":`按路径过滤…`,"files.sort.count":`按次数`,"files.sort.latest":`按最新`,"files.sort.path":`按路径`,"files.sortTip":`文件排序:按操作次数(选中分类时按该分类的次数)、最近操作时间或路径`,"files.files":`{n} 个文件`,"files.deltaTip":`按 edit/write 调用参数估算的累计行数变化:+ 新增 / − 删除`,"files.empty":`该范围内没有文件读取、写入或搜索操作`,"files.noMatch":`没有匹配当前过滤条件的文件`,"files.locate":`在上下文浏览器中查看此次操作`,"files.hits":`{n} 处命中`,"files.readTip":`读取第 {a}–{b} 行`,"files.open":`在系统中打开`,"files.preview":`在侧边栏预览`,"files.readEst":`按调用参数 limit 估算的读取行数`,"files.errs":`{n} 次失败`,"files.form.image":`图片`,"files.form.dir":`目录`,"files.form.text":`文件`,"files.glyph.root":`工作区根`,"files.glyph.tests":`测试`,"files.glyph.docs":`文档目录`,"files.glyph.deps":`依赖`,"files.glyph.build":`构建产物`,"files.glyph.scripts":`脚本`,"files.glyph.config":`配置`,"files.glyph.assets":`静态资源`,"files.glyph.hidden":`元数据目录`,"files.glyph.lock":`锁文件`,"files.glyph.docker":`Docker`,"files.glyph.ignore":`忽略规则`,"files.glyph.license":`许可证`,"files.glyph.python":`Python`,"files.glyph.notebook":`Notebook`,"files.glyph.shell":`Shell`,"files.glyph.style":`样式`,"files.glyph.database":`数据库`,"files.glyph.data":`数据清单`,"files.glyph.markdown":`标记文档`,"files.glyph.log":`日志`,"files.glyph.sheet":`表格`,"files.glyph.document":`文档`,"files.glyph.archive":`压缩包`,"files.glyph.font":`字体`,"files.glyph.media":`媒体`,"files.glyph.lang.ts":`TypeScript`,"files.glyph.lang.js":`JavaScript`,"files.glyph.lang.go":`Go`,"files.glyph.lang.rust":`Rust`,"files.glyph.lang.java":`Java`,"files.glyph.lang.kotlin":`Kotlin`,"files.glyph.lang.ruby":`Ruby`,"files.glyph.lang.php":`PHP`,"files.glyph.lang.c":`C`,"files.glyph.lang.cpp":`C++`,"files.glyph.lang.csharp":`C#`,"files.glyph.lang.scala":`Scala`,"files.glyph.lang.lua":`Lua`,"files.glyph.lang.dart":`Dart`,"files.glyph.lang.swift":`Swift`,"files.glyph.lang.vue":`Vue`,"files.glyph.lang.svelte":`Svelte`,"files.glyph.lang.html":`HTML`,"agents.title":`Agent 网络`,"agents.sub":`当前 Agent 与子 Agent 的实时上下文 · 点击节点跳转会话`,"agents.chip.count":`{n} 个 Agent`,"agents.chip.running":`{n} 个运行中`,"agents.chip.tokens":`上下文合计 {n}`,"agents.more":`另有 {n} 个未显示`,"agents.solo":`还没有子 Agent — 当 Agent 通过 subagent 工具委派任务时,协作网络会在这里展开`,"agents.self":`当前`,"agents.running":`运行中`,"agents.legend.free":`空闲窗口`,"agents.oneshot":`一次性`,"agents.continuable":`多轮`,"agents.requests":`{n} 次请求`,"agents.billed":`累计计费 {n}`,"agents.open":`点击打开会话 →`,loading:`正在读取会话日志…`,"detail.loading":`正在加载历史数据…`,"detail.loadFailed":`历史数据加载失败,点击重试`,error:`上下文数据读取失败:`,"error.retry":`重试`,"gate.title":`请更新 DeepSeek Harness 版本`,"gate.body":`dsh-context 插件支持 DeepSeek Harness v{minimum} 或更新版本。`,"gate.current":`当前版本`,"gate.minimum":`最低要求`,"gate.orNewer":`及更新的版本`,"gate.ok":`知道了`,footer:`Token 数量统计:「估算」与 DeepSeek Harness 内置 tokenMeter 相同的固定密度启发式(约 4 字符 ≈ 1 token);「实际」为供应商上报用量。`,"tip.step":`第 {t} 轮 · 第 {s} 步 (共 {n} 步)`,"tip.turn":`第 {t} 轮 · 共 {n} 步`,"tip.turn1":`第 {t} 轮 · 共 1 步`,"tip.total":`合计 ≈ {n}`,"tip.cat":`{cat} ≈ {n}`,"tip.delta":`Δ {n}`,"tip.duration":`耗时 {n}`,"ev.compaction":`压缩上下文(摘要替换 {n} 条消息)`,"ev.prune":`剪枝工具输出`,"ev.skill":`Skill 注入({name})`,"ev.model":`模型切换:{a} → {b}`,"ev.mode.plan.on":`进入计划模式`,"ev.mode.plan.off":`退出计划模式`,"form.instructions":`指令注入`,"form.catalog":`目录更新`,"form.snapshot":`状态快照`,"form.notice":`通知`,"form.relay":`代理转发`,"form.recall":`历史召回`,"form.context":`上下文注入`,"node.toolResult":`工具结果`,"node.calls":`调用 `,"node.empty":`(空回复)`,"node.nonText":`(非文本消息)`,"node.snapshot":`快照: `,"node.skillTag":`技能 · {name}`,"cmd.label":`上下文`,"cmd.section":`上下文`,"cmd.desc":`查看当前上下文构成,浏览各步骤组成`,"cmd.close":`关闭`,"browser.title":`上下文浏览器`,"browser.live":`当前(下一次请求)`,"browser.liveNow":`当前 · 下一次请求`,"browser.items":`{n} 项`,"browser.stepAt":`T{t} S{s}`,"browser.stepAtTip":`首次随第 {t} 轮 · 第 {s} 步的请求进入上下文`,"browser.stepPendingTip":`预计随第 {t} 轮 · 第 {s} 步的请求进入上下文(尚未发送)`,"browser.missingLive":`… 另有 {n} 条更早的消息也在上下文中(超出展示窗口)`,"browser.approx":`该步骤涉及的部分已移除消息超出保留范围,以下为近似构成`,"browser.base.step":`比前步`,"browser.base.turn":`比前轮`,"browser.base.tip":`变动对比的基线:比前步=与上一步对比;比前轮=与上一轮最后一步对比(首轮无基线,全部计为变动)`,"browser.dna":`DNA 模式`,"browser.dnaTip":`按模型读取上下文的次序逐条展示每一项:系统提示词、工具定义,然后是按时间排列的消息;悬停查看条目,点击定位到下方列表`,"browser.noHeader":`此数据来自旧版插件:仅提供 token 估算,无实际内容`,"browser.noEpoch":`该步骤的头部内容(系统提示词 / 工具定义)不在保留范围内`,"browser.headerMetaOnly":`此环境不支持按需读取头部内容,仅显示 token 估算`,"browser.noSystem":`该请求头部未包含系统提示词`,"browser.noContent":`完整内容不在当前加载的消息窗口内(在聊天页加载更早历史后可查看)`,"browser.search.user":`按消息内容过滤…`,"browser.search.inject":`按注入内容过滤…`,"browser.search.skill":`按技能过滤…`,"browser.search.assistant":`按回复、调用或思考过滤…`,"browser.search.tool":`按工具或参数过滤…`,"browser.kind.think":`思考`,"browser.kind.tool":`工具`,"browser.kind.answer":`回答`,"browser.kindTip":`按内容种类过滤回复:思考、工具调用、回答文本`,"browser.rowNoMatch":`没有匹配当前过滤条件的行`,"browser.loading":`正在从更早的会话历史加载完整内容…`,"browser.notInLog":`会话日志中未找到该条目的完整内容(可能已被压缩或清理)`,"browser.loadFailed":`内容加载失败,点击重试`,"tool.desc":`描述`,"tool.params":`参数`,"tool.paramsEmpty":`(无参数)`,"tool.plugin":`该工具的注册插件(仅供参考)`,"tool.unknown":`未知插件`,"tool.unknownTitle":`因早于上下文插件加载或原插件已卸载,无法查询该工具的提供者`,"tool.jsonToggle":`查看原始 JSON`,"tool.jsonHide":`收起`,"tool.search":`按名称、描述或参数过滤…`,"tool.sort.size":`按大小`,"tool.sort.count":`按次数`,"tool.sort.name":`按名称`,"tool.sortTip":`工具排序:按当前步骤中的调用次数(默认)、token 大小或名称`,"tool.hitsTip":`当前展示步骤的上下文中,该工具被调用并返回结果的次数`,"tool.noMatch":`没有匹配当前过滤条件的工具`,"rich.raw":`原文`,"rich.md":`Markdown`,"rich.toMd":`按 Markdown 渲染查看`,"rich.toRaw":`查看原始文本`,"rich.copy":`复制原文`,"rich.copied":`已复制`,"rich.md.copy":`复制`,"rich.md.copied":`已复制`,"rich.md.footnotes":`脚注`,"rich.find":`在文本中查找`,"rich.findPlaceholder":`查找…`,"rich.findPrev":`上一个匹配`,"rich.findNext":`下一个匹配`,"rich.findClose":`关闭查找`,"block.thinking":`思考`,"block.answer":`回答`,"block.content":`内容`,"block.result":`结果`,"block.summary":`摘要`,"block.line":`{n} 行`,"block.lines":`{n} 行`,"call.ok":`正常`,"call.fail":`失败`,"call.exit":`exit {n}`,"node.failed":`工具执行失败`,"attach.images":`图片附件`,"attach.other":`其他内容`,"attach.image":`图片`,"attach.open":`查看原图`,"attach.preview":`图片预览`,"attach.close":`关闭`,"attach.loading":`…`,"attach.loadFailed":`加载失败 · 点击重试`,"attach.raw":`原图`,"attach.sent":`发送`,"attach.token":`Token`,"attach.tokensTip":`按 DeepSeek 官方图片尺寸换算(单图上限 384 tokens)估算的 token 消耗`,"ov.title":`上下文洞察`,"ov.unavailable":`会话列表暂不可用`,"ov.range.label":`统计范围`,"ov.range.24h":`近 24 小时`,"ov.range.7d":`近 7 天`,"ov.range.30d":`近 30 天`,"ov.range.all":`全部`,"ov.kpi.sessions":`活跃会话`,"ov.kpi.ofTotal":`共 {n} 个`,"ov.kpi.tokens":`累计消耗`,"ov.kpi.sessionsSub":`含 {n} 个会话`,"ov.kpi.pricedSub":`已计价 {n}/{total} 个会话`,"ov.kpi.toolSub":`工具执行 {dur}`,"ov.kpi.wallSub":`模型调用 {n}`,"ov.stats.empty":`统计范围内暂无 Token 用量`,"ov.usage.title":`近 7 天用量`,"ov.usage.tokens":`Token`,"ov.usage.cost":`费用(仅含支持计价映射的模型)`,"ov.usage.costTip":`费用`,"ov.usage.empty":`近 7 天暂无用量 — 会话产生模型请求后,这里会显示每日 Token 与费用`,"balance.title":`DeepSeek 余额`,"balance.tip.granted":`赠送余额`,"balance.tip.toppedUp":`充值余额`,"ov.heat.title":`活跃度`,"ov.heat.sub":`按日期筛选`,"ov.heat.empty":`暂无活跃数据 — 会话产生模型请求后,这里会显示每日用量`,"ov.heat.sessions":`{n} 个活跃会话`,"ov.heat.less":`少`,"ov.heat.more":`多`,"ov.heat.metric":`指标`,"ov.heat.metric.sessions":`会话`,"ov.heat.metric.steps":`步数`,"ov.heat.steps":`{n} 步`,"ov.heat.wd.1":`星期一`,"ov.heat.wd.3":`星期三`,"ov.heat.wd.5":`星期五`,"ov.heat.mon.01":`1月`,"ov.heat.mon.02":`2月`,"ov.heat.mon.03":`3月`,"ov.heat.mon.04":`4月`,"ov.heat.mon.05":`5月`,"ov.heat.mon.06":`6月`,"ov.heat.mon.07":`7月`,"ov.heat.mon.08":`8月`,"ov.heat.mon.09":`9月`,"ov.heat.mon.10":`10月`,"ov.heat.mon.11":`11月`,"ov.heat.mon.12":`12月`,"ov.skills.empty":`统计范围内暂无技能加载 — 加载技能后,这里会按名称列出次数与最近加载`,"ov.skills.more":`另有 {n} 个技能`,"ov.skills.loads":`{n} 次加载`,"ov.skills.summary":`{skills} 个技能 · {loads} 次加载`,"ov.skills.sortLabel":`技能排序`,"ov.skills.sort.loads":`次数`,"ov.skills.sort.recent":`最近`,"ov.skills.sessions":`{n} 个会话`,"ov.skills.clickFilter":`点击筛选加载过它的会话`,"ov.skills.clickRelease":`再次点击取消筛选`,"ov.skills.src.project":`项目`,"ov.skills.src.user":`用户`,"ov.skills.src.bundled":`内置`,"ov.skills.k.source":`来源`,"ov.skills.k.usage":`用量`,"ov.skills.k.last":`最近`,"ov.skills.k.path":`路径`,"ov.skills.copyPath":`点击复制路径`,"ov.skills.copied":`已复制`,"ov.list.title":`会话`,"ov.list.search":`搜索标题 / 目录 / 最后消息…`,"ov.list.sortLabel":`排序`,"ov.list.sort.recent":`最近更新`,"ov.list.sort.tokens":`Token 总用量`,"ov.list.sort.context":`当前 Context`,"ov.list.empty":`还没有会话 — 发起一轮对话后,这里会列出每个会话的上下文画像`,"ov.list.noMatch":`没有匹配当前筛选条件的会话`,"ov.list.noData":`暂无上下文数据 — 该会话产生模型请求后才会统计`,"ov.list.dayFilter":`{day} 当日活跃`,"ov.list.dayClear":`清除日期筛选`,"ov.list.skillClear":`清除技能筛选`,"ov.list.pager":`会话分页`,"ov.list.page":`第 {n} / {total} 页`,"ov.list.prev":`上一页`,"ov.list.next":`下一页`,"ov.group.label":`分组`,"ov.group.ungrouped":`未分组`,"ov.running":`运行中`,"ov.current":`当前`,"ov.card.turns":`{n} 轮 {s} 步`,"ov.card.teamUsage":`Token 总用量`,"ov.card.teamCost":`总预估费用`,"ov.card.lastUser":`最后消息`,"ov.time.now":`刚刚`,"ov.time.m":`{n} 分钟前`,"ov.time.h":`{n} 小时前`,"ov.time.d":`{n} 天前`},h={tab:`Context`,"sidebar.guideDescription":`Inspect context composition, stats, and evolution.`,"cat.system":`System Prompt`,"cat.tools":`Tool Schemas`,"cat.user":`User Messages`,"cat.inject":`Injected Context`,"cat.skill":`Skill Injections`,"cat.assistant":`Assistant Messages`,"cat.tool":`Tool Results`,"overview.title":`Current Context`,"overview.estimate":`tokens (estimated)`,"overview.free":`Free Window`,"overview.used":`of context used`,"overview.ofUsed":`of used context`,"overview.compactReserve":`Auto-compaction reserve: auto-compaction triggers at {pct}% of the window — this area is normally kept as headroom, not actually used`,"stats.title":`Context Stats`,"stats.session":`Current Session`,"stats.turns":`Turns`,"stats.steps":`Steps`,"stats.answers":`Answers`,"stats.skills":`Skill Loads`,"stats.skillsJump":`Open Skill Injections in the Context Browser`,"stats.answersJump":`Filter Answers in the Context Browser`,"stats.humanInputs":`Human Inputs`,"stats.humanInputsTip":`User messages and question answerings in current session.`,"stats.io":`Input / Output`,"stats.events":`Context Events`,"stats.toolCalls":`Tool Calls`,"stats.toolsMore":`+{n} more`,"stats.cacheHit":`Cache Hit`,"stats.cacheHitTip":`Cumulative cache-read share of billed input across the session.`,"stats.cost":`Cost`,"stats.costTip":`Estimated cost for this agent and every descendant subagent session, for reference only.`,"stats.costTipDeepseek":`DeepSeek bills peak windows (Beijing Time weekdays 09:00–12:00, 14:00–18:00) at list price; all other hours are half price.`,"stats.costTipCny":`The CNY display converts at 1 CNY = 0.15 USD.`,"stats.currentAgent":`Current Agent`,"stats.teamSubs":`Subagents × {n}`,"stats.billedTip":`Token usage is the billed total: uncached input, cache read, cache write, and output.`,"stats.subCostTip":`Summed estimates of every descendant subagent session’s own cumulative cost — all levels of the subtree (same basis); the current agent is not included.`,"stats.costPriceHead":`Per-1M-token rates:`,"stats.costPriceBy":`Priced as listed on models.dev for {p} · {m}.`,"stats.costHit":`Cache input`,"stats.costMiss":`Uncached input`,"stats.costWrite":`Cache write`,"stats.costOut":`Output`,"stats.costUnavailable":`Model prices are unavailable (retrying automatically) — the cost cannot be estimated yet.`,"timing.title":`Timing Stats`,"timing.total":`Active Time`,"timing.ttft":`TTFT`,"timing.gen":`LLM Gen`,"timing.reasoning":`Thinking`,"timing.text":`Answer`,"timing.toolArgs":`Tool args`,"timing.tools":`Tool runs`,"timing.other":`Overhead`,"timing.callTimes":`{n} calls`,"timing.toolTimes":`{n} runs`,"timing.blockTimes":`{n} blocks`,"timing.empty":`No timing data yet — durations appear as the conversation runs`,"timing.tps":`TPS {tps} tok/s`,"timing.tpsTip":`Output speed (TPS): summed decoded output tokens over summed decode time — the same pairing as the harness session stats.`,"timing.strip":`Session-time strip: slices packed in occurrence order, width as share of the active time; ticks at zero, the quartiles, and the full span`,"tokens.title":`Token Stats`,"tokens.total":`Total`,"tokens.output":`Output`,"tokens.outputNote":`incl. reasoning`,"plugin.title":`Plugin Info`,"plugin.hint":`The best DSH context plugin ⭐`,"plugin.name":`Plugin`,"plugin.github":`GitHub`,"plugin.settings":`Plugin Settings`,"plugin.settingsOpen":`Open plugin settings`,"trend.title":`Context Trend`,"gran.step":`Step`,"gran.turn":`Turn`,"settings.placement":`Entry Options`,"placement.tab":`Tab`,"placement.sidebar":`Sidebar`,"placement.all":`All`,"settings.insightsEntry":`Context Insights entry`,"insightsEntry.show":`Show`,"insightsEntry.hide":`Hide`,"settings.gran":`Trend Chart · Default granularity`,"settings.mode":`Trend Chart · Default display`,"settings.durationCurve":`Trend Chart · Duration curve`,"settings.deltaBase":`Context Browser · Diff baseline`,"settings.toolSort":`Tool Schemas · Default sort`,"settings.fileSort":`File Activity · Default sort`,"settings.readOnly":`Settings are read-only in this environment`,"gran.total":`Total`,"gran.delta":`Delta`,"gran.modeHint":`Total: cumulative makeup; Delta: change vs the previous request`,"trend.adaptive":`Adaptive`,"trend.adaptiveHint":`Rescale bar heights to the visible range, following the scroll`,"trend.duration":`Duration`,"trend.durationTip":`Overlay each step’s active time (step start to end — model and tool calls, excluding waits for your decisions or answers) as a curve over the bars, read off the quartile axis on the chart’s right; turn granularity sums a turn’s steps`,"trend.dna":`DNA Mode`,"trend.dnaTip":`Draw each bar as that request’s context fingerprint — one band per item in the order the model reads it; with Delta, each band shows that item’s change against the previous bar. Hover for the item, click to reveal it in the Context browser, and every bar lights the same item’s lifetime`,"trend.dnaItem":`{label}: {n}`,"trend.empty":`Send a message and each model request’s context makeup shows up here`,"detail.step":`Turn {t} · Step {s} of {n}`,"detail.turn":`Turn {t} · {n} steps`,"detail.lastStep":`Last Step`,"detail.estTotal":`Estimated ≈ {n}`,"detail.actual":`Actual {n}`,"detail.output":`Output {n}`,"detail.cache":`Cache {n}%`,"brief.turn":`User`,"brief.input":`In`,"brief.reply":`Response`,"brief.more":`+{n}`,"brief.noInputs":`(nothing new)`,"brief.locate":`Reveal in Context Browser`,"jump.title":`View this turn in the Context view`,"brief.turnTip":`The user message that opened this turn — every step of the turn recalls it`,"brief.inputTip":`What entered after the previous reply and before this request went out — usually the previous tool-call results; a turn opener has nothing new`,"brief.replyTip":`What the model returned on this step (a text reply or tool calls) — results of calls made here appear in the In row of the next bar`,"events.title":`Context Events`,"events.empty":`No context events yet (compaction, injections, model switches appear here)`,"events.at":`Turn {t} · Step {s}`,"events.range":`Turn {t} · Step {a}→{b}`,"events.rangeTo":`Turn {a} · Step {as} → Turn {b} · Step {bs}`,"kind.inject":`Inject`,"kind.compaction":`Compact`,"kind.prune":`Prune`,"kind.model":`Switch`,"kind.mode":`Mode`,"files.title":`File Activity`,"files.scopeLatest":`Up to latest · follows the trend chart pick`,"files.kind.all":`All`,"files.kind.read":`Read`,"files.kind.write":`Written`,"files.kind.search":`Searched`,"files.kind.image":`Images`,"files.chipTip":`{files} files · {ops} ops`,"files.search":`Filter by path…`,"files.sort.count":`Most active`,"files.sort.latest":`Latest`,"files.sort.path":`By path`,"files.sortTip":`Sort files by operation counts (of the selected kind when a kind chip is active), most recent activity, or path`,"files.files":`{n} files`,"files.deltaTip":`Cumulative line change estimated from edit/write call arguments: + added / − removed`,"files.empty":`No file reads, writes, or searches in this range`,"files.noMatch":`No files match the current filters`,"files.locate":`Reveal this operation in the Context Browser`,"files.hits":`{n} hits`,"files.readTip":`Read lines {a}–{b}`,"files.open":`Open on your system`,"files.preview":`Preview in the sidebar`,"files.readEst":`Lines read, estimated from the limit argument`,"files.errs":`{n} failed`,"files.form.image":`Image`,"files.form.dir":`Directory`,"files.form.text":`File`,"files.glyph.root":`Workspace root`,"files.glyph.tests":`Tests`,"files.glyph.docs":`Docs`,"files.glyph.deps":`Dependencies`,"files.glyph.build":`Build output`,"files.glyph.scripts":`Scripts`,"files.glyph.config":`Config`,"files.glyph.assets":`Assets`,"files.glyph.hidden":`Metadata directory`,"files.glyph.lock":`Lockfile`,"files.glyph.docker":`Docker`,"files.glyph.ignore":`Ignore rules`,"files.glyph.license":`License`,"files.glyph.python":`Python`,"files.glyph.notebook":`Notebook`,"files.glyph.shell":`Shell`,"files.glyph.style":`Styles`,"files.glyph.database":`Database`,"files.glyph.data":`Data / manifest`,"files.glyph.markdown":`Markup document`,"files.glyph.log":`Log`,"files.glyph.sheet":`Spreadsheet`,"files.glyph.document":`Document`,"files.glyph.archive":`Archive`,"files.glyph.font":`Font`,"files.glyph.media":`Media`,"files.glyph.lang.ts":`TypeScript`,"files.glyph.lang.js":`JavaScript`,"files.glyph.lang.go":`Go`,"files.glyph.lang.rust":`Rust`,"files.glyph.lang.java":`Java`,"files.glyph.lang.kotlin":`Kotlin`,"files.glyph.lang.ruby":`Ruby`,"files.glyph.lang.php":`PHP`,"files.glyph.lang.c":`C`,"files.glyph.lang.cpp":`C++`,"files.glyph.lang.csharp":`C#`,"files.glyph.lang.scala":`Scala`,"files.glyph.lang.lua":`Lua`,"files.glyph.lang.dart":`Dart`,"files.glyph.lang.swift":`Swift`,"files.glyph.lang.vue":`Vue`,"files.glyph.lang.svelte":`Svelte`,"files.glyph.lang.html":`HTML`,"agents.title":`Agent Network`,"agents.sub":`Live context of this agent and its subagents · click a node to open its session`,"agents.chip.count":`{n} agents`,"agents.chip.running":`{n} running`,"agents.chip.tokens":`{n} tokens in context`,"agents.more":`{n} more not shown`,"agents.solo":`No subagents yet — when the agent delegates work through the subagent tool, the network unfolds here`,"agents.self":`current`,"agents.running":`running`,"agents.legend.free":`free window`,"agents.oneshot":`one-shot`,"agents.continuable":`continuable`,"agents.requests":`{n} requests`,"agents.billed":`{n} billed`,"agents.open":`click to open →`,loading:`Reading the session log…`,"detail.loading":`Loading history…`,"detail.loadFailed":`History failed to load — click to retry`,error:`Failed to read context data: `,"error.retry":`Retry`,"gate.title":`Update DeepSeek Harness`,"gate.body":`dsh-context supports DeepSeek Harness v{minimum} or newer.`,"gate.current":`Current`,"gate.minimum":`Minimum required`,"gate.orNewer":`or newer`,"gate.ok":`Got it`,footer:`Token amount: “Estimated” uses the same fixed-density heuristic as DeepSeek Harness’s built-in tokenMeter (~4 chars ≈ 1 token); “Actual” is provider-reported usage.`,"tip.step":`Turn {t} · Step {s} of {n}`,"tip.turn":`Turn {t} · {n} steps`,"tip.turn1":`Turn {t} · 1 step`,"tip.total":`Total ≈ {n}`,"tip.cat":`{cat} ≈ {n}`,"tip.delta":`Δ {n}`,"tip.duration":`Duration {n}`,"ev.compaction":`Context compacted (summary replaced {n} messages)`,"ev.prune":`Tool output pruned`,"ev.skill":`Skill injected ({name})`,"ev.model":`Model switched: {a} → {b}`,"ev.mode.plan.on":`Plan mode on`,"ev.mode.plan.off":`Plan mode off`,"form.instructions":`Instructions`,"form.catalog":`Catalog Update`,"form.snapshot":`State Snapshot`,"form.notice":`Notice`,"form.relay":`Agent Relay`,"form.recall":`Recall`,"form.context":`Context Injection`,"node.toolResult":`Tool Result`,"node.calls":`Calls `,"node.empty":`(empty reply)`,"node.nonText":`(non-text message)`,"node.snapshot":`Snapshot: `,"node.skillTag":`Skill · {name}`,"cmd.label":`Context`,"cmd.section":`Context`,"cmd.desc":`View current context makeup, browse per-step composition`,"cmd.close":`Close`,"browser.title":`Context Browser`,"browser.live":`Live (Next Request)`,"browser.liveNow":`Live · Next Request`,"browser.items":`{n} Items`,"browser.stepAt":`T{t} S{s}`,"browser.stepAtTip":`First carried by the Turn {t} · Step {s} request`,"browser.stepPendingTip":`Expected in the Turn {t} · Step {s} request (not yet sent)`,"browser.missingLive":`… {n} earlier messages are also part of the context (outside the served window)`,"browser.approx":`Some removed messages of this step exceed retention — the makeup below is approximate`,"browser.base.step":`prev step`,"browser.base.turn":`prev turn`,"browser.base.tip":`Diff baseline: the previous step, or the previous turn’s last step — with no predecessor, everything counts as change`,"browser.dna":`DNA Mode`,"browser.dnaTip":`One band per item in the order the model reads the context — system prompt, tool schemas, then messages chronologically; hover for details, click to open its row below`,"browser.noHeader":`Served by an older plugin build: token estimates only, no content`,"browser.noEpoch":`The header content (System Prompt / Tool Schemas) of this step is outside retention`,"browser.headerMetaOnly":`This environment cannot fetch header content on demand; token estimates only`,"browser.noSystem":`This request header carried no system prompt`,"browser.noContent":`Full content is outside the loaded message window (load older history in Chat to view)`,"browser.search.user":`Filter by message text…`,"browser.search.inject":`Filter injected context…`,"browser.search.skill":`Filter skills…`,"browser.search.assistant":`Filter by reply, calls, or thinking…`,"browser.search.tool":`Filter by tool or arguments…`,"browser.kind.think":`Thinking`,"browser.kind.tool":`Tools`,"browser.kind.answer":`Answer`,"browser.kindTip":`Filter replies by content kind: thinking, tool calls, or answer text`,"browser.rowNoMatch":`No rows match the current filter`,"browser.loading":`Loading full content from older session history…`,"browser.notInLog":`This item is not in the session log anymore (it may have been compacted away or cleared)`,"browser.loadFailed":`Load failed — click to retry`,"tool.desc":`Description`,"tool.params":`Parameters`,"tool.paramsEmpty":`(no parameters)`,"tool.plugin":`The registering plugin of this tool (for reference)`,"tool.unknown":`Unknown plugin`,"tool.unknownTitle":`The tool was registered before the context plugin loaded, or its plugin has been unloaded, so its provider cannot be determined`,"tool.jsonToggle":`View Raw JSON`,"tool.jsonHide":`Collapse`,"tool.search":`Filter by name, description, or parameters…`,"tool.sort.size":`By size`,"tool.sort.count":`By calls`,"tool.sort.name":`By name`,"tool.sortTip":`Sort tools by call count in the shown step (default), token size, or name`,"tool.hitsTip":`Times this tool was called and answered within the shown step’s context`,"tool.noMatch":`No tools match the current filter`,"rich.raw":`Raw`,"rich.md":`Markdown`,"rich.toMd":`View as Markdown`,"rich.toRaw":`View Raw Text`,"rich.copy":`Copy Raw Text`,"rich.copied":`Copied`,"rich.md.copy":`Copy`,"rich.md.copied":`Copied`,"rich.md.footnotes":`Footnotes`,"rich.find":`Find in Text`,"rich.findPlaceholder":`Find…`,"rich.findPrev":`Previous Match`,"rich.findNext":`Next Match`,"rich.findClose":`Close Find`,"block.thinking":`Reasoning`,"block.answer":`Answer`,"block.content":`Content`,"block.result":`Result`,"block.summary":`Summary`,"block.line":`1 line`,"block.lines":`{n} lines`,"call.ok":`OK`,"call.fail":`Failed`,"call.exit":`exit {n}`,"node.failed":`Tool execution failed`,"attach.images":`Images`,"attach.other":`Other content`,"attach.image":`Image`,"attach.open":`Open full image`,"attach.preview":`Image preview`,"attach.close":`Close`,"attach.loading":`…`,"attach.loadFailed":`Load failed · click to retry`,"attach.raw":`Raw`,"attach.sent":`Sent`,"attach.token":`Token`,"attach.tokensTip":`Estimated token cost via DeepSeek's official image-size conversion (384-token cap per image)`,"ov.title":`Context Insights`,"ov.unavailable":`The session list is unavailable`,"ov.range.label":`Range`,"ov.range.24h":`Last 24 hours`,"ov.range.7d":`Last 7 days`,"ov.range.30d":`Last 30 days`,"ov.range.all":`All`,"ov.kpi.sessions":`Active Sessions`,"ov.kpi.ofTotal":`of {n} total`,"ov.kpi.tokens":`Tokens Used`,"ov.kpi.sessionsSub":`across {n} sessions`,"ov.kpi.pricedSub":`{n} of {total} sessions priced`,"ov.kpi.toolSub":`tool runs {dur}`,"ov.kpi.wallSub":`{n} model calls`,"ov.stats.empty":`No billed tokens in this range`,"ov.usage.title":`Last 7 Days`,"ov.usage.tokens":`Tokens`,"ov.usage.cost":`Cost (price-mapped models only)`,"ov.usage.costTip":`Cost`,"ov.usage.empty":`No usage in the last 7 days — daily tokens and cost appear once sessions make model requests`,"balance.title":`DeepSeek balance`,"balance.tip.granted":`Granted balance`,"balance.tip.toppedUp":`Topped-up balance`,"ov.heat.title":`Activity`,"ov.heat.sub":`Filter by date`,"ov.heat.empty":`No activity yet — daily usage appears once sessions make model requests`,"ov.heat.sessions":`{n} active sessions`,"ov.heat.less":`Less`,"ov.heat.more":`More`,"ov.heat.metric":`Metric`,"ov.heat.metric.sessions":`Sessions`,"ov.heat.metric.steps":`Steps`,"ov.heat.steps":`{n} steps`,"ov.heat.wd.1":`Mon`,"ov.heat.wd.3":`Wed`,"ov.heat.wd.5":`Fri`,"ov.heat.mon.01":`Jan`,"ov.heat.mon.02":`Feb`,"ov.heat.mon.03":`Mar`,"ov.heat.mon.04":`Apr`,"ov.heat.mon.05":`May`,"ov.heat.mon.06":`Jun`,"ov.heat.mon.07":`Jul`,"ov.heat.mon.08":`Aug`,"ov.heat.mon.09":`Sep`,"ov.heat.mon.10":`Oct`,"ov.heat.mon.11":`Nov`,"ov.heat.mon.12":`Dec`,"ov.skills.empty":`No skill loads in this range — loaded skills appear here with their counts and last load`,"ov.skills.more":`{n} more skills`,"ov.skills.loads":`{n} loads`,"ov.skills.summary":`{skills} skills · {loads} loads`,"ov.skills.sortLabel":`Skill sort`,"ov.skills.sort.loads":`Loads`,"ov.skills.sort.recent":`Recent`,"ov.skills.sessions":`{n} sessions`,"ov.skills.clickFilter":`Click to filter the sessions that loaded it`,"ov.skills.clickRelease":`Click again to release the filter`,"ov.skills.src.project":`Project`,"ov.skills.src.user":`User`,"ov.skills.src.bundled":`Built-in`,"ov.skills.k.source":`Source`,"ov.skills.k.usage":`Usage`,"ov.skills.k.last":`Last`,"ov.skills.k.path":`Path`,"ov.skills.copyPath":`Click to copy the path`,"ov.skills.copied":`Copied`,"ov.list.title":`Sessions`,"ov.list.search":`Search title / path / last message…`,"ov.list.sortLabel":`Sort`,"ov.list.sort.recent":`Last updated`,"ov.list.sort.tokens":`Total Tokens`,"ov.list.sort.context":`Current Context`,"ov.list.empty":`No sessions yet — each session’s context profile appears here once you start one`,"ov.list.noMatch":`No sessions match the current filters`,"ov.list.noData":`No context data yet — stats appear once the session makes model requests`,"ov.list.dayFilter":`active on {day}`,"ov.list.dayClear":`Clear the day filter`,"ov.list.skillClear":`Clear the skill filter`,"ov.list.pager":`Session pagination`,"ov.list.page":`Page {n} of {total}`,"ov.list.prev":`Previous page`,"ov.list.next":`Next page`,"ov.group.label":`Group`,"ov.group.ungrouped":`Ungrouped`,"ov.running":`Running`,"ov.current":`current`,"ov.card.turns":`{n} turns · {s} steps`,"ov.card.teamUsage":`Total Tokens`,"ov.card.teamCost":`Total Est. Cost`,"ov.card.lastUser":`Last message`,"ov.time.now":`just now`,"ov.time.m":`{n}m ago`,"ov.time.h":`{n}h ago`,"ov.time.d":`{n}d ago`};var g=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
13
- <path d="M899.984 19.873h-3.452c-26.123 0-47.296 21.172-47.296 47.296v888.508c0 26.127 21.173 47.298 47.296 47.298h3.452c26.119 0 47.297-21.171 47.297-47.298V67.169c0-26.124-21.177-47.296-47.297-47.296z" fill="#4A5699"/>
14
- <path d="M132.643 19.873h-3.449c-26.12 0-47.296 21.172-47.296 47.296v888.508c0 26.127 21.177 47.298 47.296 47.298h3.449c26.123 0 47.299-21.171 47.299-47.298V67.169c0-26.124-21.176-47.296-47.299-47.296z" fill="#C45FA0"/>
15
- <path d="M899.463 19.873H129.194c-26.12 0-47.296 21.172-47.296 47.296v3.377c0 26.12 21.177 47.299 47.296 47.299h770.269c26.123 0 47.296-21.179 47.296-47.299v-3.377c0-26.124-21.173-47.296-47.296-47.296z" fill="#6277BA"/>
16
- <path d="M899.463 905.006H129.194c-26.12 0-47.296 21.17-47.296 47.29v3.381c0 26.127 21.177 47.298 47.296 47.298h770.269c26.123 0 47.296-21.171 47.296-47.298v-3.381c0-26.12-21.173-47.29-47.296-47.29z" fill="#C45FA0"/>
17
- <path d="M717.962 543.153H542.047c-26.121 0-47.298 21.175-47.298 47.297v3.724c0 26.123 21.177 47.293 47.298 47.293h175.915c26.121 0 47.297-21.17 47.297-47.293v-3.724c0-26.122-21.176-47.297-47.297-47.297z" fill="#E5594F"/>
18
- <path d="M689.268 198.849H513.355c-26.122 0-47.298 21.175-47.298 47.297v3.722c0 26.12 21.176 47.297 47.298 47.297h175.912c26.122 0 47.298-21.177 47.298-47.297v-3.722c0-26.122-21.175-47.297-47.297-47.297z" fill="#F0D043"/>
19
- <path d="M757.789 353.081H261.17c-26.121 0-47.297 21.172-47.297 47.296v3.377c0 26.121 21.177 47.299 47.297 47.299h496.619c26.121 0 47.296-21.178 47.296-47.299v-3.377c0-26.125-21.175-47.296-47.296-47.296z" fill="#E5594F"/>
20
- <path d="M762.638 726.225h-496.62c-26.12 0-47.294 21.18-47.294 47.301v3.377c0 26.12 21.174 47.3 47.294 47.3h496.62c26.122 0 47.296-21.18 47.296-47.3v-3.377c0-26.122-21.174-47.301-47.296-47.301z" fill="#6277BA"/>
21
- <path d="M355.734 543.328H281.41c-26.122 0-47.297 21.17-47.297 47.293v3.378c0 26.118 21.175 47.297 47.297 47.297h74.324c26.123 0 47.296-21.179 47.296-47.297v-3.378c0-26.123-21.174-47.293-47.296-47.293z" fill="#F39A2B"/>
22
- <path d="M334.85 248.006m-48.986 0a48.986 48.986 0 1 0 97.972 0 48.986 48.986 0 1 0-97.972 0Z" fill="#F39A2B"/>
23
- </svg>
24
- `;let _=g.slice(g.indexOf(`>`)+1,g.lastIndexOf(`</svg>`)).trim().replace(/>\s+</g,`><`),v=_.replace(/fill="#[0-9A-Fa-f]{6}"/g,``),y={x:-34,y:-34,width:1092,height:1092},b=`x="${y.x}" y="${y.y}" width="${y.width}" height="${y.height}"`,x=(e,t=``)=>`<rect ${b} fill="${e}"${t}/>`,S=[[17,0],[-17,0],[0,17],[0,-17]];function C(e){let t=`${e}-hole`,n=`${e}-thin`,r=S.map(([e,n])=>x(`#000`,` mask="url(#${t})" transform="translate(${e} ${n})"`)).join(``);return`<defs><mask id="${t}" maskUnits="userSpaceOnUse" ${b}>${x(`#fff`)}<g fill="#000">${v}</g></mask><mask id="${n}" maskUnits="userSpaceOnUse" ${b}>${x(`#fff`)}${r}</mask></defs>`+x(`currentColor`,` mask="url(#${n})"`)}function w({size:e=20,className:t,mono:n=!1}){let r=`dsh-context-sheet-${(0,u.useId)().replaceAll(`:`,``)}`;return(0,d.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 1024 1024`,className:t,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,dangerouslySetInnerHTML:{__html:n?C(r):_}})}function T({size:e=18}){return(0,d.jsx)(w,{size:e,mono:!0})}function E(e){return function(){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w,{size:16,className:`lc-title-icon`}),(0,d.jsx)(`span`,{className:`lc-title-label`,children:e(`tab`)})]})}}let ee=new Map;function te(e){let t=ee.get(e);if(t!==void 0)return t;let n=!1,r=new Set,i={subscribe(e){return r.add(e),()=>{r.delete(e)}},getSnapshot:()=>n,set(e){if(e!==n){n=e;for(let e of r)e()}}};return ee.set(e,i),i}let D=new Map;function O(e,t){D.set(e,t)}function k(e){let t=D.get(e);return t!==void 0&&D.delete(e),t}let A=`context`,j=`/context`;function M(e,t){e.inject([`inputTriggers`],e=>{let n=e.get(`inputTriggers`);n!==void 0&&typeof n.registerSource==`function`&&e.effect(()=>n.registerSource({trigger:`/`,name:A,order:1,candidates:(e,n)=>{if(n.position!==`leading`)return Promise.resolve([]);let r=n.query.trim().toLowerCase();return r!==``&&!A.startsWith(r)?Promise.resolve([]):Promise.resolve([{name:A,label:t.t(`cmd.label`),icon:w,section:t.t(`cmd.section`),description:t.t(`cmd.desc`)}])},onPick:e=>(O(e.session.sessionId,{kind:`span`,span:e.span}),te(e.session.sessionId).set(!0),`handled`),matchEnter:(e,t)=>t===j?(O(e.sessionId,{kind:`bare-token`,token:j}),te(e.sessionId).set(!0),Promise.resolve(`handled`)):Promise.resolve(void 0)}),`dsh-context: /context command`)})}let N=/^(\d+(?:\.\d+)?)px/,P=/^\s*minmax\(\s*([\d.]+)(?:px)?\s*,/,F=/(\d+(?:\.\d+)?)px\)?$/;function I(e){try{for(let t=e?.parentElement??null;t!==null;t=t.parentElement){let e=t.style.gridTemplateColumns;if(e===``)continue;let n=e.trim(),r=N.exec(n);if(r===null)return{left:0,right:0,frame:null};let i=F.exec(n);if(i===null||i.index===0)return{left:Number(r[1]),right:0,frame:t};let a=P.exec(n.slice(r[0].length)),o=Number(i[1]),s=a===null?0:Number(a[1]);return{left:Number(r[1]),right:Math.min(o,Math.max(0,window.innerWidth-Number(r[1])-s)),frame:t}}}catch{}return{left:0,right:0,frame:null}}let L=[{key:`system`,color:`var(--color-indigo-500)`},{key:`tools`,color:`var(--color-amber-500)`},{key:`user`,color:`var(--color-green-500)`},{key:`inject`,color:`var(--color-purple-500)`},{key:`skill`,color:`var(--color-orange-500)`},{key:`assistant`,color:`var(--color-blue-500)`},{key:`tool`,color:`var(--color-teal-500)`}],ne=Object.fromEntries(L.map(e=>[e.key,e.color])),re=[`user`,`inject`,`skill`,`assistant`,`tool`];function R(e){return L.map(t=>({key:t.key,color:t.color,value:e[t.key]||0}))}function ie(e,t){let n=e.user+e.inject+e.skill+e.assistant+e.tool,r=t?.systemTokens??e.system,i=t?.toolsTokens??e.tools,a=t?.messageTokens??n,o={system:r,tools:i};if(n>0){let t=0,r=`user`;for(let i of re){let s=Math.round(a*(e[i]/n));o[i]=s,t+=s,e[i]>e[r]&&(r=i)}o[r]=Math.max(0,o[r]+a-t)}else for(let e of re)o[e]=0;return L.map(e=>({key:e.key,color:e.color,value:o[e.key]??0}))}function z(e,t){let n=e.map(e=>({...e,raw:e.raw??e.value}));if(t===null||t<=0)return n;let r=0;for(let e of n)r+=e.raw;if(r<=0)return n;if(r===t)return n.map(e=>({...e,value:e.raw}));let i=t/r;return n.map(e=>({...e,value:Math.round(e.raw*i)}))}function B(e,t,n){let r=n.uncachedInputTokens+n.cacheReadTokens+n.cacheWriteTokens,i=ie(e,t);return[...r>0?z(i,r):i.map(e=>({...e,value:0})),{key:`output`,color:`var(--color-pink-500)`,value:Math.max(0,n.outputTokens)}]}function V(e,t){return Math.min(100,Math.round(e/t*1e3)/10)}function H(e,t=null,n=null){let r=e.current,i=t!==null&&typeof t.projectedTokens==`number`?t.projectedTokens:void 0,a=t!==null&&typeof t.pressureTokens==`number`?t.pressureTokens:void 0,o=e.last,s=e.requests,c=s.length>0?s[s.length-1]:null,l=o===void 0?c:o,u=l!==null&&typeof l.prompt==`number`?l.prompt+(r.total-l.total):void 0,d=i??a??u??null,f=t!==null&&typeof t.contextWindow==`number`?t.contextWindow:e.contextWindow,p=d??r.total;return{tokens:p,window:f,pct:f!==void 0&&f>0?V(p,f):null,parts:z(ie(r,n),d!==null&&p>0?p:null)}}function ae(e){return typeof e!=`string`||e.length===0?0:Math.ceil(e.length/4)+4}function oe(e,t){if(typeof t==`string`&&t!==``)try{let n=e.get(`uiConversation`);if(n!==void 0&&typeof n.imageUrl==`function`){let e=n.imageUrl.bind(n);return n=>e(t,n)}}catch{}}function se(e){let t=e.useChat;if(typeof t==`function`)try{let e=t(e=>typeof e==`object`&&e?e.legacy:void 0),n=typeof e==`object`&&e?e.nodes:void 0;return Array.isArray(n)?n:void 0}catch{}}function U(e,t,n){return typeof e.useProjection==`function`?n(e.useProjection(t)):null}function W(e){return typeof e!=`object`||!e?null:e}function G(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function K(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e):[]}function ce(e){return{requests:K(e.requests),events:K(e.events),nodes:K(e.nodes),droppedNodes:G(e.droppedNodes),archive:K(e.archive),...typeof e.surfaceFloor==`number`?{surfaceFloor:e.surfaceFloor}:{},...typeof e.archiveFloor==`number`?{archiveFloor:e.archiveFloor}:{},...e.fileOps===void 0?{}:{fileOps:K(e.fileOps)},...typeof e.fileOpsFloor==`number`?{fileOpsFloor:e.fileOpsFloor}:{},...e.spans===void 0?{}:{spans:K(e.spans)}}}function q(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e)}function le(e){let t=W(e);return t===null||typeof t.current!=`string`||typeof t.minimum!=`string`?null:{current:t.current,minimum:t.minimum}}function J(e){let t=W(e);if(t===null||Array.isArray(t))return;let n={};for(let e of Object.keys(t)){let r=W(t[e]);if(r===null||Array.isArray(r))continue;let i={};for(let e of Object.keys(r)){let t=W(r[e]);if(t===null||Array.isArray(t))continue;let n={};for(let e of[`peak`,`off`]){let r=W(t[e]);r===null||Array.isArray(r)||(n[e]={uncached:G(r.uncached),cacheRead:G(r.cacheRead),cacheWrite:G(r.cacheWrite),output:G(r.output)})}i[e]=n}n[e]=i}return n}function ue(e){if(e===void 0)return!0;let t=W(e);return t===null||Array.isArray(t)?!1:Object.keys(t).every(e=>{let n=W(t[e]);return n!==null&&!Array.isArray(n)})}function de(e){let t=W(e);if(t===null)return null;let n=t.current;if(typeof n==`object`&&n&&[`system`,`tools`,`user`,`inject`,`skill`,`assistant`,`tool`,`total`].every(e=>typeof n[e]==`number`)&&q(t.requests)&&q(t.events)&&q(t.nodes)&&q(t.archive)&&pe(t.systems)&&be(t.timing)&&ue(t.cost))return t;let r=typeof n==`object`&&n?n:{},i=J(t.cost),a=xe(t.timing),o=le(t.unsupported),s=Y(t.counts),c=me(t.last);return{ok:!0,...o===null?{}:{unsupported:o},...typeof t.model==`string`?{model:t.model}:{},...typeof t.provider==`string`?{provider:t.provider}:{},...typeof t.contextWindow==`number`?{contextWindow:t.contextWindow}:{},current:{system:G(r.system),tools:G(r.tools),user:G(r.user),inject:G(r.inject),skill:G(r.skill),assistant:G(r.assistant),tool:G(r.tool),total:G(r.total)},...ce(t),...typeof t.images==`number`?{images:t.images}:{},...typeof t.toolCalls==`number`?{toolCalls:t.toolCalls}:{},...typeof t.humanInputs==`number`?{humanInputs:t.humanInputs}:{},...typeof t.answers==`number`&&Number.isFinite(t.answers)?{answers:t.answers}:{},...typeof t.lastUser==`string`&&t.lastUser!==``?{lastUser:t.lastUser.slice(0,200)}:{},...s===void 0?{}:{counts:s},...c===void 0?{}:{last:c},...typeof t.detailRev==`number`&&Number.isFinite(t.detailRev)?{detailRev:t.detailRev}:{},...i===void 0?{}:{cost:i},...a===null?{}:{timing:a},...t.systems===void 0?{}:{systems:fe(t.systems)}}}function fe(e){let t=K(e),n=[];for(let e of t){let{seq:t,time:r,tokens:i}=e;typeof t==`number`&&Number.isFinite(t)&&typeof r==`number`&&Number.isFinite(r)&&typeof i==`number`&&Number.isFinite(i)&&n.push({seq:t,time:r,tokens:i})}return n.sort((e,t)=>e.seq-t.seq)}function pe(e){return e===void 0?!0:Array.isArray(e)?e.every(e=>{if(typeof e!=`object`||!e)return!1;let{seq:t,time:n,tokens:r}=e;return typeof t==`number`&&Number.isFinite(t)&&typeof n==`number`&&Number.isFinite(n)&&typeof r==`number`&&Number.isFinite(r)}):!1}function Y(e){let t=W(e);if(t!==null)return{turns:G(t.turns),steps:G(t.steps),injects:G(t.injects),compactions:G(t.compactions),prunes:G(t.prunes),skills:G(t.skills)}}function me(e){let t=W(e);if(t!==null&&typeof t.seq==`number`&&Number.isFinite(t.seq)&&typeof t.total==`number`&&Number.isFinite(t.total))return{seq:t.seq,total:t.total,...typeof t.prompt==`number`&&Number.isFinite(t.prompt)?{prompt:t.prompt}:{}}}function he(e){let t=W(e);if(t===null)return null;let n={};return typeof t.pressureTokens==`number`&&Number.isFinite(t.pressureTokens)&&(n.pressureTokens=t.pressureTokens),typeof t.projectedTokens==`number`&&Number.isFinite(t.projectedTokens)&&(n.projectedTokens=t.projectedTokens),typeof t.contextWindow==`number`&&Number.isFinite(t.contextWindow)&&(n.contextWindow=t.contextWindow),n}function ge(e){let t=W(e);if(t===null)return null;let{systemTokens:n,toolsTokens:r,messageTokens:i}=t;return typeof n!=`number`||!Number.isFinite(n)||typeof r!=`number`||!Number.isFinite(r)||typeof i!=`number`||!Number.isFinite(i)?null:{systemTokens:n,toolsTokens:r,messageTokens:i}}function _e(e){let t=W(e);if(t===null)return null;let{uncachedInputTokens:n,outputTokens:r,cacheReadTokens:i,cacheWriteTokens:a}=t;return typeof n!=`number`||!Number.isFinite(n)||typeof r!=`number`||!Number.isFinite(r)||typeof i!=`number`||!Number.isFinite(i)||typeof a!=`number`||!Number.isFinite(a)?null:{uncachedInputTokens:n,outputTokens:r,cacheReadTokens:i,cacheWriteTokens:a}}function ve(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0}function ye(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function be(e){if(e===void 0)return!0;if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;for(let e of[`wallMs`,`ttftMs`,`genMs`,`calls`,`toolsMs`,`toolCalls`])if(typeof t[e]!=`number`)return!1;for(let e of[`reasoningMs`,`textMs`,`toolArgMs`,`reasoningBlocks`,`textBlocks`,`toolArgBlocks`]){let n=t[e];if(n!==void 0&&(typeof n!=`number`||!Number.isFinite(n)||n<0))return!1}let n=t.tools;if(typeof n!=`object`||!n||Array.isArray(n))return!1;for(let e in n){let t=n[e];if(typeof t!=`object`||!t||typeof t.calls!=`number`||typeof t.ms!=`number`)return!1}return!0}function xe(e){let t=W(e);if(t===null)return null;let n={},r=t.tools;if(typeof r==`object`&&r&&!Array.isArray(r))for(let e in r){if(e===`__proto__`||!Object.hasOwn(r,e))continue;let t=r[e];if(typeof t!=`object`||!t)continue;let i=t.calls,a=t.ms;typeof i==`number`&&i>=0&&typeof a==`number`&&a>=0&&(n[e]={calls:i,ms:a})}let i={wallMs:ve(t.wallMs),ttftMs:ve(t.ttftMs),genMs:ve(t.genMs),calls:ve(t.calls),toolsMs:ve(t.toolsMs),toolCalls:ve(t.toolCalls),tools:n},a=ye(t.reasoningMs);a!==void 0&&(i.reasoningMs=a);let o=ye(t.reasoningBlocks);o!==void 0&&(i.reasoningBlocks=o);let s=ye(t.textMs);s!==void 0&&(i.textMs=s);let c=ye(t.textBlocks);c!==void 0&&(i.textBlocks=c);let l=ye(t.toolArgMs);l!==void 0&&(i.toolArgMs=l);let u=ye(t.toolArgBlocks);return u!==void 0&&(i.toolArgBlocks=u),i}function Se(e){let t=W(e);if(t===null||!Array.isArray(t.headers))return null;for(let e of t.headers){if(typeof e!=`object`||!e)return null;let t=e;if(!Array.isArray(t.tools)||t.systemTokens!==void 0&&(typeof t.systemTokens!=`number`||!Number.isFinite(t.systemTokens)))return null;for(let e of t.tools){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.name!=`string`||typeof t.tokens!=`number`||!Number.isFinite(t.tokens)||t.plugin!==void 0&&typeof t.plugin!=`string`)return null}}let n=!1;for(let e of t.headers)if(e.systemTokens===void 0&&typeof e.system==`string`&&e.system!==``){n=!0;break}return n?{headers:t.headers.map(e=>e.systemTokens===void 0?{...e,systemTokens:ae(e.system)||void 0}:e)}:t}function Ce(e){let t=W(e);if(t===null)return null;let n=W(t.days);if(n===null||Array.isArray(n))return null;let r={},i=!1;for(let e of Object.keys(n)){let t=W(n[e]),a=t?.tokens,o=t?.requests;if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||t===null||Array.isArray(t)||typeof a!=`number`||!Number.isFinite(a)||a<0||typeof o!=`number`||!Number.isFinite(o)||o<0){i=!0;continue}let s=J(t.cost),c=s!==void 0&&Object.keys(s).length>0?s:void 0;t.cost!==void 0&&c===void 0&&(i=!0);let l=we(t.skills);t.skills!==void 0&&l===void 0&&(i=!0),r[e]={tokens:a,requests:o,...c===void 0?{}:{cost:c},...l===void 0?{}:{skills:l}}}return i?{days:r}:t}function we(e){let t=W(e);if(t===null||Array.isArray(t))return;let n={},r=!1;for(let e of Object.keys(t)){let i=W(t[e]),a=i?.n,o=i?.last;typeof a!=`number`||!Number.isFinite(a)||a<0||typeof o!=`number`||!Number.isFinite(o)||(n[e]={n:a,last:o},r=!0)}return r?n:void 0}let Te=`/api`;function Ee(e){try{let t=W(e.get(`connection`)?.rpc),n=t?.call;if(t!==null&&typeof n==`function`)return n.bind(t)}catch{}}function De(e,t){if(typeof t==`string`&&t!==``)try{let n=e.get(`sessions`),r=typeof n?.list?.getSnapshot==`function`?n.list.getSnapshot():void 0,i=typeof r==`object`&&r?r.byId:void 0,a=typeof i==`object`&&i?i[t]:void 0,o=typeof a==`object`&&a?a.cwd:void 0;return typeof o==`string`&&o!==``?o:void 0}catch{return}}async function Oe(e){let t=Ee(e);if(t===void 0)return!1;try{if(e.get(`connection`)?.isLoopback!==!0)return!1;let n=W(await t(Te,`session/canOpenWorkspacePath`,{args:{}}));return n!==null&&n.ok===!0&&n.value===!0}catch{return!1}}function ke(e){let t=Ee(e);if(t!==void 0)return e=>{try{t(Te,`session/openWorkspacePath`,{args:{request:{path:e}}}).catch(()=>{})}catch{}}}function Ae(e){let t=()=>{try{let t=W(e.get(`sidebarRight`));return t!==null&&typeof t.openResource==`function`?t:void 0}catch{return}};if(t()!==void 0)return e=>{let n=t();if(n===void 0)return!1;try{return n.openResource(e),!0}catch{return!1}}}function je(e,t){try{let n=W(e.get(`uiWorkspace`)),r=n?.openSession;typeof r==`function`&&r.call(n,t)}catch{}}function Me(e){if(typeof e!=`object`||!e)return null;let t=e.event??e;if(typeof t!=`object`)return null;let n=t;if(typeof n.type!=`string`||typeof n.seq!=`number`||!Number.isFinite(n.seq))return null;let r=n.data!==null&&typeof n.data==`object`?n.data:{};return{type:n.type,seq:n.seq,data:r}}function X(e){if(!Array.isArray(e))return null;let t=``;for(let n of e){let e=typeof n==`object`&&n?n.text:void 0;typeof e==`string`&&(t+=e)}return t.trim()===``?null:t}function Ne(e){if(!Array.isArray(e))return null;let t=``,n=!1;for(let r of e){let e=typeof r==`object`&&r?r.text:void 0;typeof e==`string`&&(t+=e,n=!0)}return n?t:null}function Pe(e){let t=typeof e==`object`&&e?e:null;switch(t?.type){case`text`:case`reasoning`:return{kind:t.type,...typeof t.text==`string`?{text:t.text}:{}};case`image`:return{kind:`image`,...t.attachment===void 0?{}:{attachment:t.attachment}};case`tool-call`:return{kind:`tool-call`,name:typeof t.name==`string`?t.name:`?`,argsRaw:t.arguments};default:return typeof e==`object`&&e?e:{value:e}}}function Fe(e){let t=new Map,n=new Map,r=new Map;for(let i of e){let e=Me(i);if(e===null)continue;let{type:a,seq:o,data:s}=e;if(a===`tool/call`){typeof s.callId==`string`&&n.set(s.callId,{name:typeof s.name==`string`?s.name:`?`,argsRaw:typeof s.arguments==`string`?s.arguments:``});continue}if(a===`compaction/summary`){if(typeof s.compactionId==`string`){let e=X(s.summary);e!==null&&r.set(s.compactionId,e)}continue}if(a===`user/message`){let e=s.source!==null&&typeof s.source==`object`?s.source:null,n=e!==null&&e.kind===`plugin`&&typeof e.compactionId==`string`?e.compactionId:null;if(n!==null){t.set(o,{kind:`compaction`,seq:o,summary:r.get(n)??null});continue}t.set(o,{kind:`user`,seq:o,content:Array.isArray(s.content)?s.content:[]});continue}if(a===`assistant/message`){let e=s.message!==null&&typeof s.message==`object`?s.message:null,n=e!==null&&Array.isArray(e.content)?e.content:[];t.set(o,{kind:`assistant`,seq:o,blocks:n.map(Pe)});continue}if(a===`tool/result`){let e=s.message!==null&&typeof s.message==`object`?s.message:null,r=e?.source!==null&&typeof e?.source==`object`?e.source:null,i=typeof e?.toolCallId==`string`?e.toolCallId:typeof r?.callId==`string`?r.callId:null,a=i===null?null:n.get(i)??null;t.set(o,{kind:`tool-result`,seq:o,call:a,content:Array.isArray(e?.content)?e.content:[],isError:e?.isError===!0});continue}}return t}function Ie(e){if(typeof e==`object`&&e)try{let t=e.page;return typeof t==`function`?t.bind(e):void 0}catch{return}}let Z,Le=new Set;function Re(e){Z=e;for(let e of[...Le])e()}function ze(e){return Le.add(e),()=>{Le.delete(e)}}function Be(){return Z}function Ve(){return(0,u.useSyncExternalStore)(ze,Be,Be)}function He(e){e.inject([`remote`,`remote.session`],e=>{try{let t=e.remote?.session;Re(t===void 0?void 0:Ie(t))}catch{Re(void 0)}return()=>{Re(void 0)}})}function Ue(e){let t=e;if(typeof t==`object`&&t&&`ok`in t){let e=t;if(e.ok!==!0||e.value===null||typeof e.value!=`object`)throw Error(`history rpc failed`);t=e.value}if(typeof t!=`object`||!t)throw Error(`history rpc failed`);let n=t.records;if(!Array.isArray(n))throw Error(`history rpc failed`);return n}function We(e){let t=Z;if(t!==void 0)return n=>t({address:{kind:`session`,sessionId:e},throughSeq:n,beforeSeq:n+1},new AbortController().signal)}function Ge(e){let t=We(e);if(t===void 0)return;let n=new Map;return async e=>{let r=n.get(e);if(r!==void 0)return r;let i=Fe(Ue(await t(e))).get(e)??null;return i!==null&&n.set(e,i),i}}function Ke(e){let{type:t,data:n}=e;if(t===`system/message`){let e=Ne((n.message!==null&&typeof n.message==`object`?n.message:null)?.content);return e===null?null:{system:e,tools:[]}}let r=n.header!==null&&typeof n.header==`object`?n.header:null;if(r===null)return null;let i=Array.isArray(r.tools)?r.tools:[],a=[];for(let e of i){let t=typeof e==`object`&&e?e:null;a.push({name:t!==null&&typeof t.name==`string`?t.name:`?`,...t!==null&&typeof t.description==`string`&&t.description!==``?{description:t.description}:{},schema:e})}return{tools:a}}function qe(e){let t=We(e);if(t===void 0)return;let n=new Map;return async e=>{let r=n.get(e);if(r!==void 0)return r;let i=Ue(await t(e)),a=null;for(let t of i){let r=Me(t);if(r===null||r.type!==`request/header`&&r.type!==`system/message`)continue;let i=Ke(r);i!==null&&(n.set(r.seq,i),r.seq===e&&(a=i))}return a}}function Je(e){let t=W(e);if(t===null||typeof t.rev!=`number`||!Number.isFinite(t.rev)||t.rev<0)return null;let n=de(t.head);return{rev:t.rev,...n===null?{}:{head:n},...ce(t)}}function Ye(e){if(e!==``)return async()=>{let t=await fetch(`/api/dsh-context/detail`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({sessionId:e})});if(!t.ok)throw Error(`dsh-context: detail route HTTP ${t.status}`);let n=W(await t.json());if(n===null||n.ok!==!0)throw Error(`dsh-context: detail read failed`);if(n.value===null)return null;let r=Je(n.value);if(r===null)throw Error(`dsh-context: detail read malformed`);return r}}let Q={detail:null,failed:!1,pending:!1};var $=class{fetcher;baseDelay;detail=null;acceptedRev=-1;wantedRev=-1;targetRev=-1;lastHeadRev=-1;generation=0;failed=!1;inFlight=!1;timer=null;failures=0;listeners=new Set;snap=Q;constructor(e,t=300){this.fetcher=e,this.baseDelay=t}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snap;request(e){e<this.lastHeadRev&&(this.generation++,this.acceptedRev=-1,this.wantedRev=-1,this.detail=null,this.failed=!1),this.lastHeadRev=e,!(e<=this.acceptedRev||e<=this.wantedRev)&&(this.wantedRev=e,this.schedule())}retry=()=>{this.failures=0,this.detail===null&&(this.timer!==null&&(clearTimeout(this.timer),this.timer=null),this.inFlight||this.fire())};schedule(){this.timer===null&&(this.timer=setTimeout(()=>{this.timer=null,this.fire()},this.baseDelay*2**Math.min(this.failures,3)),this.emit())}async fire(){if(this.inFlight)return;if(this.fetcher===void 0){this.failed=!0,this.emit();return}this.inFlight=!0,this.targetRev=this.wantedRev;let e=this.generation;this.emit();try{let t=await this.fetcher();if(e!==this.generation)return;t===null?(this.wantedRev=this.acceptedRev,this.failed=this.detail===null,this.failures++):((t.rev>=this.acceptedRev||t.rev===this.targetRev)&&(this.detail=t,this.acceptedRev=t.rev),this.failures=0,this.failed=!1)}catch{e===this.generation&&(this.failed=this.detail===null,this.failures++)}finally{this.inFlight=!1,this.wantedRev>this.acceptedRev&&this.schedule(),this.emit()}}emit(){let e=this.timer!==null||this.inFlight,t={detail:this.detail,failed:this.failed,pending:e};if(t.detail!==this.snap.detail||t.failed!==this.snap.failed||t.pending!==this.snap.pending){this.snap=t;for(let e of this.listeners)e()}}};let Xe=new Map;function Ze(e){let t=Xe.get(e);return t===void 0&&(t=new $(Ye(e)),Xe.set(e,t)),t}let Qe=()=>()=>{},$e=()=>{};function et(e){let t=U(e,`contextTimeline`,de),n=typeof e.sessionId==`string`?e.sessionId:``,r=t!==null&&typeof t.detailRev==`number`?t.detailRev:null,i=r!==null,a=t===null,o=(0,u.useMemo)(()=>i||a?Ze(n):null,[n,i,a]),s=(0,u.useSyncExternalStore)(o===null?Qe:o.subscribe,o===null?()=>Q:o.getSnapshot);return(0,u.useEffect)(()=>{o!==null&&o.request(r??0)},[o,r]),(0,u.useMemo)(()=>{let e=s.detail,n=o===null?$e:o.retry;if(t!==null&&!i)return{data:t,detailState:`legacy`,retryDetail:$e};let r=t===null?e===null?null:e.head??null:t;return r===null?{data:null,detailState:o!==null&&(s.failed||e!==null)?`failed`:`loading`,retryDetail:n}:e===null?{data:r,detailState:s.failed?`failed`:`loading`,retryDetail:n}:{data:{...r,requests:e.requests,events:e.events,nodes:e.nodes,droppedNodes:e.droppedNodes,archive:e.archive,...e.surfaceFloor===void 0?{}:{surfaceFloor:e.surfaceFloor},...e.archiveFloor===void 0?{}:{archiveFloor:e.archiveFloor},...e.fileOps===void 0?{}:{fileOps:e.fileOps},...e.fileOpsFloor===void 0?{}:{fileOpsFloor:e.fileOpsFloor},...e.spans===void 0?{}:{spans:e.spans}},detailState:`ready`,retryDetail:n}},[t,i,o,s])}function tt(e,t){if(e===null||e.headers.length===0)return null;if(t===null)return e.headers[e.headers.length-1];for(let n=e.headers.length-1;n>=0;n--)if(e.headers[n].seq<t)return e.headers[n];return null}function nt(e,t,n){let r=e.systems;if(r!==void 0&&r.length>0){for(let e=r.length-1;e>=0;e--){let t=r[e];if(!(t.tokens<=0)&&(n===null||t.seq<n))return t}return null}return t!==null&&t.systemTokens!==void 0?{seq:t.seq,time:t.time,tokens:t.systemTokens}:null}function rt(e,t,n){let r=n===null,i;if(r)i=e.nodes.slice();else{let t=[];for(let r of e.nodes)r.seq<n&&t.push(r);for(let r of e.archive)r.seq<n&&r.gone!==void 0&&r.gone>n&&t.push(r);i=t}i.sort((e,t)=>e.seq-t.seq);let a=0;e.droppedNodes>0&&(r||e.surfaceFloor!==void 0&&n>e.surfaceFloor)&&(a=e.droppedNodes);let o=!r&&e.archiveFloor!==void 0&&n<e.archiveFloor,s=tt(t,n);return{live:r,header:s,system:nt(e,s,n),nodes:i,missingLive:a,approximate:o}}function it(e){let t=[];if(e.system!==null&&t.push({key:`sys`,cat:`system`,tokens:e.system.tokens,time:e.system.time}),e.header!==null)for(let n of e.header.tools)t.push({key:`tool:`+n.name,cat:`tools`,tokens:n.tokens});for(let n of e.nodes)t.push({key:`n`+String(n.seq),cat:n.cat,tokens:n.tokens,node:n,...n.time===void 0?{}:{time:n.time}});return t}function at(e){let t=[],n=0;for(let r of it(e))`node`in r?t.push({key:r.key,cat:r.cat,tokens:r.tokens,off:n,color:ne[r.cat],node:r.node}):t.push({key:r.key,cat:r.cat,tokens:r.tokens,off:n,color:ne[r.cat]}),n+=r.tokens;return t}function ot(e,t){if(t===null)return{up:[],down:[]};let n=new Map(t.map(e=>[e.key,e.tokens])),r=new Map(e.map(e=>[e.key,e.tokens])),i=[],a=[];for(let t of e){let e=t.tokens-(n.get(t.key)??0);e<=0||i.push(`node`in t?{key:t.key,cat:t.cat,tokens:e,off:0,color:t.color,node:t.node}:{key:t.key,cat:t.cat,tokens:e,off:0,color:t.color})}for(let e of t){let t=(r.get(e.key)??0)-e.tokens;t>=0||a.push(`node`in e?{key:e.key,cat:e.cat,tokens:t,off:0,color:e.color,node:e.node}:{key:e.key,cat:e.cat,tokens:t,off:0,color:e.color})}let o=0;for(let e of i)e.off=o,o+=e.tokens;let s=0;for(let e of a)e.off=s,s-=e.tokens;return{up:i,down:a}}function st(e,t,n){if(!(`node`in e))return e.cat===`system`?n(`system`):e.key.slice(5);let r=e.node;return r.skill===void 0?r.cat===`tool`?r.tool??`?`:r.cat===`inject`?t(`form.`+(r.form||`context`)):n(r.cat):t(`node.skillTag`,{name:r.skill})}function ct(e){if(typeof e!=`string`||e===``)return null;try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)?t:null}catch{return null}}let lt={read:`read`,read_image:`read`,write:`write`,edit:`write`,grep:`search`,glob:`search`};function ut(e){return e===void 0?null:lt[e]??null}function dt(e,t){return e===`str_replace_editor`?t!==null&&t.command===`view`?`read`:`write`:ut(e)}function ft(e){return e===`str_replace_editor`||ut(e)!==null}function pt(e,t){if(t===null)return null;if(e===`grep`||e===`glob`){let e=t.path;if(typeof e==`string`&&e!==``)return e;let n=t.pattern;return typeof n==`string`&&n!==``?n:null}for(let e of[`file_path`,`filePath`,`path`]){let n=t[e];if(typeof n==`string`&&n!==``)return n}return null}function mt(e){if(e===``)return 0;let t=0;for(let n=0;n<e.length;n++)e[n]===`
12
+ window.__ModuleLoader__.load({id:`dsh-context`,factory:e=>{var t={exports:{}};t.exports;var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},l=(e,t,i)=>(i=e==null?{}:n(o(e)),c(t||!e||!e.__esModule||!s.call(e,`default`)?r(i,`default`,{value:e,enumerable:!0}):i,e));let u=e("react"),d=e("react/jsx-runtime"),f=e("@deepseek-ai/dsh-client-ui-primitives");f=l(f,1);let p=e("react-dom"),m={tab:`上下文`,"sidebar.guideDescription":`查看上下文的构成、统计、演变。`,"cat.system":`系统提示词`,"cat.tools":`工具定义`,"cat.user":`用户消息`,"cat.inject":`注入内容`,"cat.skill":`技能注入`,"cat.assistant":`助手消息`,"cat.tool":`工具结果`,"overview.title":`当前上下文`,"overview.estimate":`tokens(估算)`,"overview.free":`剩余窗口`,"overview.used":`上下文已用`,"overview.ofUsed":`占已用上下文`,"overview.compactReserve":`自动压缩预留:占用达 {pct}% 窗口时触发压缩,此区域一般不实际占用`,"stats.title":`上下文统计`,"stats.session":`当前会话`,"stats.turns":`轮次`,"stats.steps":`步数`,"stats.answers":`模型回复`,"stats.skills":`技能加载`,"stats.skillsJump":`在上下文浏览器中展开技能注入`,"stats.answersJump":`在上下文浏览器中筛选回答`,"stats.humanInputs":`用户输入`,"stats.humanInputsTip":`当前会话中的用户消息与问题回答次数。`,"stats.io":`输入输出`,"stats.events":`上下文事件`,"stats.toolCalls":`工具调用`,"stats.toolsMore":`其他 +{n}`,"stats.cacheHit":`缓存命中`,"stats.cacheHitTip":`整个会话累计的缓存读取占计费输入的比例。`,"stats.cost":`费用`,"stats.costTip":`估算的费用,含当前智能体及所有层级的子智能体,仅供参考。`,"stats.costTipDeepseek":`DeepSeek 高峰时段(北京时间工作日 9:00–12:00、14:00–18:00)按挂牌价计费,其余时段半价。`,"stats.costTipCny":`人民币按 1 元 = 0.15 美元换算。`,"stats.currentAgent":`当前 Agent`,"stats.teamSubs":`子 Agent × {n}`,"stats.billedTip":`Token 用量为计费合计:未缓存输入、缓存读取、缓存写入与输出。`,"stats.subCostTip":`全部层级的子 Agent 会话各自累计费用(同口径估算)的合计,不含当前 Agent 自身。`,"stats.costPriceHead":`每百万 Token 价格:`,"stats.costPriceBy":`按 {p} · {m} 在 models.dev 的刊登价格如上。`,"stats.costHit":`缓存输入`,"stats.costMiss":`未缓存输入`,"stats.costWrite":`缓存写入`,"stats.costOut":`输出`,"stats.costUnavailable":`模型价格暂不可用(自动重试中),费用暂无法估算。`,"timing.title":`耗时统计`,"timing.total":`活跃时长`,"timing.ttft":`模型等待`,"timing.gen":`模型生成`,"timing.reasoning":`模型思考`,"timing.text":`模型回复`,"timing.toolArgs":`工具参数`,"timing.tools":`工具执行`,"timing.other":`其他开销`,"timing.callTimes":`{n}次`,"timing.toolTimes":`{n}次`,"timing.blockTimes":`{n}次`,"timing.empty":`暂无耗时数据 · 对话开始后这里会显示时长分布`,"timing.tps":`输出速度 {tps} tok/s`,"timing.tpsTip":`输出速度(TPS):累计解码输出 tokens ÷ 累计解码时长,与 DeepSeek Harness 会话统计同口径。`,"timing.strip":`耗时时间轴:各段按发生次序紧凑铺排,宽度为耗时占比,刻度为零、四分位与全程`,"tokens.title":`Token 统计`,"tokens.total":`总用量`,"tokens.output":`输出`,"tokens.outputNote":`含思考`,"plugin.title":`插件信息`,"plugin.hint":`The best DSH context plugin ⭐`,"plugin.name":`插件`,"plugin.github":`GitHub`,"plugin.settings":`插件设置`,"plugin.settingsOpen":`打开插件设置`,"trend.title":`上下文趋势`,"gran.step":`步骤`,"gran.turn":`轮次`,"settings.placement":`入口位置`,"placement.tab":`标签页`,"placement.sidebar":`侧边栏`,"placement.all":`全部`,"settings.insightsEntry":`上下文洞察入口`,"insightsEntry.show":`显示`,"insightsEntry.hide":`隐藏`,"settings.gran":`趋势图 · 默认粒度`,"settings.mode":`趋势图 · 默认展示方式`,"settings.durationCurve":`趋势图 · 耗时曲线`,"settings.deltaBase":`上下文浏览器 · 对比基线`,"settings.toolSort":`工具定义 · 默认排序`,"settings.fileSort":`文件活动 · 默认排序`,"settings.readOnly":`当前环境的设置为只读`,"gran.total":`全量`,"gran.delta":`增量`,"gran.modeHint":`全量:累计构成;增量:相对上一条请求的变化量`,"trend.adaptive":`自适应`,"trend.adaptiveHint":`按当前可视范围内的柱子重新缩放高度,滚动时随之变化`,"trend.duration":`耗时`,"trend.durationTip":`在柱子上叠加每步的活跃耗时曲线(步骤开始至结束,含模型与工具调用,不含等待你决策或回答的时间),按图中右侧的四分位坐标轴读数;轮次粒度下为一轮各步耗时之和`,"trend.dna":`DNA 模式`,"trend.dnaTip":`把每根柱子画成该次请求的上下文指纹:按模型读取顺序逐条铺色,配合增量模式逐条展示每次请求的增减;悬停查看条目,点击让上下文浏览器定位到该条目,同一条目在所有柱子中亮出其存续变化`,"trend.dnaItem":`{label}:{n}`,"trend.empty":`发起一轮对话后,这里会展示每次模型请求的上下文构成`,"detail.step":`第 {t} 轮 · 第 {s} 步 (共 {n} 步)`,"detail.turn":`第 {t} 轮 · 共 {n} 步`,"detail.lastStep":`末步`,"detail.estTotal":`估算合计 ≈ {n}`,"detail.actual":`实际 {n}`,"detail.output":`输出 {n}`,"detail.cache":`缓存 {n}%`,"brief.turn":`本轮`,"brief.input":`输入`,"brief.reply":`回复`,"brief.more":`+{n}`,"brief.noInputs":`(无新增)`,"brief.locate":`在上下文浏览器中查看`,"jump.title":`在上下文视图中查看此轮`,"brief.turnTip":`这一轮开场时用户发送的消息;回合内的每一步都会回显同一条`,"brief.inputTip":`上一步回复之后、本次请求发出前新进入上下文的内容——通常是上一步所调工具的结果;每轮的第一步无新增`,"brief.replyTip":`这一步模型返回的内容(文本回复或工具调用);此步发起的调用,其结果会出现在下一柱的「输入」行`,"events.title":`上下文事件`,"events.empty":`暂无上下文事件(压缩、注入、模型切换会出现在这里)`,"events.at":`第 {t} 轮 · 第 {s} 步`,"events.range":`第 {t} 轮 · 第 {a}→{b} 步`,"events.rangeTo":`第 {a} 轮 · 第 {as} 步 → 第 {b} 轮 · 第 {bs} 步`,"kind.inject":`注入`,"kind.compaction":`压缩`,"kind.prune":`剪枝`,"kind.model":`切换`,"kind.mode":`模式`,"files.title":`文件活动`,"files.scopeLatest":`截至最新 · 跟随趋势图的选择`,"files.kind.all":`全部`,"files.kind.read":`读取`,"files.kind.write":`写入`,"files.kind.search":`搜索`,"files.kind.image":`图片`,"files.chipTip":`{files} 个文件 · {ops} 次操作`,"files.search":`按路径过滤…`,"files.sort.count":`按次数`,"files.sort.latest":`按最新`,"files.sort.path":`按路径`,"files.sortTip":`文件排序:按操作次数(选中分类时按该分类的次数)、最近操作时间或路径`,"files.files":`{n} 个文件`,"files.deltaTip":`按 edit/write 调用参数估算的累计行数变化:+ 新增 / − 删除`,"files.empty":`该范围内没有文件读取、写入或搜索操作`,"files.noMatch":`没有匹配当前过滤条件的文件`,"files.locate":`在上下文浏览器中查看此次操作`,"files.hits":`{n} 处命中`,"files.readTip":`读取第 {a}–{b} 行`,"files.open":`在系统中打开`,"files.preview":`在侧边栏预览`,"files.readEst":`按调用参数 limit 估算的读取行数`,"files.errs":`{n} 次失败`,"files.form.image":`图片`,"files.form.dir":`目录`,"files.form.text":`文件`,"files.glyph.root":`工作区根`,"files.glyph.tests":`测试`,"files.glyph.docs":`文档目录`,"files.glyph.deps":`依赖`,"files.glyph.build":`构建产物`,"files.glyph.scripts":`脚本`,"files.glyph.config":`配置`,"files.glyph.assets":`静态资源`,"files.glyph.hidden":`元数据目录`,"files.glyph.lock":`锁文件`,"files.glyph.docker":`Docker`,"files.glyph.ignore":`忽略规则`,"files.glyph.license":`许可证`,"files.glyph.python":`Python`,"files.glyph.notebook":`Notebook`,"files.glyph.shell":`Shell`,"files.glyph.style":`样式`,"files.glyph.database":`数据库`,"files.glyph.data":`数据清单`,"files.glyph.markdown":`标记文档`,"files.glyph.log":`日志`,"files.glyph.sheet":`表格`,"files.glyph.document":`文档`,"files.glyph.archive":`压缩包`,"files.glyph.font":`字体`,"files.glyph.media":`媒体`,"files.glyph.lang.ts":`TypeScript`,"files.glyph.lang.js":`JavaScript`,"files.glyph.lang.go":`Go`,"files.glyph.lang.rust":`Rust`,"files.glyph.lang.java":`Java`,"files.glyph.lang.kotlin":`Kotlin`,"files.glyph.lang.ruby":`Ruby`,"files.glyph.lang.php":`PHP`,"files.glyph.lang.c":`C`,"files.glyph.lang.cpp":`C++`,"files.glyph.lang.csharp":`C#`,"files.glyph.lang.scala":`Scala`,"files.glyph.lang.lua":`Lua`,"files.glyph.lang.dart":`Dart`,"files.glyph.lang.swift":`Swift`,"files.glyph.lang.vue":`Vue`,"files.glyph.lang.svelte":`Svelte`,"files.glyph.lang.html":`HTML`,"agents.title":`Agent 网络`,"agents.sub":`当前 Agent 与子 Agent 的实时上下文 · 点击节点跳转会话`,"agents.chip.count":`{n} 个 Agent`,"agents.chip.running":`{n} 个运行中`,"agents.chip.tokens":`上下文合计 {n}`,"agents.more":`另有 {n} 个未显示`,"agents.solo":`还没有子 Agent — 当 Agent 通过 subagent 工具委派任务时,协作网络会在这里展开`,"agents.self":`当前`,"agents.running":`运行中`,"agents.legend.free":`空闲窗口`,"agents.oneshot":`一次性`,"agents.continuable":`多轮`,"agents.steps":`{n} 步`,"agents.billed":`累计计费 {n}`,"agents.open":`点击打开会话 →`,loading:`正在读取会话日志…`,"detail.loading":`正在加载历史数据…`,"detail.loadFailed":`历史数据加载失败,点击重试`,error:`上下文数据读取失败:`,"error.retry":`重试`,"gate.title":`请更新 DeepSeek Harness 版本`,"gate.body":`dsh-context 插件支持 DeepSeek Harness v{minimum} 或更新版本。`,"gate.current":`当前版本`,"gate.minimum":`最低要求`,"gate.orNewer":`及更新的版本`,"gate.ok":`知道了`,footer:`Token 数量统计:「估算」与 DeepSeek Harness 内置 tokenMeter 相同的固定密度启发式(约 4 字符 ≈ 1 token);「实际」为供应商上报用量。`,"tip.step":`第 {t} 轮 · 第 {s} 步 (共 {n} 步)`,"tip.turn":`第 {t} 轮 · 共 {n} 步`,"tip.turn1":`第 {t} 轮 · 共 1 步`,"tip.total":`合计 ≈ {n}`,"tip.cat":`{cat} ≈ {n}`,"tip.delta":`Δ {n}`,"tip.duration":`耗时 {n}`,"ev.compaction":`压缩上下文(摘要替换 {n} 条消息)`,"ev.prune":`剪枝工具输出`,"ev.skill":`Skill 注入({name})`,"ev.model":`模型切换:{a} → {b}`,"ev.mode.plan.on":`进入计划模式`,"ev.mode.plan.off":`退出计划模式`,"form.instructions":`指令注入`,"form.catalog":`目录更新`,"form.snapshot":`状态快照`,"form.notice":`通知`,"form.relay":`代理转发`,"form.recall":`历史召回`,"form.context":`上下文注入`,"node.toolResult":`工具结果`,"node.calls":`调用 `,"node.empty":`(空回复)`,"node.nonText":`(非文本消息)`,"node.snapshot":`快照: `,"node.skillTag":`技能 · {name}`,"cmd.label":`上下文`,"cmd.section":`上下文`,"cmd.desc":`查看当前上下文构成,浏览各步骤组成`,"cmd.close":`关闭`,"browser.title":`上下文浏览器`,"browser.live":`当前(下一次请求)`,"browser.liveNow":`当前 · 下一次请求`,"browser.items":`{n} 项`,"browser.stepAt":`T{t} S{s}`,"browser.stepAtTip":`首次随第 {t} 轮 · 第 {s} 步的请求进入上下文`,"browser.stepPendingTip":`预计随第 {t} 轮 · 第 {s} 步的请求进入上下文(尚未发送)`,"browser.missingLive":`… 另有 {n} 条更早的消息也在上下文中(超出展示窗口)`,"browser.approx":`该步骤涉及的部分已移除消息超出保留范围,以下为近似构成`,"browser.base.step":`比前步`,"browser.base.turn":`比前轮`,"browser.base.tip":`变动对比的基线:比前步=与上一步对比;比前轮=与上一轮最后一步对比(首轮无基线,全部计为变动)`,"browser.dna":`DNA 模式`,"browser.dnaTip":`按模型读取上下文的次序逐条展示每一项:系统提示词、工具定义,然后是按时间排列的消息;悬停查看条目,点击定位到下方列表`,"browser.noHeader":`此数据来自旧版插件:仅提供 token 估算,无实际内容`,"browser.noEpoch":`该步骤的头部内容(系统提示词 / 工具定义)不在保留范围内`,"browser.headerMetaOnly":`此环境不支持按需读取头部内容,仅显示 token 估算`,"browser.noSystem":`该请求头部未包含系统提示词`,"browser.noContent":`完整内容不在当前加载的消息窗口内(在聊天页加载更早历史后可查看)`,"browser.search.user":`按消息内容过滤…`,"browser.search.inject":`按注入内容过滤…`,"browser.search.skill":`按技能过滤…`,"browser.search.assistant":`按回复、调用或思考过滤…`,"browser.search.tool":`按工具或参数过滤…`,"browser.kind.think":`思考`,"browser.kind.tool":`工具`,"browser.kind.answer":`回答`,"browser.kindTip":`按内容种类过滤回复:思考、工具调用、回答文本`,"browser.rowNoMatch":`没有匹配当前过滤条件的行`,"browser.loading":`正在从更早的会话历史加载完整内容…`,"browser.notInLog":`会话日志中未找到该条目的完整内容(可能已被压缩或清理)`,"browser.loadFailed":`内容加载失败,点击重试`,"tool.desc":`描述`,"tool.params":`参数`,"tool.paramsEmpty":`(无参数)`,"tool.plugin":`该工具的注册插件(仅供参考)`,"tool.unknown":`未知插件`,"tool.unknownTitle":`因早于上下文插件加载或原插件已卸载,无法查询该工具的提供者`,"tool.jsonToggle":`查看原始 JSON`,"tool.jsonHide":`收起`,"tool.search":`按名称、描述或参数过滤…`,"tool.sort.size":`按大小`,"tool.sort.count":`按次数`,"tool.sort.name":`按名称`,"tool.sortTip":`工具排序:按当前步骤中的调用次数(默认)、token 大小或名称`,"tool.hitsTip":`当前展示步骤的上下文中,该工具被调用并返回结果的次数`,"tool.noMatch":`没有匹配当前过滤条件的工具`,"rich.raw":`原文`,"rich.md":`Markdown`,"rich.toMd":`按 Markdown 渲染查看`,"rich.toRaw":`查看原始文本`,"rich.copy":`复制原文`,"rich.copied":`已复制`,"rich.md.copy":`复制`,"rich.md.copied":`已复制`,"rich.md.footnotes":`脚注`,"rich.find":`在文本中查找`,"rich.findPlaceholder":`查找…`,"rich.findPrev":`上一个匹配`,"rich.findNext":`下一个匹配`,"rich.findClose":`关闭查找`,"block.thinking":`思考`,"block.answer":`回答`,"block.content":`内容`,"block.result":`结果`,"block.summary":`摘要`,"block.line":`{n} 行`,"block.lines":`{n} 行`,"call.ok":`正常`,"call.fail":`失败`,"call.exit":`exit {n}`,"node.failed":`工具执行失败`,"attach.images":`图片附件`,"attach.other":`其他内容`,"attach.image":`图片`,"attach.open":`查看原图`,"attach.preview":`图片预览`,"attach.close":`关闭`,"attach.loading":`…`,"attach.loadFailed":`加载失败 · 点击重试`,"attach.raw":`原图`,"attach.sent":`发送`,"attach.token":`Token`,"attach.tokensTip":`按 DeepSeek 官方图片尺寸换算(单图上限 384 tokens)估算的 token 消耗`,"ov.title":`上下文洞察`,"ov.unavailable":`会话列表暂不可用`,"ov.range.label":`统计范围`,"ov.range.today":`今天`,"ov.range.7d":`近 7 天`,"ov.range.30d":`近 30 天`,"ov.range.all":`全部`,"ov.date.label":`日期范围`,"ov.date.open":`选择自定义日期范围`,"ov.date.from":`开始日期`,"ov.date.to":`结束日期`,"ov.date.pick":`选择日期`,"ov.date.prev":`上个月`,"ov.date.next":`下个月`,"ov.date.hint":`点击选择开始日期`,"ov.date.hintEnd":`再点一下选择结束日期`,"ov.date.clear":`清除`,"ov.date.wd.0":`日`,"ov.date.wd.1":`一`,"ov.date.wd.2":`二`,"ov.date.wd.3":`三`,"ov.date.wd.4":`四`,"ov.date.wd.5":`五`,"ov.date.wd.6":`六`,"ov.kpi.sessions":`活跃会话`,"ov.kpi.ofTotal":`共 {n} 个`,"ov.kpi.tokens":`累计消耗`,"ov.kpi.sessionsSub":`含 {n} 个会话`,"ov.kpi.pricedSub":`已计价 {n}/{total} 个会话`,"ov.kpi.toolSub":`工具执行 {dur}`,"ov.kpi.wallSub":`模型调用 {n}`,"ov.stats.empty":`统计范围内暂无 Token 用量`,"ov.usage.title":`近 7 天用量`,"ov.usage.tokens":`Token`,"ov.usage.cost":`费用(仅含支持计价映射的模型)`,"ov.usage.costTip":`费用`,"ov.usage.empty":`近 7 天暂无用量 — 会话产生模型请求后,这里会显示每日 Token 与费用`,"balance.title":`DeepSeek 余额`,"balance.tip.granted":`赠送余额`,"balance.tip.toppedUp":`充值余额`,"ov.heat.title":`活跃度`,"ov.heat.sub":`按日期筛选`,"ov.heat.empty":`暂无活跃数据 — 会话产生模型请求后,这里会显示每日用量`,"ov.heat.sessions":`{n} 个活跃会话`,"ov.heat.less":`少`,"ov.heat.more":`多`,"ov.heat.metric":`指标`,"ov.heat.metric.sessions":`会话`,"ov.heat.metric.steps":`步数`,"ov.heat.steps":`{n} 步`,"ov.heat.wd.1":`星期一`,"ov.heat.wd.3":`星期三`,"ov.heat.wd.5":`星期五`,"ov.heat.mon.01":`1月`,"ov.heat.mon.02":`2月`,"ov.heat.mon.03":`3月`,"ov.heat.mon.04":`4月`,"ov.heat.mon.05":`5月`,"ov.heat.mon.06":`6月`,"ov.heat.mon.07":`7月`,"ov.heat.mon.08":`8月`,"ov.heat.mon.09":`9月`,"ov.heat.mon.10":`10月`,"ov.heat.mon.11":`11月`,"ov.heat.mon.12":`12月`,"ov.skills.empty":`统计范围内暂无技能加载 — 加载技能后,这里会按名称列出次数与最近加载`,"ov.skills.noMatch":`没有匹配当前筛选的技能`,"ov.skills.search":`搜索技能…`,"ov.skills.more":`另有 {n} 个技能`,"ov.skills.loads":`{n} 次加载`,"ov.skills.summary":`{skills} 个技能 · {loads} 次加载`,"ov.skills.sortLabel":`技能排序`,"ov.skills.sort.loads":`次数`,"ov.skills.sort.recent":`最近`,"ov.skills.sessions":`{n} 个会话`,"ov.skills.clickFilter":`点击筛选加载过它的会话`,"ov.skills.clickRelease":`再次点击取消筛选`,"ov.skills.src.project":`项目`,"ov.skills.src.user":`用户`,"ov.skills.src.bundled":`内置`,"ov.skills.k.source":`来源`,"ov.skills.k.usage":`用量`,"ov.skills.k.last":`最近`,"ov.skills.k.path":`路径`,"ov.skills.copyPath":`点击复制路径`,"ov.skills.copied":`已复制`,"ov.list.title":`会话`,"ov.list.search":`搜索标题 / 目录 / 最后消息…`,"ov.list.sortLabel":`排序`,"ov.list.sort.recent":`最近更新`,"ov.list.sort.tokens":`Token 总用量`,"ov.list.sort.context":`当前 Context`,"ov.list.empty":`还没有会话 — 发起一轮对话后,这里会列出每个会话的上下文画像`,"ov.list.noMatch":`没有匹配当前筛选条件的会话`,"ov.list.noData":`暂无上下文数据 — 该会话产生模型请求后才会统计`,"ov.list.dayFilter":`{day} 当日活跃`,"ov.list.dayClear":`清除日期筛选`,"ov.list.skillClear":`清除技能筛选`,"ov.list.pager":`会话分页`,"ov.list.page":`第 {n} / {total} 页`,"ov.list.prev":`上一页`,"ov.list.next":`下一页`,"ov.group.label":`分组`,"ov.group.ungrouped":`未分组`,"ov.running":`运行中`,"ov.current":`当前`,"ov.card.turns":`{n} 轮 {s} 步`,"ov.card.teamUsage":`Token 总用量`,"ov.card.teamCost":`总预估费用`,"ov.card.lastUser":`最后消息`,"ov.time.now":`刚刚`,"ov.time.m":`{n} 分钟前`,"ov.time.h":`{n} 小时前`,"ov.time.d":`{n} 天前`},h={tab:`Context`,"sidebar.guideDescription":`Inspect context composition, stats, and evolution.`,"cat.system":`System Prompt`,"cat.tools":`Tool Schemas`,"cat.user":`User Messages`,"cat.inject":`Injected Context`,"cat.skill":`Skill Injections`,"cat.assistant":`Assistant Messages`,"cat.tool":`Tool Results`,"overview.title":`Current Context`,"overview.estimate":`tokens (estimated)`,"overview.free":`Free Window`,"overview.used":`of context used`,"overview.ofUsed":`of used context`,"overview.compactReserve":`Auto-compaction reserve: auto-compaction triggers at {pct}% of the window — this area is normally kept as headroom, not actually used`,"stats.title":`Context Stats`,"stats.session":`Current Session`,"stats.turns":`Turns`,"stats.steps":`Steps`,"stats.answers":`Answers`,"stats.skills":`Skill Loads`,"stats.skillsJump":`Open Skill Injections in the Context Browser`,"stats.answersJump":`Filter Answers in the Context Browser`,"stats.humanInputs":`Human Inputs`,"stats.humanInputsTip":`User messages and question answerings in current session.`,"stats.io":`Input / Output`,"stats.events":`Context Events`,"stats.toolCalls":`Tool Calls`,"stats.toolsMore":`+{n} more`,"stats.cacheHit":`Cache Hit`,"stats.cacheHitTip":`Cumulative cache-read share of billed input across the session.`,"stats.cost":`Cost`,"stats.costTip":`Estimated cost for this agent and every descendant subagent session, for reference only.`,"stats.costTipDeepseek":`DeepSeek bills peak windows (Beijing Time weekdays 09:00–12:00, 14:00–18:00) at list price; all other hours are half price.`,"stats.costTipCny":`The CNY display converts at 1 CNY = 0.15 USD.`,"stats.currentAgent":`Current Agent`,"stats.teamSubs":`Subagents × {n}`,"stats.billedTip":`Token usage is the billed total: uncached input, cache read, cache write, and output.`,"stats.subCostTip":`Summed estimates of every descendant subagent session’s own cumulative cost — all levels of the subtree (same basis); the current agent is not included.`,"stats.costPriceHead":`Per-1M-token rates:`,"stats.costPriceBy":`Priced as listed on models.dev for {p} · {m}.`,"stats.costHit":`Cache input`,"stats.costMiss":`Uncached input`,"stats.costWrite":`Cache write`,"stats.costOut":`Output`,"stats.costUnavailable":`Model prices are unavailable (retrying automatically) — the cost cannot be estimated yet.`,"timing.title":`Timing Stats`,"timing.total":`Active Time`,"timing.ttft":`TTFT`,"timing.gen":`LLM Gen`,"timing.reasoning":`Thinking`,"timing.text":`Answers`,"timing.toolArgs":`Tool args`,"timing.tools":`Tool runs`,"timing.other":`Overhead`,"timing.callTimes":`{n} calls`,"timing.toolTimes":`{n} runs`,"timing.blockTimes":`{n} blocks`,"timing.empty":`No timing data yet — durations appear as the conversation runs`,"timing.tps":`TPS {tps} tok/s`,"timing.tpsTip":`Output speed (TPS): summed decoded output tokens over summed decode time — the same pairing as the harness session stats.`,"timing.strip":`Session-time strip: slices packed in occurrence order, width as share of the active time; ticks at zero, the quartiles, and the full span`,"tokens.title":`Token Stats`,"tokens.total":`Total`,"tokens.output":`Output`,"tokens.outputNote":`incl. reasoning`,"plugin.title":`Plugin Info`,"plugin.hint":`The best DSH context plugin ⭐`,"plugin.name":`Plugin`,"plugin.github":`GitHub`,"plugin.settings":`Plugin Settings`,"plugin.settingsOpen":`Open plugin settings`,"trend.title":`Context Trend`,"gran.step":`Step`,"gran.turn":`Turn`,"settings.placement":`Entry Options`,"placement.tab":`Tab`,"placement.sidebar":`Sidebar`,"placement.all":`All`,"settings.insightsEntry":`Context Insights entry`,"insightsEntry.show":`Show`,"insightsEntry.hide":`Hide`,"settings.gran":`Trend Chart · Default granularity`,"settings.mode":`Trend Chart · Default display`,"settings.durationCurve":`Trend Chart · Duration curve`,"settings.deltaBase":`Context Browser · Diff baseline`,"settings.toolSort":`Tool Schemas · Default sort`,"settings.fileSort":`File Activity · Default sort`,"settings.readOnly":`Settings are read-only in this environment`,"gran.total":`Total`,"gran.delta":`Delta`,"gran.modeHint":`Total: cumulative makeup; Delta: change vs the previous request`,"trend.adaptive":`Adaptive`,"trend.adaptiveHint":`Rescale bar heights to the visible range, following the scroll`,"trend.duration":`Duration`,"trend.durationTip":`Overlay each step’s active time (step start to end — model and tool calls, excluding waits for your decisions or answers) as a curve over the bars, read off the quartile axis on the chart’s right; turn granularity sums a turn’s steps`,"trend.dna":`DNA Mode`,"trend.dnaTip":`Draw each bar as that request’s context fingerprint — one band per item in the order the model reads it; with Delta, each band shows that item’s change against the previous bar. Hover for the item, click to reveal it in the Context browser, and every bar lights the same item’s lifetime`,"trend.dnaItem":`{label}: {n}`,"trend.empty":`Send a message and each model request’s context makeup shows up here`,"detail.step":`Turn {t} · Step {s} of {n}`,"detail.turn":`Turn {t} · {n} steps`,"detail.lastStep":`Last Step`,"detail.estTotal":`Estimated ≈ {n}`,"detail.actual":`Actual {n}`,"detail.output":`Output {n}`,"detail.cache":`Cache {n}%`,"brief.turn":`User`,"brief.input":`In`,"brief.reply":`Response`,"brief.more":`+{n}`,"brief.noInputs":`(nothing new)`,"brief.locate":`Reveal in Context Browser`,"jump.title":`View this turn in the Context view`,"brief.turnTip":`The user message that opened this turn — every step of the turn recalls it`,"brief.inputTip":`What entered after the previous reply and before this request went out — usually the previous tool-call results; a turn opener has nothing new`,"brief.replyTip":`What the model returned on this step (a text reply or tool calls) — results of calls made here appear in the In row of the next bar`,"events.title":`Context Events`,"events.empty":`No context events yet (compaction, injections, model switches appear here)`,"events.at":`Turn {t} · Step {s}`,"events.range":`Turn {t} · Step {a}→{b}`,"events.rangeTo":`Turn {a} · Step {as} → Turn {b} · Step {bs}`,"kind.inject":`Inject`,"kind.compaction":`Compact`,"kind.prune":`Prune`,"kind.model":`Switch`,"kind.mode":`Mode`,"files.title":`File Activity`,"files.scopeLatest":`Up to latest · follows the trend chart pick`,"files.kind.all":`All`,"files.kind.read":`Read`,"files.kind.write":`Written`,"files.kind.search":`Searched`,"files.kind.image":`Images`,"files.chipTip":`{files} files · {ops} ops`,"files.search":`Filter by path…`,"files.sort.count":`Most active`,"files.sort.latest":`Latest`,"files.sort.path":`By path`,"files.sortTip":`Sort files by operation counts (of the selected kind when a kind chip is active), most recent activity, or path`,"files.files":`{n} files`,"files.deltaTip":`Cumulative line change estimated from edit/write call arguments: + added / − removed`,"files.empty":`No file reads, writes, or searches in this range`,"files.noMatch":`No files match the current filters`,"files.locate":`Reveal this operation in the Context Browser`,"files.hits":`{n} hits`,"files.readTip":`Read lines {a}–{b}`,"files.open":`Open on your system`,"files.preview":`Preview in the sidebar`,"files.readEst":`Lines read, estimated from the limit argument`,"files.errs":`{n} failed`,"files.form.image":`Image`,"files.form.dir":`Directory`,"files.form.text":`File`,"files.glyph.root":`Workspace root`,"files.glyph.tests":`Tests`,"files.glyph.docs":`Docs`,"files.glyph.deps":`Dependencies`,"files.glyph.build":`Build output`,"files.glyph.scripts":`Scripts`,"files.glyph.config":`Config`,"files.glyph.assets":`Assets`,"files.glyph.hidden":`Metadata directory`,"files.glyph.lock":`Lockfile`,"files.glyph.docker":`Docker`,"files.glyph.ignore":`Ignore rules`,"files.glyph.license":`License`,"files.glyph.python":`Python`,"files.glyph.notebook":`Notebook`,"files.glyph.shell":`Shell`,"files.glyph.style":`Styles`,"files.glyph.database":`Database`,"files.glyph.data":`Data / manifest`,"files.glyph.markdown":`Markup document`,"files.glyph.log":`Log`,"files.glyph.sheet":`Spreadsheet`,"files.glyph.document":`Document`,"files.glyph.archive":`Archive`,"files.glyph.font":`Font`,"files.glyph.media":`Media`,"files.glyph.lang.ts":`TypeScript`,"files.glyph.lang.js":`JavaScript`,"files.glyph.lang.go":`Go`,"files.glyph.lang.rust":`Rust`,"files.glyph.lang.java":`Java`,"files.glyph.lang.kotlin":`Kotlin`,"files.glyph.lang.ruby":`Ruby`,"files.glyph.lang.php":`PHP`,"files.glyph.lang.c":`C`,"files.glyph.lang.cpp":`C++`,"files.glyph.lang.csharp":`C#`,"files.glyph.lang.scala":`Scala`,"files.glyph.lang.lua":`Lua`,"files.glyph.lang.dart":`Dart`,"files.glyph.lang.swift":`Swift`,"files.glyph.lang.vue":`Vue`,"files.glyph.lang.svelte":`Svelte`,"files.glyph.lang.html":`HTML`,"agents.title":`Agent Network`,"agents.sub":`Live context of this agent and its subagents · click a node to open its session`,"agents.chip.count":`{n} agents`,"agents.chip.running":`{n} running`,"agents.chip.tokens":`{n} tokens in context`,"agents.more":`{n} more not shown`,"agents.solo":`No subagents yet — when the agent delegates work through the subagent tool, the network unfolds here`,"agents.self":`current`,"agents.running":`running`,"agents.legend.free":`free window`,"agents.oneshot":`one-shot`,"agents.continuable":`continuable`,"agents.steps":`{n} steps`,"agents.billed":`{n} billed`,"agents.open":`click to open →`,loading:`Reading the session log…`,"detail.loading":`Loading history…`,"detail.loadFailed":`History failed to load — click to retry`,error:`Failed to read context data: `,"error.retry":`Retry`,"gate.title":`Update DeepSeek Harness`,"gate.body":`dsh-context supports DeepSeek Harness v{minimum} or newer.`,"gate.current":`Current`,"gate.minimum":`Minimum required`,"gate.orNewer":`or newer`,"gate.ok":`Got it`,footer:`Token amount: “Estimated” uses the same fixed-density heuristic as DeepSeek Harness’s built-in tokenMeter (~4 chars ≈ 1 token); “Actual” is provider-reported usage.`,"tip.step":`Turn {t} · Step {s} of {n}`,"tip.turn":`Turn {t} · {n} steps`,"tip.turn1":`Turn {t} · 1 step`,"tip.total":`Total ≈ {n}`,"tip.cat":`{cat} ≈ {n}`,"tip.delta":`Δ {n}`,"tip.duration":`Duration {n}`,"ev.compaction":`Context compacted (summary replaced {n} messages)`,"ev.prune":`Tool output pruned`,"ev.skill":`Skill injected ({name})`,"ev.model":`Model switched: {a} → {b}`,"ev.mode.plan.on":`Plan mode on`,"ev.mode.plan.off":`Plan mode off`,"form.instructions":`Instructions`,"form.catalog":`Catalog Update`,"form.snapshot":`State Snapshot`,"form.notice":`Notice`,"form.relay":`Agent Relay`,"form.recall":`Recall`,"form.context":`Context Injection`,"node.toolResult":`Tool Result`,"node.calls":`Calls `,"node.empty":`(empty reply)`,"node.nonText":`(non-text message)`,"node.snapshot":`Snapshot: `,"node.skillTag":`Skill · {name}`,"cmd.label":`Context`,"cmd.section":`Context`,"cmd.desc":`View current context makeup, browse per-step composition`,"cmd.close":`Close`,"browser.title":`Context Browser`,"browser.live":`Live (Next Request)`,"browser.liveNow":`Live · Next Request`,"browser.items":`{n} Items`,"browser.stepAt":`T{t} S{s}`,"browser.stepAtTip":`First carried by the Turn {t} · Step {s} request`,"browser.stepPendingTip":`Expected in the Turn {t} · Step {s} request (not yet sent)`,"browser.missingLive":`… {n} earlier messages are also part of the context (outside the served window)`,"browser.approx":`Some removed messages of this step exceed retention — the makeup below is approximate`,"browser.base.step":`prev step`,"browser.base.turn":`prev turn`,"browser.base.tip":`Diff baseline: the previous step, or the previous turn’s last step — with no predecessor, everything counts as change`,"browser.dna":`DNA Mode`,"browser.dnaTip":`One band per item in the order the model reads the context — system prompt, tool schemas, then messages chronologically; hover for details, click to open its row below`,"browser.noHeader":`Served by an older plugin build: token estimates only, no content`,"browser.noEpoch":`The header content (System Prompt / Tool Schemas) of this step is outside retention`,"browser.headerMetaOnly":`This environment cannot fetch header content on demand; token estimates only`,"browser.noSystem":`This request header carried no system prompt`,"browser.noContent":`Full content is outside the loaded message window (load older history in Chat to view)`,"browser.search.user":`Filter by message text…`,"browser.search.inject":`Filter injected context…`,"browser.search.skill":`Filter skills…`,"browser.search.assistant":`Filter by reply, calls, or thinking…`,"browser.search.tool":`Filter by tool or arguments…`,"browser.kind.think":`Thinking`,"browser.kind.tool":`Tools`,"browser.kind.answer":`Answer`,"browser.kindTip":`Filter replies by content kind: thinking, tool calls, or answer text`,"browser.rowNoMatch":`No rows match the current filter`,"browser.loading":`Loading full content from older session history…`,"browser.notInLog":`This item is not in the session log anymore (it may have been compacted away or cleared)`,"browser.loadFailed":`Load failed — click to retry`,"tool.desc":`Description`,"tool.params":`Parameters`,"tool.paramsEmpty":`(no parameters)`,"tool.plugin":`The registering plugin of this tool (for reference)`,"tool.unknown":`Unknown plugin`,"tool.unknownTitle":`The tool was registered before the context plugin loaded, or its plugin has been unloaded, so its provider cannot be determined`,"tool.jsonToggle":`View Raw JSON`,"tool.jsonHide":`Collapse`,"tool.search":`Filter by name, description, or parameters…`,"tool.sort.size":`By size`,"tool.sort.count":`By calls`,"tool.sort.name":`By name`,"tool.sortTip":`Sort tools by call count in the shown step (default), token size, or name`,"tool.hitsTip":`Times this tool was called and answered within the shown step’s context`,"tool.noMatch":`No tools match the current filter`,"rich.raw":`Raw`,"rich.md":`Markdown`,"rich.toMd":`View as Markdown`,"rich.toRaw":`View Raw Text`,"rich.copy":`Copy Raw Text`,"rich.copied":`Copied`,"rich.md.copy":`Copy`,"rich.md.copied":`Copied`,"rich.md.footnotes":`Footnotes`,"rich.find":`Find in Text`,"rich.findPlaceholder":`Find…`,"rich.findPrev":`Previous Match`,"rich.findNext":`Next Match`,"rich.findClose":`Close Find`,"block.thinking":`Reasoning`,"block.answer":`Answer`,"block.content":`Content`,"block.result":`Result`,"block.summary":`Summary`,"block.line":`1 line`,"block.lines":`{n} lines`,"call.ok":`OK`,"call.fail":`Failed`,"call.exit":`exit {n}`,"node.failed":`Tool execution failed`,"attach.images":`Images`,"attach.other":`Other content`,"attach.image":`Image`,"attach.open":`Open full image`,"attach.preview":`Image preview`,"attach.close":`Close`,"attach.loading":`…`,"attach.loadFailed":`Load failed · click to retry`,"attach.raw":`Raw`,"attach.sent":`Sent`,"attach.token":`Token`,"attach.tokensTip":`Estimated token cost via DeepSeek's official image-size conversion (384-token cap per image)`,"ov.title":`Context Insights`,"ov.unavailable":`The session list is unavailable`,"ov.range.label":`Range`,"ov.range.today":`Today`,"ov.range.7d":`Last 7 days`,"ov.range.30d":`Last 30 days`,"ov.range.all":`All`,"ov.date.label":`Date range`,"ov.date.open":`Pick a custom date range`,"ov.date.from":`Start date`,"ov.date.to":`End date`,"ov.date.pick":`Pick a date`,"ov.date.prev":`Previous month`,"ov.date.next":`Next month`,"ov.date.hint":`Click a start date`,"ov.date.hintEnd":`Now click the end date`,"ov.date.clear":`Clear`,"ov.date.wd.0":`S`,"ov.date.wd.1":`M`,"ov.date.wd.2":`T`,"ov.date.wd.3":`W`,"ov.date.wd.4":`T`,"ov.date.wd.5":`F`,"ov.date.wd.6":`S`,"ov.kpi.sessions":`Active Sessions`,"ov.kpi.ofTotal":`of {n} total`,"ov.kpi.tokens":`Tokens Used`,"ov.kpi.sessionsSub":`across {n} sessions`,"ov.kpi.pricedSub":`{n} of {total} sessions priced`,"ov.kpi.toolSub":`tool runs {dur}`,"ov.kpi.wallSub":`{n} model calls`,"ov.stats.empty":`No billed tokens in this range`,"ov.usage.title":`Last 7 Days`,"ov.usage.tokens":`Tokens`,"ov.usage.cost":`Cost (price-mapped models only)`,"ov.usage.costTip":`Cost`,"ov.usage.empty":`No usage in the last 7 days — daily tokens and cost appear once sessions make model requests`,"balance.title":`DeepSeek balance`,"balance.tip.granted":`Granted balance`,"balance.tip.toppedUp":`Topped-up balance`,"ov.heat.title":`Activity`,"ov.heat.sub":`Filter by date`,"ov.heat.empty":`No activity yet — daily usage appears once sessions make model requests`,"ov.heat.sessions":`{n} active sessions`,"ov.heat.less":`Less`,"ov.heat.more":`More`,"ov.heat.metric":`Metric`,"ov.heat.metric.sessions":`Sessions`,"ov.heat.metric.steps":`Steps`,"ov.heat.steps":`{n} steps`,"ov.heat.wd.1":`Mon`,"ov.heat.wd.3":`Wed`,"ov.heat.wd.5":`Fri`,"ov.heat.mon.01":`Jan`,"ov.heat.mon.02":`Feb`,"ov.heat.mon.03":`Mar`,"ov.heat.mon.04":`Apr`,"ov.heat.mon.05":`May`,"ov.heat.mon.06":`Jun`,"ov.heat.mon.07":`Jul`,"ov.heat.mon.08":`Aug`,"ov.heat.mon.09":`Sep`,"ov.heat.mon.10":`Oct`,"ov.heat.mon.11":`Nov`,"ov.heat.mon.12":`Dec`,"ov.skills.empty":`No skill loads in this range — loaded skills appear here with their counts and last load`,"ov.skills.noMatch":`No skills match the current filter`,"ov.skills.search":`Search skills…`,"ov.skills.more":`{n} more skills`,"ov.skills.loads":`{n} loads`,"ov.skills.summary":`{skills} skills · {loads} loads`,"ov.skills.sortLabel":`Skill sort`,"ov.skills.sort.loads":`Loads`,"ov.skills.sort.recent":`Recent`,"ov.skills.sessions":`{n} sessions`,"ov.skills.clickFilter":`Click to filter the sessions that loaded it`,"ov.skills.clickRelease":`Click again to release the filter`,"ov.skills.src.project":`Project`,"ov.skills.src.user":`User`,"ov.skills.src.bundled":`Built-in`,"ov.skills.k.source":`Source`,"ov.skills.k.usage":`Usage`,"ov.skills.k.last":`Last`,"ov.skills.k.path":`Path`,"ov.skills.copyPath":`Click to copy the path`,"ov.skills.copied":`Copied`,"ov.list.title":`Sessions`,"ov.list.search":`Search title / path / last message…`,"ov.list.sortLabel":`Sort`,"ov.list.sort.recent":`Last updated`,"ov.list.sort.tokens":`Total Tokens`,"ov.list.sort.context":`Current Context`,"ov.list.empty":`No sessions yet — each session’s context profile appears here once you start one`,"ov.list.noMatch":`No sessions match the current filters`,"ov.list.noData":`No context data yet — stats appear once the session makes model requests`,"ov.list.dayFilter":`active on {day}`,"ov.list.dayClear":`Clear the day filter`,"ov.list.skillClear":`Clear the skill filter`,"ov.list.pager":`Session pagination`,"ov.list.page":`Page {n} of {total}`,"ov.list.prev":`Previous page`,"ov.list.next":`Next page`,"ov.group.label":`Group`,"ov.group.ungrouped":`Ungrouped`,"ov.running":`Running`,"ov.current":`current`,"ov.card.turns":`{n} turns · {s} steps`,"ov.card.teamUsage":`Total Tokens`,"ov.card.teamCost":`Total Est. Cost`,"ov.card.lastUser":`Last message`,"ov.time.now":`just now`,"ov.time.m":`{n}m ago`,"ov.time.h":`{n}h ago`,"ov.time.d":`{n}d ago`};var g=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path d="M899.984 19.873h-3.452c-26.123 0-47.296 21.172-47.296 47.296v888.508c0 26.127 21.173 47.298 47.296 47.298h3.452c26.119 0 47.297-21.171 47.297-47.298V67.169c0-26.124-21.177-47.296-47.297-47.296z" fill="#4A5699"/><path d="M132.643 19.873h-3.449c-26.12 0-47.296 21.172-47.296 47.296v888.508c0 26.127 21.177 47.298 47.296 47.298h3.449c26.123 0 47.299-21.171 47.299-47.298V67.169c0-26.124-21.176-47.296-47.299-47.296z" fill="#C45FA0"/><path d="M899.463 19.873H129.194c-26.12 0-47.296 21.172-47.296 47.296v3.377c0 26.12 21.177 47.299 47.296 47.299h770.269c26.123 0 47.296-21.179 47.296-47.299v-3.377c0-26.124-21.173-47.296-47.296-47.296z" fill="#6277BA"/><path d="M899.463 905.006H129.194c-26.12 0-47.296 21.17-47.296 47.29v3.381c0 26.127 21.177 47.298 47.296 47.298h770.269c26.123 0 47.296-21.171 47.296-47.298v-3.381c0-26.12-21.173-47.29-47.296-47.29z" fill="#C45FA0"/><path d="M717.962 543.153H542.047c-26.121 0-47.298 21.175-47.298 47.297v3.724c0 26.123 21.177 47.293 47.298 47.293h175.915c26.121 0 47.297-21.17 47.297-47.293v-3.724c0-26.122-21.176-47.297-47.297-47.297z" fill="#E5594F"/><path d="M689.268 198.849H513.355c-26.122 0-47.298 21.175-47.298 47.297v3.722c0 26.12 21.176 47.297 47.298 47.297h175.912c26.122 0 47.298-21.177 47.298-47.297v-3.722c0-26.122-21.175-47.297-47.297-47.297z" fill="#F0D043"/><path d="M757.789 353.081H261.17c-26.121 0-47.297 21.172-47.297 47.296v3.377c0 26.121 21.177 47.299 47.297 47.299h496.619c26.121 0 47.296-21.178 47.296-47.299v-3.377c0-26.125-21.175-47.296-47.296-47.296z" fill="#E5594F"/><path d="M762.638 726.225h-496.62c-26.12 0-47.294 21.18-47.294 47.301v3.377c0 26.12 21.174 47.3 47.294 47.3h496.62c26.122 0 47.296-21.18 47.296-47.3v-3.377c0-26.122-21.174-47.301-47.296-47.301z" fill="#6277BA"/><path d="M355.734 543.328H281.41c-26.122 0-47.297 21.17-47.297 47.293v3.378c0 26.118 21.175 47.297 47.297 47.297h74.324c26.123 0 47.296-21.179 47.296-47.297v-3.378c0-26.123-21.174-47.293-47.296-47.293z" fill="#F39A2B"/><path d="M334.85 248.006m-48.986 0a48.986 48.986 0 1 0 97.972 0 48.986 48.986 0 1 0-97.972 0Z" fill="#F39A2B"/></svg>`;let _=g.slice(g.indexOf(`>`)+1,g.lastIndexOf(`</svg>`)).trim().replace(/>\s+</g,`><`),v=_.replace(/fill="#[0-9A-Fa-f]{6}"/g,``),y={x:-34,y:-34,width:1092,height:1092},b=`x="${y.x}" y="${y.y}" width="${y.width}" height="${y.height}"`,x=(e,t=``)=>`<rect ${b} fill="${e}"${t}/>`,S=[[17,0],[-17,0],[0,17],[0,-17]];function C(e){let t=`${e}-hole`,n=`${e}-thin`,r=S.map(([e,n])=>x(`#000`,` mask="url(#${t})" transform="translate(${e} ${n})"`)).join(``);return`<defs><mask id="${t}" maskUnits="userSpaceOnUse" ${b}>${x(`#fff`)}<g fill="#000">${v}</g></mask><mask id="${n}" maskUnits="userSpaceOnUse" ${b}>${x(`#fff`)}${r}</mask></defs>`+x(`currentColor`,` mask="url(#${n})"`)}function w({size:e=20,className:t,mono:n=!1}){let r=`dsh-context-sheet-${(0,u.useId)().replaceAll(`:`,``)}`;return(0,d.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 1024 1024`,className:t,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,dangerouslySetInnerHTML:{__html:n?C(r):_}})}function T({size:e=18}){return(0,d.jsx)(w,{size:e,mono:!0})}function E(e){return function(){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w,{size:16,className:`lc-title-icon`}),(0,d.jsx)(`span`,{className:`lc-title-label`,children:e(`tab`)})]})}}let D=new Map;function O(e){let t=D.get(e);if(t!==void 0)return t;let n=!1,r=new Set,i={subscribe(e){return r.add(e),()=>{r.delete(e)}},getSnapshot:()=>n,set(e){if(e!==n){n=e;for(let e of r)e()}}};return D.set(e,i),i}let k=new Map;function A(e,t){k.set(e,t)}function j(e){let t=k.get(e);return t!==void 0&&k.delete(e),t}let M=`context`,N=`/context`;function ee(e,t){e.inject([`inputTriggers`],e=>{let n=e.get(`inputTriggers`);n!==void 0&&typeof n.registerSource==`function`&&e.effect(()=>n.registerSource({trigger:`/`,name:M,order:1,candidates:(e,n)=>{if(n.position!==`leading`)return Promise.resolve([]);let r=n.query.trim().toLowerCase();return r!==``&&!M.startsWith(r)?Promise.resolve([]):Promise.resolve([{name:M,label:t.t(`cmd.label`),icon:w,section:t.t(`cmd.section`),description:t.t(`cmd.desc`)}])},onPick:e=>(A(e.session.sessionId,{kind:`span`,span:e.span}),O(e.session.sessionId).set(!0),`handled`),matchEnter:(e,t)=>t===N?(A(e.sessionId,{kind:`bare-token`,token:N}),O(e.sessionId).set(!0),Promise.resolve(`handled`)):Promise.resolve(void 0)}),`dsh-context: /context command`)})}let P=/^(\d+(?:\.\d+)?)px/,F=/^\s*minmax\(\s*([\d.]+)(?:px)?\s*,/,I=/(\d+(?:\.\d+)?)px\)?$/;function L(e){try{for(let t=e?.parentElement??null;t!==null;t=t.parentElement){let e=t.style.gridTemplateColumns;if(e===``)continue;let n=e.trim(),r=P.exec(n);if(r===null)return{left:0,right:0,frame:null};let i=I.exec(n);if(i===null||i.index===0)return{left:Number(r[1]),right:0,frame:t};let a=F.exec(n.slice(r[0].length)),o=Number(i[1]),s=a===null?0:Number(a[1]);return{left:Number(r[1]),right:Math.min(o,Math.max(0,window.innerWidth-Number(r[1])-s)),frame:t}}}catch{}return{left:0,right:0,frame:null}}let R=[{key:`system`,color:`var(--color-indigo-500)`},{key:`tools`,color:`var(--color-amber-500)`},{key:`user`,color:`var(--color-green-500)`},{key:`inject`,color:`var(--color-purple-500)`},{key:`skill`,color:`var(--color-orange-500)`},{key:`assistant`,color:`var(--color-blue-500)`},{key:`tool`,color:`var(--color-teal-500)`}],te=Object.fromEntries(R.map(e=>[e.key,e.color])),ne=[`user`,`inject`,`skill`,`assistant`,`tool`];function z(e){return R.map(t=>({key:t.key,color:t.color,value:e[t.key]||0}))}function re(e,t){let n=e.user+e.inject+e.skill+e.assistant+e.tool,r=t?.systemTokens??e.system,i=t?.toolsTokens??e.tools,a=t?.messageTokens??n,o={system:r,tools:i};if(n>0){let t=0,r=`user`;for(let i of ne){let s=Math.round(a*(e[i]/n));o[i]=s,t+=s,e[i]>e[r]&&(r=i)}o[r]=Math.max(0,o[r]+a-t)}else for(let e of ne)o[e]=0;return R.map(e=>({key:e.key,color:e.color,value:o[e.key]??0}))}function ie(e,t){let n=e.map(e=>({...e,raw:e.raw??e.value}));if(t===null||t<=0)return n;let r=0;for(let e of n)r+=e.raw;if(r<=0)return n;if(r===t)return n.map(e=>({...e,value:e.raw}));let i=t/r;return n.map(e=>({...e,value:Math.round(e.raw*i)}))}function ae(e,t,n){let r=n.uncachedInputTokens+n.cacheReadTokens+n.cacheWriteTokens,i=re(e,t);return[...r>0?ie(i,r):i.map(e=>({...e,value:0})),{key:`output`,color:`var(--color-pink-500)`,value:Math.max(0,n.outputTokens)}]}function B(e,t){return Math.min(100,Math.round(e/t*1e3)/10)}function oe(e,t=null,n=null){let r=e.current,i=t!==null&&typeof t.projectedTokens==`number`?t.projectedTokens:void 0,a=t!==null&&typeof t.pressureTokens==`number`?t.pressureTokens:void 0,o=e.last,s=e.requests,c=s.length>0?s[s.length-1]:null,l=o===void 0?c:o,u=l!==null&&typeof l.prompt==`number`?l.prompt+(r.total-l.total):void 0,d=i??a??u??null,f=t!==null&&typeof t.contextWindow==`number`?t.contextWindow:e.contextWindow,p=d??r.total;return{tokens:p,window:f,pct:f!==void 0&&f>0?B(p,f):null,parts:ie(re(r,n),d!==null&&p>0?p:null)}}function V(e){return typeof e!=`string`||e.length===0?0:Math.ceil(e.length/4)+4}function se(e,t){if(typeof t==`string`&&t!==``)try{let n=e.get(`uiConversation`);if(n!==void 0&&typeof n.imageUrl==`function`){let e=n.imageUrl.bind(n);return n=>e(t,n)}}catch{}}function ce(e){let t=e.useChat;if(typeof t==`function`)try{let e=t(e=>typeof e==`object`&&e?e.legacy:void 0),n=typeof e==`object`&&e?e.nodes:void 0;return Array.isArray(n)?n:void 0}catch{}}function H(e,t,n){return typeof e.useProjection==`function`?n(e.useProjection(t)):null}function U(e){return typeof e!=`object`||!e?null:e}function W(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function G(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e):[]}function le(e){return{requests:G(e.requests),events:G(e.events),nodes:G(e.nodes),droppedNodes:W(e.droppedNodes),archive:G(e.archive),...typeof e.surfaceFloor==`number`?{surfaceFloor:e.surfaceFloor}:{},...typeof e.archiveFloor==`number`?{archiveFloor:e.archiveFloor}:{},...e.fileOps===void 0?{}:{fileOps:G(e.fileOps)},...typeof e.fileOpsFloor==`number`?{fileOpsFloor:e.fileOpsFloor}:{},...e.spans===void 0?{}:{spans:G(e.spans)}}}function ue(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e)}function K(e){let t=U(e);return t===null||typeof t.current!=`string`||typeof t.minimum!=`string`?null:{current:t.current,minimum:t.minimum}}function q(e){let t=U(e);if(t===null||Array.isArray(t))return;let n={};for(let e of Object.keys(t)){let r=U(t[e]);if(r===null||Array.isArray(r))continue;let i={};for(let e of Object.keys(r)){let t=U(r[e]);if(t===null||Array.isArray(t))continue;let n={};for(let e of[`peak`,`off`]){let r=U(t[e]);r===null||Array.isArray(r)||(n[e]={uncached:W(r.uncached),cacheRead:W(r.cacheRead),cacheWrite:W(r.cacheWrite),output:W(r.output)})}i[e]=n}n[e]=i}return n}function de(e){if(e===void 0)return!0;let t=U(e);return t===null||Array.isArray(t)?!1:Object.keys(t).every(e=>{let n=U(t[e]);return n!==null&&!Array.isArray(n)})}function J(e){let t=U(e);if(t===null)return null;let n=t.current;if(typeof n==`object`&&n&&[`system`,`tools`,`user`,`inject`,`skill`,`assistant`,`tool`,`total`].every(e=>typeof n[e]==`number`)&&ue(t.requests)&&ue(t.events)&&ue(t.nodes)&&ue(t.archive)&&fe(t.systems)&&ye(t.timing)&&de(t.cost))return t;let r=typeof n==`object`&&n?n:{},i=q(t.cost),a=be(t.timing),o=K(t.unsupported),s=X(t.counts),c=pe(t.last);return{ok:!0,...o===null?{}:{unsupported:o},...typeof t.model==`string`?{model:t.model}:{},...typeof t.provider==`string`?{provider:t.provider}:{},...typeof t.contextWindow==`number`?{contextWindow:t.contextWindow}:{},current:{system:W(r.system),tools:W(r.tools),user:W(r.user),inject:W(r.inject),skill:W(r.skill),assistant:W(r.assistant),tool:W(r.tool),total:W(r.total)},...le(t),...typeof t.images==`number`?{images:t.images}:{},...typeof t.toolCalls==`number`?{toolCalls:t.toolCalls}:{},...typeof t.humanInputs==`number`?{humanInputs:t.humanInputs}:{},...typeof t.answers==`number`&&Number.isFinite(t.answers)?{answers:t.answers}:{},...typeof t.lastUser==`string`&&t.lastUser!==``?{lastUser:t.lastUser.slice(0,200)}:{},...s===void 0?{}:{counts:s},...c===void 0?{}:{last:c},...typeof t.detailRev==`number`&&Number.isFinite(t.detailRev)?{detailRev:t.detailRev}:{},...i===void 0?{}:{cost:i},...a===null?{}:{timing:a},...t.systems===void 0?{}:{systems:Y(t.systems)}}}function Y(e){let t=G(e),n=[];for(let e of t){let{seq:t,time:r,tokens:i}=e;typeof t==`number`&&Number.isFinite(t)&&typeof r==`number`&&Number.isFinite(r)&&typeof i==`number`&&Number.isFinite(i)&&n.push({seq:t,time:r,tokens:i})}return n.sort((e,t)=>e.seq-t.seq)}function fe(e){return e===void 0?!0:Array.isArray(e)?e.every(e=>{if(typeof e!=`object`||!e)return!1;let{seq:t,time:n,tokens:r}=e;return typeof t==`number`&&Number.isFinite(t)&&typeof n==`number`&&Number.isFinite(n)&&typeof r==`number`&&Number.isFinite(r)}):!1}function X(e){let t=U(e);if(t!==null)return{turns:W(t.turns),steps:W(t.steps),injects:W(t.injects),compactions:W(t.compactions),prunes:W(t.prunes),skills:W(t.skills)}}function pe(e){let t=U(e);if(t!==null&&typeof t.seq==`number`&&Number.isFinite(t.seq)&&typeof t.total==`number`&&Number.isFinite(t.total))return{seq:t.seq,total:t.total,...typeof t.prompt==`number`&&Number.isFinite(t.prompt)?{prompt:t.prompt}:{}}}function me(e){let t=U(e);if(t===null)return null;let n={};return typeof t.pressureTokens==`number`&&Number.isFinite(t.pressureTokens)&&(n.pressureTokens=t.pressureTokens),typeof t.projectedTokens==`number`&&Number.isFinite(t.projectedTokens)&&(n.projectedTokens=t.projectedTokens),typeof t.contextWindow==`number`&&Number.isFinite(t.contextWindow)&&(n.contextWindow=t.contextWindow),n}function he(e){let t=U(e);if(t===null)return null;let{systemTokens:n,toolsTokens:r,messageTokens:i}=t;return typeof n!=`number`||!Number.isFinite(n)||typeof r!=`number`||!Number.isFinite(r)||typeof i!=`number`||!Number.isFinite(i)?null:{systemTokens:n,toolsTokens:r,messageTokens:i}}function ge(e){let t=U(e);if(t===null)return null;let{uncachedInputTokens:n,outputTokens:r,cacheReadTokens:i,cacheWriteTokens:a}=t;return typeof n!=`number`||!Number.isFinite(n)||typeof r!=`number`||!Number.isFinite(r)||typeof i!=`number`||!Number.isFinite(i)||typeof a!=`number`||!Number.isFinite(a)?null:{uncachedInputTokens:n,outputTokens:r,cacheReadTokens:i,cacheWriteTokens:a}}function _e(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0}function ve(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function ye(e){if(e===void 0)return!0;if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;for(let e of[`wallMs`,`ttftMs`,`genMs`,`calls`,`toolsMs`,`toolCalls`])if(typeof t[e]!=`number`)return!1;for(let e of[`reasoningMs`,`textMs`,`toolArgMs`,`reasoningBlocks`,`textBlocks`,`toolArgBlocks`]){let n=t[e];if(n!==void 0&&(typeof n!=`number`||!Number.isFinite(n)||n<0))return!1}let n=t.tools;if(typeof n!=`object`||!n||Array.isArray(n))return!1;for(let e in n){let t=n[e];if(typeof t!=`object`||!t||typeof t.calls!=`number`||typeof t.ms!=`number`)return!1}return!0}function be(e){let t=U(e);if(t===null)return null;let n={},r=t.tools;if(typeof r==`object`&&r&&!Array.isArray(r))for(let e in r){if(e===`__proto__`||!Object.hasOwn(r,e))continue;let t=r[e];if(typeof t!=`object`||!t)continue;let i=t.calls,a=t.ms;typeof i==`number`&&i>=0&&typeof a==`number`&&a>=0&&(n[e]={calls:i,ms:a})}let i={wallMs:_e(t.wallMs),ttftMs:_e(t.ttftMs),genMs:_e(t.genMs),calls:_e(t.calls),toolsMs:_e(t.toolsMs),toolCalls:_e(t.toolCalls),tools:n},a=ve(t.reasoningMs);a!==void 0&&(i.reasoningMs=a);let o=ve(t.reasoningBlocks);o!==void 0&&(i.reasoningBlocks=o);let s=ve(t.textMs);s!==void 0&&(i.textMs=s);let c=ve(t.textBlocks);c!==void 0&&(i.textBlocks=c);let l=ve(t.toolArgMs);l!==void 0&&(i.toolArgMs=l);let u=ve(t.toolArgBlocks);return u!==void 0&&(i.toolArgBlocks=u),i}function xe(e){let t=U(e);if(t===null||!Array.isArray(t.headers))return null;for(let e of t.headers){if(typeof e!=`object`||!e)return null;let t=e;if(!Array.isArray(t.tools)||t.systemTokens!==void 0&&(typeof t.systemTokens!=`number`||!Number.isFinite(t.systemTokens)))return null;for(let e of t.tools){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.name!=`string`||typeof t.tokens!=`number`||!Number.isFinite(t.tokens)||t.plugin!==void 0&&typeof t.plugin!=`string`)return null}}let n=!1;for(let e of t.headers)if(e.systemTokens===void 0&&typeof e.system==`string`&&e.system!==``){n=!0;break}return n?{headers:t.headers.map(e=>e.systemTokens===void 0?{...e,systemTokens:V(e.system)||void 0}:e)}:t}function Se(e){let t=U(e);if(t===null)return null;let n=U(t.days);if(n===null||Array.isArray(n))return null;let r={},i=!1;for(let e of Object.keys(n)){let t=U(n[e]),a=t?.tokens,o=t?.requests;if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||t===null||Array.isArray(t)||typeof a!=`number`||!Number.isFinite(a)||a<0||typeof o!=`number`||!Number.isFinite(o)||o<0){i=!0;continue}let s=q(t.cost),c=s!==void 0&&Object.keys(s).length>0?s:void 0;t.cost!==void 0&&c===void 0&&(i=!0);let l=Ce(t.skills);t.skills!==void 0&&l===void 0&&(i=!0),r[e]={tokens:a,requests:o,...c===void 0?{}:{cost:c},...l===void 0?{}:{skills:l}}}return i?{days:r}:t}function Ce(e){let t=U(e);if(t===null||Array.isArray(t))return;let n={},r=!1;for(let e of Object.keys(t)){let i=U(t[e]),a=i?.n,o=i?.last;typeof a!=`number`||!Number.isFinite(a)||a<0||typeof o!=`number`||!Number.isFinite(o)||(n[e]={n:a,last:o},r=!0)}return r?n:void 0}let we=`/api`;function Te(e){try{let t=U(e.get(`connection`)?.rpc),n=t?.call;if(t!==null&&typeof n==`function`)return n.bind(t)}catch{}}function Ee(e,t){if(typeof t==`string`&&t!==``)try{let n=e.get(`sessions`),r=typeof n?.list?.getSnapshot==`function`?n.list.getSnapshot():void 0,i=typeof r==`object`&&r?r.byId:void 0,a=typeof i==`object`&&i?i[t]:void 0,o=typeof a==`object`&&a?a.cwd:void 0;return typeof o==`string`&&o!==``?o:void 0}catch{return}}async function De(e){let t=Te(e);if(t===void 0)return!1;try{if(e.get(`connection`)?.isLoopback!==!0)return!1;let n=U(await t(we,`session/canOpenWorkspacePath`,{args:{}}));return n!==null&&n.ok===!0&&n.value===!0}catch{return!1}}function Oe(e){let t=Te(e);if(t!==void 0)return e=>{try{t(we,`session/openWorkspacePath`,{args:{request:{path:e}}}).catch(()=>{})}catch{}}}function ke(e){let t=()=>{try{let t=U(e.get(`sidebarRight`));return t!==null&&typeof t.openResource==`function`?t:void 0}catch{return}};if(t()!==void 0)return e=>{let n=t();if(n===void 0)return!1;try{return n.openResource(e),!0}catch{return!1}}}function Ae(e,t){try{let n=U(e.get(`uiWorkspace`)),r=n?.openSession;typeof r==`function`&&r.call(n,t)}catch{}}function je(e){if(typeof e!=`object`||!e)return null;let t=e.event??e;if(typeof t!=`object`)return null;let n=t;if(typeof n.type!=`string`||typeof n.seq!=`number`||!Number.isFinite(n.seq))return null;let r=n.data!==null&&typeof n.data==`object`?n.data:{};return{type:n.type,seq:n.seq,data:r}}function Me(e){if(!Array.isArray(e))return null;let t=``;for(let n of e){let e=typeof n==`object`&&n?n.text:void 0;typeof e==`string`&&(t+=e)}return t.trim()===``?null:t}function Z(e){if(!Array.isArray(e))return null;let t=``,n=!1;for(let r of e){let e=typeof r==`object`&&r?r.text:void 0;typeof e==`string`&&(t+=e,n=!0)}return n?t:null}function Ne(e){let t=typeof e==`object`&&e?e:null;switch(t?.type){case`text`:case`reasoning`:return{kind:t.type,...typeof t.text==`string`?{text:t.text}:{}};case`image`:return{kind:`image`,...t.attachment===void 0?{}:{attachment:t.attachment}};case`tool-call`:return{kind:`tool-call`,name:typeof t.name==`string`?t.name:`?`,argsRaw:t.arguments};default:return typeof e==`object`&&e?e:{value:e}}}function Pe(e){let t=new Map,n=new Map,r=new Map;for(let i of e){let e=je(i);if(e===null)continue;let{type:a,seq:o,data:s}=e;if(a===`tool/call`){typeof s.callId==`string`&&n.set(s.callId,{name:typeof s.name==`string`?s.name:`?`,argsRaw:typeof s.arguments==`string`?s.arguments:``});continue}if(a===`compaction/summary`){if(typeof s.compactionId==`string`){let e=Me(s.summary);e!==null&&r.set(s.compactionId,e)}continue}if(a===`user/message`){let e=s.source!==null&&typeof s.source==`object`?s.source:null,n=e!==null&&e.kind===`plugin`&&typeof e.compactionId==`string`?e.compactionId:null;if(n!==null){t.set(o,{kind:`compaction`,seq:o,summary:r.get(n)??null});continue}t.set(o,{kind:`user`,seq:o,content:Array.isArray(s.content)?s.content:[]});continue}if(a===`assistant/message`){let e=s.message!==null&&typeof s.message==`object`?s.message:null,n=e!==null&&Array.isArray(e.content)?e.content:[];t.set(o,{kind:`assistant`,seq:o,blocks:n.map(Ne)});continue}if(a===`tool/result`){let e=s.message!==null&&typeof s.message==`object`?s.message:null,r=e?.source!==null&&typeof e?.source==`object`?e.source:null,i=typeof e?.toolCallId==`string`?e.toolCallId:typeof r?.callId==`string`?r.callId:null,a=i===null?null:n.get(i)??null;t.set(o,{kind:`tool-result`,seq:o,call:a,content:Array.isArray(e?.content)?e.content:[],isError:e?.isError===!0});continue}}return t}function Fe(e){if(typeof e==`object`&&e)try{let t=e.page;return typeof t==`function`?t.bind(e):void 0}catch{return}}let Ie,Q=new Set;function Le(e){Ie=e;for(let e of[...Q])e()}function Re(e){return Q.add(e),()=>{Q.delete(e)}}function ze(){return Ie}function Be(){return(0,u.useSyncExternalStore)(Re,ze,ze)}function Ve(e){e.inject([`remote`,`remote.session`],e=>{try{let t=e.remote?.session;Le(t===void 0?void 0:Fe(t))}catch{Le(void 0)}return()=>{Le(void 0)}})}function He(e){let t=e;if(typeof t==`object`&&t&&`ok`in t){let e=t;if(e.ok!==!0||e.value===null||typeof e.value!=`object`)throw Error(`history rpc failed`);t=e.value}if(typeof t!=`object`||!t)throw Error(`history rpc failed`);let n=t.records;if(!Array.isArray(n))throw Error(`history rpc failed`);return n}function Ue(e){let t=Ie;if(t!==void 0)return n=>t({address:{kind:`session`,sessionId:e},throughSeq:n,beforeSeq:n+1},new AbortController().signal)}function We(e){let t=Ue(e);if(t===void 0)return;let n=new Map;return async e=>{let r=n.get(e);if(r!==void 0)return r;let i=Pe(He(await t(e))).get(e)??null;return i!==null&&n.set(e,i),i}}function Ge(e){let{type:t,data:n}=e;if(t===`system/message`){let e=Z((n.message!==null&&typeof n.message==`object`?n.message:null)?.content);return e===null?null:{system:e,tools:[]}}let r=n.header!==null&&typeof n.header==`object`?n.header:null;if(r===null)return null;let i=Array.isArray(r.tools)?r.tools:[],a=[];for(let e of i){let t=typeof e==`object`&&e?e:null;a.push({name:t!==null&&typeof t.name==`string`?t.name:`?`,...t!==null&&typeof t.description==`string`&&t.description!==``?{description:t.description}:{},schema:e})}return{tools:a}}function Ke(e){let t=Ue(e);if(t===void 0)return;let n=new Map;return async e=>{let r=n.get(e);if(r!==void 0)return r;let i=He(await t(e)),a=null;for(let t of i){let r=je(t);if(r===null||r.type!==`request/header`&&r.type!==`system/message`)continue;let i=Ge(r);i!==null&&(n.set(r.seq,i),r.seq===e&&(a=i))}return a}}function qe(e){let t=U(e);if(t===null||typeof t.rev!=`number`||!Number.isFinite(t.rev)||t.rev<0)return null;let n=J(t.head);return{rev:t.rev,...n===null?{}:{head:n},...le(t)}}function Je(e){if(e!==``)return async()=>{let t=await fetch(`/api/dsh-context/detail`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({sessionId:e})});if(!t.ok)throw Error(`dsh-context: detail route HTTP ${t.status}`);let n=U(await t.json());if(n===null||n.ok!==!0)throw Error(`dsh-context: detail read failed`);if(n.value===null)return null;let r=qe(n.value);if(r===null)throw Error(`dsh-context: detail read malformed`);return r}}let Ye={detail:null,failed:!1,pending:!1};var Xe=class{fetcher;baseDelay;detail=null;acceptedRev=-1;wantedRev=-1;targetRev=-1;lastHeadRev=-1;generation=0;failed=!1;inFlight=!1;timer=null;failures=0;parked=!1;listeners=new Set;snap=Ye;constructor(e,t=300){this.fetcher=e,this.baseDelay=t}subscribe=e=>(this.listeners.add(e),this.parked&&(this.parked=!1,this.detail===null&&(this.resetLedger(),this.failures=0)),()=>{this.listeners.delete(e),this.listeners.size===0&&this.park()});getSnapshot=()=>this.snap;request(e){e<this.lastHeadRev&&this.resetLedger(),this.lastHeadRev=e,!(e<=this.acceptedRev||e<=this.wantedRev)&&(this.wantedRev=e,this.schedule())}retry=()=>{this.failures=0,this.detail===null&&(this.timer!==null&&(clearTimeout(this.timer),this.timer=null),this.inFlight||this.fire())};resetLedger(){this.generation++,this.acceptedRev=-1,this.wantedRev=-1,this.detail=null,this.failed=!1,this.snap=Ye}get active(){return this.listeners.size>0}get hasPayload(){return this.detail!==null}release(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null),this.resetLedger(),this.failures=0}park(){this.parked=!0,this.timer!==null&&(clearTimeout(this.timer),this.timer=null),this.emit()}schedule(){this.parked||this.timer!==null||(this.timer=setTimeout(()=>{this.timer=null,this.fire()},this.baseDelay*2**Math.min(this.failures,3)),this.emit())}async fire(){if(this.inFlight)return;if(this.fetcher===void 0){this.failed=!0,this.emit();return}this.inFlight=!0,this.targetRev=this.wantedRev;let e=this.generation;this.emit();try{let t=await this.fetcher();if(e!==this.generation)return;t===null?(this.wantedRev=this.acceptedRev,this.failed=this.detail===null,this.failures++):((t.rev>=this.acceptedRev||t.rev===this.targetRev)&&(this.detail=t,this.acceptedRev=t.rev),this.failures=0,this.failed=!1)}catch{e===this.generation&&(this.failed=this.detail===null,this.failures++)}finally{this.inFlight=!1,this.wantedRev>this.acceptedRev&&this.schedule(),this.emit()}}emit(){let e=this.timer!==null||this.inFlight,t={detail:this.detail,failed:this.failed,pending:e};if(t.detail!==this.snap.detail||t.failed!==this.snap.failed||t.pending!==this.snap.pending){this.snap=t;for(let e of this.listeners)e()}}};let $=new Map;function Ze(){let e=0;for(let t of $.values())t.hasPayload&&e++;return e}function Qe(e){let t=$.get(e),n=t??new Xe(Je(e));t!==void 0&&$.delete(e),$.set(e,n);let r=Ze()-8+ +!n.hasPayload;for(let e of $.values()){if(r<=0)break;!e.active&&e.hasPayload&&(e.release(),r--)}return n}let $e=()=>()=>{},et=()=>{};function tt(e){let t=H(e,`contextTimeline`,J),n=typeof e.sessionId==`string`?e.sessionId:``,r=t!==null&&typeof t.detailRev==`number`?t.detailRev:null,i=r!==null,a=t===null,o=(0,u.useMemo)(()=>i||a?Qe(n):null,[n,i,a]),s=(0,u.useSyncExternalStore)(o===null?$e:o.subscribe,o===null?()=>Ye:o.getSnapshot);return(0,u.useEffect)(()=>{o!==null&&o.request(r??0)},[o,r]),(0,u.useMemo)(()=>{let e=s.detail,n=o===null?et:o.retry;if(t!==null&&!i)return{data:t,detailState:`legacy`,retryDetail:et};let r=t===null?e===null?null:e.head??null:t;return r===null?{data:null,detailState:o!==null&&(s.failed||e!==null)?`failed`:`loading`,retryDetail:n}:e===null?{data:r,detailState:s.failed?`failed`:`loading`,retryDetail:n}:{data:{...r,requests:e.requests,events:e.events,nodes:e.nodes,droppedNodes:e.droppedNodes,archive:e.archive,...e.surfaceFloor===void 0?{}:{surfaceFloor:e.surfaceFloor},...e.archiveFloor===void 0?{}:{archiveFloor:e.archiveFloor},...e.fileOps===void 0?{}:{fileOps:e.fileOps},...e.fileOpsFloor===void 0?{}:{fileOpsFloor:e.fileOpsFloor},...e.spans===void 0?{}:{spans:e.spans}},detailState:`ready`,retryDetail:n}},[t,i,o,s])}function nt(e,t){if(e===null||e.headers.length===0)return null;if(t===null)return e.headers[e.headers.length-1];for(let n=e.headers.length-1;n>=0;n--)if(e.headers[n].seq<t)return e.headers[n];return null}function rt(e,t,n){let r=e.systems;if(r!==void 0&&r.length>0){for(let e=r.length-1;e>=0;e--){let t=r[e];if(!(t.tokens<=0)&&(n===null||t.seq<n))return t}return null}return t!==null&&t.systemTokens!==void 0?{seq:t.seq,time:t.time,tokens:t.systemTokens}:null}function it(e,t,n){let r=n===null,i;if(r)i=e.nodes.slice();else{let t=[];for(let r of e.nodes)r.seq<n&&t.push(r);for(let r of e.archive)r.seq<n&&r.gone!==void 0&&r.gone>n&&t.push(r);i=t}i.sort((e,t)=>e.seq-t.seq);let a=0;e.droppedNodes>0&&(r||e.surfaceFloor!==void 0&&n>e.surfaceFloor)&&(a=e.droppedNodes);let o=!r&&e.archiveFloor!==void 0&&n<e.archiveFloor,s=nt(t,n);return{live:r,header:s,system:rt(e,s,n),nodes:i,missingLive:a,approximate:o}}function at(e){let t=[];if(e.system!==null&&t.push({key:`sys`,cat:`system`,tokens:e.system.tokens,time:e.system.time}),e.header!==null)for(let n of e.header.tools)t.push({key:`tool:`+n.name,cat:`tools`,tokens:n.tokens});for(let n of e.nodes)t.push({key:`n`+String(n.seq),cat:n.cat,tokens:n.tokens,node:n,...n.time===void 0?{}:{time:n.time}});return t}function ot(e){let t=[],n=0;for(let r of at(e))`node`in r?t.push({key:r.key,cat:r.cat,tokens:r.tokens,off:n,color:te[r.cat],node:r.node}):t.push({key:r.key,cat:r.cat,tokens:r.tokens,off:n,color:te[r.cat]}),n+=r.tokens;return t}function st(e,t){if(t===null)return{up:[],down:[]};let n=new Map(t.map(e=>[e.key,e.tokens])),r=new Map(e.map(e=>[e.key,e.tokens])),i=[],a=[];for(let t of e){let e=t.tokens-(n.get(t.key)??0);e<=0||i.push(`node`in t?{key:t.key,cat:t.cat,tokens:e,off:0,color:t.color,node:t.node}:{key:t.key,cat:t.cat,tokens:e,off:0,color:t.color})}for(let e of t){let t=(r.get(e.key)??0)-e.tokens;t>=0||a.push(`node`in e?{key:e.key,cat:e.cat,tokens:t,off:0,color:e.color,node:e.node}:{key:e.key,cat:e.cat,tokens:t,off:0,color:e.color})}let o=0;for(let e of i)e.off=o,o+=e.tokens;let s=0;for(let e of a)e.off=s,s-=e.tokens;return{up:i,down:a}}function ct(e,t,n){if(!(`node`in e))return e.cat===`system`?n(`system`):e.key.slice(5);let r=e.node;return r.skill===void 0?r.cat===`tool`?r.tool??`?`:r.cat===`inject`?t(`form.`+(r.form||`context`)):n(r.cat):t(`node.skillTag`,{name:r.skill})}function lt(e){if(typeof e!=`string`||e===``)return null;try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)?t:null}catch{return null}}let ut={read:`read`,read_image:`read`,write:`write`,edit:`write`,grep:`search`,glob:`search`};function dt(e){return e===void 0?null:ut[e]??null}function ft(e,t){return e===`str_replace_editor`?t!==null&&t.command===`view`?`read`:`write`:dt(e)}function pt(e){return e===`str_replace_editor`||dt(e)!==null}function mt(e,t){if(t===null)return null;if(e===`grep`||e===`glob`){let e=t.path;if(typeof e==`string`&&e!==``)return e;let n=t.pattern;return typeof n==`string`&&n!==``?n:null}for(let e of[`file_path`,`filePath`,`path`]){let n=t[e];if(typeof n==`string`&&n!==``)return n}return null}function ht(e){if(e===``)return 0;let t=0;for(let n=0;n<e.length;n++)e[n]===`
25
13
  `&&t++;return e.endsWith(`
26
- `)?t:t+1}function ht(e,t){return{added:typeof e==`string`?mt(e):0,removed:typeof t==`string`?mt(t):0}}function gt(e,t){if(e===`edit`)return ht(t.new_string,t.old_string);if(e===`write`)return ht(t.content,void 0);if(e===`str_replace_editor`){if(t.command===`str_replace`)return ht(t.new_str,t.old_str);if(t.command===`insert`)return ht(t.new_str,void 0);if(t.command===`create`)return ht(t.file_text,void 0)}return{added:0,removed:0}}function _t(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.path!=`string`||t.path===``||typeof t.offset!=`number`||!Number.isFinite(t.offset)||t.offset<1||!Array.isArray(t.lines)||t.lines.length===0?null:{start:t.offset,count:t.lines.length}}function vt(e){let t=e.limit;return typeof t==`number`&&Number.isFinite(t)&&t>0?{count:Math.floor(t),est:!0}:void 0}function yt(e,t){let n=_t(e);return n===null?vt(t):{start:n.start,count:n.count}}function bt(e){let t=e?.pattern;if(typeof t!=`string`||t===``)return;let n=e?.include;return typeof n==`string`&&n!==``?`${t} (${n})`:t}function xt(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.truncated!==!1)return null;let n=[];if(t.shape===`matches`&&Array.isArray(t.files))for(let e of t.files){if(typeof e!=`object`||!e)continue;let t=e;typeof t.path==`string`&&t.path!==``&&Array.isArray(t.matches)&&n.push({path:t.path,hits:t.matches.length})}else if(t.shape===`paths`&&Array.isArray(t.paths))for(let e of t.paths)typeof e==`string`&&e!==``&&n.push({path:e,hits:0});return n.length>0?n:null}function St(e){let t=ft(e.tool)?ct(e.argsRaw):null,n=dt(e.tool,t);if(n===null)return[];let r={seq:e.seq,kind:n,tool:e.tool,err:e.err===!0,added:0,removed:0,path:``,...e.time===void 0?{}:{time:e.time},...e.gone===void 0?{}:{gone:e.gone},...e.parent===void 0?{}:{parent:e.parent},...e.program===void 0?{}:{program:e.program}};if(n===`search`){let n=xt(e.meta);if(n!==null){let i=bt(t),a=t===null?null:pt(e.tool,t),o=t!==null&&typeof t.path==`string`&&t.path!==``;return[...a!==null&&!n.some(e=>e.path===a)?[{...r,path:a,...o&&i!==void 0?{detail:i}:{},...o?{}:{pattern:!0}}]:[],...n.map(e=>({...r,path:e.path,...i===void 0?{}:{detail:i},...e.hits>0?{hits:e.hits}:{}}))]}}if(t===null)return[];let i=pt(e.tool,t);if(i===null)return[];let{added:a,removed:o}=gt(e.tool,t),s=typeof t.path==`string`&&t.path!==``,c=n===`search`&&s?bt(t):void 0,l=n===`read`?yt(e.meta,t):void 0;return[{...r,path:i,added:a,removed:o,...c===void 0?{}:{detail:c},...l===void 0?{}:{read:l},...n===`search`&&!s?{pattern:!0}:{}}]}function Ct(e){if(e===null)return null;for(let t of[`description`,`file_path`,`path`,`filePath`]){let n=e[t];if(typeof n==`string`&&n!==``)return n}return null}function wt(e){return Ct(ct(e?.call?.argsRaw))}function Tt(e){if(e===void 0||!Array.isArray(e.blocks))return null;for(let t of e.blocks){let e=typeof t==`object`&&t?t:null;if(e===null||e.kind!==`tool-call`)continue;let n=Ct(ct(e.argsRaw));if(n!==null)return n}return null}function Et(e){if(e===void 0||!Array.isArray(e.blocks))return[];let t=[];for(let n of e.blocks){let e=typeof n==`object`&&n?n:null;e!==null&&e.kind===`tool-call`&&typeof e.name==`string`&&t.push(e.name)}return t}function Dt(e){let{t}=e;return function(e){let n=e.className??`lc-empty`;return e.state===`loading`?(0,d.jsx)(`div`,{className:n,children:t(`detail.loading`)}):(0,d.jsx)(`div`,{className:n,children:e.onRetry===void 0?t(`detail.loadFailed`):(0,d.jsx)(`button`,{type:`button`,className:`lc-br-retry hover:brightness-[1.15]`,onClick:e.onRetry,children:t(`detail.loadFailed`)})})}}function Ot(e){let{t}=e;return function(e){return e.cat===`tool`?t(`node.toolResult`)+(e.tool?` ← `+e.tool:``)+(e.err?` ⚠`:``):e.skill?`Skill: `+e.skill:e.calls?t(`node.calls`)+e.calls.join(`, `):e.text?e.form===`snapshot`?t(`node.snapshot`)+e.text:e.text:e.cat===`assistant`?t(`node.empty`):e.cat===`inject`||e.cat===`skill`?t(`form.`+(e.form||`context`)):t(`node.nonText`)}}function kt(e){let t=t=>{if(Math.abs(t.deltaX)<=Math.abs(t.deltaY))return;let n=t.deltaX<0&&e.scrollLeft<=0,r=t.deltaX>0&&e.scrollLeft+e.clientWidth>=e.scrollWidth-1;(n||r)&&t.preventDefault()};return e.addEventListener(`wheel`,t,{passive:!1}),()=>{e.removeEventListener(`wheel`,t)}}function At(e){let t=[],n=0,r=0,i=!1;for(let a of e){let e=t.length>0?t[t.length-1]:null;e!==null&&(e.turn??0)===(a.turn??0)?(n++,a.activeMs!==void 0&&(r+=a.activeMs,i=!0),t[t.length-1]={...a,stepCount:n,...i?{activeMs:r}:{}}):(n=1,r=a.activeMs??0,i=a.activeMs!==void 0,t.push({...a,stepCount:1}))}return t}function jt(e){let t=new Map;for(let n of e){let e=n.turn??0;t.set(e,(t.get(e)??0)+1)}return e=>t.get(e??0)??1}function Mt(e,t){let n=Array(e.length);for(let r of t)if(r.kind===`compaction`||r.kind===`prune`){for(let t=0;t<e.length;t++)if(e[t].seq>=r.seq){n[t]===void 0&&(n[t]=r);break}}return n}function Nt(e,t){for(let n of e)if(n.seq===t)return n;return e.length>0?e[0]:null}function Pt(e){let{t,fmt:n,fmtDuration:r,eventLabel:i,eventAt:a,catLabel:o}=e,s=e=>(e>0?`+`:``)+n(e),c=[`color-mix(in srgb, var(--color-neutral-500) 12%, transparent)`,`color-mix(in srgb, var(--color-neutral-500) 26%, transparent)`],l=e=>6.5*String(e).length,f=(e,t)=>{let n=t,r={...e},i=e[n]||0;r.total=i;for(let e of L)r[e.key]=e.key===n?i:0;return r},p=(e,t)=>{let{prompt:n,output:r,...i}=e,a=0,o=0;for(let n of L){let r=t===null?0:(e[n.key]||0)-(t[n.key]||0);i[n.key]=r,a+=Math.abs(r),o+=r}return i.total=a,i.net=o,i},m=function(e){let t=[];for(let n of e.bands)n.tokens>0&&t.push(n);if(t.length===0)return null;let n=[];for(let r of t){let t=Math.round(r.off/e.total*1e4)/100,i=Math.round((r.off+r.tokens)/e.total*1e4)/100,a=n.length>0?n[n.length-1]:null;a!==null&&a.color===r.color&&a.to===t?a.to=i:n.push({color:r.color,from:t,to:i})}let r=n=>{let r=n.currentTarget.getBoundingClientRect(),i=(r.height>0?Math.min(1,Math.max(0,1-(n.clientY-r.top)/r.height)):0)*e.total,a=t[0];for(let t of e.bands){if(t.off>i)break;t.tokens>0&&(a=t)}return a};return(0,d.jsx)(`div`,{className:`lc-bar-dna animate-lc-bar-in motion-reduce:animate-none`,style:{height:`${Math.max(1,Math.round(e.total/e.maxTotal*112))}px`,background:`linear-gradient(to top, `+n.map(e=>`${e.color} ${e.from}%, ${e.color} ${e.to}%`).join(`, `)+`)`,"--lc-i":Math.min(e.enterIndex,20)},onMouseMove:t=>{e.onHit(r(t).key)},onMouseLeave:()=>{e.onHit(null)},onClick:t=>{e.onPick!==void 0&&e.onPick(e.seq,r(t))}})},h=function(e){let t=0;for(let n of e.d.up)t+=n.tokens;let n=0;for(let t of e.d.down)n-=t.tokens;let r=t+n;if(r===0)return null;let i=[],a=(e,t,n)=>{let a=Math.round(n/r*1e4)/100,o=Math.round((n+t)/r*1e4)/100,s=i.length>0?i[i.length-1]:null;return s!==null&&s.color===e&&s.to===a?s.to=o:i.push({color:e,from:a,to:o}),n+t},o=0;for(let t=e.d.down.length-1;t>=0;t--)o=a(e.d.down[t].color,-e.d.down[t].tokens,o);for(let t of e.d.up)o=a(t.color,t.tokens,o);let s=Math.max(1,Math.round(r*e.scale)),c=t=>{let i=t.currentTarget.getBoundingClientRect(),a=(i.height>0?Math.min(1,Math.max(0,1-(t.clientY-i.top)/i.height)):0)*r-n,o=a>=0&&e.d.up.length>0,s=o?e.d.up:e.d.down,c=o?a:-a,l=s[0];for(let e of s){if(e.off>c)break;l=e}return l};return(0,d.jsx)(`div`,{className:`lc-bar-dna animate-lc-bar-in motion-reduce:animate-none`,style:{position:`absolute`,bottom:`${Math.round(e.zeroBottom-n*e.scale)}px`,height:`${s}px`,background:`linear-gradient(to top, `+i.map(e=>`${e.color} ${e.from}%, ${e.color} ${e.to}%`).join(`, `)+`)`,transformOrigin:`50% ${Math.round(n/r*1e4)/100}%`,"--lc-i":Math.min(e.enterIndex,20)},onMouseMove:t=>{e.onHit(c(t).key)},onMouseLeave:()=>{e.onHit(null)},onClick:t=>{e.onPick!==void 0&&e.onPick(e.seq,c(t))}})},g=(0,u.memo)(function(e){return e.slices===null?null:(0,d.jsx)(`div`,{className:`lc-dna-hl`,children:e.slices.map((e,t)=>(0,d.jsx)(`span`,{className:`lc-dna-cell`,children:e===null?null:(0,d.jsx)(`span`,{className:`lc-dna-slice`,style:{bottom:`${e.bottom}px`,height:`${e.height}px`}})},t))})}),_=(0,u.memo)(function(e){let{req:t,marker:n}=e,r=n===void 0?null:a(n),o=e.upPx!==void 0&&e.downPx!==void 0&&e.deltaScale!==void 0,s={"--lc-i":Math.min(e.enterIndex,20)};return(0,d.jsxs)(`div`,{className:`lc-bar hover:bg-(--dsw-alias-bg-layer-2)`+(e.selected?` lc-bar-selected`:``)+(e.hovered?` lc-bar-hovered`:``)+(e.inTurn?` lc-bar-in-turn`:``),"data-seq":t.seq,style:{width:`14px`},onClick:()=>{e.onSelect(e.selected?null:t.seq)},onMouseEnter:()=>{e.onHover(t.seq)},children:[e.flag===null?null:(0,d.jsx)(`span`,{className:`lc-step-flag`,"aria-hidden":`true`,children:(0,d.jsx)(`span`,{className:`lc-step-flag-label`,children:e.flag})}),n===void 0?null:(0,d.jsx)(`span`,{className:`lc-bar-marker`,title:`✂ `+(r===null?``:r+` — `)+i(n),children:`✂`}),e.dna===null?o?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{className:`lc-bar-up animate-lc-bar-in motion-reduce:animate-none`,style:{bottom:`${e.downPx}px`,...s},children:L.map(n=>{let r=t[n.key]||0;return r<=0?null:(0,d.jsx)(`div`,{"data-cat":n.key,className:`lc-cat-seg`,style:{height:`${Math.max(1,Math.round(r*e.deltaScale))}px`,background:n.color}},n.key)})}),(0,d.jsx)(`div`,{className:`lc-bar-down animate-lc-bar-in motion-reduce:animate-none`,style:{top:`${e.upPx}px`,...s},children:L.map(n=>{let r=t[n.key]||0;return r>=0?null:(0,d.jsx)(`div`,{"data-cat":n.key,className:`lc-cat-seg`,style:{height:`${Math.max(1,Math.round(-r*e.deltaScale))}px`,background:n.color}},n.key)})})]}):(0,d.jsx)(`div`,{className:`lc-bar-stack animate-lc-bar-in motion-reduce:animate-none`,style:s,children:L.map(n=>{let r=t[n.key]||0;return r?(0,d.jsx)(`div`,{"data-cat":n.key,className:`lc-cat-seg`,style:{height:`${Math.max(1,Math.round(r/e.maxTotal*112))}px`,background:n.color}},n.key):null})}):e.dnaDelta!==null&&e.dnaScale!==void 0&&e.zeroBottom!==void 0?(0,d.jsx)(h,{d:e.dnaDelta,scale:e.dnaScale,zeroBottom:e.zeroBottom,enterIndex:e.enterIndex,seq:t.seq,onHit:e.onDnaHit,onPick:e.onPickBand}):(0,d.jsx)(m,{bands:e.dna,total:t.total,maxTotal:e.maxTotal,enterIndex:e.enterIndex,seq:t.seq,onHit:e.onDnaHit,onPick:e.onPickBand})]})});return function(e){let i=e.dna??null,a=i!==null,m=e.mode===`delta`,h=a&&m,v=e.durationCurve===!0,y=!a&&e.focusCat!==null&&e.focusCat!==void 0&&L.some(t=>t.key===e.focusCat)?e.focusCat:null,[b,x]=(0,u.useState)(null),S=(0,u.useMemo)(()=>h?i.map((e,t)=>ot(e,t>0?i[t-1]:null)):null,[h,i]),C=(0,u.useMemo)(()=>{let t=y===null?e.requests:e.requests.map(e=>f(e,y));return m?t.map((e,n)=>p(e,n>0?t[n-1]:null)):t},[e.requests,m,y]),w=e.markers,T=e.adaptive===!0,[E,ee]=(0,u.useState)(null),te=e=>{if(!T)return;let t=C.length;if(t===0||e.clientWidth<=0)return;let n=e.scrollLeft,r=n+e.clientWidth,i=0,a=0,o=0,s=0,c=Math.max(0,Math.floor(n/16)),l=Math.min(t-1,Math.max(c,Math.floor((r-1)/16)));for(let e=c;e<=l;e++){let t=e*16;if(t>=r||t+14<=n)continue;let c=C[e],l=c.activeMs??0;if(l>s&&(s=l),h&&S!==null){let t=0,n=0;for(let n of S[e].up)t+=n.tokens;for(let t of S[e].down)n-=t.tokens;t>a&&(a=t),n>o&&(o=n)}else if(m){let e=0,t=0;for(let n of L){let r=c[n.key]||0;r>0?e+=r:t-=r}e>a&&(a=e),t>o&&(o=t)}else c.total>i&&(i=c.total)}ee(e=>e!==null&&e.total===i&&e.up===a&&e.down===o&&e.activeMs===s?e:{total:i,up:a,down:o,activeMs:s})},D=1,O=0,k=0;if(h&&S!==null)for(let e of S){let t=0,n=0;for(let n of e.up)t+=n.tokens;for(let t of e.down)n-=t.tokens;t>O&&(O=t),n>k&&(k=n)}else if(m)for(let e of C){let t=0,n=0;for(let r of L){let i=e[r.key]||0;i>0?t+=i:n-=i}t>O&&(O=t),n>k&&(k=n)}else for(let e of C)e.total>D&&(D=e.total);T&&E!==null&&(m?E.up+E.down>0&&(O=E.up,k=E.down):D=Math.max(1,E.total));let A=0;if(v){for(let e of C){let t=e.activeMs??0;t>A&&(A=t)}T&&E!==null&&(A=E.activeMs)}let j=[],M=[];if(v){let e=112/Math.max(1,A),t=[],n=()=>{t.length>=2?j.push(t.map(e=>`${e[0]},${e[1]}`).join(` `)):t.length===1&&M.push(t[0]),t=[]};for(let r=0;r<C.length;r++){let i=C[r].activeMs;if(i===void 0){n();continue}t.push([r*16+7,Math.round((112-i*e)*100)/100])}n()}let N=Math.max(1,O+k),P=112/N,F=Math.round(O*P),I=112-F,ne=Math.abs(28-F)>=11,re=Math.abs(84-F)>=11,R=[];for(let e of C){let t=R.length>0?R[R.length-1]:null;(t===null||t.turn!==(e.turn??0))&&(t={turn:e.turn??0,count:0,span:0,agg:e.stepCount!==void 0},R.push(t)),t.count++,t.span+=e.stepCount??1}let ie=[],z=[];{let e=0;for(let t of R){let n=t.agg?14:t.span*16-2;ie.push(e),z.push(n),e+=n+2}}let B=``;{let e=1;for(let t=0;t+1<R.length;t++){let n=(z[t]+z[t+1])/2+2,r=(l(R[t].turn)+l(R[t+1].turn))/2+2;r>n&&(e=Math.min(e,n/r))}e<1&&(B=`${Math.max(6,Math.floor(10*e))}px`)}let V=(0,u.useRef)(null),H=(0,u.useRef)(!1),ae=(0,u.useRef)(e.granularity),oe=(0,u.useRef)(0),se=(0,u.useRef)(0),U=(0,u.useRef)(0),W=(0,u.useRef)(0),G=e=>{let t=e.querySelectorAll(`.lc-turn-label`),n=Math.min(t.length,ie.length),r=e.scrollLeft,i=r+e.clientWidth,a=[],o=-1/0;for(let e=0;e<n;e++){let n=ie[e],s=z[e],c=0,l=``;if(n+s+48>r&&n-48<i){let a=t[e].offsetWidth,u=Math.max(n,r),d=Math.min(n+s,i);if(d>u&&a<s){let e=(u+d)/2-n;c=Math.min(Math.max(e,a/2),s-a/2)-s/2}let f=n+s/2+c-a/2;f<o?l=`hidden`:o=f+a+2}let u=c===0?``:`translateX(${c}px)`;(t[e].style.transform!==u||t[e].style.visibility!==l)&&a.push([t[e],u,l])}for(let[e,t,n]of a)e.style.transform=t,e.style.visibility=n};(0,u.useLayoutEffect)(()=>{let t=V.current;if(t===null)return;let n=C.length===0?0:C[C.length-1].seq,r=n!==oe.current,i=se.current;if(e.granularity!==ae.current&&(ae.current=e.granularity,H.current=!1),e.focusTurn!==null){let n=R.findIndex(t=>t.turn===e.focusTurn);n>=0&&(H.current=!0,t.scrollLeft=Math.max(0,n*16+7-t.clientWidth/2)),e.onFocusTurnHandled()}else H.current?r&&t.scrollLeft+t.clientWidth>=i-24&&(t.scrollLeft=t.scrollWidth):(H.current=!0,t.scrollLeft=t.scrollWidth);oe.current=n,se.current=t.scrollWidth,W.current=t.scrollLeft,U.current=t.clientWidth,G(t),me(t),te(t)},[e.granularity,e.focusTurn,C,T,h]);let K=(0,u.useRef)(te);(0,u.useLayoutEffect)(()=>{K.current=te}),(0,u.useLayoutEffect)(()=>{let e=V.current;if(e===null||typeof ResizeObserver!=`function`)return;let t=new ResizeObserver(()=>{U.current=e.clientWidth,K.current(e)});return t.observe(e),()=>{t.disconnect()}},[]),(0,u.useLayoutEffect)(()=>{let e=V.current;if(e!==null)return kt(e)},[]);let ce=(0,u.useMemo)(()=>jt(e.requests),[e.requests]),q=e.hoveredSeq===null?-1:C.findIndex(t=>t.seq===e.hoveredSeq),le=q>=0?C[q]:null,J=a&&!h&&q>=0?i[q]:null,ue=J!==null&&b!==null?J.find(e=>e.key===b&&e.tokens>0)??null:null,de=h&&q>=0&&S!==null?S[q].up.find(e=>e.key===b)??S[q].down.find(e=>e.key===b)??null:null,fe=(0,u.useMemo)(()=>{if(!a||b===null)return null;let e=[];if(h&&S!==null)for(let t of S){let n=t.up.find(e=>e.key===b)??t.down.find(e=>e.key===b)??null;if(n===null){e.push(null);continue}let r=Math.abs(n.tokens),i=n.tokens>0?I+n.off*P:I-(n.off+r)*P;e.push({bottom:Math.round(i),height:Math.max(1,Math.round(r*P))})}else for(let t of i){let n=t.find(e=>e.key===b&&e.tokens>0)??null;e.push(n===null?null:{bottom:Math.round(n.off/D*112),height:Math.max(1,Math.round(n.tokens/D*112))})}return e},[a,b,h,S,i,I,P,D]),pe=i=>{let a=i.stepCount??1,c=e.granularity===`turn`?a>1?t(`tip.turn`,{t:i.turn??0,n:a}):t(`tip.turn1`,{t:i.turn??0}):t(`tip.step`,{t:i.turn??0,s:i.step??0,n:ce(i.turn)}),l=ue??de,u;u=l===null?m?t(`tip.delta`,{n:s(i.net??0)}):y===null?t(`tip.total`,{n:n(i.total)}):t(`tip.cat`,{cat:o(y),n:n(i.total)}):t(`trend.dnaItem`,{label:st(l,t,o),n:h?s(l.tokens):n(l.tokens)});let d=[c,u];return v&&i.activeMs!==void 0&&d.push(t(`tip.duration`,{n:r(i.activeMs)})),d},Y=(0,u.useRef)(0),me=e=>{let t=(e.parentElement??document.body).querySelector(`.lc-chart-tip`);if(t===null)return;let n=t.offsetWidth,r=U.current,i=Math.min(n/2,r/2),a=Math.min(Math.max(Y.current-W.current,i),r-i),o=`translate(${Math.round(a-n/2)}px, 0)`;t.style.transform!==o&&(t.style.transform=o)};return(0,u.useLayoutEffect)(()=>{V.current!==null&&(Y.current=q>=0?q*16+7:0,me(V.current))}),(0,d.jsxs)(`div`,{className:`lc-chartrow`,children:[(0,d.jsx)(`div`,{className:`lc-axis`,children:m?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-axis-top`,children:s(O)}),ne?(0,d.jsx)(`span`,{className:`lc-axis-q3`,children:s(Math.round(O-N/4))}):null,(0,d.jsx)(`span`,{className:`lc-axis-mid`,style:{top:`${13+F}px`},children:`0`}),re?(0,d.jsx)(`span`,{className:`lc-axis-q1`,children:s(Math.round(O-3*N/4))}):null,(0,d.jsx)(`span`,{className:`lc-axis-bot`,children:s(-k)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-axis-top`,children:n(D)}),(0,d.jsx)(`span`,{className:`lc-axis-q3`,children:n(Math.round(D*3/4))}),(0,d.jsx)(`span`,{className:`lc-axis-mid`,children:n(Math.round(D/2))}),(0,d.jsx)(`span`,{className:`lc-axis-q1`,children:n(Math.round(D/4))}),(0,d.jsx)(`span`,{className:`lc-axis-bot`,children:`0`})]})}),(0,d.jsxs)(`div`,{className:`lc-chart-wrap`,children:[(0,d.jsxs)(`div`,{className:`lc-chart-scroll`+(e.activeTurn===null?``:` lc-chart-dim`),ref:V,onScroll:e=>{W.current=e.currentTarget.scrollLeft,U.current=e.currentTarget.clientWidth,G(e.currentTarget),me(e.currentTarget),te(e.currentTarget)},children:[(0,d.jsxs)(`div`,{className:`lc-chart`,"data-catdim":e.hoverCat??void 0,onMouseLeave:()=>{e.onHover(null),x(null)},children:[(0,d.jsx)(`div`,{className:`lc-grid lc-grid-top`}),!m||ne?(0,d.jsx)(`div`,{className:`lc-grid lc-grid-q3`}):null,!m||re?(0,d.jsx)(`div`,{className:`lc-grid lc-grid-q1`}):null,m?null:(0,d.jsx)(`div`,{className:`lc-grid lc-grid-mid`}),(0,d.jsx)(`div`,{className:`lc-grid lc-grid-zero`,style:m?{top:`${18+F}px`}:void 0}),C.map((t,n)=>(0,d.jsx)(_,{req:t,marker:w[n],selected:e.selectedSeq===t.seq,hovered:e.hoveredSeq===t.seq,inTurn:e.activeTurn!==null&&(t.turn??0)===e.activeTurn,flag:e.granularity===`step`&&(n+1)%5==0?n+1:null,maxTotal:D,upPx:m?F:void 0,downPx:m?I:void 0,deltaScale:m?P:void 0,enterIndex:n,dna:a?i[n]:null,dnaDelta:h&&S!==null?S[n]:null,dnaScale:h?P:void 0,zeroBottom:h?I:void 0,onDnaHit:x,onPickBand:e.onPickBand,onSelect:e.onSelect,onHover:e.onHover},`${t.seq}:${e.granularity}`)),a?(0,d.jsx)(g,{slices:fe}):null,v&&(j.length>0||M.length>0)?(0,d.jsxs)(`svg`,{className:`lc-duration`,width:C.length*16-2,height:112,"aria-hidden":`true`,children:[j.map((e,t)=>(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`polyline`,{className:`lc-dur-halo`,points:e}),(0,d.jsx)(`polyline`,{points:e})]},t)),M.map((e,t)=>(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`circle`,{className:`lc-dur-halo`,cx:e[0],cy:e[1],r:2}),(0,d.jsx)(`circle`,{cx:e[0],cy:e[1],r:1.2})]},t))]}):null]}),(0,d.jsx)(`div`,{className:`lc-turns`,style:B===``?void 0:{fontSize:B},onMouseLeave:()=>{e.onHoverTurn(null)},children:R.map((t,n)=>{let r=e.activeTurn===t.turn;return(0,d.jsx)(`span`,{className:`lc-turn`+(r?` lc-turn-on`:``),style:{width:`${z[n]}px`,background:c[n%c.length]},title:`T${t.turn}`,onMouseEnter:()=>{e.onHoverTurn(t.turn)},onClick:()=>{e.onPickTurn(t.turn)},children:(0,d.jsx)(`span`,{className:`lc-turn-label`,children:`${t.turn}`})},`turn-${n}`)})})]}),le===null?null:(0,d.jsx)(`div`,{className:`lc-chart-tip`,children:pe(le).map((e,t)=>(0,d.jsx)(`span`,{children:e},t))})]}),v?(0,d.jsxs)(`div`,{className:`lc-axis lc-axis-r`,children:[(0,d.jsx)(`span`,{className:`lc-axis-top`,children:r(A)}),(0,d.jsx)(`span`,{className:`lc-axis-q3`,children:r(Math.round(A*3/4))}),(0,d.jsx)(`span`,{className:`lc-axis-mid`,children:r(Math.round(A/2))}),(0,d.jsx)(`span`,{className:`lc-axis-q1`,children:r(Math.round(A/4))}),(0,d.jsx)(`span`,{className:`lc-axis-bot`,children:`0`})]}):null]})}}function Ft(e,t,n){let[r,i]=(0,u.useState)(()=>new Map),[a,o]=(0,u.useState)(`idle`),[s,c]=(0,u.useState)(0);return(0,u.useEffect)(()=>{if(e===null||t===void 0||r.has(e))return;let a=!0;return o(`loading`),t(e).then(t=>{if(a){if(t===null){o(`absent`);return}i(n=>{let r=new Map(n);return r.set(e,t),r}),o(`idle`)}},e=>{console.warn(n,e),a&&o(`failed`)}),()=>{a=!1}},[e,t,s,r]),{values:r,state:a,retry:()=>{c(e=>e+1)}}}function It(e,t,n,r,i){return t===void 0?e(i):n===`absent`?e(`browser.notInLog`):n===`failed`?(0,d.jsx)(`button`,{type:`button`,className:`lc-br-retry hover:brightness-[1.15]`,onClick:r,children:e(`browser.loadFailed`)}):e(`browser.loading`)}function Lt(e){if(e==null||isNaN(e))return`—`;let t=e<0?`-`:``,n=Math.abs(e);return n>=1e9?t+(n/1e9).toFixed(1)+`B`:n>=1e6?t+(n/1e6).toFixed(1)+`M`:n>=1e3?t+(n/1e3).toFixed(1)+`k`:t+String(Math.round(n))}function Rt(e){return e==null||isNaN(e)||e<0?`—`:e>=1e6?(e/1e6).toFixed(1)+` MB`:e>=1e3?(e/1e3).toFixed(1)+` kB`:String(Math.round(e))+` B`}function zt(e,t){if(!(t>0))return null;let n=Math.trunc(e/t*100*100+1e-9);return`${Math.floor(n/100)}.${String(n%100).padStart(2,`0`)}`}let Bt=new Intl.DateTimeFormat(`en-GB`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`});function Vt(e){let t=new Date(e);return isNaN(t.getTime())?`—`:Bt.format(t)}function Ht(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0)return`—`;if(e<=0)return`0.0%`;let n=Math.min(1,e/t)*100;return n<.1?`<0.1%`:`${n.toFixed(1)}%`}function Ut(e){if(!Number.isFinite(e)||e<=0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return e<36e5?`${n}m${r}s`:`${Math.floor(n/60)}h${n%60}m`}let Wt=147456,Gt=(e,t)=>Math.floor(e/t),Kt=(e,t)=>Math.floor((e+t-1)/t);function qt(e,t){let n=e*(t+1)+2;return e%2==1&&(n+=t+1),n+=Kt(e,2)*(t+1)%2*2,n}function Jt(e,t,n){let r=e/t,i=Math.sqrt((n-2)/r+.25)-.5,a=i*r,o,s;if(i<1){let e=Gt(n-2,2);e%2==1&&--e,s=42,o=e*42}else if(a<2){let e=Gt(n-2,2)-1;if(e<=1)throw Error(`image tokens: budget too small to solve`);o=84,s=e*42}else{let n=Math.trunc(i),r=Math.trunc(a);r%2==1&&--r;let c=Math.min(n*42/t,r*42/e);s=Math.trunc(t*c/14)*14,o=Math.trunc(e*c/14)*14}let c=Kt(Gt(o,14),3),l=Kt(Gt(s,14),3);return{nLlmH:c,nLlmW:l,bestHeight:o,bestWidth:s,numTokens:qt(c,l)}}function Yt(e,t,n,r){let i=Kt(Gt(n,14),3),a=Kt(Gt(r,14),3),o={nLlmH:i,nLlmW:a,bestHeight:n,bestWidth:r,numTokens:qt(i,a)};if(o.numTokens>381){o=Jt(e,t,381);let n=381;for(;o.numTokens>381;)--n,o=Jt(e,t,n)}return o.numTokens+=3,o}function Xt(e,t){let n=e,r=t;n>r*8&&(n=r*8);let i=n*r;if(i<Wt&&i>0){let e=Math.sqrt(Wt/i);n=Math.trunc(n*e),r=Math.trunc(r*e)}let a=Kt(n,14)*14,o=Kt(r,14)*14;return Yt(r,n,o,a)}function Zt(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0)return null;try{let n=Xt(e,t);for(let e=1;e<10;e++){let e=Xt(n.bestWidth,n.bestHeight);if(e.nLlmH===n.nLlmH&&e.nLlmW===n.nLlmW&&e.bestHeight===n.bestHeight&&e.bestWidth===n.bestWidth&&e.numTokens===n.numTokens)return n.numTokens;n=e}return null}catch{return null}}function Qt(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.type!==`image`&&t.kind!==`image`)return null;let n=t.attachment;if(typeof n!=`object`||!n)return null;let r=n;if(typeof r.attachmentId!=`string`||r.attachmentId===``)return null;let i=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0,a=r.originalDimensions!==null&&typeof r.originalDimensions==`object`?r.originalDimensions:void 0,o=a!==void 0&&i(a.width)!==void 0&&i(a.height)!==void 0?{width:i(a.width),height:i(a.height)}:void 0;return{attachmentId:r.attachmentId,...typeof r.name==`string`&&r.name!==``?{name:r.name}:{},...i(r.bytes)===void 0?{}:{bytes:i(r.bytes)},...i(r.width)===void 0?{}:{width:i(r.width)},...i(r.height)===void 0?{}:{height:i(r.height)},...o===void 0?{}:{originalDimensions:o}}}function $t(e){let{t,fmt:n}=e;return function(e){let{attachment:r,load:i}=e,[a,o]=(0,u.useState)(null),[s,c]=(0,u.useState)(!1),[l,p]=(0,u.useState)(0),[m,h]=(0,u.useState)(!1),g=(0,u.useCallback)(()=>{h(!1)},[]);(0,u.useEffect)(()=>{if(i===void 0)return;let e=!0;return c(!1),o(null),i(r).then(t=>{e&&o(t)}).catch(()=>{e&&c(!0)}),()=>{e=!1}},[r,i,l]);let _=r.name??t(`attach.image`),v=(e,t)=>e!==void 0&&t!==void 0?`${e}×${t}`:null,y=[],b=r.originalDimensions===void 0?null:v(r.originalDimensions.width,r.originalDimensions.height);b!==null&&y.push({label:t(`attach.raw`),value:b});let x=v(r.width,r.height);x!==null&&y.push({label:t(`attach.sent`),value:r.bytes===void 0?x:`${x} · ${Rt(r.bytes)}`});let S=r.width!==void 0&&r.height!==void 0?Zt(r.width,r.height):null;return S!==null&&y.push({label:t(`attach.token`),value:`≈${n(S)}`,tip:t(`attach.tokensTip`)}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-att-item hover:border-(--dsw-alias-label-dimmed) hover:bg-[var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))]`,title:t(s?`attach.loadFailed`:`attach.open`),onClick:()=>{if(s){p(e=>e+1);return}a!==null&&h(!0)},children:[(0,d.jsx)(`span`,{className:`lc-att-thumb`,children:a===null?(0,d.jsx)(`span`,{className:s?`lc-att-err`:`lc-att-ph`,children:s?`⚠`:i===void 0?`🖼`:t(`attach.loading`)}):(0,d.jsx)(`img`,{src:a,alt:_})}),(0,d.jsxs)(`span`,{className:`lc-att-meta`,children:[(0,d.jsx)(`span`,{className:`lc-att-name`,title:_,children:_}),y.map(e=>(0,d.jsxs)(`span`,{className:`lc-att-row`,title:e.tip,children:[(0,d.jsx)(`b`,{className:`lc-att-row-label`,children:e.label}),e.value]},e.label))]})]}),m&&a!==null&&(0,d.jsx)(f.ImageLightbox,{src:a,alt:_,labels:{dialog:t(`attach.preview`),close:t(`attach.close`)},onClose:g})]})}}let en=f;function tn(e,t=en){try{let n=t[e];if(typeof n==`function`)return n}catch{}return()=>null}let nn=tn(`IconBranchOutlineRegular`),rn=tn(`IconPlusOutlineRegular`),an=tn(`IconCheckOutlineRegular`),on=tn(`IconCopyOutlineRegular`),sn=tn(`IconCloseOutlineRegular`),cn=tn(`IconSettingsOutlineMedium`),ln=tn(`IconChevronDownOutlineMedium`),un=tn(`IconChevronUpOutlineMedium`),dn=tn(`IconSearchOutlineRegular`),fn=f.MarkdownText;function pn(e,t,n){let r=t.toLowerCase(),i=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let e=a.nextNode();e!==null;e=a.nextNode())i.push(e);let o=[],s=[],c=!1;for(let e of i){let t=e.data,n=[],i=e,a=t.toLowerCase().indexOf(r);for(;a!==-1;){if(s.length>=500){c=!0;break}let e=i.splitText(a),t=e.splitText(r.length),o=document.createElement(`mark`);o.className=`lc-find-mark`,e.before(o),o.appendChild(e),s.push(o),n.push(o,t),i=t,a=t.data.toLowerCase().indexOf(r)}if(n.length>0&&o.push({node:e,full:t,created:n}),c)break}let l=Math.min(n,s.length-1);return l>=0&&(s[l].classList.add(`lc-find-mark-on`),s[l].scrollIntoView({block:`nearest`,inline:`nearest`})),{count:s.length,capped:c,restore:()=>{for(let{node:e,full:t,created:n}of o){e.data=t;for(let e of n)e.parentNode?.removeChild(e)}}}}function mn(e){let{t}=e;function n(){let[e,t]=(0,u.useState)(`md`);return[e,t]}function r(e){let n=(t,n,r)=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(e.mode===t?` lc-gran-on`:``),title:r,onClick:()=>{e.onPick(t)},children:n});return(0,d.jsxs)(`span`,{className:`lc-gran`,children:[n(`raw`,t(`rich.raw`),t(`rich.toRaw`)),n(`md`,t(`rich.md`),t(`rich.toMd`))]})}function i(e){let t=(0,u.useMemo)(()=>{let t=e.text.split(`
27
- `);return t.length>1&&t[t.length-1]===``?t.slice(0,-1):t},[e.text]);return(0,d.jsx)(`pre`,{className:`lc-ts-desc-body lc-ts-lines`,children:t.map((e,t)=>(0,d.jsx)(`span`,{className:`lc-ts-line`,children:e},t))})}function a(e){let[n,r]=(0,u.useState)(!1),i=(0,u.useCallback)(()=>{n||(0,f.writeClipboard)(e.text).then(e=>{e&&(r(!0),window.setTimeout(()=>{r(!1)},1200))})},[n,e.text]),a=t(n?`rich.copied`:`rich.copy`);return(0,d.jsx)(`button`,{type:`button`,className:`lc-rich-copy`+(n?` lc-rich-copy-on`:``),title:a,"aria-label":a,onClick:i,children:n?(0,d.jsx)(an,{size:13}):(0,d.jsx)(on,{size:13})})}function o(e){let n=(0,u.useMemo)(()=>({code:{copyLabel:t(`rich.md.copy`),copiedLabel:t(`rich.md.copied`)},footnotes:t(`rich.md.footnotes`)}),[t]);return e.mode===`md`?(0,d.jsx)(`div`,{className:`lc-ts-desc-md`,children:(0,d.jsx)(fn,{text:e.text,labels:n})}):(0,d.jsx)(i,{text:e.text})}function s(e,n){let[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(``),[l,f]=(0,u.useState)(0),[p,m]=(0,u.useState)(0),[h,g]=(0,u.useState)(!1),_=(0,u.useRef)(null),v=(0,u.useRef)(null);(0,u.useEffect)(()=>{if(!r||a===``){c(``);return}let e=window.setTimeout(()=>{c(a),f(0)},150);return()=>{window.clearTimeout(e)}},[r,a]),(0,u.useEffect)(()=>{r&&v.current?.focus()},[r]),(0,u.useLayoutEffect)(()=>{let e=_.current;if(!r||s===``||e===null){m(0),g(!1);return}let t=pn(e,s,l);return m(t.count),g(t.capped),l>=t.count&&f(t.count>0?t.count-1:0),()=>{t.restore()}},[r,s,l,e,n]);let y=(0,u.useCallback)(e=>{f(t=>p>0?(t+e+p)%p:0)},[p]),b=(0,u.useCallback)(e=>{e.key===`Enter`?(e.preventDefault(),y(e.shiftKey?-1:1)):e.key===`Escape`&&(e.preventDefault(),i(!1))},[y]),x=t(`rich.find`),S=(e,t,n,r=!1)=>(0,d.jsx)(`button`,{type:`button`,className:`lc-find-btn`,title:e,"aria-label":e,disabled:r,onClick:n,children:t});return{button:(0,d.jsx)(`button`,{type:`button`,className:`lc-find-btn`+(r?` lc-find-btn-on`:``),title:x,"aria-label":x,onClick:()=>{i(e=>!e)},children:(0,d.jsx)(dn,{size:13})}),bar:r?(0,d.jsxs)(`div`,{className:`lc-find`,children:[(0,d.jsx)(`input`,{ref:v,className:`lc-find-input focus:border-(--dsw-alias-label-dimmed)`,value:a,placeholder:t(`rich.findPlaceholder`),onChange:e=>{o(e.target.value)},onKeyDown:b}),s===``?null:(0,d.jsx)(`span`,{className:`lc-find-count`,children:String(p>0?l+1:0)+`/`+String(p)+(h?`+`:``)}),S(t(`rich.findPrev`),(0,d.jsx)(un,{size:13}),()=>{y(-1)},p===0),S(t(`rich.findNext`),(0,d.jsx)(ln,{size:13}),()=>{y(1)},p===0),S(t(`rich.findClose`),(0,d.jsx)(sn,{size:13}),()=>{i(!1)})]}):null,bodyKey:e,bodyRef:_}}return{RichText:o,RichSwitch:r,RichCopy:a,useRichMode:n,useRichFind:s}}function hn(e){let t=[];if(Array.isArray(e.anyOf)&&t.push(...e.anyOf),Array.isArray(e.oneOf)&&t.push(...e.oneOf),t.length===0)return null;let n=[];for(let e of t)typeof e==`object`&&e&&n.push(gn(e));return n.length>0?n.join(` | `):null}function gn(e){let t=hn(e);if(t!==null)return t;let n=e.type;if(n===`array`){let t=e.items;return typeof t==`object`&&t?`array<`+gn(t)+`>`:`array`}if(typeof n==`string`){if(n===`object`){let t=e.properties;if(typeof t==`object`&&t&&Object.keys(t).length>0)return`object{${Object.keys(t).length}}`}return Array.isArray(e.enum)&&e.enum.length>0?n+` (enum)`:n}return Array.isArray(e.enum)&&e.enum.length>0?`(enum)`:`unknown`}function _n(e){if(typeof e!=`object`||!e)return null;let t=e,n=e=>typeof e==`object`&&e?e:null,r=n(t.parameters)??n(t.input_schema)??n(t.inputSchema);return r===null?t.type===`object`&&t.properties!==void 0&&typeof t.properties==`object`?t:null:r}function vn(e){let t=gn(e.schema),n=e.schema.description;return(0,d.jsxs)(`div`,{className:`lc-ts-param-row`,children:[(0,d.jsx)(`span`,{className:`lc-ts-param-name`,children:e.name}),(0,d.jsx)(`span`,{className:`lc-ts-param-type`,children:t}),(0,d.jsx)(`span`,{className:e.required?`lc-ts-param-req`:`lc-ts-param-req-off`,children:e.required?`✓`:`·`}),typeof n==`string`&&n!==``?(0,d.jsx)(`span`,{className:`lc-ts-param-desc`,children:n}):null]})}function yn(e){let t=e.actions!==void 0||e.meta!==void 0;return(0,d.jsxs)(`div`,{className:`lc-ts-card`,children:[(0,d.jsxs)(`div`,{className:`lc-ts-card-head`+(e.foldHead===!0?` lc-ts-card-head-wrap`:``),children:[(0,d.jsx)(`b`,{className:e.labelClass,title:e.label,children:e.label}),t?(0,d.jsxs)(`span`,{className:`lc-ts-card-right`,children:[e.meta,e.actions]}):null,e.count===void 0?null:(0,d.jsx)(`span`,{className:`lc-ts-card-count`,children:e.count})]}),e.children]})}function bn(e){return e.split(/\r\n|\r|\n/).length}function xn(e){let{rich:t}=e,[n,r]=t.useRichMode(),i=t.useRichFind(e.text,n),a=(0,u.useMemo)(()=>bn(e.text),[e.text]);return(0,d.jsxs)(yn,{label:e.label,foldHead:!0,actions:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(t.RichSwitch,{mode:n,onPick:r}),(0,d.jsx)(t.RichCopy,{text:e.text}),i.button]}),meta:(0,d.jsx)(`span`,{className:`lc-ts-card-meta`,children:e.lines(a)}),children:[i.bar,(0,d.jsx)(`div`,{ref:i.bodyRef,children:(0,d.jsx)(t.RichText,{text:e.text,mode:n})},i.bodyKey)]})}function Sn(e){try{return JSON.stringify(e??``)}catch{return``}}function Cn(e){return(0,d.jsxs)(`div`,{className:`lc-br-toolctl`,children:[(0,d.jsx)(`input`,{className:`lc-br-tool-search focus:border-(--dsw-alias-label-dimmed)`,value:e.value,placeholder:e.placeholder,onChange:t=>{e.onChange(t.target.value)}}),e.children===void 0?null:(0,d.jsx)(`span`,{className:`lc-gran`,role:`group`,title:e.tip,children:e.children})]})}function wn(e){let{rich:t}=e,[n,r]=(0,u.useState)(!1),i=(0,u.useMemo)(()=>_n(e.schema),[e.schema]),a=(0,u.useMemo)(()=>{if(i===null)return[];let e=i.properties;if(typeof e!=`object`||!e)return[];let t=Array.isArray(i.required)?new Set(i.required.filter(e=>typeof e==`string`)):new Set,n=[];for(let r of Object.keys(e)){let i=e[r];typeof i==`object`&&i&&n.push({name:r,schema:i,required:t.has(r)})}return n},[i]),o=(0,u.useMemo)(()=>n?JSON.stringify(e.schema,null,2):``,[e.schema,n]);return(0,d.jsxs)(d.Fragment,{children:[e.description===void 0?null:(0,d.jsx)(xn,{label:e.labels.desc,text:e.description,rich:t,lines:e.lines}),i!==null&&a.length>0?(0,d.jsx)(yn,{label:e.labels.title,count:a.length,children:a.map(e=>(0,d.jsx)(vn,{name:e.name,schema:e.schema,required:e.required},e.name))}):i===null?null:(0,d.jsx)(`div`,{className:`lc-ts-params-empty`,children:e.labels.empty}),(0,d.jsxs)(`div`,{className:`lc-ts-json`,children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-ts-json-toggle hover:text-(--dsw-alias-label-primary) hover:underline`,onClick:()=>{r(e=>!e)},children:(n?`▾ `:`▸ `)+(n?e.labels.hide:e.labels.show)}),n?(0,d.jsx)(`pre`,{className:`lc-ts-desc-body lc-br-dim`,children:o}):null]})]})}function Tn(e){let{rich:t,img:n,labels:r}=e,i=[],a=[],o=()=>{if(a.length===0)return;let e=a;a=[],i.push((0,d.jsx)(yn,{label:r.images,count:e.length,children:(0,d.jsx)(`div`,{className:`lc-att-grid`,children:e.map((e,t)=>(0,d.jsx)(n.Card,{attachment:e,load:n.load},`${e.attachmentId}:${t}`))})},`img`+String(i.length)))};for(let s of e.blocks){let c=Qt(s);if(c!==null){a.push(c);continue}o();let l=typeof s==`object`&&s?s:null,u=l===null?``:typeof l.type==`string`?l.type:typeof l.kind==`string`?l.kind:``;if((u===`text`||u===`reasoning`)&&typeof l?.text==`string`){let n=u===`reasoning`?r.thinking:e.textLabel;i.push((0,d.jsx)(xn,{label:n,text:l.text,rich:t,lines:r.lines},i.length));continue}if(u===`tool-call`){i.push((0,d.jsx)(On,{name:typeof l?.name==`string`?l.name:`?`,argsRaw:l?.argsRaw??l?.arguments},i.length));continue}if(u===`tool-result`&&Array.isArray(l?.content)){i.push((0,d.jsx)(Tn,{blocks:l.content,textLabel:r.result,rich:t,img:n,labels:r},i.length));continue}i.push((0,d.jsx)(yn,{label:r.other,children:(0,d.jsx)(`pre`,{className:`lc-ts-desc-body lc-br-dim`,children:JSON.stringify(s,null,2)})},i.length))}return o(),(0,d.jsx)(d.Fragment,{children:i})}function En(e){if(e===void 0||!Array.isArray(e.content))return{fail:!1,exit:null};for(let t of e.content){let e=t?.text;if(typeof e!=`string`)continue;let n=e.trimEnd(),r=/\[(shell killed by signal: [^\]\n]+|shell exited(?:: code \d+)?)\]$/.exec(n);if(r!==null){let e=/\[exit code:\s*(\d+)\]\s*$/.exec(n.slice(0,r.index));if(e!==null)return{fail:!0,exit:Number(e[1])};let t=/: code (\d+)$/.exec(r[1]);return t===null?{fail:r[1].startsWith(`shell killed`),exit:null}:{fail:t[1]!==`0`,exit:t[1]===`0`?null:Number(t[1])}}let i=/\[exit code:\s*(\d+)\]$/.exec(n);if(i!==null)return{fail:!0,exit:Number(i[1])};if(/\[killed by signal: [^\]\n]+\]$/.test(n)||/\[status: (?:killed|failed)(?:, [^\]\n]*)?\]$/.test(n))return{fail:!0,exit:null}}return{fail:!1,exit:null}}function Dn(e,t){let n=En(t);return{err:e.err===!0||t?.isError===!0||n.fail,exit:n.exit}}function On(e){let t=(0,u.useMemo)(()=>ct(e.argsRaw),[e.argsRaw]);return(0,d.jsx)(yn,{label:(e.arrow??`→`)+` `+e.name,labelClass:`lc-ts-call-name`,meta:e.status,children:t===null?typeof e.argsRaw==`string`&&e.argsRaw!==``?(0,d.jsx)(`pre`,{className:`lc-ts-desc-body lc-br-dim`,children:e.argsRaw}):null:Object.keys(t).map(e=>(0,d.jsx)(kn,{name:e,value:t[e]},e))})}function kn(e){let t=e.value,n=typeof t==`string`?t:t===void 0?``:JSON.stringify(t);return(0,d.jsxs)(`div`,{className:`lc-ts-arg-row`,children:[(0,d.jsx)(`span`,{className:`lc-ts-param-name`,children:e.name}),(0,d.jsx)(`span`,{className:`lc-ts-arg-val`,children:n})]})}function An(e){let{node:t,conv:n,rich:r,img:i,labels:a}=e;if(n===void 0)return t.text===void 0||t.text===``?(0,d.jsx)(`div`,{className:`lc-br-note`,children:e.hint}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(xn,{label:a.content,text:t.text,rich:r,lines:a.lines}),(0,d.jsx)(`div`,{className:`lc-br-note`,children:e.hint})]});if(n.kind===`assistant`&&Array.isArray(n.blocks))return(0,d.jsx)(Tn,{blocks:n.blocks,textLabel:a.answer,rich:r,img:i,labels:a});if(n.kind===`tool-result`){let{err:e,exit:o}=Dn(t,n);return(0,d.jsxs)(d.Fragment,{children:[n.call==null?null:(0,d.jsx)(On,{arrow:`←`,name:n.call.name,argsRaw:n.call.argsRaw,status:a.callState(e,o)}),Array.isArray(n.content)?(0,d.jsx)(Tn,{blocks:n.content,textLabel:a.result,rich:r,img:i,labels:a}):null]})}return n.kind===`compaction`?typeof n.summary==`string`&&n.summary!==``?(0,d.jsx)(xn,{label:a.summary,text:n.summary,rich:r,lines:a.lines}):(0,d.jsx)(d.Fragment,{}):Array.isArray(n.content)?(0,d.jsx)(Tn,{blocks:n.content,textLabel:a.content,rich:r,img:i,labels:a}):(0,d.jsx)(`div`,{className:`lc-br-note`,children:e.hint})}function jn(e){let t={};for(let n of e.nodes)(t[n.cat]??=[]).push(n);return t}function Mn(e){return typeof e.name==`string`?e.name:``}function Nn(e,t){let n=!1,r=!1,i=!1;for(let e of[t?.blocks,t?.content])if(Array.isArray(e))for(let t of e){let e=typeof t==`object`&&t?t:null,a=e===null?``:typeof e.kind==`string`?e.kind:typeof e.type==`string`?e.type:``;a===`reasoning`?n=!0:a===`tool-call`?r=!0:a===`text`&&(i=!0)}return{think:n,tool:r||Array.isArray(e.calls)&&e.calls.length>0,answer:i||typeof e.text==`string`&&e.text!==``}}function Pn(e){if(e===void 0)return``;let t=``;for(let n of[e.blocks,e.content])if(Array.isArray(n))for(let e of n){let n=typeof e==`object`&&e?e:null;(n===null?``:typeof n.kind==`string`?n.kind:typeof n.type==`string`?n.type:``)===`reasoning`&&typeof n?.text==`string`&&(t+=n.text+`
28
- `)}return t}let Fn=[`think`,`tool`,`answer`];function In(e,t,n){return n===`system`?e.system===null?0:1:n===`tools`?e.header===null?0:e.header.tools.length:t[n]?.length??0}function Ln(e,t){for(let n=e.length-1;n>=0;n--)if((e[n].turn??0)===t)return e[n];return null}function Rn(e){let t=e.slice().sort((e,t)=>e.seq-t.seq);return e=>{for(let n of t)if(n.seq>e)return typeof n.turn==`number`&&typeof n.step==`number`?{turn:n.turn,step:n.step}:null;return null}}function zn(e,t,n){let{t:r,fmt:i,fmtTime:a,catLabel:o}=e,s=Dt(e),c=Ot(e),l=mn(e),f=$t(e),p=e=>r(e===1?`block.line`:`block.lines`,{n:e});return function(e){let{data:m,headers:h}=e,[g,_]=(0,u.useState)(`live`),[v,y]=(0,u.useState)(null),[b,x]=(0,u.useState)(null),[S,C]=(0,u.useState)(``),[w,T]=(0,u.useState)(null),[E,ee]=(0,u.useState)(()=>n.defaultToolSort()),[te,D]=(0,u.useState)(!1),O=e.dna!==void 0&&e.onDnaChange!==void 0,k=O?e.dna===!0:te,A=t=>{O?e.onDnaChange?.(t):D(t)},[j,M]=(0,u.useState)(null),[N,P]=(0,u.useState)(()=>n.defaultDeltaBase()),F=e.onOpenCat,I=e=>{y(e),F!==void 0&&F(e)},re=e.convNodes,ie=(0,u.useMemo)(()=>{let e=new Map;for(let t of re??[])e.set(t.seq,t);return e},[re]),z=b!==null&&b.startsWith(`n`)?Number(b.slice(1)):null,B=e.fetchContent,V=Ft(z!==null&&!ie.has(z)?z:null,B,`dsh-context: targeted history read failed`),H=(0,u.useMemo)(()=>{if(V.values.size===0)return ie;let e=new Map(ie);for(let[t,n]of V.values)e.has(t)||e.set(t,n);return e},[ie,V.values]),ae=e.pinSeq;(0,u.useEffect)(()=>{_(ae??`live`),I(null),x(null)},[ae,F]);let oe=(0,u.useRef)(null),se=(0,u.useRef)(!1),U=e.nodeFocus;(0,u.useEffect)(()=>{U!=null&&(_(U.step),I(U.cat),x(U.key),C(``),T(null),se.current=!0,e.onNodeFocusHandled!==void 0&&e.onNodeFocusHandled())},[U,e.onNodeFocusHandled,F]);let W=e.catFocus;(0,u.useEffect)(()=>{W!=null&&(_(`live`),I(W.cat),x(null),C(``),T(W.kind??null),e.onCatFocusHandled!==void 0&&e.onCatFocusHandled())},[W,e.onCatFocusHandled,F]),(0,u.useLayoutEffect)(()=>{se.current&&(se.current=!1,oe.current?.querySelector(`.lc-br-elem-on`)?.scrollIntoView({block:`nearest`}))});let G=It(r,B,V.state,V.retry,`browser.noContent`),K=m.requests,ce=(0,u.useMemo)(()=>jt(K),[K]),q=(0,u.useMemo)(()=>Rn(K),[K]),le=(0,u.useMemo)(()=>{let e=!1,t=-1,n=0,r=0;for(let i of K)e&&i.seq<=t||(e=!0,t=i.seq,n=typeof i.turn==`number`?i.turn:-1,r=typeof i.step==`number`?i.step:-1);if(e&&(n<0||r<0))return null;let i=-1,a=null;for(let e of m.nodes)(a===null||e.seq>i)&&(a=e,i=e.seq);if(a===null)return null;let o={turn:n+1,step:1};return a.cat===`user`?o:e?a.cat===`assistant`&&!Nn(a,H.get(a.seq)).tool?o:{turn:n,step:r+1}:null},[K,m.nodes,H]),J=(e.previewSeq!==null&&e.previewSeq!==void 0?K.find(t=>t.seq===e.previewSeq)??null:null)??(g===`live`?null:K.find(e=>e.seq===g)??null),ue=J??K.reduce((e,t)=>e===null||t.seq>e.seq?t:e,null),de=J===null?null:J.seq,fe=J===null&&e.onHoverKey!==void 0,pe=fe&&e.hoverKey!==null&&e.hoverKey!==`free`?e.hoverKey:null,Y=rt(m,h,de),me=e.fetchHeader,he=Y.header===null?null:Y.header.seq,ge=Y.system===null?null:Y.system.seq,_e=Ft(v===`system`?ge:v===`tools`?he:null,me,`dsh-context: header content fetch failed`),ve=_e.values,ye=It(r,me,_e.state,_e.retry,`browser.headerMetaOnly`),be=J===null?m.current:J,xe=R(be),Se=be.total,Ce=v!==null&&(be[v]||0)>0?v:null,we=e=>{_(e===`live`?`live`:Number(e)),I(null),x(null)},Te=e=>{let t=K.findIndex(t=>t.seq===e.seq);return t>0?K[t-1]:null},Ee=K.length>0?K[K.length-1]:null,De=e=>Ln(K,(e.turn??0)-1),Oe=J===null?N===`step`?Ee:Ee===null?null:De(Ee):N===`turn`?De(J):Te(J),ke=Oe===null&&Ee!==null,Ae=Oe===null?null:rt(m,h,Oe.seq),je=Ae===null?null:jn(Ae),Me=jn(Y),X=new Map;for(let e of Y.nodes)(e.cat===`tool`||e.cat===`skill`)&&e.tool!==void 0&&X.set(e.tool,(X.get(e.tool)??0)+1);let Ne=e=>X.get(e.name)??0,Pe=e=>{let t=st(e,r,o);return e.time===void 0?t:t+` · `+a(e.time)},Fe=k?it(Y):null,Ie=new Map(Fe?.map(e=>[e.key,e])??[]),Z=Fe?.map(e=>({key:e.key,color:ne[e.cat],value:e.tokens,label:Pe(e),group:e.cat}))??null,Le=j!==null&&Ie.has(j)?j:null,Re=e=>{let t=Ie.get(e);t!==void 0&&(I(t.cat),C(``),T(null),x(e),se.current=!0)},ze=e=>In(Y,Me,e),Be=e=>{if(e===`system`)return Y.system===null?null:`sys`;if(e===`tools`){let e=Y.header?.tools;return e!==void 0&&e.length===1?`tool:`+e[0].name:null}let t=Me[e]??[];return t.length===1?`n`+String(t[0].seq):null},Ve=e=>{if(ze(e)>0||(e===`system`||e===`tools`)&&Y.header===null){if(v===e){I(null),x(null);return}I(e),C(``),T(null),x(Be(e))}},He=e=>{x(b===e?null:e)},Ue=(e,t,n,o,s,c,l=!1,u=null,f=null)=>{let p=b===e;return(0,d.jsxs)(`div`,{className:`lc-br-elem`+(p?` lc-br-elem-on`:``),children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-br-elem-row hover:bg-(--dsw-alias-interactive-bg-hover)`,onClick:()=>{He(e)},children:[(0,d.jsx)(`span`,{className:`lc-br-chev`+(p?` lc-br-chev-on`:``)}),l?(0,d.jsx)(`span`,{className:`lc-br-err-dot`,title:r(`node.failed`)}):null,t===null?null:(0,d.jsx)(`span`,{className:`lc-br-tags`,children:t}),(0,d.jsx)(`span`,{className:`lc-br-preview`,children:n}),u===null?null:u,f!==null||s!==void 0?(0,d.jsxs)(`span`,{className:`lc-br-time`+(f!==null&&f.pending?` lc-br-time-pending`:``),title:f===null?void 0:r(f.pending?`browser.stepPendingTip`:`browser.stepAtTip`,{t:f.turn,s:f.step}),children:[f===null?``:r(`browser.stepAt`,{t:f.turn,s:f.step}),f!==null&&s!==void 0?` · `:``,s===void 0?``:a(s)]}):null,(0,d.jsx)(`span`,{className:`lc-br-tokens`,children:`≈`+i(o)})]}),p?(0,d.jsx)(`div`,{className:`lc-br-content`,children:c}):null]},e)},We=e=>{let t=q(e);return t===null?!Y.live||le===null?null:{...le,pending:!0}:{...t,pending:!1}},Ge=(e,t)=>{if(e===null)return null;if(t===null)return(0,d.jsx)(`span`,{className:`lc-br-tag`,children:e});let n=new Map;for(let e of t)n.set(e,(n.get(e)??0)+1);return[...n.entries()].map(([e,t])=>(0,d.jsx)(`span`,{className:`lc-br-tag`,children:t>1?e+` ×`+String(t):e},e))},Ke=t=>{if(t===`system`){let e=Y.system;if(e===null)return(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(h===null?`browser.noHeader`:`browser.noEpoch`)});let t=ve.get(e.seq);return t===void 0?(0,d.jsx)(`div`,{className:`lc-br-note`,children:ye}):t.system===void 0?(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.noSystem`)}):Ue(`sys`,null,t.system.replace(/\s+/g,` `).trim().slice(0,80),be.system,void 0,(0,d.jsx)(xn,{label:o(`system`),text:t.system,rich:l,lines:p}),!1,null,We(e.seq))}if(t===`tools`){if(Y.header===null)return(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(h===null?`browser.noHeader`:`browser.noEpoch`)});let e={desc:r(`tool.desc`),title:r(`tool.params`),empty:r(`tool.paramsEmpty`),show:r(`tool.jsonToggle`),hide:r(`tool.jsonHide`)},t=ve.get(Y.header.seq),n=We(Y.header.seq),a=new Map(t?.tools.map(e=>[e.name,e])??[]),o=S.trim().toLowerCase(),s=Y.header.tools.filter(e=>{if(o===``||e.name.toLowerCase().includes(o)||(e.plugin??``).toLowerCase().includes(o))return!0;let t=a.get(e.name);return t===void 0?!1:(t.description??``).toLowerCase().includes(o)||Sn(t.schema).toLowerCase().includes(o)}).sort((e,t)=>E===`count`?Ne(t)-Ne(e)||(e.name<t.name?-1:1):E===`size`?t.tokens-e.tokens:e.name<t.name?-1:1),c=(0,d.jsx)(Cn,{value:S,placeholder:r(`tool.search`),tip:r(`tool.sortTip`),onChange:C,children:[`size`,`count`,`name`].map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(E===e?` lc-gran-on`:``),onClick:()=>{ee(e)},children:r(`tool.sort.`+e)},e))});if(s.length===0)return(0,d.jsxs)(`div`,{children:[c,(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`tool.noMatch`)})]});let u=n=>{if(t===void 0)return(0,d.jsx)(`div`,{className:`lc-br-note`,children:ye});let i=a.get(n.name);return i===void 0?(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.notInLog`)}):(0,d.jsx)(wn,{description:i.description,schema:i.schema,rich:l,lines:p,labels:e})};return(0,d.jsxs)(`div`,{children:[c,s.map(e=>{let t=(0,d.jsxs)(d.Fragment,{children:[e.plugin===void 0?null:(0,d.jsx)(`span`,{className:`lc-br-tag lc-br-tool-plugin`,title:e.plugin===`<unknown-plugin>`?r(`tool.unknownTitle`):r(`tool.plugin`),children:e.plugin===`<unknown-plugin>`?r(`tool.unknown`):e.plugin}),(0,d.jsx)(`span`,{className:`lc-br-hits`,title:r(`tool.hitsTip`),children:`×`+i(Ne(e))})]});return Ue(`tool:`+e.name,null,e.name,e.tokens,void 0,u(e),!1,t,n)})]})}let n=(Me[t]??[]).slice().reverse().map(e=>{let t=H.get(e.seq),n=(e.cat===`tool`||e.cat===`skill`)&&Dn(e,t).err,i=null,a=null,o=c(e),s=Mn(e);if(e.cat===`tool`)i=e.tool??`?`,a=e.tool===void 0?null:[e.tool],o=wt(t)??r(`node.toolResult`);else if(e.cat===`skill`)i=e.skill===void 0?r(`form.`+(e.form||`context`)):r(`node.skillTag`,{name:e.skill}),o=(e.skill===void 0&&s!==``?s:null)??(e.text!==void 0&&e.text!==``?e.text:null)??wt(t)??o;else if(e.cat===`assistant`){let n=Array.isArray(e.calls)&&e.calls.length>0?e.calls:Et(t);n.length>0?(i=n.join(` › `),a=n,o=(e.text!==void 0&&e.text!==``?e.text:null)??Tt(t)??r(`node.empty`)):(e.text===void 0||e.text===``)&&(o=Tt(t)??o)}else if(e.cat===`user`){let n=t!==void 0&&Array.isArray(t.content)?t.content.filter(e=>Qt(e)!==null).length:0;n>0&&b!==`n${e.seq}`&&(i=r(`attach.image`)+(n>1?` ×`+String(n):``))}else i=r(`form.`+(e.form||`context`)),s===``?e.text!==void 0&&e.text!==``&&(o=e.form===`snapshot`?r(`node.snapshot`)+e.text:e.text):o=s;return{n:e,conv:t,rowErr:n,tag:i,tagNames:a,preview:o,reasoning:e.cat===`assistant`?Pn(t):``,kinds:Nn(e,t)}}),a=S.trim().toLowerCase(),s=t===`assistant`?Fn.map(e=>({k:e,n:n.reduce((t,n)=>t+ +!!n.kinds[e],0)})):null,u=a===``&&w===null?n:n.filter(e=>(w===null||e.kinds[w])&&(a===``||(e.tag??``).toLowerCase().includes(a)||e.preview.toLowerCase().includes(a)||typeof e.n.text==`string`&&e.n.text.toLowerCase().includes(a)||e.reasoning.toLowerCase().includes(a))),m=s===null?(0,d.jsx)(Cn,{value:S,placeholder:r(`browser.search.`+t),onChange:C}):(0,d.jsx)(Cn,{value:S,placeholder:r(`browser.search.`+t),tip:r(`browser.kindTip`),onChange:C,children:s.map(({k:e,n:t})=>(0,d.jsxs)(`button`,{type:`button`,className:`lc-gran-btn`+(w===e?` lc-gran-on`:``),onClick:()=>{T(w===e?null:e)},children:[r(`browser.kind.`+e),(0,d.jsx)(`span`,{className:`lc-kind-n`,children:i(t)})]},e))});return u.length===0?(0,d.jsxs)(`div`,{children:[m,(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.rowNoMatch`)})]}):(0,d.jsxs)(`div`,{children:[m,u.map(({n:t,conv:n,rowErr:i,tag:a,tagNames:o,preview:s})=>Ue(`n${t.seq}`,Ge(a,o),s,t.tokens,t.time,(0,d.jsx)(An,{node:t,conv:n,rich:l,img:{Card:f,load:e.loadImage},labels:{thinking:r(`block.thinking`),answer:r(`block.answer`),content:r(`block.content`),result:r(`block.result`),summary:r(`block.summary`),images:r(`attach.images`),other:r(`attach.other`),lines:p,callState:(e,t)=>(0,d.jsxs)(`span`,{className:`lc-ts-call-state `+(e?`lc-ts-call-err`:`lc-ts-call-ok`),children:[(0,d.jsx)(`i`,{}),e?r(`call.fail`)+(t===null?``:` · `+r(`call.exit`,{n:t})):r(`call.ok`)]})},hint:n===void 0?G:r(`browser.noContent`)}),i,null,We(t.seq)))]})};return(0,d.jsxs)(`div`,{className:`lc-card`,ref:oe,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`browser.title`)}),(0,d.jsx)(`span`,{className:`lc-gran lc-br-dna-ctl`,role:`group`,title:r(`browser.dnaTip`),children:(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(k?` lc-gran-on`:``),onClick:()=>{A(!k)},children:r(`browser.dna`)})}),(0,d.jsxs)(`span`,{className:`lc-gran`,role:`group`,title:r(`browser.base.tip`),children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(N===`step`?` lc-gran-on`:``),onClick:()=>{P(`step`)},children:r(`browser.base.step`)}),(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(N===`turn`?` lc-gran-on`:``),onClick:()=>{P(`turn`)},children:r(`browser.base.turn`)})]}),(0,d.jsxs)(`select`,{className:`lc-br-pick`,value:de===null?`live`:String(de),onChange:e=>{we(e.target.value)},children:[(0,d.jsx)(`option`,{value:`live`,children:r(`browser.live`)}),K.slice().reverse().map(e=>(0,d.jsx)(`option`,{value:String(e.seq),children:r(`detail.step`,{t:e.turn??0,s:e.step??0,n:ce(e.turn)})},e.seq))]})]}),(0,d.jsxs)(`div`,{className:`lc-br-meta`,children:[(0,d.jsx)(`b`,{children:J===null?r(`browser.liveNow`):r(`detail.step`,{t:J.turn??0,s:J.step??0,n:ce(J.turn)})}),J===null?null:(0,d.jsx)(`span`,{children:a(J.time)}),(0,d.jsx)(`span`,{className:`lc-est`,children:r(`detail.estTotal`,{n:i(Se)})}),ue!==null&&ue.prompt!==void 0?(0,d.jsx)(`span`,{children:r(`detail.actual`,{n:i(ue.prompt)})}):null]}),(0,d.jsx)(`div`,{className:`lc-br-bar`+(k?` lc-br-bar-dna`:``),children:(0,d.jsx)(t,{parts:Z??xe,height:10,hoverKey:k?Le??pe??Ce:pe??Ce,onHoverKey:k?M:fe?e.onHoverKey:void 0,tip:k,onPickKey:k?Re:void 0,minBand:k?.35:void 0})}),Y.missingLive>0?(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.missingLive`,{n:Y.missingLive})}):null,Y.approximate?(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.approx`)}):null,e.detailState===`loading`?(0,d.jsx)(s,{state:`loading`,className:`lc-br-note`}):null,e.detailState===`failed`&&e.onDetailRetry!==void 0?(0,d.jsx)(s,{state:`failed`,onRetry:e.onDetailRetry,className:`lc-br-note`}):null,(0,d.jsx)(`div`,{className:`lc-br-cats`,children:L.map(t=>{let n=ze(t.key),a=be[t.key]||0,s=ke?0:Ae!==null&&je!==null?In(Ae,je,t.key):null,c=s===null?null:n-s,l=ke?0:Oe===null?null:Oe[t.key]||0,u=l===null?null:a-l,f=n>0||(t.key===`system`||t.key===`tools`)&&Y.header===null,p=v===t.key&&f;return(0,d.jsxs)(`div`,{className:`lc-br-cat`+(f?``:` lc-br-cat-empty`),children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-br-cat-row hover:bg-(--dsw-alias-interactive-bg-hover)`+(p?` lc-br-cat-open`:``)+(fe&&e.hoverKey===t.key?` lc-br-cat-on`:``),onMouseEnter:fe?()=>{e.onHoverKey!==void 0&&e.onHoverKey(t.key)}:void 0,onMouseLeave:fe?()=>{e.onHoverKey!==void 0&&e.onHoverKey(null)}:void 0,onClick:()=>{Ve(t.key)},children:[(0,d.jsx)(`span`,{className:`lc-br-chev`+(p?` lc-br-chev-on`:``)}),(0,d.jsx)(`i`,{style:{background:t.color}}),(0,d.jsx)(`span`,{className:`lc-br-cat-label`,children:o(t.key)}),(0,d.jsxs)(`span`,{className:`lc-br-count-grp`,children:[(0,d.jsx)(`span`,{className:`lc-br-cat-count`,children:r(`browser.items`,{n})}),c!==null&&c!==0?(0,d.jsx)(`span`,{className:`lc-br-delta lc-br-delta-`+(c>0?`up`:`down`),children:`${c>0?`+`:``}${c}`}):null]}),(0,d.jsxs)(`span`,{className:`lc-br-tokens-grp`,children:[u!==null&&u!==0?(0,d.jsx)(`span`,{className:`lc-br-tdelta lc-br-tdelta-`+(u>0?`up`:`down`),children:(u>0?`+`:``)+i(u)}):null,(0,d.jsx)(`span`,{className:`lc-br-tokens`,children:`≈`+i(a)})]}),(0,d.jsx)(`span`,{className:`lc-br-pct`,children:Se>0?`${Math.round(a/Se*100)}%`:``})]}),p?(0,d.jsx)(`div`,{className:`lc-br-body`,children:Ke(t.key)}):null]},t.key)})})]})}}function Bn(e){let{t,fmt:n,catLabel:r}=e;return function(e){let[i,a]=(0,u.useState)(!1),o=0;for(let t of e.parts)o+=t.value;let s=e.max!==void 0&&e.max>o?e.max:o,c=e.max!==void 0&&e.max>o?e.max-o:0,l=s>0?o/s*100:0,f=e.hoverKey!==null&&e.hoverKey!==void 0,p=c>0&&f,m=e.onPickKey,h=e.minBand!==void 0&&e.minBand>0?e.minBand:0,g=o>0?e.parts.filter(e=>e.value>0):[],_=(()=>{if(h===0||g.length<2)return g.map(e=>e.value/s*100);let e=g.map(e=>e.value/o*100),t=Math.min(h,100/g.length),n=0,r=0;for(let i of e)i<t&&(n+=1,r+=i);if(n===0)return g.map(e=>e.value/s*100);let i=100-n*t,a=100-r;return e.map(e=>(e<t?t:e*i/a)*o/s)})(),v=e.reserve!==void 0&&e.max!==void 0&&e.max>0?{...e.reserve,max:e.max}:null,y=v===null?0:Math.round(v.max*v.ratio/s*1e3)/10,b=v===null?0:Math.round((1-v.ratio)*v.max/s*1e3)/10,x=null;if(i&&v!==null)x={text:v.label,leftPct:Math.max(12,Math.min(y+b/2,88))};else if(e.hoverKey!==null&&e.hoverKey!==void 0){if(e.hoverKey===`free`&&c>0){let e=s>0?c/s*100:0;x={text:`${t(`overview.free`)} ${n(c)} (${Math.round(e)}%)`,leftPct:Math.max(12,Math.min(o/s*100+e/2,88))}}else{let i=0,a=0;for(let t of e.parts)a+=t.raw??t.value;for(let o=0;o<g.length;o++){let s=g[o];if(s.key===e.hoverKey){let e=s.raw??s.value;x={text:`${s.label??r(s.key)} ≈${n(e)} (${a>0?Math.round(e/a*100):0}%) `+t(`overview.ofUsed`),leftPct:Math.max(12,Math.min(i+_[o]/2,88))};break}i+=_[o]}}}return(0,d.jsxs)(`div`,{className:`lc-stacked-wrap`,children:[(0,d.jsxs)(`div`,{className:`lc-stacked`+(f?` lc-stacked-dim`:``),style:{height:`${e.height||14}px`},onMouseLeave:()=>{e.onHoverKey!==void 0&&e.onHoverKey(null),a(!1)},children:[g.map((t,n)=>{let r=e.hoverKey!==void 0&&(e.hoverKey===t.key||t.group!==void 0&&e.hoverKey===t.group);return(0,d.jsx)(`div`,{className:`lc-stacked-seg animate-lc-stacked-in motion-reduce:animate-none`+(r?` lc-stacked-seg-on`:``)+(m===void 0?``:` lc-stacked-seg-pick`),style:{width:`${_[n]}%`,backgroundColor:t.color,"--lc-i":Math.min(n,8)},onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(t.key)},onClick:m===void 0?void 0:()=>{m(t.key)}},t.key)}),c>0?(0,d.jsx)(`div`,{className:`lc-stacked-free animate-lc-stacked-in motion-reduce:animate-none`+(e.hoverKey===`free`?` lc-stacked-free-on`:``),style:{width:`${c/s*100}%`,"--lc-i":Math.min(g.length,9)},onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(`free`)}},`free`):null,v===null?null:(0,d.jsx)(`div`,{className:`lc-reserve`,style:{left:`${y}%`,width:`${b}%`},onMouseEnter:()=>{a(!0),e.onHoverKey!==void 0&&e.onHoverKey(null)},onMouseLeave:()=>{a(!1)}}),(0,d.jsx)(`div`,{className:`lc-occupied-box`+(p?` lc-occupied-box-on`:``),style:{width:`${l}%`}})]}),e.tip===!1?null:(0,d.jsx)(`div`,{className:`lc-tip lc-bar-tip`+(x?` lc-bar-tip-on`:``),style:{left:x?`${x.leftPct}%`:`50%`},children:x?x.text:``})]})}}function Vn(e){let{t,fmt:n,catLabel:r}=e;return function(e){let i=0;for(let t of e.parts)i+=t.raw??t.value;return(0,d.jsx)(`div`,{className:`lc-legend`,children:e.parts.map(a=>{let o=a.raw??a.value,s=e.hoverKey!==void 0&&e.hoverKey===a.key;return(0,d.jsxs)(`span`,{className:`lc-chip`+(s?` lc-chip-on`:``),title:t(`overview.ofUsed`),onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(a.key)},onMouseLeave:()=>{e.onHoverKey!==void 0&&e.onHoverKey(null)},children:[(0,d.jsx)(`i`,{style:{background:a.color}}),(0,d.jsx)(`span`,{className:`lc-chip-label`,children:r(a.key)}),(0,d.jsxs)(`span`,{className:`lc-chip-nums`,children:[`≈`+n(o),i>0?(0,d.jsx)(`em`,{children:`${Math.round(o/i*100)}%`}):null]})]},a.key)})})}}function Hn(e,t,n){let{t:r,fmt:i}=e;return function(e){let a=e.head,o=a.window!=null&&a.window>0?{ratio:.8,label:r(`overview.compactReserve`,{pct:80})}:void 0;return(0,d.jsxs)(`div`,{className:`lc-card`,"data-lc-current":!0,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`overview.title`)}),e.subtitle!==void 0&&e.subtitle!==``?(0,d.jsx)(`span`,{className:`lc-card-sub`,children:e.subtitle}):null]}),(0,d.jsxs)(`div`,{className:`lc-overview-num`,children:[(0,d.jsx)(`b`,{children:i(a.tokens)}),(0,d.jsx)(`span`,{children:a.window?` / `+i(a.window)+` tokens`:` `+r(`overview.estimate`)}),a.pct===null?null:(0,d.jsxs)(`span`,{className:`lc-overview-pct`,children:[(0,d.jsx)(`b`,{children:`${a.pct.toFixed(1)}%`}),r(`overview.used`)]})]}),(0,d.jsx)(t,{parts:a.parts,height:16,max:a.window,hoverKey:e.hoverKey,onHoverKey:e.onHoverKey,reserve:o}),(0,d.jsx)(n,{parts:a.parts,hoverKey:e.hoverKey,onHoverKey:e.onHoverKey})]})}}function Un(e){return class extends u.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}render(){let t=this.state.error;return t===null?this.props.children:(0,d.jsx)(`div`,{className:`lc-root`,children:(0,d.jsxs)(`div`,{className:`lc-empty lc-error`,children:[(0,d.jsx)(`span`,{children:e(`error`)}),(0,d.jsx)(`code`,{className:`lc-error-msg`,children:t.message}),(0,d.jsx)(`button`,{type:`button`,className:`lc-error-retry hover:border-(--dsw-alias-label-primary)`,onClick:()=>{this.setState({error:null})},children:e(`error.retry`)})]})})}}}function Wn(e,t){let n=(0,u.useRef)(t);n.current=t,(0,u.useEffect)(()=>{if(!e)return;let t=document.activeElement instanceof HTMLElement?document.activeElement:null,r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n.current())};return window.addEventListener(`keydown`,r,!0),()=>{window.removeEventListener(`keydown`,r,!0),t!==null&&document.contains(t)&&t.focus()}},[e])}function Gn(e,t,n){let{t:r}=t,i=Bn(t),a=Hn(t,i,Vn(t)),o=zn(t,i,n),s=Dt(t),c=Un(r);function l(t){let n=typeof t.sessionId==`string`?t.sessionId:``,i=typeof t.useContextModal==`function`&&t.useContextModal(e=>e),c=et(t),l=c.data,f=U(t,`contextPressure`,he),p=U(t,`contextBreakdown`,ge),m=U(t,`contextHeaders`,Se),h=se(t),[g,_]=(0,u.useState)(null),[v,y]=(0,u.useState)({left:0,right:0}),b=(0,u.useRef)(null),x=(0,u.useMemo)(()=>oe(e,n===``?void 0:n),[e,n]),S=Ve(),C=(0,u.useMemo)(()=>n!==``&&S!==void 0?Ge(n):void 0,[n,S]),w=(0,u.useMemo)(()=>n!==``&&S!==void 0?qe(n):void 0,[n,S]),T=(0,u.useCallback)(()=>{if(n===``)return;te(n).set(!1);let t=k(n),r=e.get(`sessions`);if(t===void 0||r===void 0)return;let i=r.scope(n);i!==void 0&&i.bail(i,`slash/input-consume-token`,{guard:t})},[e,n]);if(Wn(i,T),(0,u.useLayoutEffect)(()=>{if(!i)return;let e=I(b.current);if(y({left:e.left,right:e.right}),e.frame===null)return;let t=new MutationObserver(()=>{let e=I(b.current);y({left:e.left,right:e.right})});return t.observe(e.frame,{attributes:!0,attributeFilter:[`style`]}),()=>{t.disconnect()}},[i]),!i)return null;let E=l===null?null:H(l,f,p),ee=l===null?``:(l.model?l.model:``)+(l.provider?` · `+l.provider:``);return(0,d.jsx)(`div`,{ref:b,className:`lc-modal-backdrop`,style:{left:v.left,right:v.right},onClick:T,children:(0,d.jsxs)(`div`,{className:`lc-modal-card`,onClick:e=>{e.stopPropagation()},children:[(0,d.jsxs)(`div`,{className:`lc-modal-head`,children:[(0,d.jsx)(`span`,{className:`lc-modal-title`,children:r(`tab`)}),(0,d.jsx)(`button`,{className:`lc-modal-close hover:text-(--dsw-alias-label-primary) hover:bg-(--dsw-alias-bg-layer-2)`,"aria-label":r(`cmd.close`),onClick:T,children:`×`})]}),l===null||E===null?c.detailState===`failed`?(0,d.jsx)(s,{state:`failed`,onRetry:c.retryDetail}):(0,d.jsx)(`div`,{className:`lc-empty`,children:r(`loading`)}):(0,d.jsxs)(`div`,{children:[(0,d.jsx)(a,{head:E,subtitle:ee,hoverKey:g,onHoverKey:_}),(0,d.jsx)(o,{data:l,headers:m,convNodes:h,fetchContent:C,fetchHeader:w,loadImage:x,hoverKey:g,onHoverKey:_,detailState:c.detailState,onDetailRetry:c.retryDetail})]})]})})}return function(e){return(0,u.createElement)(c,null,(0,u.createElement)(l,e))}}let Kn={"deepseek-official":`deepseek`,"deepseek-account":`deepseek`,"kimi-coding":`moonshotai`,"minimax-cn":`minimax`,"zai-coding-cn":`zhipuai`};function qn(e){return Kn[e]??e}function Jn(e){return qn(e)===`deepseek`}function Yn(e,t){return t===`cny`?e/.15:e}function Xn(e,t){let n=(e,t)=>Math.abs(e-t)<=1e-9*Math.max(1,Math.abs(e));return n(e.hit,t.hit)&&n(e.miss,t.miss)&&n(e.write,t.write)&&n(e.out,t.out)}function Zn(e){let t=e;if(typeof t!=`object`||!t)return null;let n=t,r=e=>typeof e==`number`&&Number.isFinite(e);return r(n.hit)&&r(n.miss)&&r(n.write)&&r(n.out)?{hit:n.hit,miss:n.miss,write:n.write,out:n.out}:null}function Qn(e,t){let n=new Map,r=(e,t)=>{let r=n.get(e);r===void 0?n.set(e,[t]):r.some(e=>e.pid===t.pid&&Xn(e.rate,t.rate))||r.push(t)};for(let n of Object.keys(e)){let i=nr(e,n);if(i===null)continue;let a=t[n],o=typeof a==`string`&&a.startsWith(`@ai-sdk/`)&&a.slice(8)===n;for(let e of Object.keys(i)){let t=Zn(i[e]);if(t===null)continue;let a=e.toLowerCase(),s={pid:n,mid:e,rate:t,primary:o};r(a,s);let c=a.split(`-`);for(let e=1;e<c.length;e++)r(c.slice(e).join(`-`),s)}}return{byModel:n}}function $n(e){let t=[];for(let n of e){let e=t.find(e=>Xn(e.cand.rate,n.rate));e===void 0?t.push({cand:n,n:1}):e.n++}return t.sort((e,t)=>t.n-e.n),t.length>1&&t[0].n===t[1].n?null:t[0].cand}function er(e,t,n){if(n!==null){let e=t.filter(e=>e.pid===n||n.startsWith(e.pid+`-`)||n.length>=4&&n.startsWith(e.pid));if(e.length>0){let t=$n(e);if(t!==null)return t}}let r=t.filter(e=>e.primary);if(r.length>0){let e=$n(r);if(e!==null)return e}let i=t.filter(t=>e.startsWith(t.pid+`-`)||e.startsWith(t.pid+`/`));if(i.length>0){let e=$n(i);if(e!==null)return e}return t.length===1?t[0]:null}function tr(e,t){let n=t.toLowerCase(),r=n.lastIndexOf(`/`),i=r>0?n.slice(0,r):null;for(let t of r>0?[n,n.slice(r+1)]:[n]){let n=e.byModel.get(t);if(n===void 0)continue;let r=er(t,n,i);if(r!==null)return r}return null}function nr(e,t){let n=e[t];return typeof n==`object`&&n?n:null}function rr(e,t){if(Object.hasOwn(e,t))return{mid:t,rate:e[t]};let n=t.toLowerCase(),r=null,i=null;for(let t in e){let a=t.toLowerCase();if(a===n||a.endsWith(`-`+n)){if(i!==null&&i!==a)return null;i=a,r={mid:t,rate:e[t]}}}return r}function ir(e,t,n){if(e==null)return null;let r=qn(t),i=nr(e.prices,r);if(i!==null){let e=rr(i,n);return e===null?null:{pid:r,mid:e.mid,rate:e.rate}}if(n.toLowerCase().startsWith(`deepseek-`)){let t=nr(e.prices,`deepseek`);if(t!==null){let e=rr(t,n);if(e!==null)return{pid:`deepseek`,mid:e.mid,rate:e.rate}}}let a=tr(e.index,n);return a===null?null:{pid:a.pid,mid:a.mid,rate:a.rate}}function ar(e,t,n){return ir(e,t,n)?.rate??null}function or(e,t,n){if(e==null||t==null)return null;let r=0,i=!1;for(let n of Object.keys(e)){let a=W(e[n]);if(a===null)continue;let o=Jn(n);for(let e of Object.keys(a)){let s=ar(t,n,e),c=W(a[e]);if(s!==null&&c!==null)for(let e of[`peak`,`off`]){let t=W(c[e]);if(t===null)continue;let n=(G(t.cacheRead)*s.hit+G(t.uncached)*s.miss+G(t.cacheWrite)*s.write+G(t.output)*s.out)/1e6;r+=o&&e===`peak`?n*2:n,i=!0}}}return i?Yn(r,n):null}function sr(e){if(e==null)return 0;let t=0;for(let n of Object.keys(e)){let r=W(e[n]);if(r!==null)for(let e of Object.keys(r)){let n=W(r[e]);if(n!==null)for(let e of[`peak`,`off`]){let r=W(n[e]);r!==null&&(t+=G(r.uncached)+G(r.cacheRead)+G(r.cacheWrite)+G(r.output))}}}return t}function cr(e,t){if(t==null)return!1;let n=!1;for(let r of Object.keys(t)){let i=W(t[r]);if(i===null||Array.isArray(i))continue;let a=e[r]??(e[r]={});for(let e of Object.keys(i)){let t=W(i[e]);if(t===null||Array.isArray(t))continue;let r=a[e]??(a[e]={});for(let e of[`peak`,`off`]){let i=W(t[e]);if(i===null||Array.isArray(i))continue;let a=r[e]??{uncached:0,cacheRead:0,cacheWrite:0,output:0};r[e]={uncached:a.uncached+G(i.uncached),cacheRead:a.cacheRead+G(i.cacheRead),cacheWrite:a.cacheWrite+G(i.cacheWrite),output:a.output+G(i.output)},n=!0}}}return n}function lr(...e){let t={},n=!1;for(let r of e)cr(t,r)&&(n=!0);return n?t:null}function ur(e,t){return(t===`cny`?`¥`:`$`)+(e>=1?e.toFixed(2):e.toPrecision(2))}function dr(e,t){return(t===`cny`?`¥`:`$`)+e.toFixed(2)}var fr=class extends Error{reason;name=`ModelsDevError`;constructor(e,t){super(e,t),this.reason=e}};function pr(e={}){let t=e.baseUrl??`https://models.dev`,n=t.endsWith(`/`)?t:t+`/`,r=async(t,r)=>{let i=e.fetch??globalThis.fetch,a=new Headers;for(let[t,n]of new Headers(e.headers))a.set(t,n);for(let[e,t]of new Headers(r?.headers))a.set(e,t);let o;try{let e=new URL(t,n),s=r?.modelTypes;s===`all`?e.searchParams.set(`type`,`all`):s&&s.length>0&&e.searchParams.set(`type`,s.join(`,`)),o=await i(e,{method:`GET`,headers:a,signal:r?.signal})}catch(e){throw new fr(`Transport`,{cause:e})}if(!o.ok){try{await o.body?.cancel()}catch{}throw new fr(`UnexpectedStatus`,{cause:{status:o.status}})}let s;try{s=await o.text()}catch(e){throw new fr(`Transport`,{cause:e})}if(s===``)throw new fr(`MalformedResponse`);try{return JSON.parse(s)}catch(e){throw new fr(`MalformedResponse`,{cause:e})}};return{providers:e=>r(`api.json`,e),models:e=>r(`models.json`,e),catalog:e=>r(`catalog.json`,e)}}function mr(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:null}function hr(e){let t=W(e);if(t===null||Array.isArray(t))return null;let n={},r={};for(let e of Object.keys(t)){let i=W(t[e]);if(i===null)continue;let a=W(i.models);if(a===null)continue;let o=i.npm;r[e]=typeof o==`string`?o:null;let s={};for(let e of Object.keys(a)){let t=W(a[e]),n=t===null?null:W(t.cost);if(n===null)continue;let r=mr(n.input),i=mr(n.output);r!==null&&i!==null&&(s[e]={hit:mr(n.cache_read)??r,miss:r,write:mr(n.cache_write)??r,out:i})}Object.keys(s).length>0&&(n[e]=s)}return{prices:n,index:Qn(n,r)}}let gr=()=>pr().providers(),_r={book:null,failed:!1},vr=!1,yr=0,br=null,xr=new Set;function Sr(){_r={..._r,failed:!0},yr++,br=setTimeout(()=>{br=null,Cr()},3e4*2**Math.min(yr-1,3))}async function Cr(){vr=!0;try{let e=hr(await gr());e===null?Sr():(_r={book:e,failed:!1},yr=0)}catch{Sr()}vr=!1;for(let e of xr)e()}function wr(){_r.book!==null||vr||br!==null||Cr()}let Tr=e=>(xr.add(e),wr(),()=>{xr.delete(e)}),Er=()=>_r;function Dr(){return(0,u.useSyncExternalStore)(Tr,Er)}function Or(e){return encodeURIComponent(e).replace(/%3A/gi,`:`)}function kr(e){return e.split(`/`).map(Or).join(`/`)}function Ar(e,t){let n=t.replace(/\\/g,`/`).replace(/^(?:\.\/)+/,``);return`dsh-resource://file/session/${Or(e)}/${kr(n)}`}function jr(e){return/^[A-Za-z]:[/\\]/.test(e)||e.startsWith(`\\\\`)}function Mr(e){return e.startsWith(`/`)||jr(e)}function Nr(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return t.slice(n+1)}function Pr(e,t,n){let r=n.replace(/\\/g,`/`);if(!Mr(r))return Ar(e,r);let i=t===void 0?``:t.replace(/\\/g,`/`).replace(/\/+$/,``);return i!==``&&r===i?Ar(e,``):i!==``&&r.startsWith(`${i}/`)?Ar(e,r.slice(i.length+1)):Ar(e,r)}let Fr=/^\d{4}-\d{2}-\d{2}$/;function Ir(e){if(!Number.isFinite(e))return null;let t=new Date(e),n=t.getFullYear();return!Number.isFinite(n)||n<1970||n>9999?null:`${String(n).padStart(4,`0`)}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function Lr(e,t){if(!Fr.test(e))return null;let n=Number(e.slice(0,4)),r=Number(e.slice(5,7)),i=Number(e.slice(8,10)),a=new Date(n,r-1,i);return a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==i?null:(a.setDate(a.getDate()+t),Ir(a.getTime()))}function Rr(e){if(!Fr.test(e))return null;let t=Number(e.slice(0,4)),n=Number(e.slice(5,7)),r=Number(e.slice(8,10)),i=new Date(t,n-1,r);return i.getFullYear()!==t||i.getMonth()!==n-1||i.getDate()!==r?null:Lr(e,-i.getDay())}function zr(e){let t=W(e);if(t===null)return null;let n=W(t.projectionValues);return{...typeof t.displayTitle==`string`?{displayTitle:t.displayTitle}:{},...typeof t.title==`string`?{title:t.title}:{},...typeof t.parentId==`string`?{parentId:t.parentId}:{},...typeof t.origin==`string`?{origin:t.origin}:{},running:t.running===!0,completed:t.completed===!0,blank:t.blank===!0,updatedAt:G(t.updatedAt),...n===null?{}:{projections:n}}}function Br(e){let t=W(e);return t===null||t.mode!==`one-shot`&&t.mode!==`continuable`?null:{mode:t.mode,...typeof t.label==`string`&&t.label!==``?{label:t.label}:{}}}function Vr(e){let t=W(e);if(t===null)return null;let n=G(t.settledMs),r=W(t.active),i=n+(r===null?0:Math.max(0,G(r.through)-G(r.since)));return i>0?i:null}function Hr(e){let t=de(e?.contextTimeline),n=he(e?.contextPressure),r=ge(e?.contextBreakdown),i=_e(e?.tokenUsage),a=null;if(t!==null)a=H(t,n,r);else if(n!==null){let e=typeof n.projectedTokens==`number`?n.projectedTokens:typeof n.pressureTokens==`number`?n.pressureTokens:null;if(e!==null){let t=typeof n.contextWindow==`number`&&n.contextWindow>0?n.contextWindow:void 0;a={tokens:e,window:t,pct:t===void 0?null:V(e,t),parts:[]}}}let o=i===null?null:G(i.uncachedInputTokens)+G(i.outputTokens)+G(i.cacheReadTokens)+G(i.cacheWriteTokens);return{head:a,requests:t===null?0:t.counts?.steps??t.requests.length,billed:o,durationMs:Vr(e?.subagentTiming),identity:Br(e?.subagent)}}function Ur(e,t,n,r){let i=W(W(e)?.byId);if(i===null||t===void 0||t===``)return null;let a=new Map;for(let e of Object.keys(i)){let n=zr(i[e]);n!==null&&(!n.blank||e===t)&&a.set(e,n)}a.has(t)||a.set(t,{running:!1,completed:!1,blank:!1,updatedAt:0});let o=t,s=new Set([t]);for(;;){let e=a.get(o)?.parentId;if(e===void 0||!a.has(e)||s.has(e))break;s.add(e),o=e}let c=a.get(o);if(c===void 0)return null;let l=new Map;for(let[e,t]of a){if(t.parentId===void 0||!a.has(t.parentId))continue;let n=l.get(t.parentId)??[];n.push({id:e,row:t}),l.set(t.parentId,n)}for(let e of l.values())e.sort((e,t)=>{let n=Number(t.row.running)-Number(e.row.running);if(n!==0)return n;let r=t.row.updatedAt-e.row.updatedAt;return r===0?e.id<t.id?-1:1:r});let u=(e,t)=>{if(t.has(e))return 0;t.add(e);let n=1;for(let r of l.get(e)??[])n+=u(r.id,t);return n},d=u(o,new Set),f=[],p=[],m=(e,i,a,o,s,c)=>{if(s.has(e)||f.length>=25)return;s.add(e);let u=i.projections,d=r===void 0?void 0:r.get(e),h=Hr(d!==void 0&&u?.contextTimeline===void 0?{...u,contextTimeline:d}:u),g=h.identity,_={...h,id:e,label:g?.label??i.title??i.displayTitle??e,...a===void 0?{}:{parentId:a},depth:o,family:c,isCurrent:e===t,running:i.running,completed:i.completed,subagent:i.origin===`subagent`||g!==null};_.isCurrent&&n!==void 0&&(_.head=n.head??_.head,_.billed=n.billed??_.billed,_.requests=n.requests>0?n.requests:_.requests),f.push(_),a!==void 0&&p.push({from:a,to:e}),(l.get(e)??[]).forEach((t,n)=>{m(t.id,t.row,e,o+1,s,o===0?n:c)})};return m(o,c,void 0,0,new Set,-1),{nodes:f,edges:p,overflow:Math.max(0,d-f.length),solo:f.length===1}}function Wr(e,t,n){let r=W(W(e)?.byId);if(r===null||t===void 0||t===``)return{usage:null,cold:[],count:0};let i=new Map;for(let e of Object.keys(r)){let t=zr(r[e]);if(t===null||t.blank||t.parentId===void 0)continue;let n=i.get(t.parentId)??[];n.push(e),i.set(t.parentId,n)}let a=[],o=[],s=new Set([t]),c=[t];for(let e=0;e<c.length;e++){let t=c[e];for(let e of i.get(t)??[]){if(s.has(e))continue;s.add(e);let t=n?.get(e),i=zr(r[e])?.projections;if(i?.contextTimeline===void 0)t===void 0?o.push(e):t.cost!==void 0&&a.push(t.cost);else{let e=de(i.contextTimeline)?.cost;e!==void 0&&a.push(e)}c.push(e)}}return{usage:a.length>0?lr(...a):null,cold:o,count:s.size-1}}function Gr(e,t=0){let n=new Map;for(let t of e.nodes){if(t.parentId===void 0)continue;let e=n.get(t.parentId)??[];e.push(t),n.set(t.parentId,e)}let r=new Map,i=0,a=e=>{let t=n.get(e.id)??[];if(t.length===0){let t=i;return i++,r.set(e.id,t),t}let o=0,s=0;t.forEach((e,t)=>{let n=a(e);t===0&&(o=n),s=n});let c=(o+s)/2;return r.set(e.id,c),c};e.nodes.length>0&&a(e.nodes[0]);let o=t>0?Math.max(2,Math.floor(t/112)):0;if(o>0&&i>o){let r=Math.min(184,t/o),i=o*r,a=[],s=0,c=(e,t)=>{let l=(i-e.length*r)/2;e.forEach((e,n)=>{a.push({id:e.id,x:l+(n+.5)*r,y:56+s*154,depth:t})}),s++;let u=[],d=()=>{if(u.length===0)return;let e=u;u=[],c(e,t+1)};for(let t of e){let e=n.get(t.id)??[];for(let t=0;t<e.length;t+=o){let n=e.slice(t,t+o);u.length+n.length>o&&d(),u.push(...n),u.length===o&&d()}}d()};return e.nodes.length>0&&c([e.nodes[0]],0),{width:i,height:56+(s-1)*154+90+28,captionW:r-8,points:a,links:qr(e,a)}}let s=t>0&&i>1?Math.min(184,t/i):184,c=e.nodes.map(e=>({id:e.id,x:(r.get(e.id)??0)*s+s/2,y:56+e.depth*154,depth:e.depth})),l=c.reduce((e,t)=>Math.max(e,t.depth),0);return{width:i*s,height:56+l*154+90+28,captionW:s-8,points:c,links:qr(e,c)}}function Kr(e){return`hsl(${Math.round(e*137.508)%360} 58% 52%)`}function qr(e,t){let n=new Map(t.map(e=>[e.id,e])),r=new Map(e.nodes.map(e=>[e.id,e])),i=new Set(e.nodes.filter(e=>e.running).map(e=>e.id)),a=[];for(let t of e.edges){let e=n.get(t.from),o=n.get(t.to);e!==void 0&&o!==void 0&&a.push({to:t.to,running:i.has(t.to),color:Kr(r.get(t.to)?.family??0),x1:e.x,y1:e.y+90,x2:o.x,y2:o.y-26-10})}return a}function Jr(e,t,n,r){let i=2*Math.PI*n,a=t===null?1:Math.min(100,Math.max(0,t))/100,o=0;for(let t of e)o+=t.value>0?t.value:0;let s=[],c=0;if(o>0)for(let t of e){if(t.value<=0)continue;let e=i*(t.value/o)*a;e<=0||(s.push({key:t.key,color:t.color,len:e,offset:c,free:!1}),c+=e)}else t!==null&&a>0&&(s.push({key:`fill`,color:r,len:i*a,offset:0,free:!1}),c=i*a);return t!==null&&c<i&&s.push({key:`free`,color:``,len:i-c,offset:c,free:!0}),s}function Yr(e){let t=W(e.get(`sessions`));if(t===null)return null;let n=W(t.list);return n===null||typeof n.getSnapshot!=`function`||typeof n.subscribe!=`function`?null:t}function Xr(e){if(!Number.isFinite(e)||e<0)return`—`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}function Zr(e){if(typeof e!=`function`)return null;try{return e(e=>e)}catch{return null}}function Qr(e){return Zr(e.useSessions)}function $r(e){return Zr(e.useWorkspaces)}function ei(e){let t=W(e);if(t===null||!Array.isArray(t.items))return null;let n={},r=n;for(let e of t.items){let t=W(e);if(t===null)continue;let i=typeof t.title==`string`&&t.title!==``?t.title:void 0;if(i!==void 0&&Array.isArray(t.sessionIds))for(let e of t.sessionIds)typeof e==`string`&&r[e]===void 0&&(n[e]=i)}return n}function ti(e){if(e===void 0||e===``)return;let t=Nr(e);return t===``?void 0:t}function ni(e,t){let n=W(t);if(n===null||!Array.isArray(n.items))return[];let r=new Map,i=[];for(let e of n.items){let t=W(e);if(t===null)continue;let n=typeof t.title==`string`&&t.title!==``?t.title:void 0;if(n!==void 0&&Array.isArray(t.sessionIds)){i.push(n);for(let e of t.sessionIds)typeof e==`string`&&!r.has(e)&&r.set(e,n)}}let a=new Map,o=0;for(let t of e){let e=r.get(t.id);e===void 0?o++:a.set(e,(a.get(e)??0)+1)}let s=[];for(let e of i){let t=a.get(e)??0;t>0&&s.push({key:e,count:t})}return o>0&&s.push({key:`__ungrouped__`,count:o}),s}function ri(e,t,n){let r=(n??{})[e.id];return t===`__ungrouped__`?r===void 0:r===t}function ii(e){try{let t=W(e)?.archivedSessionIds;return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function ai(e,t){let n=W(e);if(n===null||!Array.isArray(n.ids))return null;let r=n.ids.filter(e=>typeof e==`string`),i=ii(t),a=W(n.byId)??{},o=typeof n.current==`string`?n.current:void 0,s=[];for(let e of r)if(!i.has(e))try{let t=W(a[e]);if(t===null||t.blank===!0||t.origin===`subagent`)continue;let n=typeof t.displayTitle==`string`&&t.displayTitle!==``?t.displayTitle:void 0,r=typeof t.title==`string`&&t.title!==``?t.title:void 0,i=typeof t.cwd==`string`&&t.cwd!==``?t.cwd:void 0,c=W(t.projectionValues);s.push({id:e,title:n??r??e,...i===void 0?{}:{cwd:i},updatedAt:typeof t.updatedAt==`number`&&Number.isFinite(t.updatedAt)?t.updatedAt:0,running:t.running===!0,current:e===o,timeline:de(c?.contextTimeline),activity:Ce(c?.contextActivity),family:[],familyCost:null})}catch{}let c=new Map;for(let e of Object.keys(a))try{let t=zr(a[e]);if(t===null||t.blank||t.parentId===void 0)continue;let n=c.get(t.parentId)??[];n.push(e),c.set(t.parentId,n)}catch{}for(let e of s){let t=[e.timeline],n=[e.activity],r=new Set([e.id]),i=[e.id];for(let e=0;e<i.length;e++)for(let o of c.get(i[e])??[]){if(r.has(o))continue;r.add(o);let e=W(W(a[o])?.projectionValues);t.push(de(e?.contextTimeline)),n.push(Ce(e?.contextActivity)),i.push(o)}e.family=t,e.familyCost=lr(...t.map(e=>e?.cost)),e.activity=oi(n)}return s}function oi(e){let t={},n=t,r=!1;for(let i of e)if(i!==null){r=!0;for(let e of Object.keys(i.days)){let r=i.days[e],a=n[e];a===void 0?t[e]={tokens:r.tokens,requests:r.requests,...r.cost===void 0?{}:{cost:r.cost},...r.skills===void 0?{}:{skills:r.skills}}:(a.tokens+=r.tokens,a.requests+=r.requests,r.cost!==void 0&&(a.cost=lr(a.cost,r.cost)??r.cost),r.skills!==void 0&&(a.skills=si(a.skills,r.skills)))}}return r?{days:t}:null}function si(e,t){let n={...e};for(let e of Object.keys(t)){let r=t[e],i=n[e];n[e]=i===void 0?r:{n:i.n+r.n,last:Math.max(i.last,r.last)}}return n}function ci(e,t){return e===`24h`?t-864e5:e===`7d`?t-6048e5:e===`30d`?t-2592e6:null}function li(e){return vi(e.familyCost)?.total??null}function ui(e){return e===null?0:e.counts?.turns??e.requests.length}function di(e){let t=e?.days;if(t===void 0)return;let n;for(let e of Object.keys(t))(n===void 0||e<n)&&(n=e);return n}function fi(e,t,n){let r=ci(t.range,n),i=t.query.trim().toLowerCase();return e.filter(e=>{if(r!==null&&e.updatedAt<r)return!1;if(t.day!==null){let n=e.activity?.days[t.day];if(n===void 0||n.tokens<=0&&n.requests<=0)return!1}if(i!==``){let t=e.title.toLowerCase().includes(i),n=e.cwd!==void 0&&e.cwd.toLowerCase().includes(i),r=e.timeline?.lastUser,a=typeof r==`string`&&r.toLowerCase().includes(i);if(!t&&!n&&!a)return!1}return!0})}function pi(e,t){let n=[...e];return t===`tokens`?n.sort((e,t)=>(li(t)??-1)-(li(e)??-1)):t===`context`?n.sort((e,t)=>(t.timeline?.current.total??-1)-(e.timeline?.current.total??-1)):n.sort((e,t)=>t.updatedAt-e.updatedAt),n}function mi(e,t){let n=Math.max(1,Math.ceil(e.length/12)),r=Math.min(Math.max(0,t),n-1);return{items:e.slice(r*12,(r+1)*12),index:r,count:n}}function hi(e,t){if(e.day!==null)return t=>t===e.day;let n=ci(e.range,t),r=n===null?null:Ir(n);return r===null?()=>!0:e=>e>=r}function gi(e,t,n){let r=hi(t,n),i=new Map;for(let t of e){let e=t.activity?.days;if(e===void 0)continue;let n=new Set;for(let t of Object.keys(e)){if(!r(t))continue;let a=e[t].skills;if(a!==void 0)for(let e of Object.keys(a)){let t=a[e],r=i.get(e);r===void 0?i.set(e,{name:e,loads:t.n,sessions:1,last:t.last}):(r.loads+=t.n,r.last=Math.max(r.last,t.last),n.has(e)||(r.sessions+=1)),n.add(e)}}}let a=(e,t)=>e.name<t.name?-1:1,o=[...i.values()];switch(t.sort??`loads`){case`recent`:return o.sort((e,t)=>t.last-e.last||t.loads-e.loads||a(e,t));default:return o.sort((e,t)=>t.loads-e.loads||t.last-e.last||a(e,t))}}function _i(e,t,n,r){let i=hi(n,r),a=e.activity?.days;if(a===void 0)return!1;for(let e of Object.keys(a))if(i(e)&&a[e].skills?.[t]!==void 0)return!0;return!1}function vi(e){if(e==null)return null;let t={input:0,cacheRead:0,cacheWrite:0,output:0,total:0},n=!1;for(let r of Object.keys(e)){let i=e[r];for(let e of Object.keys(i)){let r=i[e];for(let e of[`peak`,`off`]){let i=r[e];i!==void 0&&(t.input+=i.uncached,t.cacheRead+=i.cacheRead,t.cacheWrite+=i.cacheWrite,t.output+=i.output,n=!0)}}}return n?(t.total=t.input+t.cacheRead+t.cacheWrite+t.output,t):null}function yi(e){let t=null;for(let n of e){let e=n.timeline?.timing;if(e!==void 0){if(t===null){t={...e,tools:{...e.tools}};continue}t.wallMs+=e.wallMs,t.ttftMs+=e.ttftMs,t.genMs+=e.genMs,t.calls+=e.calls,t.toolsMs+=e.toolsMs,t.toolCalls+=e.toolCalls,bi(t,e,`reasoningMs`),bi(t,e,`reasoningBlocks`),bi(t,e,`textMs`),bi(t,e,`textBlocks`),bi(t,e,`toolArgMs`),bi(t,e,`toolArgBlocks`),bi(t,e,`speedTokens`),bi(t,e,`speedMs`);for(let n of Object.keys(e.tools)){let r=e.tools[n],i=t.tools[n];t.tools[n]=i===void 0?{...r}:{calls:i.calls+r.calls,ms:i.ms+r.ms}}}}return t}function bi(e,t,n){let r=e[n],i=t[n];(r!==void 0||i!==void 0)&&(e[n]=(r??0)+(i??0))}function xi(e){let t=new Map,n=0,r=!1;for(let i of e)for(let e of i.family){if(e===null)continue;let i=vi(e.cost);if(i===null)continue;r=!0;let a={uncachedInputTokens:i.input,cacheReadTokens:i.cacheRead,cacheWriteTokens:i.cacheWrite,outputTokens:i.output};for(let r of B(e.current,null,a)){if(!Number.isFinite(r.value)||r.value<=0)continue;n+=r.value;let e=t.get(r.key);t.set(r.key,e===void 0?{key:r.key,color:r.color,value:r.value}:{...e,value:e.value+r.value})}}return r?{parts:[...t.values()],total:n}:null}function Si(e,t,n,r){let i=lr(...e.map(e=>e.familyCost)),a=vi(i),o=0,s=0,c=0,l=0,u=0,d=0,f=0;for(let t of e){or(t.familyCost,n,r)!==null&&d++,vi(t.familyCost)!==null&&f++,o+=ui(t.timeline);let e=t.timeline?.timing;s+=e?.toolCalls??0,c+=e?.toolsMs??0,l+=e?.calls??0,u+=e?.wallMs??0}return{sessions:e.length,listed:t,tokens:a?.total??0,turns:o,cost:or(i,n,r),costSessions:d,cacheHit:a===null?null:zt(a.cacheRead,a.input+a.cacheRead+a.cacheWrite),usageSessions:f,toolCalls:s,toolsMs:c,calls:l,wallMs:u,tokenParts:xi(e),timing:yi(e)}}function Ci(e,t,n){let r={},i=r;for(let t of e)if(t.activity!==null)for(let e of Object.keys(t.activity.days)){let n=t.activity.days[e];if(n.tokens<=0&&n.requests<=0)continue;let a=i[e];a===void 0?r[e]={tokens:n.tokens,requests:n.requests,sessions:1,fees:n.cost===void 0?[]:[n.cost]}:(a.tokens+=n.tokens,a.requests+=n.requests,a.sessions++,n.cost!==void 0&&a.fees.push(n.cost))}let a={};for(let[e,i]of Object.entries(r))a[e]={tokens:i.tokens,requests:i.requests,sessions:i.sessions,cost:or(lr(...i.fees),t,n)};return a}function wi(e){try{let t=e.get(`sessions`);if(t===void 0||typeof t.refresh!=`function`)return;Promise.resolve(t.refresh()).catch(()=>{})}catch{}}function Ti(){try{fetch(`/api/dsh-context/backfill`,{method:`POST`}).catch(()=>{})}catch{}}function Ei(e,t,n){let r=n-t;if(!Number.isFinite(r)||r<6e4)return e(`ov.time.now`);let i=Math.floor(r/6e4);if(i<60)return e(`ov.time.m`,{n:i});let a=Math.floor(i/60);return a<24?e(`ov.time.h`,{n:a}):e(`ov.time.d`,{n:Math.floor(a/24)})}function Di(e){let t=W(e)?.skills;if(!Array.isArray(t))return null;let n=[];for(let e of t){let t=W(e);t!==null&&typeof t.name==`string`&&t.name!==``&&n.push({name:t.name,description:typeof t.description==`string`?t.description:``,...typeof t.path==`string`&&t.path!==``?{path:t.path}:{},...typeof t.source==`string`&&t.source!==``?{source:t.source}:{}})}return n}async function Oi(e,t){try{let n=await fetch(`/api/dsh-context/skills`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e===void 0?{}:{cwd:e},...t===void 0?{}:{sessionId:t}})});if(!n.ok)return null;let r=W(await n.json()),i=r===null||r.ok!==!0?null:Di(r.value);return i===null||i.length===0?null:new Map(i.map(e=>[e.name,e]))}catch{return null}}let ki=async e=>{let t=globalThis.navigator?.clipboard;if(typeof t?.writeText!=`function`)throw Error(`clipboard unavailable`);await t.writeText.call(t,e)};async function Ai(e){try{return await ki(e),!0}catch{return!1}}let ji=new Set([`Plugins`,`插件`]);function Mi(e){return[...e.querySelectorAll(`button`)]}function Ni(e){return Mi(e).find(e=>ji.has(e.getAttribute(`aria-label`)??``))}function Pi(e){let t=e.querySelector(`[data-plugin-package="dsh-context"]`);if(t===null)return;let n=[...t.querySelectorAll(`button`)].filter(e=>e.getAttribute(`role`)!==`switch`);return n.length===1?n[0]:void 0}function Fi(e=document,t=(e,t)=>{window.setTimeout(e,t)}){try{let n=Ni(e);if(n===void 0)return;n.click();let r=n=>{try{let t=Pi(e);if(t!==void 0){t.click();return}}catch{}n>0&&t(()=>{r(n-1)},100)};t(()=>{r(40)},200)}catch{}}let Ii=`dsh-context:platform-balance`;function Li(e){let t=typeof e==`string`?Number(e):e;return typeof t==`number`&&Number.isFinite(t)&&t>=0?t:null}function Ri(e){let t=W(e);if(t===null)return null;let n=Array.isArray(t.balances)?t.balances:[],r=[];for(let e of n)try{let t=W(e);if(t===null)continue;let n=t.currency,i=Li(t.total),a=Li(t.granted),o=Li(t.toppedUp);if(typeof n!=`string`||n===``||i===null||a===null||o===null)continue;r.push({currency:n,total:i,granted:a,toppedUp:o})}catch{continue}return r.length>0?{isAvailable:t.isAvailable===!0,balances:r}:null}function zi(e,t){if(e==null||e.balances.length===0)return null;let n=t===`cny`?`CNY`:`USD`;return e.balances.find(e=>e.currency===n)??e.balances[0]}let Bi=null,Vi=null,Hi=new Set,Ui;function Wi(){if(Ui!==void 0)return Ui;try{Ui=globalThis.localStorage??null}catch{Ui=null}return Ui}function Gi(){try{let e=Wi()?.getItem(Ii);return e==null?null:Ri(JSON.parse(e))}catch{return null}}function Ki(e){try{Wi()?.setItem(Ii,JSON.stringify(e))}catch{}}async function qi(){try{let e=await fetch(`/api/dsh-context/balance`,{method:`POST`,headers:{"content-type":`application/json`}});if(!e.ok)return null;let t=W(await e.json());return t===null||t.ok!==!0||t.value===null||t.value===void 0?null:Ri(t.value)}catch{return null}}function Ji(e){return Hi.add(e),Vi===null&&(Vi=(async()=>{let e=await qi();if(e!==null){Bi=e,Ki(e);for(let t of Hi)t(e)}})().finally(()=>{Vi=null,Hi.clear()})),Bi??Gi()}function Yi(e){return e===`CNY`?`¥`:e===`USD`?`$`:e+` `}function Xi(e,t){let{t:n}=t;return function(){let[t,r]=(0,u.useState)(()=>Ji(e=>{r(e)})),i=e.locale,a=zi(t,(typeof i.getLocale==`function`?i.getLocale().active:`en`)===`zh`?`cny`:`usd`);if(a===null)return null;let o=e=>Yi(a.currency)+e.toFixed(2),s=[...a.toppedUp>0?[n(`balance.tip.toppedUp`)+`: `+o(a.toppedUp)]:[],...a.granted>0?[n(`balance.tip.granted`)+`: `+o(a.granted)]:[]];return(0,d.jsxs)(`a`,{className:`lc-ov-balance`,"aria-label":s.length>0?s.join(`
14
+ `)?t:t+1}function gt(e,t){return{added:typeof e==`string`?ht(e):0,removed:typeof t==`string`?ht(t):0}}function _t(e,t){if(e===`edit`)return gt(t.new_string,t.old_string);if(e===`write`)return gt(t.content,void 0);if(e===`str_replace_editor`){if(t.command===`str_replace`)return gt(t.new_str,t.old_str);if(t.command===`insert`)return gt(t.new_str,void 0);if(t.command===`create`)return gt(t.file_text,void 0)}return{added:0,removed:0}}function vt(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.path!=`string`||t.path===``||typeof t.offset!=`number`||!Number.isFinite(t.offset)||t.offset<1||!Array.isArray(t.lines)||t.lines.length===0?null:{start:t.offset,count:t.lines.length}}function yt(e){let t=e.limit;return typeof t==`number`&&Number.isFinite(t)&&t>0?{count:Math.floor(t),est:!0}:void 0}function bt(e,t){let n=vt(e);return n===null?yt(t):{start:n.start,count:n.count}}function xt(e){let t=e?.pattern;if(typeof t!=`string`||t===``)return;let n=e?.include;return typeof n==`string`&&n!==``?`${t} (${n})`:t}function St(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.truncated!==!1)return null;let n=[];if(t.shape===`matches`&&Array.isArray(t.files))for(let e of t.files){if(typeof e!=`object`||!e)continue;let t=e;typeof t.path==`string`&&t.path!==``&&Array.isArray(t.matches)&&n.push({path:t.path,hits:t.matches.length})}else if(t.shape===`paths`&&Array.isArray(t.paths))for(let e of t.paths)typeof e==`string`&&e!==``&&n.push({path:e,hits:0});return n.length>0?n:null}function Ct(e){let t=pt(e.tool)?lt(e.argsRaw):null,n=ft(e.tool,t);if(n===null)return[];let r={seq:e.seq,kind:n,tool:e.tool,err:e.err===!0,added:0,removed:0,path:``,...e.time===void 0?{}:{time:e.time},...e.gone===void 0?{}:{gone:e.gone},...e.parent===void 0?{}:{parent:e.parent},...e.program===void 0?{}:{program:e.program}};if(n===`search`){let n=St(e.meta);if(n!==null){let i=xt(t),a=t===null?null:mt(e.tool,t),o=t!==null&&typeof t.path==`string`&&t.path!==``;return[...a!==null&&!n.some(e=>e.path===a)?[{...r,path:a,...o&&i!==void 0?{detail:i}:{},...o?{}:{pattern:!0}}]:[],...n.map(e=>({...r,path:e.path,...i===void 0?{}:{detail:i},...e.hits>0?{hits:e.hits}:{}}))]}}if(t===null)return[];let i=mt(e.tool,t);if(i===null)return[];let{added:a,removed:o}=_t(e.tool,t),s=typeof t.path==`string`&&t.path!==``,c=n===`search`&&s?xt(t):void 0,l=n===`read`?bt(e.meta,t):void 0;return[{...r,path:i,added:a,removed:o,...c===void 0?{}:{detail:c},...l===void 0?{}:{read:l},...n===`search`&&!s?{pattern:!0}:{}}]}function wt(e){if(e===null)return null;for(let t of[`description`,`file_path`,`path`,`filePath`]){let n=e[t];if(typeof n==`string`&&n!==``)return n}return null}function Tt(e){return wt(lt(e?.call?.argsRaw))}function Et(e){if(e===void 0||!Array.isArray(e.blocks))return null;for(let t of e.blocks){let e=typeof t==`object`&&t?t:null;if(e===null||e.kind!==`tool-call`)continue;let n=wt(lt(e.argsRaw));if(n!==null)return n}return null}function Dt(e){if(e===void 0||!Array.isArray(e.blocks))return[];let t=[];for(let n of e.blocks){let e=typeof n==`object`&&n?n:null;e!==null&&e.kind===`tool-call`&&typeof e.name==`string`&&t.push(e.name)}return t}function Ot(e){let{t}=e;return function(e){let n=e.className??`lc-empty`;return e.state===`loading`?(0,d.jsx)(`div`,{className:n,children:t(`detail.loading`)}):(0,d.jsx)(`div`,{className:n,children:e.onRetry===void 0?t(`detail.loadFailed`):(0,d.jsx)(`button`,{type:`button`,className:`lc-br-retry hover:brightness-[1.15]`,onClick:e.onRetry,children:t(`detail.loadFailed`)})})}}function kt(e){let{t}=e;return function(e){return e.cat===`tool`?t(`node.toolResult`)+(e.tool?` ← `+e.tool:``)+(e.err?` ⚠`:``):e.skill?`Skill: `+e.skill:e.calls?t(`node.calls`)+e.calls.join(`, `):e.text?e.form===`snapshot`?t(`node.snapshot`)+e.text:e.text:e.cat===`assistant`?t(`node.empty`):e.cat===`inject`||e.cat===`skill`?t(`form.`+(e.form||`context`)):t(`node.nonText`)}}function At(e){let t=t=>{if(Math.abs(t.deltaX)<=Math.abs(t.deltaY))return;let n=t.deltaX<0&&e.scrollLeft<=0,r=t.deltaX>0&&e.scrollLeft+e.clientWidth>=e.scrollWidth-1;(n||r)&&t.preventDefault()};return e.addEventListener(`wheel`,t,{passive:!1}),()=>{e.removeEventListener(`wheel`,t)}}let jt=` animate-lc-bar-in motion-reduce:animate-none`;function Mt(e){let t=[],n=0,r=0,i=!1;for(let a of e){let e=t.length>0?t[t.length-1]:null;e!==null&&(e.turn??0)===(a.turn??0)?(n++,a.activeMs!==void 0&&(r+=a.activeMs,i=!0),t[t.length-1]={...a,stepCount:n,...i?{activeMs:r}:{}}):(n=1,r=a.activeMs??0,i=a.activeMs!==void 0,t.push({...a,stepCount:1}))}return t}function Nt(e){let t=new Map;for(let n of e){let e=n.turn??0;t.set(e,(t.get(e)??0)+1)}return e=>t.get(e??0)??1}function Pt(e,t){let n=Array(e.length);for(let r of t)if(r.kind===`compaction`||r.kind===`prune`){for(let t=0;t<e.length;t++)if(e[t].seq>=r.seq){n[t]===void 0&&(n[t]=r);break}}return n}function Ft(e,t){for(let n of e)if(n.seq===t)return n;return e.length>0?e[0]:null}function It(e){let{t,fmt:n,fmtDuration:r,eventLabel:i,eventAt:a,catLabel:o}=e,s=e=>(e>0?`+`:``)+n(e),c=[`color-mix(in srgb, var(--color-neutral-500) 12%, transparent)`,`color-mix(in srgb, var(--color-neutral-500) 26%, transparent)`],l=e=>6.5*String(e).length,f=(e,t)=>{let n=t,r={...e},i=e[n]||0;r.total=i;for(let e of R)r[e.key]=e.key===n?i:0;return r},p=(e,t)=>{let{prompt:n,output:r,...i}=e,a=0,o=0;for(let n of R){let r=t===null?0:(e[n.key]||0)-(t[n.key]||0);i[n.key]=r,a+=Math.abs(r),o+=r}return i.total=a,i.net=o,i},m=function(e){let t=[];for(let n of e.bands)n.tokens>0&&t.push(n);if(t.length===0)return null;let n=[];for(let r of t){let t=Math.round(r.off/e.total*1e4)/100,i=Math.round((r.off+r.tokens)/e.total*1e4)/100,a=n.length>0?n[n.length-1]:null;a!==null&&a.color===r.color&&a.to===t?a.to=i:n.push({color:r.color,from:t,to:i})}let r=n=>{let r=n.currentTarget.getBoundingClientRect(),i=(r.height>0?Math.min(1,Math.max(0,1-(n.clientY-r.top)/r.height)):0)*e.total,a=t[0];for(let t of e.bands){if(t.off>i)break;t.tokens>0&&(a=t)}return a};return(0,d.jsx)(`div`,{className:`lc-bar-dna`+(e.rise?jt:``),style:{height:`${Math.max(1,Math.round(e.total/e.maxTotal*112))}px`,background:`linear-gradient(to top, `+n.map(e=>`${e.color} ${e.from}%, ${e.color} ${e.to}%`).join(`, `)+`)`,"--lc-i":Math.min(e.enterIndex,20)},onMouseMove:t=>{e.onHit(r(t).key)},onMouseLeave:()=>{e.onHit(null)},onClick:t=>{e.onPick!==void 0&&e.onPick(e.seq,r(t))}})},h=function(e){let t=0;for(let n of e.d.up)t+=n.tokens;let n=0;for(let t of e.d.down)n-=t.tokens;let r=t+n;if(r===0)return null;let i=[],a=(e,t,n)=>{let a=Math.round(n/r*1e4)/100,o=Math.round((n+t)/r*1e4)/100,s=i.length>0?i[i.length-1]:null;return s!==null&&s.color===e&&s.to===a?s.to=o:i.push({color:e,from:a,to:o}),n+t},o=0;for(let t=e.d.down.length-1;t>=0;t--)o=a(e.d.down[t].color,-e.d.down[t].tokens,o);for(let t of e.d.up)o=a(t.color,t.tokens,o);let s=Math.max(1,Math.round(r*e.scale)),c=t=>{let i=t.currentTarget.getBoundingClientRect(),a=(i.height>0?Math.min(1,Math.max(0,1-(t.clientY-i.top)/i.height)):0)*r-n,o=a>=0&&e.d.up.length>0,s=o?e.d.up:e.d.down,c=o?a:-a,l=s[0];for(let e of s){if(e.off>c)break;l=e}return l};return(0,d.jsx)(`div`,{className:`lc-bar-dna`+(e.rise?jt:``),style:{position:`absolute`,bottom:`${Math.round(e.zeroBottom-n*e.scale)}px`,height:`${s}px`,background:`linear-gradient(to top, `+i.map(e=>`${e.color} ${e.from}%, ${e.color} ${e.to}%`).join(`, `)+`)`,transformOrigin:`50% ${Math.round(n/r*1e4)/100}%`,"--lc-i":Math.min(e.enterIndex,20)},onMouseMove:t=>{e.onHit(c(t).key)},onMouseLeave:()=>{e.onHit(null)},onClick:t=>{e.onPick!==void 0&&e.onPick(e.seq,c(t))}})},g=(0,u.memo)(function(e){return e.slices===null?null:(0,d.jsx)(`div`,{className:`lc-dna-hl`,children:e.slices.map((e,t)=>(0,d.jsx)(`span`,{className:`lc-dna-cell`,children:e===null?null:(0,d.jsx)(`span`,{className:`lc-dna-slice`,style:{bottom:`${e.bottom}px`,height:`${e.height}px`}})},t))})}),_=(0,u.memo)(function(e){let{req:t,marker:n}=e,r=n===void 0?null:a(n),o=e.upPx!==void 0&&e.downPx!==void 0&&e.deltaScale!==void 0,s={"--lc-i":Math.min(e.enterIndex,20)},c=e.rise?jt:``;return(0,d.jsxs)(`div`,{className:`lc-bar hover:bg-(--dsw-alias-bg-layer-2)`+(e.selected?` lc-bar-selected`:``)+(e.hovered?` lc-bar-hovered`:``)+(e.inTurn?` lc-bar-in-turn`:``),"data-seq":t.seq,style:{width:`14px`},onClick:()=>{e.onSelect(e.selected?null:t.seq)},onMouseEnter:()=>{e.onHover(t.seq)},children:[e.flag===null?null:(0,d.jsx)(`span`,{className:`lc-step-flag`,"aria-hidden":`true`,children:(0,d.jsx)(`span`,{className:`lc-step-flag-label`,children:e.flag})}),n===void 0?null:(0,d.jsx)(`span`,{className:`lc-bar-marker`,title:`✂ `+(r===null?``:r+` — `)+i(n),children:`✂`}),e.dna===null?o?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{className:`lc-bar-up`+c,style:{bottom:`${e.downPx}px`,...s},children:R.map(n=>{let r=t[n.key]||0;return r<=0?null:(0,d.jsx)(`div`,{"data-cat":n.key,className:`lc-cat-seg`,style:{height:`${Math.max(1,Math.round(r*e.deltaScale))}px`,background:n.color}},n.key)})}),(0,d.jsx)(`div`,{className:`lc-bar-down`+c,style:{top:`${e.upPx}px`,...s},children:R.map(n=>{let r=t[n.key]||0;return r>=0?null:(0,d.jsx)(`div`,{"data-cat":n.key,className:`lc-cat-seg`,style:{height:`${Math.max(1,Math.round(-r*e.deltaScale))}px`,background:n.color}},n.key)})})]}):(0,d.jsx)(`div`,{className:`lc-bar-stack`+c,style:s,children:R.map(n=>{let r=t[n.key]||0;return r?(0,d.jsx)(`div`,{"data-cat":n.key,className:`lc-cat-seg`,style:{height:`${Math.max(1,Math.round(r/e.maxTotal*112))}px`,background:n.color}},n.key):null})}):e.dnaDelta!==null&&e.dnaScale!==void 0&&e.zeroBottom!==void 0?(0,d.jsx)(h,{d:e.dnaDelta,scale:e.dnaScale,zeroBottom:e.zeroBottom,enterIndex:e.enterIndex,rise:e.rise,seq:t.seq,onHit:e.onDnaHit,onPick:e.onPickBand}):(0,d.jsx)(m,{bands:e.dna,total:t.total,maxTotal:e.maxTotal,enterIndex:e.enterIndex,rise:e.rise,seq:t.seq,onHit:e.onDnaHit,onPick:e.onPickBand})]})});return function(e){let i=e.dna??null,a=i!==null,m=e.mode===`delta`,h=a&&m,v=e.durationCurve===!0,y=!a&&e.focusCat!==null&&e.focusCat!==void 0&&R.some(t=>t.key===e.focusCat)?e.focusCat:null,[b,x]=(0,u.useState)(null),S=(0,u.useMemo)(()=>h?i.map((e,t)=>st(e,t>0?i[t-1]:null)):null,[h,i]),C=(0,u.useMemo)(()=>{let t=y===null?e.requests:e.requests.map(e=>f(e,y));return m?t.map((e,n)=>p(e,n>0?t[n-1]:null)):t},[e.requests,m,y]),w=e.markers,T=e.adaptive===!0,[E,D]=(0,u.useState)(null),O=e=>{if(!T)return;let t=C.length;if(t===0||e.clientWidth<=0)return;let n=e.scrollLeft,r=n+e.clientWidth,i=0,a=0,o=0,s=0,c=Math.max(0,Math.floor(n/16)),l=Math.min(t-1,Math.max(c,Math.floor((r-1)/16)));for(let e=c;e<=l;e++){let t=e*16;if(t>=r||t+14<=n)continue;let c=C[e],l=c.activeMs??0;if(l>s&&(s=l),h&&S!==null){let t=0,n=0;for(let n of S[e].up)t+=n.tokens;for(let t of S[e].down)n-=t.tokens;t>a&&(a=t),n>o&&(o=n)}else if(m){let e=0,t=0;for(let n of R){let r=c[n.key]||0;r>0?e+=r:t-=r}e>a&&(a=e),t>o&&(o=t)}else c.total>i&&(i=c.total)}D(e=>e!==null&&e.total===i&&e.up===a&&e.down===o&&e.activeMs===s?e:{total:i,up:a,down:o,activeMs:s})},k=1,A=0,j=0;if(h&&S!==null)for(let e of S){let t=0,n=0;for(let n of e.up)t+=n.tokens;for(let t of e.down)n-=t.tokens;t>A&&(A=t),n>j&&(j=n)}else if(m)for(let e of C){let t=0,n=0;for(let r of R){let i=e[r.key]||0;i>0?t+=i:n-=i}t>A&&(A=t),n>j&&(j=n)}else for(let e of C)e.total>k&&(k=e.total);T&&E!==null&&(m?E.up+E.down>0&&(A=E.up,j=E.down):k=Math.max(1,E.total));let M=0;if(v){for(let e of C){let t=e.activeMs??0;t>M&&(M=t)}T&&E!==null&&(M=E.activeMs)}let N=[],ee=[];if(v){let e=112/Math.max(1,M),t=[],n=()=>{t.length>=2?N.push(t.map(e=>`${e[0]},${e[1]}`).join(` `)):t.length===1&&ee.push(t[0]),t=[]};for(let r=0;r<C.length;r++){let i=C[r].activeMs;if(i===void 0){n();continue}t.push([r*16+7,Math.round((112-i*e)*100)/100])}n()}let P=Math.max(1,A+j),F=112/P,I=Math.round(A*F),L=112-I,te=Math.abs(28-I)>=11,ne=Math.abs(84-I)>=11,z=[];for(let e of C){let t=z.length>0?z[z.length-1]:null;(t===null||t.turn!==(e.turn??0))&&(t={turn:e.turn??0,count:0,span:0,agg:e.stepCount!==void 0},z.push(t)),t.count++,t.span+=e.stepCount??1}let re=[],ie=[];{let e=0;for(let t of z){let n=t.agg?14:t.span*16-2;re.push(e),ie.push(n),e+=n+2}}let ae=Math.max(0,C.length-200),B=``;{let e=1;for(let t=0;t+1<z.length;t++){let n=(ie[t]+ie[t+1])/2+2,r=(l(z[t].turn)+l(z[t+1].turn))/2+2;r>n&&(e=Math.min(e,n/r))}e<1&&(B=`${Math.max(6,Math.floor(10*e))}px`)}let oe=(0,u.useRef)(null),V=(0,u.useRef)(!1),se=(0,u.useRef)(e.granularity),ce=(0,u.useRef)(0),H=(0,u.useRef)(0),U=(0,u.useRef)(0),W=(0,u.useRef)(0),G=e=>{let t=e.querySelectorAll(`.lc-turn-label`),n=Math.min(t.length,re.length),r=e.scrollLeft,i=r+e.clientWidth,a=[],o=-1/0;for(let e=0;e<n;e++){let n=re[e],s=ie[e],c=0,l=``;if(n+s+48>r&&n-48<i){let a=t[e].offsetWidth,u=Math.max(n,r),d=Math.min(n+s,i);if(d>u&&a<s){let e=(u+d)/2-n;c=Math.min(Math.max(e,a/2),s-a/2)-s/2}let f=n+s/2+c-a/2;f<o?l=`hidden`:o=f+a+2}let u=c===0?``:`translateX(${c}px)`;(t[e].style.transform!==u||t[e].style.visibility!==l)&&a.push([t[e],u,l])}for(let[e,t,n]of a)e.style.transform=t,e.style.visibility=n};(0,u.useLayoutEffect)(()=>{let t=oe.current;if(t===null)return;let n=C.length===0?0:C[C.length-1].seq,r=n!==ce.current,i=H.current;if(e.granularity!==se.current&&(se.current=e.granularity,V.current=!1),e.focusTurn!==null){let n=z.findIndex(t=>t.turn===e.focusTurn);n>=0&&(V.current=!0,t.scrollLeft=Math.max(0,n*16+7-t.clientWidth/2)),e.onFocusTurnHandled()}else V.current?r&&t.scrollLeft+t.clientWidth>=i-24&&(t.scrollLeft=t.scrollWidth):(V.current=!0,t.scrollLeft=t.scrollWidth);ce.current=n,H.current=t.scrollWidth,W.current=t.scrollLeft,U.current=t.clientWidth,G(t),me(t),O(t)},[e.granularity,e.focusTurn,C,T,h]);let le=(0,u.useRef)(O);(0,u.useLayoutEffect)(()=>{le.current=O}),(0,u.useLayoutEffect)(()=>{let e=oe.current;if(e===null||typeof ResizeObserver!=`function`)return;let t=new ResizeObserver(()=>{U.current=e.clientWidth,le.current(e)});return t.observe(e),()=>{t.disconnect()}},[]),(0,u.useLayoutEffect)(()=>{let e=oe.current;if(e!==null)return At(e)},[]);let ue=(0,u.useMemo)(()=>Nt(e.requests),[e.requests]),K=e.hoveredSeq===null?-1:C.findIndex(t=>t.seq===e.hoveredSeq),q=K>=0?C[K]:null,de=a&&!h&&K>=0?i[K]:null,J=de!==null&&b!==null?de.find(e=>e.key===b&&e.tokens>0)??null:null,Y=h&&K>=0&&S!==null?S[K].up.find(e=>e.key===b)??S[K].down.find(e=>e.key===b)??null:null,fe=(0,u.useMemo)(()=>{if(!a||b===null)return null;let e=[];if(h&&S!==null)for(let t of S){let n=t.up.find(e=>e.key===b)??t.down.find(e=>e.key===b)??null;if(n===null){e.push(null);continue}let r=Math.abs(n.tokens),i=n.tokens>0?L+n.off*F:L-(n.off+r)*F;e.push({bottom:Math.round(i),height:Math.max(1,Math.round(r*F))})}else for(let t of i){let n=t.find(e=>e.key===b&&e.tokens>0)??null;e.push(n===null?null:{bottom:Math.round(n.off/k*112),height:Math.max(1,Math.round(n.tokens/k*112))})}return e},[a,b,h,S,i,L,F,k]),X=i=>{let a=i.stepCount??1,c=e.granularity===`turn`?a>1?t(`tip.turn`,{t:i.turn??0,n:a}):t(`tip.turn1`,{t:i.turn??0}):t(`tip.step`,{t:i.turn??0,s:i.step??0,n:ue(i.turn)}),l=J??Y,u;u=l===null?m?t(`tip.delta`,{n:s(i.net??0)}):y===null?t(`tip.total`,{n:n(i.total)}):t(`tip.cat`,{cat:o(y),n:n(i.total)}):t(`trend.dnaItem`,{label:ct(l,t,o),n:h?s(l.tokens):n(l.tokens)});let d=[c,u];return v&&i.activeMs!==void 0&&d.push(t(`tip.duration`,{n:r(i.activeMs)})),d},pe=(0,u.useRef)(0),me=e=>{let t=(e.parentElement??document.body).querySelector(`.lc-chart-tip`);if(t===null)return;let n=t.offsetWidth,r=U.current,i=Math.min(n/2,r/2),a=Math.min(Math.max(pe.current-W.current,i),r-i),o=`translate(${Math.round(a-n/2)}px, 0)`;t.style.transform!==o&&(t.style.transform=o)};return(0,u.useLayoutEffect)(()=>{oe.current!==null&&(pe.current=K>=0?K*16+7:0,me(oe.current))}),(0,d.jsxs)(`div`,{className:`lc-chartrow`,children:[(0,d.jsx)(`div`,{className:`lc-axis`,children:m?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-axis-top`,children:s(A)}),te?(0,d.jsx)(`span`,{className:`lc-axis-q3`,children:s(Math.round(A-P/4))}):null,(0,d.jsx)(`span`,{className:`lc-axis-mid`,style:{top:`${13+I}px`},children:`0`}),ne?(0,d.jsx)(`span`,{className:`lc-axis-q1`,children:s(Math.round(A-3*P/4))}):null,(0,d.jsx)(`span`,{className:`lc-axis-bot`,children:s(-j)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-axis-top`,children:n(k)}),(0,d.jsx)(`span`,{className:`lc-axis-q3`,children:n(Math.round(k*3/4))}),(0,d.jsx)(`span`,{className:`lc-axis-mid`,children:n(Math.round(k/2))}),(0,d.jsx)(`span`,{className:`lc-axis-q1`,children:n(Math.round(k/4))}),(0,d.jsx)(`span`,{className:`lc-axis-bot`,children:`0`})]})}),(0,d.jsxs)(`div`,{className:`lc-chart-wrap`,children:[(0,d.jsxs)(`div`,{className:`lc-chart-scroll`+(e.activeTurn===null?``:` lc-chart-dim`),ref:oe,onScroll:e=>{W.current=e.currentTarget.scrollLeft,U.current=e.currentTarget.clientWidth,G(e.currentTarget),me(e.currentTarget),O(e.currentTarget)},children:[(0,d.jsxs)(`div`,{className:`lc-chart`,"data-catdim":e.hoverCat??void 0,onMouseLeave:()=>{e.onHover(null),x(null)},children:[(0,d.jsx)(`div`,{className:`lc-grid lc-grid-top`}),!m||te?(0,d.jsx)(`div`,{className:`lc-grid lc-grid-q3`}):null,!m||ne?(0,d.jsx)(`div`,{className:`lc-grid lc-grid-q1`}):null,m?null:(0,d.jsx)(`div`,{className:`lc-grid lc-grid-mid`}),(0,d.jsx)(`div`,{className:`lc-grid lc-grid-zero`,style:m?{top:`${18+I}px`}:void 0}),C.map((t,n)=>(0,d.jsx)(_,{req:t,marker:w[n],selected:e.selectedSeq===t.seq,hovered:e.hoveredSeq===t.seq,inTurn:e.activeTurn!==null&&(t.turn??0)===e.activeTurn,flag:e.granularity===`step`&&(n+1)%5==0?n+1:null,maxTotal:k,upPx:m?I:void 0,downPx:m?L:void 0,deltaScale:m?F:void 0,enterIndex:Math.max(0,n-ae),rise:n>=ae,dna:a?i[n]:null,dnaDelta:h&&S!==null?S[n]:null,dnaScale:h?F:void 0,zeroBottom:h?L:void 0,onDnaHit:x,onPickBand:e.onPickBand,onSelect:e.onSelect,onHover:e.onHover},`${t.seq}:${e.granularity}`)),a?(0,d.jsx)(g,{slices:fe}):null,v&&(N.length>0||ee.length>0)?(0,d.jsxs)(`svg`,{className:`lc-duration`,width:C.length*16-2,height:112,"aria-hidden":`true`,children:[N.map((e,t)=>(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`polyline`,{className:`lc-dur-halo`,points:e}),(0,d.jsx)(`polyline`,{points:e})]},t)),ee.map((e,t)=>(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`circle`,{className:`lc-dur-halo`,cx:e[0],cy:e[1],r:2}),(0,d.jsx)(`circle`,{cx:e[0],cy:e[1],r:1.2})]},t))]}):null]}),(0,d.jsx)(`div`,{className:`lc-turns`,style:B===``?void 0:{fontSize:B},onMouseLeave:()=>{e.onHoverTurn(null)},children:z.map((t,n)=>{let r=e.activeTurn===t.turn;return(0,d.jsx)(`span`,{className:`lc-turn`+(r?` lc-turn-on`:``),style:{width:`${ie[n]}px`,background:c[n%c.length]},title:`T${t.turn}`,onMouseEnter:()=>{e.onHoverTurn(t.turn)},onClick:()=>{e.onPickTurn(t.turn)},children:(0,d.jsx)(`span`,{className:`lc-turn-label`,children:`${t.turn}`})},`turn-${n}`)})})]}),q===null?null:(0,d.jsx)(`div`,{className:`lc-chart-tip`,children:X(q).map((e,t)=>(0,d.jsx)(`span`,{children:e},t))})]}),v?(0,d.jsxs)(`div`,{className:`lc-axis lc-axis-r`,children:[(0,d.jsx)(`span`,{className:`lc-axis-top`,children:r(M)}),(0,d.jsx)(`span`,{className:`lc-axis-q3`,children:r(Math.round(M*3/4))}),(0,d.jsx)(`span`,{className:`lc-axis-mid`,children:r(Math.round(M/2))}),(0,d.jsx)(`span`,{className:`lc-axis-q1`,children:r(Math.round(M/4))}),(0,d.jsx)(`span`,{className:`lc-axis-bot`,children:`0`})]}):null]})}}function Lt(e,t,n){let[r,i]=(0,u.useState)(()=>new Map),[a,o]=(0,u.useState)(`idle`),[s,c]=(0,u.useState)(0);return(0,u.useEffect)(()=>{if(e===null||t===void 0||r.has(e))return;let a=!0;return o(`loading`),t(e).then(t=>{if(a){if(t===null){o(`absent`);return}i(n=>{let r=new Map(n);return r.set(e,t),r}),o(`idle`)}},e=>{console.warn(n,e),a&&o(`failed`)}),()=>{a=!1}},[e,t,s,r]),{values:r,state:a,retry:()=>{c(e=>e+1)}}}function Rt(e,t,n,r,i){return t===void 0?e(i):n===`absent`?e(`browser.notInLog`):n===`failed`?(0,d.jsx)(`button`,{type:`button`,className:`lc-br-retry hover:brightness-[1.15]`,onClick:r,children:e(`browser.loadFailed`)}):e(`browser.loading`)}function zt(e){if(e==null||isNaN(e))return`—`;let t=e<0?`-`:``,n=Math.abs(e);return n>=1e9?t+(n/1e9).toFixed(1)+`B`:n>=1e6?t+(n/1e6).toFixed(1)+`M`:n>=1e3?t+(n/1e3).toFixed(1)+`k`:t+String(Math.round(n))}function Bt(e){return e==null||isNaN(e)||e<0?`—`:e>=1e6?(e/1e6).toFixed(1)+` MB`:e>=1e3?(e/1e3).toFixed(1)+` kB`:String(Math.round(e))+` B`}function Vt(e,t){if(!(t>0))return null;let n=Math.trunc(e/t*100*100+1e-9);return`${Math.floor(n/100)}.${String(n%100).padStart(2,`0`)}`}let Ht=new Intl.DateTimeFormat(`en-GB`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`});function Ut(e){let t=new Date(e);return isNaN(t.getTime())?`—`:Ht.format(t)}function Wt(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0)return`—`;if(e<=0)return`0.0%`;let n=Math.min(1,e/t)*100;return n<.1?`<0.1%`:`${n.toFixed(1)}%`}function Gt(e){if(!Number.isFinite(e)||e<=0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return e<36e5?`${n}m${r}s`:`${Math.floor(n/60)}h${n%60}m`}let Kt=147456,qt=(e,t)=>Math.floor(e/t),Jt=(e,t)=>Math.floor((e+t-1)/t);function Yt(e,t){let n=e*(t+1)+2;return e%2==1&&(n+=t+1),n+=Jt(e,2)*(t+1)%2*2,n}function Xt(e,t,n){let r=e/t,i=Math.sqrt((n-2)/r+.25)-.5,a=i*r,o,s;if(i<1){let e=qt(n-2,2);e%2==1&&--e,s=42,o=e*42}else if(a<2){let e=qt(n-2,2)-1;if(e<=1)throw Error(`image tokens: budget too small to solve`);o=84,s=e*42}else{let n=Math.trunc(i),r=Math.trunc(a);r%2==1&&--r;let c=Math.min(n*42/t,r*42/e);s=Math.trunc(t*c/14)*14,o=Math.trunc(e*c/14)*14}let c=Jt(qt(o,14),3),l=Jt(qt(s,14),3);return{nLlmH:c,nLlmW:l,bestHeight:o,bestWidth:s,numTokens:Yt(c,l)}}function Zt(e,t,n,r){let i=Jt(qt(n,14),3),a=Jt(qt(r,14),3),o={nLlmH:i,nLlmW:a,bestHeight:n,bestWidth:r,numTokens:Yt(i,a)};if(o.numTokens>381){o=Xt(e,t,381);let n=381;for(;o.numTokens>381;)--n,o=Xt(e,t,n)}return o.numTokens+=3,o}function Qt(e,t){let n=e,r=t;n>r*8&&(n=r*8);let i=n*r;if(i<Kt&&i>0){let e=Math.sqrt(Kt/i);n=Math.trunc(n*e),r=Math.trunc(r*e)}let a=Jt(n,14)*14,o=Jt(r,14)*14;return Zt(r,n,o,a)}function $t(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0)return null;try{let n=Qt(e,t);for(let e=1;e<10;e++){let e=Qt(n.bestWidth,n.bestHeight);if(e.nLlmH===n.nLlmH&&e.nLlmW===n.nLlmW&&e.bestHeight===n.bestHeight&&e.bestWidth===n.bestWidth&&e.numTokens===n.numTokens)return n.numTokens;n=e}return null}catch{return null}}function en(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.type!==`image`&&t.kind!==`image`)return null;let n=t.attachment;if(typeof n!=`object`||!n)return null;let r=n;if(typeof r.attachmentId!=`string`||r.attachmentId===``)return null;let i=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0,a=r.originalDimensions!==null&&typeof r.originalDimensions==`object`?r.originalDimensions:void 0,o=a!==void 0&&i(a.width)!==void 0&&i(a.height)!==void 0?{width:i(a.width),height:i(a.height)}:void 0;return{attachmentId:r.attachmentId,...typeof r.name==`string`&&r.name!==``?{name:r.name}:{},...i(r.bytes)===void 0?{}:{bytes:i(r.bytes)},...i(r.width)===void 0?{}:{width:i(r.width)},...i(r.height)===void 0?{}:{height:i(r.height)},...o===void 0?{}:{originalDimensions:o}}}function tn(e){let{t,fmt:n}=e;return function(e){let{attachment:r,load:i}=e,[a,o]=(0,u.useState)(null),[s,c]=(0,u.useState)(!1),[l,p]=(0,u.useState)(0),[m,h]=(0,u.useState)(!1),g=(0,u.useCallback)(()=>{h(!1)},[]);(0,u.useEffect)(()=>{if(i===void 0)return;let e=!0;return c(!1),o(null),i(r).then(t=>{e&&o(t)}).catch(()=>{e&&c(!0)}),()=>{e=!1}},[r,i,l]);let _=r.name??t(`attach.image`),v=(e,t)=>e!==void 0&&t!==void 0?`${e}×${t}`:null,y=[],b=r.originalDimensions===void 0?null:v(r.originalDimensions.width,r.originalDimensions.height);b!==null&&y.push({label:t(`attach.raw`),value:b});let x=v(r.width,r.height);x!==null&&y.push({label:t(`attach.sent`),value:r.bytes===void 0?x:`${x} · ${Bt(r.bytes)}`});let S=r.width!==void 0&&r.height!==void 0?$t(r.width,r.height):null;return S!==null&&y.push({label:t(`attach.token`),value:`≈${n(S)}`,tip:t(`attach.tokensTip`)}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-att-item hover:border-(--dsw-alias-label-dimmed) hover:bg-[var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))]`,title:t(s?`attach.loadFailed`:`attach.open`),onClick:()=>{if(s){p(e=>e+1);return}a!==null&&h(!0)},children:[(0,d.jsx)(`span`,{className:`lc-att-thumb`,children:a===null?(0,d.jsx)(`span`,{className:s?`lc-att-err`:`lc-att-ph`,children:s?`⚠`:i===void 0?`🖼`:t(`attach.loading`)}):(0,d.jsx)(`img`,{src:a,alt:_})}),(0,d.jsxs)(`span`,{className:`lc-att-meta`,children:[(0,d.jsx)(`span`,{className:`lc-att-name`,title:_,children:_}),y.map(e=>(0,d.jsxs)(`span`,{className:`lc-att-row`,title:e.tip,children:[(0,d.jsx)(`b`,{className:`lc-att-row-label`,children:e.label}),e.value]},e.label))]})]}),m&&a!==null&&(0,d.jsx)(f.ImageLightbox,{src:a,alt:_,labels:{dialog:t(`attach.preview`),close:t(`attach.close`)},onClose:g})]})}}let nn=f;function rn(e,t=nn){try{let n=t[e];if(typeof n==`function`)return n}catch{}return()=>null}let an=rn(`IconBranchOutlineRegular`),on=rn(`IconPlusOutlineRegular`),sn=rn(`IconCheckOutlineRegular`),cn=rn(`IconCopyOutlineRegular`),ln=rn(`IconCloseOutlineRegular`),un=rn(`IconSettingsOutlineMedium`),dn=rn(`IconChevronDownOutlineMedium`),fn=rn(`IconChevronUpOutlineMedium`),pn=rn(`IconSearchOutlineRegular`),mn=f.MarkdownText;function hn(e,t,n){let r=t.toLowerCase(),i=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let e=a.nextNode();e!==null;e=a.nextNode())i.push(e);let o=[],s=[],c=!1;for(let e of i){let t=e.data,n=[],i=e,a=t.toLowerCase().indexOf(r);for(;a!==-1;){if(s.length>=500){c=!0;break}let e=i.splitText(a),t=e.splitText(r.length),o=document.createElement(`mark`);o.className=`lc-find-mark`,e.before(o),o.appendChild(e),s.push(o),n.push(o,t),i=t,a=t.data.toLowerCase().indexOf(r)}if(n.length>0&&o.push({node:e,full:t,created:n}),c)break}let l=Math.min(n,s.length-1);return l>=0&&(s[l].classList.add(`lc-find-mark-on`),s[l].scrollIntoView({block:`nearest`,inline:`nearest`})),{count:s.length,capped:c,restore:()=>{for(let{node:e,full:t,created:n}of o){e.data=t;for(let e of n)e.parentNode?.removeChild(e)}}}}function gn(e){let{t}=e;function n(){let[e,t]=(0,u.useState)(`md`);return[e,t]}function r(e){let n=(t,n,r)=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(e.mode===t?` lc-gran-on`:``),title:r,onClick:()=>{e.onPick(t)},children:n});return(0,d.jsxs)(`span`,{className:`lc-gran`,children:[n(`raw`,t(`rich.raw`),t(`rich.toRaw`)),n(`md`,t(`rich.md`),t(`rich.toMd`))]})}function i(e){let t=(0,u.useMemo)(()=>{let t=e.text.split(`
15
+ `);return t.length>1&&t[t.length-1]===``?t.slice(0,-1):t},[e.text]);return(0,d.jsx)(`pre`,{className:`lc-ts-desc-body lc-ts-lines`,children:t.map((e,t)=>(0,d.jsx)(`span`,{className:`lc-ts-line`,children:e},t))})}function a(e){let[n,r]=(0,u.useState)(!1),i=(0,u.useCallback)(()=>{n||(0,f.writeClipboard)(e.text).then(e=>{e&&(r(!0),window.setTimeout(()=>{r(!1)},1200))})},[n,e.text]),a=t(n?`rich.copied`:`rich.copy`);return(0,d.jsx)(`button`,{type:`button`,className:`lc-rich-copy`+(n?` lc-rich-copy-on`:``),title:a,"aria-label":a,onClick:i,children:n?(0,d.jsx)(sn,{size:13}):(0,d.jsx)(cn,{size:13})})}function o(e){let n=(0,u.useMemo)(()=>({code:{copyLabel:t(`rich.md.copy`),copiedLabel:t(`rich.md.copied`)},footnotes:t(`rich.md.footnotes`)}),[t]);return e.mode===`md`?(0,d.jsx)(`div`,{className:`lc-ts-desc-md`,children:(0,d.jsx)(mn,{text:e.text,labels:n})}):(0,d.jsx)(i,{text:e.text})}function s(e,n){let[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(``),[l,f]=(0,u.useState)(0),[p,m]=(0,u.useState)(0),[h,g]=(0,u.useState)(!1),_=(0,u.useRef)(null),v=(0,u.useRef)(null);(0,u.useEffect)(()=>{if(!r||a===``){c(``);return}let e=window.setTimeout(()=>{c(a),f(0)},150);return()=>{window.clearTimeout(e)}},[r,a]),(0,u.useEffect)(()=>{r&&v.current?.focus()},[r]),(0,u.useLayoutEffect)(()=>{let e=_.current;if(!r||s===``||e===null){m(0),g(!1);return}let t=hn(e,s,l);return m(t.count),g(t.capped),l>=t.count&&f(t.count>0?t.count-1:0),()=>{t.restore()}},[r,s,l,e,n]);let y=(0,u.useCallback)(e=>{f(t=>p>0?(t+e+p)%p:0)},[p]),b=(0,u.useCallback)(e=>{e.key===`Enter`?(e.preventDefault(),y(e.shiftKey?-1:1)):e.key===`Escape`&&(e.preventDefault(),i(!1))},[y]),x=t(`rich.find`),S=(e,t,n,r=!1)=>(0,d.jsx)(`button`,{type:`button`,className:`lc-find-btn`,title:e,"aria-label":e,disabled:r,onClick:n,children:t});return{button:(0,d.jsx)(`button`,{type:`button`,className:`lc-find-btn`+(r?` lc-find-btn-on`:``),title:x,"aria-label":x,onClick:()=>{i(e=>!e)},children:(0,d.jsx)(pn,{size:13})}),bar:r?(0,d.jsxs)(`div`,{className:`lc-find`,children:[(0,d.jsx)(`input`,{ref:v,className:`lc-find-input focus:border-(--dsw-alias-label-dimmed)`,value:a,placeholder:t(`rich.findPlaceholder`),onChange:e=>{o(e.target.value)},onKeyDown:b}),s===``?null:(0,d.jsx)(`span`,{className:`lc-find-count`,children:String(p>0?l+1:0)+`/`+String(p)+(h?`+`:``)}),S(t(`rich.findPrev`),(0,d.jsx)(fn,{size:13}),()=>{y(-1)},p===0),S(t(`rich.findNext`),(0,d.jsx)(dn,{size:13}),()=>{y(1)},p===0),S(t(`rich.findClose`),(0,d.jsx)(ln,{size:13}),()=>{i(!1)})]}):null,bodyKey:e,bodyRef:_}}return{RichText:o,RichSwitch:r,RichCopy:a,useRichMode:n,useRichFind:s}}function _n(e){let t=[];if(Array.isArray(e.anyOf)&&t.push(...e.anyOf),Array.isArray(e.oneOf)&&t.push(...e.oneOf),t.length===0)return null;let n=[];for(let e of t)typeof e==`object`&&e&&n.push(vn(e));return n.length>0?n.join(` | `):null}function vn(e){let t=_n(e);if(t!==null)return t;let n=e.type;if(n===`array`){let t=e.items;return typeof t==`object`&&t?`array<`+vn(t)+`>`:`array`}if(typeof n==`string`){if(n===`object`){let t=e.properties;if(typeof t==`object`&&t&&Object.keys(t).length>0)return`object{${Object.keys(t).length}}`}return Array.isArray(e.enum)&&e.enum.length>0?n+` (enum)`:n}return Array.isArray(e.enum)&&e.enum.length>0?`(enum)`:`unknown`}function yn(e){if(typeof e!=`object`||!e)return null;let t=e,n=e=>typeof e==`object`&&e?e:null,r=n(t.parameters)??n(t.input_schema)??n(t.inputSchema);return r===null?t.type===`object`&&t.properties!==void 0&&typeof t.properties==`object`?t:null:r}function bn(e){let t=vn(e.schema),n=e.schema.description;return(0,d.jsxs)(`div`,{className:`lc-ts-param-row`,children:[(0,d.jsx)(`span`,{className:`lc-ts-param-name`,children:e.name}),(0,d.jsx)(`span`,{className:`lc-ts-param-type`,children:t}),(0,d.jsx)(`span`,{className:e.required?`lc-ts-param-req`:`lc-ts-param-req-off`,children:e.required?`✓`:`·`}),typeof n==`string`&&n!==``?(0,d.jsx)(`span`,{className:`lc-ts-param-desc`,children:n}):null]})}function xn(e){let t=e.actions!==void 0||e.meta!==void 0;return(0,d.jsxs)(`div`,{className:`lc-ts-card`,children:[(0,d.jsxs)(`div`,{className:`lc-ts-card-head`+(e.foldHead===!0?` lc-ts-card-head-wrap`:``),children:[(0,d.jsx)(`b`,{className:e.labelClass,title:e.label,children:e.label}),t?(0,d.jsxs)(`span`,{className:`lc-ts-card-right`,children:[e.meta,e.actions]}):null,e.count===void 0?null:(0,d.jsx)(`span`,{className:`lc-ts-card-count`,children:e.count})]}),e.children]})}function Sn(e){return e.split(/\r\n|\r|\n/).length}function Cn(e){let{rich:t}=e,[n,r]=t.useRichMode(),i=t.useRichFind(e.text,n),a=(0,u.useMemo)(()=>Sn(e.text),[e.text]);return(0,d.jsxs)(xn,{label:e.label,foldHead:!0,actions:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(t.RichSwitch,{mode:n,onPick:r}),(0,d.jsx)(t.RichCopy,{text:e.text}),i.button]}),meta:(0,d.jsx)(`span`,{className:`lc-ts-card-meta`,children:e.lines(a)}),children:[i.bar,(0,d.jsx)(`div`,{ref:i.bodyRef,children:(0,d.jsx)(t.RichText,{text:e.text,mode:n})},i.bodyKey)]})}function wn(e){try{return JSON.stringify(e??``)}catch{return``}}function Tn(e){return(0,d.jsxs)(`div`,{className:`lc-br-toolctl`,children:[(0,d.jsx)(`input`,{className:`lc-br-tool-search focus:border-(--dsw-alias-label-dimmed)`,value:e.value,placeholder:e.placeholder,onChange:t=>{e.onChange(t.target.value)}}),e.children===void 0?null:(0,d.jsx)(`span`,{className:`lc-gran`,role:`group`,title:e.tip,children:e.children})]})}function En(e){let{rich:t}=e,[n,r]=(0,u.useState)(!1),i=(0,u.useMemo)(()=>yn(e.schema),[e.schema]),a=(0,u.useMemo)(()=>{if(i===null)return[];let e=i.properties;if(typeof e!=`object`||!e)return[];let t=Array.isArray(i.required)?new Set(i.required.filter(e=>typeof e==`string`)):new Set,n=[];for(let r of Object.keys(e)){let i=e[r];typeof i==`object`&&i&&n.push({name:r,schema:i,required:t.has(r)})}return n},[i]),o=(0,u.useMemo)(()=>n?JSON.stringify(e.schema,null,2):``,[e.schema,n]);return(0,d.jsxs)(d.Fragment,{children:[e.description===void 0?null:(0,d.jsx)(Cn,{label:e.labels.desc,text:e.description,rich:t,lines:e.lines}),i!==null&&a.length>0?(0,d.jsx)(xn,{label:e.labels.title,count:a.length,children:a.map(e=>(0,d.jsx)(bn,{name:e.name,schema:e.schema,required:e.required},e.name))}):i===null?null:(0,d.jsx)(`div`,{className:`lc-ts-params-empty`,children:e.labels.empty}),(0,d.jsxs)(`div`,{className:`lc-ts-json`,children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-ts-json-toggle hover:text-(--dsw-alias-label-primary) hover:underline`,onClick:()=>{r(e=>!e)},children:(n?`▾ `:`▸ `)+(n?e.labels.hide:e.labels.show)}),n?(0,d.jsx)(`pre`,{className:`lc-ts-desc-body lc-br-dim`,children:o}):null]})]})}function Dn(e){let{rich:t,img:n,labels:r}=e,i=[],a=[],o=()=>{if(a.length===0)return;let e=a;a=[],i.push((0,d.jsx)(xn,{label:r.images,count:e.length,children:(0,d.jsx)(`div`,{className:`lc-att-grid`,children:e.map((e,t)=>(0,d.jsx)(n.Card,{attachment:e,load:n.load},`${e.attachmentId}:${t}`))})},`img`+String(i.length)))};for(let s of e.blocks){let c=en(s);if(c!==null){a.push(c);continue}o();let l=typeof s==`object`&&s?s:null,u=l===null?``:typeof l.type==`string`?l.type:typeof l.kind==`string`?l.kind:``;if((u===`text`||u===`reasoning`)&&typeof l?.text==`string`){let n=u===`reasoning`?r.thinking:e.textLabel;i.push((0,d.jsx)(Cn,{label:n,text:l.text,rich:t,lines:r.lines},i.length));continue}if(u===`tool-call`){i.push((0,d.jsx)(An,{name:typeof l?.name==`string`?l.name:`?`,argsRaw:l?.argsRaw??l?.arguments},i.length));continue}if(u===`tool-result`&&Array.isArray(l?.content)){i.push((0,d.jsx)(Dn,{blocks:l.content,textLabel:r.result,rich:t,img:n,labels:r},i.length));continue}i.push((0,d.jsx)(xn,{label:r.other,children:(0,d.jsx)(`pre`,{className:`lc-ts-desc-body lc-br-dim`,children:JSON.stringify(s,null,2)})},i.length))}return o(),(0,d.jsx)(d.Fragment,{children:i})}function On(e){if(e===void 0||!Array.isArray(e.content))return{fail:!1,exit:null};for(let t of e.content){let e=t?.text;if(typeof e!=`string`)continue;let n=e.trimEnd(),r=/\[(shell killed by signal: [^\]\n]+|shell exited(?:: code \d+)?)\]$/.exec(n);if(r!==null){let e=/\[exit code:\s*(\d+)\]\s*$/.exec(n.slice(0,r.index));if(e!==null)return{fail:!0,exit:Number(e[1])};let t=/: code (\d+)$/.exec(r[1]);return t===null?{fail:r[1].startsWith(`shell killed`),exit:null}:{fail:t[1]!==`0`,exit:t[1]===`0`?null:Number(t[1])}}let i=/\[exit code:\s*(\d+)\]$/.exec(n);if(i!==null)return{fail:!0,exit:Number(i[1])};if(/\[killed by signal: [^\]\n]+\]$/.test(n)||/\[status: (?:killed|failed)(?:, [^\]\n]*)?\]$/.test(n))return{fail:!0,exit:null}}return{fail:!1,exit:null}}function kn(e,t){let n=On(t);return{err:e.err===!0||t?.isError===!0||n.fail,exit:n.exit}}function An(e){let t=(0,u.useMemo)(()=>lt(e.argsRaw),[e.argsRaw]);return(0,d.jsx)(xn,{label:(e.arrow??`→`)+` `+e.name,labelClass:`lc-ts-call-name`,meta:e.status,children:t===null?typeof e.argsRaw==`string`&&e.argsRaw!==``?(0,d.jsx)(`pre`,{className:`lc-ts-desc-body lc-br-dim`,children:e.argsRaw}):null:Object.keys(t).map(e=>(0,d.jsx)(jn,{name:e,value:t[e]},e))})}function jn(e){let t=e.value,n=typeof t==`string`?t:t===void 0?``:JSON.stringify(t);return(0,d.jsxs)(`div`,{className:`lc-ts-arg-row`,children:[(0,d.jsx)(`span`,{className:`lc-ts-param-name`,children:e.name}),(0,d.jsx)(`span`,{className:`lc-ts-arg-val`,children:n})]})}function Mn(e){let{node:t,conv:n,rich:r,img:i,labels:a}=e;if(n===void 0)return t.text===void 0||t.text===``?(0,d.jsx)(`div`,{className:`lc-br-note`,children:e.hint}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Cn,{label:a.content,text:t.text,rich:r,lines:a.lines}),(0,d.jsx)(`div`,{className:`lc-br-note`,children:e.hint})]});if(n.kind===`assistant`&&Array.isArray(n.blocks))return(0,d.jsx)(Dn,{blocks:n.blocks,textLabel:a.answer,rich:r,img:i,labels:a});if(n.kind===`tool-result`){let{err:e,exit:o}=kn(t,n);return(0,d.jsxs)(d.Fragment,{children:[n.call==null?null:(0,d.jsx)(An,{arrow:`←`,name:n.call.name,argsRaw:n.call.argsRaw,status:a.callState(e,o)}),Array.isArray(n.content)?(0,d.jsx)(Dn,{blocks:n.content,textLabel:a.result,rich:r,img:i,labels:a}):null]})}return n.kind===`compaction`?typeof n.summary==`string`&&n.summary!==``?(0,d.jsx)(Cn,{label:a.summary,text:n.summary,rich:r,lines:a.lines}):(0,d.jsx)(d.Fragment,{}):Array.isArray(n.content)?(0,d.jsx)(Dn,{blocks:n.content,textLabel:a.content,rich:r,img:i,labels:a}):(0,d.jsx)(`div`,{className:`lc-br-note`,children:e.hint})}function Nn(e){let t={};for(let n of e.nodes)(t[n.cat]??=[]).push(n);return t}function Pn(e){return typeof e.name==`string`?e.name:``}function Fn(e,t){let n=!1,r=!1,i=!1;for(let e of[t?.blocks,t?.content])if(Array.isArray(e))for(let t of e){let e=typeof t==`object`&&t?t:null,a=e===null?``:typeof e.kind==`string`?e.kind:typeof e.type==`string`?e.type:``;a===`reasoning`?n=!0:a===`tool-call`?r=!0:a===`text`&&(i=!0)}return{think:n,tool:r||Array.isArray(e.calls)&&e.calls.length>0,answer:i||typeof e.text==`string`&&e.text!==``}}function In(e){if(e===void 0)return``;let t=``;for(let n of[e.blocks,e.content])if(Array.isArray(n))for(let e of n){let n=typeof e==`object`&&e?e:null;(n===null?``:typeof n.kind==`string`?n.kind:typeof n.type==`string`?n.type:``)===`reasoning`&&typeof n?.text==`string`&&(t+=n.text+`
16
+ `)}return t}let Ln=[`think`,`tool`,`answer`];function Rn(e,t,n){return n===`system`?e.system===null?0:1:n===`tools`?e.header===null?0:e.header.tools.length:t[n]?.length??0}function zn(e,t){for(let n=e.length-1;n>=0;n--)if((e[n].turn??0)===t)return e[n];return null}function Bn(e){let t=e.slice().sort((e,t)=>e.seq-t.seq);return e=>{for(let n of t)if(n.seq>e)return typeof n.turn==`number`&&typeof n.step==`number`?{turn:n.turn,step:n.step}:null;return null}}function Vn(e,t,n){let{t:r,fmt:i,fmtTime:a,catLabel:o}=e,s=Ot(e),c=kt(e),l=gn(e),f=tn(e),p=e=>r(e===1?`block.line`:`block.lines`,{n:e});return function(e){let{data:m,headers:h}=e,[g,_]=(0,u.useState)(`live`),[v,y]=(0,u.useState)(null),[b,x]=(0,u.useState)(null),[S,C]=(0,u.useState)(``),[w,T]=(0,u.useState)(null),[E,D]=(0,u.useState)(()=>n.defaultToolSort()),[O,k]=(0,u.useState)(!1),A=e.dna!==void 0&&e.onDnaChange!==void 0,j=A?e.dna===!0:O,M=t=>{A?e.onDnaChange?.(t):k(t)},[N,ee]=(0,u.useState)(null),[P,F]=(0,u.useState)(()=>n.defaultDeltaBase()),I=e.onOpenCat,L=e=>{y(e),I!==void 0&&I(e)},ne=e.convNodes,re=(0,u.useMemo)(()=>{let e=new Map;for(let t of ne??[])e.set(t.seq,t);return e},[ne]),ie=b!==null&&b.startsWith(`n`)?Number(b.slice(1)):null,ae=e.fetchContent,B=Lt(ie!==null&&!re.has(ie)?ie:null,ae,`dsh-context: targeted history read failed`),oe=(0,u.useMemo)(()=>{if(B.values.size===0)return re;let e=new Map(re);for(let[t,n]of B.values)e.has(t)||e.set(t,n);return e},[re,B.values]),V=e.pinSeq;(0,u.useEffect)(()=>{_(V??`live`),L(null),x(null)},[V,I]);let se=(0,u.useRef)(null),ce=(0,u.useRef)(!1),H=e.nodeFocus;(0,u.useEffect)(()=>{H!=null&&(_(H.step),L(H.cat),x(H.key),C(``),T(null),ce.current=!0,e.onNodeFocusHandled!==void 0&&e.onNodeFocusHandled())},[H,e.onNodeFocusHandled,I]);let U=e.catFocus;(0,u.useEffect)(()=>{U!=null&&(_(`live`),L(U.cat),x(null),C(``),T(U.kind??null),e.onCatFocusHandled!==void 0&&e.onCatFocusHandled())},[U,e.onCatFocusHandled,I]),(0,u.useLayoutEffect)(()=>{ce.current&&(ce.current=!1,se.current?.querySelector(`.lc-br-elem-on`)?.scrollIntoView({block:`nearest`}))});let W=Rt(r,ae,B.state,B.retry,`browser.noContent`),G=m.requests,le=(0,u.useMemo)(()=>Nt(G),[G]),ue=(0,u.useMemo)(()=>Bn(G),[G]),K=(0,u.useMemo)(()=>{let e=!1,t=-1,n=0,r=0;for(let i of G)e&&i.seq<=t||(e=!0,t=i.seq,n=typeof i.turn==`number`?i.turn:-1,r=typeof i.step==`number`?i.step:-1);if(e&&(n<0||r<0))return null;let i=-1,a=null;for(let e of m.nodes)(a===null||e.seq>i)&&(a=e,i=e.seq);if(a===null)return null;let o={turn:n+1,step:1};return a.cat===`user`?o:e?a.cat===`assistant`&&!Fn(a,oe.get(a.seq)).tool?o:{turn:n,step:r+1}:null},[G,m.nodes,oe]),q=(e.previewSeq!==null&&e.previewSeq!==void 0?G.find(t=>t.seq===e.previewSeq)??null:null)??(g===`live`?null:G.find(e=>e.seq===g)??null),de=q??G.reduce((e,t)=>e===null||t.seq>e.seq?t:e,null),J=q===null?null:q.seq,Y=q===null&&e.onHoverKey!==void 0,fe=Y&&e.hoverKey!==null&&e.hoverKey!==`free`?e.hoverKey:null,X=it(m,h,J),pe=e.fetchHeader,me=X.header===null?null:X.header.seq,he=X.system===null?null:X.system.seq,ge=Lt(v===`system`?he:v===`tools`?me:null,pe,`dsh-context: header content fetch failed`),_e=ge.values,ve=Rt(r,pe,ge.state,ge.retry,`browser.headerMetaOnly`),ye=q===null?m.current:q,be=z(ye),xe=ye.total,Se=v!==null&&(ye[v]||0)>0?v:null,Ce=e=>{_(e===`live`?`live`:Number(e)),L(null),x(null)},we=e=>{let t=G.findIndex(t=>t.seq===e.seq);return t>0?G[t-1]:null},Te=G.length>0?G[G.length-1]:null,Ee=e=>zn(G,(e.turn??0)-1),De=q===null?P===`step`?Te:Te===null?null:Ee(Te):P===`turn`?Ee(q):we(q),Oe=De===null&&Te!==null,ke=De===null?null:it(m,h,De.seq),Ae=ke===null?null:Nn(ke),je=Nn(X),Me=new Map;for(let e of X.nodes)(e.cat===`tool`||e.cat===`skill`)&&e.tool!==void 0&&Me.set(e.tool,(Me.get(e.tool)??0)+1);let Z=e=>Me.get(e.name)??0,Ne=e=>{let t=ct(e,r,o);return e.time===void 0?t:t+` · `+a(e.time)},Pe=j?at(X):null,Fe=new Map(Pe?.map(e=>[e.key,e])??[]),Ie=Pe?.map(e=>({key:e.key,color:te[e.cat],value:e.tokens,label:Ne(e),group:e.cat}))??null,Q=N!==null&&Fe.has(N)?N:null,Le=e=>{let t=Fe.get(e);t!==void 0&&(L(t.cat),C(``),T(null),x(e),ce.current=!0)},Re=e=>Rn(X,je,e),ze=e=>{if(e===`system`)return X.system===null?null:`sys`;if(e===`tools`){let e=X.header?.tools;return e!==void 0&&e.length===1?`tool:`+e[0].name:null}let t=je[e]??[];return t.length===1?`n`+String(t[0].seq):null},Be=e=>{if(Re(e)>0||(e===`system`||e===`tools`)&&X.header===null){if(v===e){L(null),x(null);return}L(e),C(``),T(null),x(ze(e))}},Ve=e=>{x(b===e?null:e)},He=(e,t,n,o,s,c,l=!1,u=null,f=null)=>{let p=b===e;return(0,d.jsxs)(`div`,{className:`lc-br-elem`+(p?` lc-br-elem-on`:``),children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-br-elem-row hover:bg-(--dsw-alias-interactive-bg-hover)`,onClick:()=>{Ve(e)},children:[(0,d.jsx)(`span`,{className:`lc-br-chev`+(p?` lc-br-chev-on`:``)}),l?(0,d.jsx)(`span`,{className:`lc-br-err-dot`,title:r(`node.failed`)}):null,t===null?null:(0,d.jsx)(`span`,{className:`lc-br-tags`,children:t}),(0,d.jsx)(`span`,{className:`lc-br-preview`,children:n}),u===null?null:u,f!==null||s!==void 0?(0,d.jsxs)(`span`,{className:`lc-br-time`+(f!==null&&f.pending?` lc-br-time-pending`:``),title:f===null?void 0:r(f.pending?`browser.stepPendingTip`:`browser.stepAtTip`,{t:f.turn,s:f.step}),children:[f===null?``:r(`browser.stepAt`,{t:f.turn,s:f.step}),f!==null&&s!==void 0?` · `:``,s===void 0?``:a(s)]}):null,(0,d.jsx)(`span`,{className:`lc-br-tokens`,children:`≈`+i(o)})]}),p?(0,d.jsx)(`div`,{className:`lc-br-content`,children:c}):null]},e)},Ue=e=>{let t=ue(e);return t===null?!X.live||K===null?null:{...K,pending:!0}:{...t,pending:!1}},We=(e,t)=>{if(e===null)return null;if(t===null)return(0,d.jsx)(`span`,{className:`lc-br-tag`,children:e});let n=new Map;for(let e of t)n.set(e,(n.get(e)??0)+1);return[...n.entries()].map(([e,t])=>(0,d.jsx)(`span`,{className:`lc-br-tag`,children:t>1?e+` ×`+String(t):e},e))},Ge=t=>{if(t===`system`){let e=X.system;if(e===null)return(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(h===null?`browser.noHeader`:`browser.noEpoch`)});let t=_e.get(e.seq);return t===void 0?(0,d.jsx)(`div`,{className:`lc-br-note`,children:ve}):t.system===void 0?(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.noSystem`)}):He(`sys`,null,t.system.replace(/\s+/g,` `).trim().slice(0,80),ye.system,void 0,(0,d.jsx)(Cn,{label:o(`system`),text:t.system,rich:l,lines:p}),!1,null,Ue(e.seq))}if(t===`tools`){if(X.header===null)return(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(h===null?`browser.noHeader`:`browser.noEpoch`)});let e={desc:r(`tool.desc`),title:r(`tool.params`),empty:r(`tool.paramsEmpty`),show:r(`tool.jsonToggle`),hide:r(`tool.jsonHide`)},t=_e.get(X.header.seq),n=Ue(X.header.seq),a=new Map(t?.tools.map(e=>[e.name,e])??[]),o=S.trim().toLowerCase(),s=X.header.tools.filter(e=>{if(o===``||e.name.toLowerCase().includes(o)||(e.plugin??``).toLowerCase().includes(o))return!0;let t=a.get(e.name);return t===void 0?!1:(t.description??``).toLowerCase().includes(o)||wn(t.schema).toLowerCase().includes(o)}).sort((e,t)=>E===`count`?Z(t)-Z(e)||(e.name<t.name?-1:1):E===`size`?t.tokens-e.tokens:e.name<t.name?-1:1),c=(0,d.jsx)(Tn,{value:S,placeholder:r(`tool.search`),tip:r(`tool.sortTip`),onChange:C,children:[`size`,`count`,`name`].map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(E===e?` lc-gran-on`:``),onClick:()=>{D(e)},children:r(`tool.sort.`+e)},e))});if(s.length===0)return(0,d.jsxs)(`div`,{children:[c,(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`tool.noMatch`)})]});let u=n=>{if(t===void 0)return(0,d.jsx)(`div`,{className:`lc-br-note`,children:ve});let i=a.get(n.name);return i===void 0?(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.notInLog`)}):(0,d.jsx)(En,{description:i.description,schema:i.schema,rich:l,lines:p,labels:e})};return(0,d.jsxs)(`div`,{children:[c,s.map(e=>{let t=(0,d.jsxs)(d.Fragment,{children:[e.plugin===void 0?null:(0,d.jsx)(`span`,{className:`lc-br-tag lc-br-tool-plugin`,title:e.plugin===`<unknown-plugin>`?r(`tool.unknownTitle`):r(`tool.plugin`),children:e.plugin===`<unknown-plugin>`?r(`tool.unknown`):e.plugin}),(0,d.jsx)(`span`,{className:`lc-br-hits`,title:r(`tool.hitsTip`),children:`×`+i(Z(e))})]});return He(`tool:`+e.name,null,e.name,e.tokens,void 0,u(e),!1,t,n)})]})}let n=(je[t]??[]).slice().reverse().map(e=>{let t=oe.get(e.seq),n=(e.cat===`tool`||e.cat===`skill`)&&kn(e,t).err,i=null,a=null,o=c(e),s=Pn(e);if(e.cat===`tool`)i=e.tool??`?`,a=e.tool===void 0?null:[e.tool],o=Tt(t)??r(`node.toolResult`);else if(e.cat===`skill`)i=e.skill===void 0?r(`form.`+(e.form||`context`)):r(`node.skillTag`,{name:e.skill}),o=(e.skill===void 0&&s!==``?s:null)??(e.text!==void 0&&e.text!==``?e.text:null)??Tt(t)??o;else if(e.cat===`assistant`){let n=Array.isArray(e.calls)&&e.calls.length>0?e.calls:Dt(t);n.length>0?(i=n.join(` › `),a=n,o=(e.text!==void 0&&e.text!==``?e.text:null)??Et(t)??r(`node.empty`)):(e.text===void 0||e.text===``)&&(o=Et(t)??o)}else if(e.cat===`user`){let n=t!==void 0&&Array.isArray(t.content)?t.content.filter(e=>en(e)!==null).length:0;n>0&&b!==`n${e.seq}`&&(i=r(`attach.image`)+(n>1?` ×`+String(n):``))}else i=r(`form.`+(e.form||`context`)),s===``?e.text!==void 0&&e.text!==``&&(o=e.form===`snapshot`?r(`node.snapshot`)+e.text:e.text):o=s;return{n:e,conv:t,rowErr:n,tag:i,tagNames:a,preview:o,reasoning:e.cat===`assistant`?In(t):``,kinds:Fn(e,t)}}),a=S.trim().toLowerCase(),s=t===`assistant`?Ln.map(e=>({k:e,n:n.reduce((t,n)=>t+ +!!n.kinds[e],0)})):null,u=a===``&&w===null?n:n.filter(e=>(w===null||e.kinds[w])&&(a===``||(e.tag??``).toLowerCase().includes(a)||e.preview.toLowerCase().includes(a)||typeof e.n.text==`string`&&e.n.text.toLowerCase().includes(a)||e.reasoning.toLowerCase().includes(a))),m=s===null?(0,d.jsx)(Tn,{value:S,placeholder:r(`browser.search.`+t),onChange:C}):(0,d.jsx)(Tn,{value:S,placeholder:r(`browser.search.`+t),tip:r(`browser.kindTip`),onChange:C,children:s.map(({k:e,n:t})=>(0,d.jsxs)(`button`,{type:`button`,className:`lc-gran-btn`+(w===e?` lc-gran-on`:``),onClick:()=>{T(w===e?null:e)},children:[r(`browser.kind.`+e),(0,d.jsx)(`span`,{className:`lc-kind-n`,children:i(t)})]},e))});return u.length===0?(0,d.jsxs)(`div`,{children:[m,(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.rowNoMatch`)})]}):(0,d.jsxs)(`div`,{children:[m,u.map(({n:t,conv:n,rowErr:i,tag:a,tagNames:o,preview:s})=>He(`n${t.seq}`,We(a,o),s,t.tokens,t.time,(0,d.jsx)(Mn,{node:t,conv:n,rich:l,img:{Card:f,load:e.loadImage},labels:{thinking:r(`block.thinking`),answer:r(`block.answer`),content:r(`block.content`),result:r(`block.result`),summary:r(`block.summary`),images:r(`attach.images`),other:r(`attach.other`),lines:p,callState:(e,t)=>(0,d.jsxs)(`span`,{className:`lc-ts-call-state `+(e?`lc-ts-call-err`:`lc-ts-call-ok`),children:[(0,d.jsx)(`i`,{}),e?r(`call.fail`)+(t===null?``:` · `+r(`call.exit`,{n:t})):r(`call.ok`)]})},hint:n===void 0?W:r(`browser.noContent`)}),i,null,Ue(t.seq)))]})};return(0,d.jsxs)(`div`,{className:`lc-card`,ref:se,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`browser.title`)}),(0,d.jsx)(`span`,{className:`lc-gran lc-br-dna-ctl`,role:`group`,title:r(`browser.dnaTip`),children:(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(j?` lc-gran-on`:``),onClick:()=>{M(!j)},children:r(`browser.dna`)})}),(0,d.jsxs)(`span`,{className:`lc-gran`,role:`group`,title:r(`browser.base.tip`),children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(P===`step`?` lc-gran-on`:``),onClick:()=>{F(`step`)},children:r(`browser.base.step`)}),(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(P===`turn`?` lc-gran-on`:``),onClick:()=>{F(`turn`)},children:r(`browser.base.turn`)})]}),(0,d.jsxs)(`select`,{className:`lc-br-pick`,value:J===null?`live`:String(J),onChange:e=>{Ce(e.target.value)},children:[(0,d.jsx)(`option`,{value:`live`,children:r(`browser.live`)}),G.slice().reverse().map(e=>(0,d.jsx)(`option`,{value:String(e.seq),children:r(`detail.step`,{t:e.turn??0,s:e.step??0,n:le(e.turn)})},e.seq))]})]}),(0,d.jsxs)(`div`,{className:`lc-br-meta`,children:[(0,d.jsx)(`b`,{children:q===null?r(`browser.liveNow`):r(`detail.step`,{t:q.turn??0,s:q.step??0,n:le(q.turn)})}),q===null?null:(0,d.jsx)(`span`,{children:a(q.time)}),(0,d.jsx)(`span`,{className:`lc-est`,children:r(`detail.estTotal`,{n:i(xe)})}),de!==null&&de.prompt!==void 0?(0,d.jsx)(`span`,{children:r(`detail.actual`,{n:i(de.prompt)})}):null]}),(0,d.jsx)(`div`,{className:`lc-br-bar`+(j?` lc-br-bar-dna`:``),children:(0,d.jsx)(t,{parts:Ie??be,height:10,hoverKey:j?Q??fe??Se:fe??Se,onHoverKey:j?ee:Y?e.onHoverKey:void 0,tip:j,onPickKey:j?Le:void 0,minBand:j?.35:void 0})}),X.missingLive>0?(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.missingLive`,{n:X.missingLive})}):null,X.approximate?(0,d.jsx)(`div`,{className:`lc-br-note`,children:r(`browser.approx`)}):null,e.detailState===`loading`?(0,d.jsx)(s,{state:`loading`,className:`lc-br-note`}):null,e.detailState===`failed`&&e.onDetailRetry!==void 0?(0,d.jsx)(s,{state:`failed`,onRetry:e.onDetailRetry,className:`lc-br-note`}):null,(0,d.jsx)(`div`,{className:`lc-br-cats`,children:R.map(t=>{let n=Re(t.key),a=ye[t.key]||0,s=Oe?0:ke!==null&&Ae!==null?Rn(ke,Ae,t.key):null,c=s===null?null:n-s,l=Oe?0:De===null?null:De[t.key]||0,u=l===null?null:a-l,f=n>0||(t.key===`system`||t.key===`tools`)&&X.header===null,p=v===t.key&&f;return(0,d.jsxs)(`div`,{className:`lc-br-cat`+(f?``:` lc-br-cat-empty`),children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-br-cat-row hover:bg-(--dsw-alias-interactive-bg-hover)`+(p?` lc-br-cat-open`:``)+(Y&&e.hoverKey===t.key?` lc-br-cat-on`:``),onMouseEnter:Y?()=>{e.onHoverKey!==void 0&&e.onHoverKey(t.key)}:void 0,onMouseLeave:Y?()=>{e.onHoverKey!==void 0&&e.onHoverKey(null)}:void 0,onClick:()=>{Be(t.key)},children:[(0,d.jsx)(`span`,{className:`lc-br-chev`+(p?` lc-br-chev-on`:``)}),(0,d.jsx)(`i`,{style:{background:t.color}}),(0,d.jsx)(`span`,{className:`lc-br-cat-label`,children:o(t.key)}),(0,d.jsxs)(`span`,{className:`lc-br-count-grp`,children:[(0,d.jsx)(`span`,{className:`lc-br-cat-count`,children:r(`browser.items`,{n})}),c!==null&&c!==0?(0,d.jsx)(`span`,{className:`lc-br-delta lc-br-delta-`+(c>0?`up`:`down`),children:`${c>0?`+`:``}${c}`}):null]}),(0,d.jsxs)(`span`,{className:`lc-br-tokens-grp`,children:[u!==null&&u!==0?(0,d.jsx)(`span`,{className:`lc-br-tdelta lc-br-tdelta-`+(u>0?`up`:`down`),children:(u>0?`+`:``)+i(u)}):null,(0,d.jsx)(`span`,{className:`lc-br-tokens`,children:`≈`+i(a)})]}),(0,d.jsx)(`span`,{className:`lc-br-pct`,children:xe>0?`${Math.round(a/xe*100)}%`:``})]}),p?(0,d.jsx)(`div`,{className:`lc-br-body`,children:Ge(t.key)}):null]},t.key)})})]})}}function Hn(e){let{t,fmt:n,catLabel:r}=e;return function(e){let[i,a]=(0,u.useState)(!1),o=0;for(let t of e.parts)o+=t.value;let s=e.max!==void 0&&e.max>o?e.max:o,c=e.max!==void 0&&e.max>o?e.max-o:0,l=s>0?o/s*100:0,f=e.hoverKey!==null&&e.hoverKey!==void 0,p=c>0&&f,m=e.onPickKey,h=e.minBand!==void 0&&e.minBand>0?e.minBand:0,g=o>0?e.parts.filter(e=>e.value>0):[],_=(()=>{if(h===0||g.length<2)return g.map(e=>e.value/s*100);let e=g.map(e=>e.value/o*100),t=Math.min(h,100/g.length),n=0,r=0;for(let i of e)i<t&&(n+=1,r+=i);if(n===0)return g.map(e=>e.value/s*100);let i=100-n*t,a=100-r;return e.map(e=>(e<t?t:e*i/a)*o/s)})(),v=e.reserve!==void 0&&e.max!==void 0&&e.max>0?{...e.reserve,max:e.max}:null,y=v===null?0:Math.round(v.max*v.ratio/s*1e3)/10,b=v===null?0:Math.round((1-v.ratio)*v.max/s*1e3)/10,x=null;if(i&&v!==null)x={text:v.label,leftPct:Math.max(12,Math.min(y+b/2,88))};else if(e.hoverKey!==null&&e.hoverKey!==void 0){if(e.hoverKey===`free`&&c>0){let e=s>0?c/s*100:0;x={text:`${t(`overview.free`)} ${n(c)} (${Math.round(e)}%)`,leftPct:Math.max(12,Math.min(o/s*100+e/2,88))}}else{let i=0,a=0;for(let t of e.parts)a+=t.raw??t.value;for(let o=0;o<g.length;o++){let s=g[o];if(s.key===e.hoverKey){let e=s.raw??s.value;x={text:`${s.label??r(s.key)} ≈${n(e)} (${a>0?Math.round(e/a*100):0}%) `+t(`overview.ofUsed`),leftPct:Math.max(12,Math.min(i+_[o]/2,88))};break}i+=_[o]}}}return(0,d.jsxs)(`div`,{className:`lc-stacked-wrap`,children:[(0,d.jsxs)(`div`,{className:`lc-stacked`+(f?` lc-stacked-dim`:``),style:{height:`${e.height||14}px`},onMouseLeave:()=>{e.onHoverKey!==void 0&&e.onHoverKey(null),a(!1)},children:[g.map((t,n)=>{let r=e.hoverKey!==void 0&&(e.hoverKey===t.key||t.group!==void 0&&e.hoverKey===t.group);return(0,d.jsx)(`div`,{className:`lc-stacked-seg animate-lc-stacked-in motion-reduce:animate-none`+(r?` lc-stacked-seg-on`:``)+(m===void 0?``:` lc-stacked-seg-pick`),style:{width:`${_[n]}%`,backgroundColor:t.color,"--lc-i":Math.min(n,8)},onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(t.key)},onClick:m===void 0?void 0:()=>{m(t.key)}},t.key)}),c>0?(0,d.jsx)(`div`,{className:`lc-stacked-free animate-lc-stacked-in motion-reduce:animate-none`+(e.hoverKey===`free`?` lc-stacked-free-on`:``),style:{width:`${c/s*100}%`,"--lc-i":Math.min(g.length,9)},onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(`free`)}},`free`):null,v===null?null:(0,d.jsx)(`div`,{className:`lc-reserve`,style:{left:`${y}%`,width:`${b}%`},onMouseEnter:()=>{a(!0),e.onHoverKey!==void 0&&e.onHoverKey(null)},onMouseLeave:()=>{a(!1)}}),(0,d.jsx)(`div`,{className:`lc-occupied-box`+(p?` lc-occupied-box-on`:``),style:{width:`${l}%`}})]}),e.tip===!1?null:(0,d.jsx)(`div`,{className:`lc-tip lc-bar-tip`+(x?` lc-bar-tip-on`:``),style:{left:x?`${x.leftPct}%`:`50%`},children:x?x.text:``})]})}}function Un(e){let{t,fmt:n,catLabel:r}=e;return function(e){let i=0;for(let t of e.parts)i+=t.raw??t.value;return(0,d.jsx)(`div`,{className:`lc-legend`,children:e.parts.map(a=>{let o=a.raw??a.value,s=e.hoverKey!==void 0&&e.hoverKey===a.key;return(0,d.jsxs)(`span`,{className:`lc-chip`+(s?` lc-chip-on`:``),title:t(`overview.ofUsed`),onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(a.key)},onMouseLeave:()=>{e.onHoverKey!==void 0&&e.onHoverKey(null)},children:[(0,d.jsx)(`i`,{style:{background:a.color}}),(0,d.jsx)(`span`,{className:`lc-chip-label`,children:r(a.key)}),(0,d.jsxs)(`span`,{className:`lc-chip-nums`,children:[`≈`+n(o),i>0?(0,d.jsx)(`em`,{children:`${Math.round(o/i*100)}%`}):null]})]},a.key)})})}}function Wn(e,t,n){let{t:r,fmt:i}=e;return function(e){let a=e.head,o=a.window!=null&&a.window>0?{ratio:.8,label:r(`overview.compactReserve`,{pct:80})}:void 0;return(0,d.jsxs)(`div`,{className:`lc-card`,"data-lc-current":!0,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`overview.title`)}),e.subtitle!==void 0&&e.subtitle!==``?(0,d.jsx)(`span`,{className:`lc-card-sub`,children:e.subtitle}):null]}),(0,d.jsxs)(`div`,{className:`lc-overview-num`,children:[(0,d.jsx)(`b`,{children:i(a.tokens)}),(0,d.jsx)(`span`,{children:a.window?` / `+i(a.window)+` tokens`:` `+r(`overview.estimate`)}),a.pct===null?null:(0,d.jsxs)(`span`,{className:`lc-overview-pct`,children:[(0,d.jsx)(`b`,{children:`${a.pct.toFixed(1)}%`}),r(`overview.used`)]})]}),(0,d.jsx)(t,{parts:a.parts,height:16,max:a.window,hoverKey:e.hoverKey,onHoverKey:e.onHoverKey,reserve:o}),(0,d.jsx)(n,{parts:a.parts,hoverKey:e.hoverKey,onHoverKey:e.onHoverKey})]})}}function Gn(e){return class extends u.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}render(){let t=this.state.error;return t===null?this.props.children:(0,d.jsx)(`div`,{className:`lc-root`,children:(0,d.jsxs)(`div`,{className:`lc-empty lc-error`,children:[(0,d.jsx)(`span`,{children:e(`error`)}),(0,d.jsx)(`code`,{className:`lc-error-msg`,children:t.message}),(0,d.jsx)(`button`,{type:`button`,className:`lc-error-retry hover:border-(--dsw-alias-label-primary)`,onClick:()=>{this.setState({error:null})},children:e(`error.retry`)})]})})}}}function Kn(e,t){let n=(0,u.useRef)(t);n.current=t,(0,u.useEffect)(()=>{if(!e)return;let t=document.activeElement instanceof HTMLElement?document.activeElement:null,r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n.current())};return window.addEventListener(`keydown`,r,!0),()=>{window.removeEventListener(`keydown`,r,!0),t!==null&&document.contains(t)&&t.focus()}},[e])}function qn(e,t,n){let{t:r}=t,i=Hn(t),a=Wn(t,i,Un(t)),o=Vn(t,i,n),s=Ot(t),c=Gn(r);function l(t){let n=typeof t.sessionId==`string`?t.sessionId:``,i=typeof t.useContextModal==`function`&&t.useContextModal(e=>e),c=tt(t),l=c.data,f=H(t,`contextPressure`,me),p=H(t,`contextBreakdown`,he),m=H(t,`contextHeaders`,xe),h=ce(t),[g,_]=(0,u.useState)(null),[v,y]=(0,u.useState)({left:0,right:0}),b=(0,u.useRef)(null),x=(0,u.useMemo)(()=>se(e,n===``?void 0:n),[e,n]),S=Be(),C=(0,u.useMemo)(()=>n!==``&&S!==void 0?We(n):void 0,[n,S]),w=(0,u.useMemo)(()=>n!==``&&S!==void 0?Ke(n):void 0,[n,S]),T=(0,u.useCallback)(()=>{if(n===``)return;O(n).set(!1);let t=j(n),r=e.get(`sessions`);if(t===void 0||r===void 0)return;let i=r.scope(n);i!==void 0&&i.bail(i,`slash/input-consume-token`,{guard:t})},[e,n]);if(Kn(i,T),(0,u.useLayoutEffect)(()=>{if(!i)return;let e=L(b.current);if(y({left:e.left,right:e.right}),e.frame===null)return;let t=new MutationObserver(()=>{let e=L(b.current);y({left:e.left,right:e.right})});return t.observe(e.frame,{attributes:!0,attributeFilter:[`style`]}),()=>{t.disconnect()}},[i]),!i)return null;let E=l===null?null:oe(l,f,p),D=l===null?``:(l.model?l.model:``)+(l.provider?` · `+l.provider:``);return(0,d.jsx)(`div`,{ref:b,className:`lc-modal-backdrop`,style:{left:v.left,right:v.right},onClick:T,children:(0,d.jsxs)(`div`,{className:`lc-modal-card`,onClick:e=>{e.stopPropagation()},children:[(0,d.jsxs)(`div`,{className:`lc-modal-head`,children:[(0,d.jsx)(`span`,{className:`lc-modal-title`,children:r(`tab`)}),(0,d.jsx)(`button`,{className:`lc-modal-close hover:text-(--dsw-alias-label-primary) hover:bg-(--dsw-alias-bg-layer-2)`,"aria-label":r(`cmd.close`),onClick:T,children:`×`})]}),l===null||E===null?c.detailState===`failed`?(0,d.jsx)(s,{state:`failed`,onRetry:c.retryDetail}):(0,d.jsx)(`div`,{className:`lc-empty`,children:r(`loading`)}):(0,d.jsxs)(`div`,{children:[(0,d.jsx)(a,{head:E,subtitle:D,hoverKey:g,onHoverKey:_}),(0,d.jsx)(o,{data:l,headers:m,convNodes:h,fetchContent:C,fetchHeader:w,loadImage:x,hoverKey:g,onHoverKey:_,detailState:c.detailState,onDetailRetry:c.retryDetail})]})]})})}return function(e){return(0,u.createElement)(c,null,(0,u.createElement)(l,e))}}let Jn={"deepseek-official":`deepseek`,"deepseek-account":`deepseek`,"kimi-coding":`moonshotai`,"minimax-cn":`minimax`,"zai-coding-cn":`zhipuai`};function Yn(e){return Jn[e]??e}function Xn(e){return Yn(e)===`deepseek`}function Zn(e,t){return t===`cny`?e/.15:e}function Qn(e,t){let n=(e,t)=>Math.abs(e-t)<=1e-9*Math.max(1,Math.abs(e));return n(e.hit,t.hit)&&n(e.miss,t.miss)&&n(e.write,t.write)&&n(e.out,t.out)}function $n(e){let t=e;if(typeof t!=`object`||!t)return null;let n=t,r=e=>typeof e==`number`&&Number.isFinite(e);return r(n.hit)&&r(n.miss)&&r(n.write)&&r(n.out)?{hit:n.hit,miss:n.miss,write:n.write,out:n.out}:null}function er(e,t){let n=new Map,r=(e,t)=>{let r=n.get(e);r===void 0?n.set(e,[t]):r.some(e=>e.pid===t.pid&&Qn(e.rate,t.rate))||r.push(t)};for(let n of Object.keys(e)){let i=ir(e,n);if(i===null)continue;let a=t[n],o=typeof a==`string`&&a.startsWith(`@ai-sdk/`)&&a.slice(8)===n;for(let e of Object.keys(i)){let t=$n(i[e]);if(t===null)continue;let a=e.toLowerCase(),s={pid:n,mid:e,rate:t,primary:o};r(a,s);let c=a.split(`-`);for(let e=1;e<c.length;e++)r(c.slice(e).join(`-`),s)}}return{byModel:n}}function tr(e){let t=[];for(let n of e){let e=t.find(e=>Qn(e.cand.rate,n.rate));e===void 0?t.push({cand:n,n:1}):e.n++}return t.sort((e,t)=>t.n-e.n),t.length>1&&t[0].n===t[1].n?null:t[0].cand}function nr(e,t,n){if(n!==null){let e=t.filter(e=>e.pid===n||n.startsWith(e.pid+`-`)||n.length>=4&&n.startsWith(e.pid));if(e.length>0){let t=tr(e);if(t!==null)return t}}let r=t.filter(e=>e.primary);if(r.length>0){let e=tr(r);if(e!==null)return e}let i=t.filter(t=>e.startsWith(t.pid+`-`)||e.startsWith(t.pid+`/`));if(i.length>0){let e=tr(i);if(e!==null)return e}return t.length===1?t[0]:null}function rr(e,t){let n=t.toLowerCase(),r=n.lastIndexOf(`/`),i=r>0?n.slice(0,r):null;for(let t of r>0?[n,n.slice(r+1)]:[n]){let n=e.byModel.get(t);if(n===void 0)continue;let r=nr(t,n,i);if(r!==null)return r}return null}function ir(e,t){let n=e[t];return typeof n==`object`&&n?n:null}function ar(e,t){if(Object.hasOwn(e,t))return{mid:t,rate:e[t]};let n=t.toLowerCase(),r=null,i=null;for(let t in e){let a=t.toLowerCase();if(a===n||a.endsWith(`-`+n)){if(i!==null&&i!==a)return null;i=a,r={mid:t,rate:e[t]}}}return r}function or(e,t,n){if(e==null)return null;let r=Yn(t),i=ir(e.prices,r);if(i!==null){let e=ar(i,n);return e===null?null:{pid:r,mid:e.mid,rate:e.rate}}if(n.toLowerCase().startsWith(`deepseek-`)){let t=ir(e.prices,`deepseek`);if(t!==null){let e=ar(t,n);if(e!==null)return{pid:`deepseek`,mid:e.mid,rate:e.rate}}}let a=rr(e.index,n);return a===null?null:{pid:a.pid,mid:a.mid,rate:a.rate}}function sr(e,t,n){return or(e,t,n)?.rate??null}function cr(e,t,n){if(e==null||t==null)return null;let r=0,i=!1;for(let n of Object.keys(e)){let a=U(e[n]);if(a===null)continue;let o=Xn(n);for(let e of Object.keys(a)){let s=sr(t,n,e),c=U(a[e]);if(s!==null&&c!==null)for(let e of[`peak`,`off`]){let t=U(c[e]);if(t===null)continue;let n=(W(t.cacheRead)*s.hit+W(t.uncached)*s.miss+W(t.cacheWrite)*s.write+W(t.output)*s.out)/1e6;r+=o&&e===`peak`?n*2:n,i=!0}}}return i?Zn(r,n):null}function lr(e){if(e==null)return 0;let t=0;for(let n of Object.keys(e)){let r=U(e[n]);if(r!==null)for(let e of Object.keys(r)){let n=U(r[e]);if(n!==null)for(let e of[`peak`,`off`]){let r=U(n[e]);r!==null&&(t+=W(r.uncached)+W(r.cacheRead)+W(r.cacheWrite)+W(r.output))}}}return t}function ur(e,t){if(t==null)return!1;let n=!1;for(let r of Object.keys(t)){let i=U(t[r]);if(i===null||Array.isArray(i))continue;let a=e[r]??(e[r]={});for(let e of Object.keys(i)){let t=U(i[e]);if(t===null||Array.isArray(t))continue;let r=a[e]??(a[e]={});for(let e of[`peak`,`off`]){let i=U(t[e]);if(i===null||Array.isArray(i))continue;let a=r[e]??{uncached:0,cacheRead:0,cacheWrite:0,output:0};r[e]={uncached:a.uncached+W(i.uncached),cacheRead:a.cacheRead+W(i.cacheRead),cacheWrite:a.cacheWrite+W(i.cacheWrite),output:a.output+W(i.output)},n=!0}}}return n}function dr(...e){let t={},n=!1;for(let r of e)ur(t,r)&&(n=!0);return n?t:null}function fr(e,t){return(t===`cny`?`¥`:`$`)+(e>=1?e.toFixed(2):e.toPrecision(2))}function pr(e,t){return(t===`cny`?`¥`:`$`)+e.toFixed(2)}var mr=class extends Error{reason;name=`ModelsDevError`;constructor(e,t){super(e,t),this.reason=e}};function hr(e={}){let t=e.baseUrl??`https://models.dev`,n=t.endsWith(`/`)?t:t+`/`,r=async(t,r)=>{let i=e.fetch??globalThis.fetch,a=new Headers;for(let[t,n]of new Headers(e.headers))a.set(t,n);for(let[e,t]of new Headers(r?.headers))a.set(e,t);let o;try{let e=new URL(t,n),s=r?.modelTypes;s===`all`?e.searchParams.set(`type`,`all`):s&&s.length>0&&e.searchParams.set(`type`,s.join(`,`)),o=await i(e,{method:`GET`,headers:a,signal:r?.signal})}catch(e){throw new mr(`Transport`,{cause:e})}if(!o.ok){try{await o.body?.cancel()}catch{}throw new mr(`UnexpectedStatus`,{cause:{status:o.status}})}let s;try{s=await o.text()}catch(e){throw new mr(`Transport`,{cause:e})}if(s===``)throw new mr(`MalformedResponse`);try{return JSON.parse(s)}catch(e){throw new mr(`MalformedResponse`,{cause:e})}};return{providers:e=>r(`api.json`,e),models:e=>r(`models.json`,e),catalog:e=>r(`catalog.json`,e)}}function gr(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:null}function _r(e){let t=U(e);if(t===null||Array.isArray(t))return null;let n={},r={};for(let e of Object.keys(t)){let i=U(t[e]);if(i===null)continue;let a=U(i.models);if(a===null)continue;let o=i.npm;r[e]=typeof o==`string`?o:null;let s={};for(let e of Object.keys(a)){let t=U(a[e]),n=t===null?null:U(t.cost);if(n===null)continue;let r=gr(n.input),i=gr(n.output);r!==null&&i!==null&&(s[e]={hit:gr(n.cache_read)??r,miss:r,write:gr(n.cache_write)??r,out:i})}Object.keys(s).length>0&&(n[e]=s)}return{prices:n,index:er(n,r)}}let vr=()=>hr().providers(),yr={book:null,failed:!1},br=!1,xr=0,Sr=null,Cr=new Set;function wr(){yr={...yr,failed:!0},xr++,Sr=setTimeout(()=>{Sr=null,Cr.size!==0&&Tr()},3e4*2**Math.min(xr-1,3))}async function Tr(){br=!0;try{let e=_r(await vr());e===null?wr():(yr={book:e,failed:!1},xr=0)}catch{wr()}br=!1;for(let e of Cr)e()}function Er(){yr.book!==null||br||Sr!==null||Tr()}let Dr=e=>(Cr.add(e),Er(),()=>{Cr.delete(e)}),Or=()=>yr;function kr(){return(0,u.useSyncExternalStore)(Dr,Or)}function Ar(e){return encodeURIComponent(e).replace(/%3A/gi,`:`)}function jr(e){return e.split(`/`).map(Ar).join(`/`)}function Mr(e,t){let n=t.replace(/\\/g,`/`).replace(/^(?:\.\/)+/,``);return`dsh-resource://file/session/${Ar(e)}/${jr(n)}`}function Nr(e){return/^[A-Za-z]:[/\\]/.test(e)||e.startsWith(`\\\\`)}function Pr(e){return e.startsWith(`/`)||Nr(e)}function Fr(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return t.slice(n+1)}function Ir(e,t,n){let r=n.replace(/\\/g,`/`);if(!Pr(r))return Mr(e,r);let i=t===void 0?``:t.replace(/\\/g,`/`).replace(/\/+$/,``);return i!==``&&r===i?Mr(e,``):i!==``&&r.startsWith(`${i}/`)?Mr(e,r.slice(i.length+1)):Mr(e,r)}let Lr=/^\d{4}-\d{2}-\d{2}$/,Rr=/^\d{4}-\d{2}$/;function zr(e){if(!Number.isFinite(e))return null;let t=new Date(e),n=t.getFullYear();return!Number.isFinite(n)||n<1970||n>9999?null:`${String(n).padStart(4,`0`)}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function Br(e){if(!Lr.test(e))return null;let t=Number(e.slice(0,4)),n=Number(e.slice(5,7)),r=Number(e.slice(8,10)),i=new Date(t,n-1,r);return i.getFullYear()!==t||i.getMonth()!==n-1||i.getDate()!==r?null:i}function Vr(e,t){let n=Br(e);return n===null?null:(n.setDate(n.getDate()+t),zr(n.getTime()))}function Hr(e){let t=Br(e);return t===null?null:t.getDay()}function Ur(e){let t=Hr(e);return t===null?null:Vr(e,-t)}function Wr(e){let t=Br(e);return t===null?null:(t.setHours(0,0,0,0),t.getTime())}function Gr(e){let t=Br(e);return t===null?null:(t.setHours(23,59,59,999),t.getTime())}function Kr(e,t){if(!Rr.test(e))return null;let n=Number(e.slice(0,4)),r=Number(e.slice(5,7));if(r<1||r>12)return null;let i=n*12+(r-1)+t,a=Math.floor(i/12);return a<1970||a>9999?null:`${String(a).padStart(4,`0`)}-${String(i-a*12+1).padStart(2,`0`)}`}function qr(e){let t=`${e}-01`,n=Hr(t);if(n===null)return null;let r=[],i=[];for(let e=0;e<n;e++)i.push(null);for(let n=0;;n++){let a=Vr(t,n);if(a===null||a.slice(0,7)!==e){for(;i.length<7;)i.push(null);return r.push(i),r}i.push(a),i.length===7&&(r.push(i),i=[])}}function Jr(e){let t=U(e);if(t===null)return null;let n=U(t.projectionValues);return{...typeof t.displayTitle==`string`?{displayTitle:t.displayTitle}:{},...typeof t.title==`string`?{title:t.title}:{},...typeof t.parentId==`string`?{parentId:t.parentId}:{},...typeof t.origin==`string`?{origin:t.origin}:{},running:t.running===!0,blank:t.blank===!0,updatedAt:W(t.updatedAt),...n===null?{}:{projections:n}}}function Yr(e){let t=U(e);return t===null||t.mode!==`one-shot`&&t.mode!==`continuable`?null:{mode:t.mode,...typeof t.label==`string`&&t.label!==``?{label:t.label}:{}}}function Xr(e){let t=U(e);if(t===null)return null;let n=W(t.settledMs),r=U(t.active),i=n+(r===null?0:Math.max(0,W(r.through)-W(r.since)));return i>0?i:null}function Zr(e){return U(e)?.lastTurnCompleted===!0}function Qr(e){let t=J(e?.contextTimeline),n=me(e?.contextPressure),r=he(e?.contextBreakdown),i=ge(e?.tokenUsage),a=null;if(t!==null)a=oe(t,n,r);else if(n!==null){let e=typeof n.projectedTokens==`number`?n.projectedTokens:typeof n.pressureTokens==`number`?n.pressureTokens:null;if(e!==null){let t=typeof n.contextWindow==`number`&&n.contextWindow>0?n.contextWindow:void 0;a={tokens:e,window:t,pct:t===void 0?null:B(e,t),parts:[]}}}let o=i===null?null:W(i.uncachedInputTokens)+W(i.outputTokens)+W(i.cacheReadTokens)+W(i.cacheWriteTokens);return{head:a,requests:t===null?0:t.counts?.steps??t.requests.length,billed:o,costUsage:t?.cost??null,durationMs:Xr(e?.subagentTiming),identity:Yr(e?.subagent)}}function $r(e){let t=e?.subagentCatalog;if(!Array.isArray(t))return null;let n=new Map;for(let e of t){let t=U(e);t!==null&&typeof t.id==`string`&&t.id!==``&&(n.has(t.id)||n.set(t.id,n.size))}return n.size>0?n:null}function ei(e,t,n,r){let i=U(U(e)?.byId);if(i===null||t===void 0||t===``)return null;let a=new Map;for(let e of Object.keys(i)){let n=Jr(i[e]);n!==null&&(!n.blank||e===t)&&a.set(e,n)}a.has(t)||a.set(t,{running:!1,blank:!1,updatedAt:0});let o=t,s=new Set([t]);for(;;){let e=a.get(o)?.parentId;if(e===void 0||!a.has(e)||s.has(e))break;s.add(e),o=e}let c=a.get(o);if(c===void 0)return null;let l=new Map;for(let[e,t]of a){if(t.parentId===void 0||!a.has(t.parentId))continue;let n=l.get(t.parentId)??[];n.push({id:e,row:t}),l.set(t.parentId,n)}for(let[e,t]of l){let n=$r(a.get(e)?.projections);t.sort((e,t)=>{let r=n?.get(e.id),i=n?.get(t.id);if(r!==void 0||i!==void 0)return r===void 0?1:i===void 0?-1:r-i;let a=Number(t.row.running)-Number(e.row.running);if(a!==0)return a;let o=t.row.updatedAt-e.row.updatedAt;return o===0?e.id<t.id?-1:1:o})}let u=(e,t)=>{if(t.has(e))return 0;t.add(e);let n=1;for(let r of l.get(e)??[])n+=u(r.id,t);return n},d=u(o,new Set),f=[],p=[],m=(e,i,a,o,s,c)=>{if(s.has(e)||f.length>=25)return;s.add(e);let u=i.projections,d=r===void 0?void 0:r.get(e),h=Qr(d!==void 0&&u?.contextTimeline===void 0?{...u,contextTimeline:d}:u),g=h.identity;e===t&&n!==void 0&&(h.head=n.head??h.head,h.billed=n.billed??h.billed,h.requests=n.requests>0?n.requests:h.requests,h.costUsage=n.costUsage??h.costUsage,h.durationMs=n.durationMs??h.durationMs);let _=i.origin===`subagent`||g!==null,v={...h,id:e,label:g?.label??i.title??i.displayTitle??e,...a===void 0?{}:{parentId:a},depth:o,family:c,isCurrent:e===t,running:i.running,completed:!i.running&&(Zr(u?.subagentTiming)||!_&&h.requests>0),subagent:_};f.push(v),a!==void 0&&p.push({from:a,to:e}),(l.get(e)??[]).forEach((t,n)=>{m(t.id,t.row,e,o+1,s,o===0?n:c)})};return m(o,c,void 0,0,new Set,-1),{nodes:f,edges:p,overflow:Math.max(0,d-f.length),solo:f.length===1}}function ti(e,t,n){let r=U(U(e)?.byId);if(r===null||t===void 0||t===``)return{usage:null,cold:[],count:0};let i=new Map;for(let e of Object.keys(r)){let t=Jr(r[e]);if(t===null||t.blank||t.parentId===void 0)continue;let n=i.get(t.parentId)??[];n.push(e),i.set(t.parentId,n)}let a=[],o=[],s=new Set([t]),c=[t];for(let e=0;e<c.length;e++){let t=c[e];for(let e of i.get(t)??[]){if(s.has(e))continue;s.add(e);let t=n?.get(e),i=Jr(r[e])?.projections;if(i?.contextTimeline===void 0)t===void 0?o.push(e):t.cost!==void 0&&a.push(t.cost);else{let e=J(i.contextTimeline)?.cost;e!==void 0&&a.push(e)}c.push(e)}}return{usage:a.length>0?dr(...a):null,cold:o,count:s.size-1}}function ni(e,t=0){let n=new Map;for(let t of e.nodes){if(t.parentId===void 0)continue;let e=n.get(t.parentId)??[];e.push(t),n.set(t.parentId,e)}let r=new Map,i=0,a=e=>{let t=n.get(e.id)??[];if(t.length===0){let t=i;return i++,r.set(e.id,t),t}let o=0,s=0;t.forEach((e,t)=>{let n=a(e);t===0&&(o=n),s=n});let c=(o+s)/2;return r.set(e.id,c),c};e.nodes.length>0&&a(e.nodes[0]);let o=t>0?Math.max(1,Math.floor(t/150)):0;if(o>0&&i>o){let r=Math.min(276,t/o),i=o*r,a=[],s=0,c=(e,t)=>{let l=(i-e.length*r)/2;e.forEach((e,n)=>{a.push({id:e.id,x:l+(n+.5)*r,y:48+s*144,depth:t})}),s++;let u=[],d=()=>{if(u.length===0)return;let e=u;u=[],c(e,t+1)};for(let t of e){let e=n.get(t.id)??[];for(let t=0;t<e.length;t+=o){let n=e.slice(t,t+o);u.length+n.length>o&&d(),u.push(...n),u.length===o&&d()}}d()};return e.nodes.length>0&&c([e.nodes[0]],0),{width:i,height:48+(s-1)*144+104+24,cardW:r-12,points:a,links:ii(e,a)}}let s=t>0&&i>1?Math.min(276,t/i):276,c=e.nodes.map(e=>({id:e.id,x:(r.get(e.id)??0)*s+s/2,y:48+e.depth*144,depth:e.depth})),l=c.reduce((e,t)=>Math.max(e,t.depth),0);return{width:i*s,height:48+l*144+104+24,cardW:s-12,points:c,links:ii(e,c)}}function ri(e){return`hsl(${Math.round(e*137.508)%360} 58% 52%)`}function ii(e,t){let n=new Map(t.map(e=>[e.id,e])),r=new Map(e.nodes.map(e=>[e.id,e])),i=new Set(e.nodes.filter(e=>e.running).map(e=>e.id)),a=[];for(let t of e.edges){let e=n.get(t.from),o=n.get(t.to);e!==void 0&&o!==void 0&&a.push({to:t.to,running:i.has(t.to),color:ri(r.get(t.to)?.family??0),x1:e.x,y1:e.y+104,x2:o.x,y2:o.y})}return a}function ai(e,t){if(t===null)return null;let n=new Map(e.nodes.map(e=>[e.id,e])),r=n.get(t);if(r===void 0)return null;let i=new Set,a=r;for(;a!==void 0;)i.add(a.id),a=a.parentId===void 0?void 0:n.get(a.parentId);let o=[t];for(let t=0;t<o.length;t++)for(let n of e.nodes)n.parentId===o[t]&&!i.has(n.id)&&(i.add(n.id),o.push(n.id));return i}function oi(e){return e===null?`var(--dsw-alias-border-l1)`:e>=90?`var(--color-red-500)`:e>=70?`var(--color-amber-500)`:`var(--color-green-500)`}function si(e,t,n){let r=t===null?1:Math.min(100,Math.max(0,t))/100,i=0;for(let t of e)i+=t.value>0?t.value:0;let a=[],o=0;if(i>0)for(let t of e){if(t.value<=0)continue;let e=t.value/i*r;e<=0||(a.push({key:t.key,color:t.color,share:e,free:!1}),o+=e)}else t!==null&&r>0&&(a.push({key:`fill`,color:n,share:r,free:!1}),o=r);return t!==null&&o<1&&a.push({key:`free`,color:``,share:1-o,free:!0}),a}function ci(e){let t=U(e.get(`sessions`));if(t===null)return null;let n=U(t.list);return n===null||typeof n.getSnapshot!=`function`||typeof n.subscribe!=`function`?null:t}function li(e){if(!Number.isFinite(e)||e<0)return`—`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}function ui(e){if(typeof e!=`function`)return null;try{return e(e=>e)}catch{return null}}function di(e){return ui(e.useSessions)}function fi(e){return ui(e.useWorkspaces)}function pi(e){let t=U(e);if(t===null||!Array.isArray(t.items))return null;let n={},r=n;for(let e of t.items){let t=U(e);if(t===null)continue;let i=typeof t.title==`string`&&t.title!==``?t.title:void 0;if(i!==void 0&&Array.isArray(t.sessionIds))for(let e of t.sessionIds)typeof e==`string`&&r[e]===void 0&&(n[e]=i)}return n}function mi(e){if(e===void 0||e===``)return;let t=Fr(e);return t===``?void 0:t}function hi(e,t){let n=U(t);if(n===null||!Array.isArray(n.items))return[];let r=new Map,i=[];for(let e of n.items){let t=U(e);if(t===null)continue;let n=typeof t.title==`string`&&t.title!==``?t.title:void 0;if(n!==void 0&&Array.isArray(t.sessionIds)){i.push(n);for(let e of t.sessionIds)typeof e==`string`&&!r.has(e)&&r.set(e,n)}}let a=new Map,o=0;for(let t of e){let e=r.get(t.id);e===void 0?o++:a.set(e,(a.get(e)??0)+1)}let s=[];for(let e of i){let t=a.get(e)??0;t>0&&s.push({key:e,count:t})}return o>0&&s.push({key:`__ungrouped__`,count:o}),s}function gi(e,t,n){let r=(n??{})[e.id];return t===`__ungrouped__`?r===void 0:r===t}function _i(e){try{let t=U(e)?.archivedSessionIds;return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function vi(e,t){let n=U(e);if(n===null||!Array.isArray(n.ids))return null;let r=n.ids.filter(e=>typeof e==`string`),i=_i(t),a=U(n.byId)??{},o=typeof n.current==`string`?n.current:void 0,s=[];for(let e of r)if(!i.has(e))try{let t=U(a[e]);if(t===null||t.blank===!0||t.origin===`subagent`)continue;let n=typeof t.displayTitle==`string`&&t.displayTitle!==``?t.displayTitle:void 0,r=typeof t.title==`string`&&t.title!==``?t.title:void 0,i=typeof t.cwd==`string`&&t.cwd!==``?t.cwd:void 0,c=U(t.projectionValues);s.push({id:e,title:n??r??e,...i===void 0?{}:{cwd:i},updatedAt:typeof t.updatedAt==`number`&&Number.isFinite(t.updatedAt)?t.updatedAt:0,running:t.running===!0,current:e===o,timeline:J(c?.contextTimeline),activity:Se(c?.contextActivity),family:[],familyCost:null})}catch{}let c=new Map;for(let e of Object.keys(a))try{let t=Jr(a[e]);if(t===null||t.blank||t.parentId===void 0)continue;let n=c.get(t.parentId)??[];n.push(e),c.set(t.parentId,n)}catch{}for(let e of s){let t=[e.timeline],n=[e.activity],r=new Set([e.id]),i=[e.id];for(let e=0;e<i.length;e++)for(let o of c.get(i[e])??[]){if(r.has(o))continue;r.add(o);let e=U(U(a[o])?.projectionValues);t.push(J(e?.contextTimeline)),n.push(Se(e?.contextActivity)),i.push(o)}e.family=t,e.familyCost=dr(...t.map(e=>e?.cost)),e.activity=yi(n)}return s}function yi(e){let t={},n=t,r=!1;for(let i of e)if(i!==null){r=!0;for(let e of Object.keys(i.days)){let r=i.days[e],a=n[e];a===void 0?t[e]={tokens:r.tokens,requests:r.requests,...r.cost===void 0?{}:{cost:r.cost},...r.skills===void 0?{}:{skills:r.skills}}:(a.tokens+=r.tokens,a.requests+=r.requests,r.cost!==void 0&&(a.cost=dr(a.cost,r.cost)??r.cost),r.skills!==void 0&&(a.skills=bi(a.skills,r.skills)))}}return r?{days:t}:null}function bi(e,t){let n={...e};for(let e of Object.keys(t)){let r=t[e],i=n[e];n[e]=i===void 0?r:{n:i.n+r.n,last:Math.max(i.last,r.last)}}return n}let xi=Object.freeze({start:null,end:null});function Si(e,t){return e<=t?{from:e,to:t}:{from:t,to:e}}function Ci(e,t){return e===`all`?xi:{start:wi(e,t),end:null}}function wi(e,t){if(e===`today`){let e=new Date(t);return e.setHours(0,0,0,0),e.getTime()}return t-(e===`7d`?7:30)*864e5}function Ti(e){let t=Si(e.from,e.to),n=Wr(t.from),r=Gr(t.to);return n===null||r===null?null:{start:n,end:r}}function Ei(e){return Fi(e.familyCost)?.total??null}function Di(e){return e===null?0:e.counts?.turns??e.requests.length}function Oi(e){let t=e?.days;if(t===void 0)return;let n;for(let e of Object.keys(t))(n===void 0||e<n)&&(n=e);return n}function ki(e,t){let n=t.query.trim().toLowerCase();return e.filter(e=>{if(t.scope.start!==null&&e.updatedAt<t.scope.start||t.scope.end!==null&&e.updatedAt>t.scope.end)return!1;if(t.day!==null){let n=e.activity?.days[t.day];if(n===void 0||n.tokens<=0&&n.requests<=0)return!1}if(n!==``){let t=e.title.toLowerCase().includes(n),r=e.cwd!==void 0&&e.cwd.toLowerCase().includes(n),i=e.timeline?.lastUser,a=typeof i==`string`&&i.toLowerCase().includes(n);if(!t&&!r&&!a)return!1}return!0})}function Ai(e,t){let n=[...e];return t===`tokens`?n.sort((e,t)=>(Ei(t)??-1)-(Ei(e)??-1)):t===`context`?n.sort((e,t)=>(t.timeline?.current.total??-1)-(e.timeline?.current.total??-1)):n.sort((e,t)=>t.updatedAt-e.updatedAt),n}function ji(e,t){let n=Math.max(1,Math.ceil(e.length/12)),r=Math.min(Math.max(0,t),n-1);return{items:e.slice(r*12,(r+1)*12),index:r,count:n}}function Mi(e){if(e.day!==null)return t=>t===e.day;let{start:t,end:n}=e.scope,r=t===null?null:zr(t),i=n===null?null:zr(n);return e=>(r===null||e>=r)&&(i===null||e<=i)}function Ni(e,t){let n=Mi(t),r=new Map;for(let t of e){let e=t.activity?.days;if(e===void 0)continue;let i=new Set;for(let t of Object.keys(e)){if(!n(t))continue;let a=e[t].skills;if(a!==void 0)for(let e of Object.keys(a)){let t=a[e],n=r.get(e);n===void 0?r.set(e,{name:e,loads:t.n,sessions:1,last:t.last}):(n.loads+=t.n,n.last=Math.max(n.last,t.last),i.has(e)||(n.sessions+=1)),i.add(e)}}}let i=(e,t)=>e.name<t.name?-1:1,a=[...r.values()];switch(t.sort??`loads`){case`recent`:return a.sort((e,t)=>t.last-e.last||t.loads-e.loads||i(e,t));default:return a.sort((e,t)=>t.loads-e.loads||t.last-e.last||i(e,t))}}function Pi(e,t,n){let r=Mi(n),i=e.activity?.days;if(i===void 0)return!1;for(let e of Object.keys(i))if(r(e)&&i[e].skills?.[t]!==void 0)return!0;return!1}function Fi(e){if(e==null)return null;let t={input:0,cacheRead:0,cacheWrite:0,output:0,total:0},n=!1;for(let r of Object.keys(e)){let i=e[r];for(let e of Object.keys(i)){let r=i[e];for(let e of[`peak`,`off`]){let i=r[e];i!==void 0&&(t.input+=i.uncached,t.cacheRead+=i.cacheRead,t.cacheWrite+=i.cacheWrite,t.output+=i.output,n=!0)}}}return n?(t.total=t.input+t.cacheRead+t.cacheWrite+t.output,t):null}function Ii(e){let t=null;for(let n of e){let e=n.timeline?.timing;if(e!==void 0){if(t===null){t={...e,tools:{...e.tools}};continue}t.wallMs+=e.wallMs,t.ttftMs+=e.ttftMs,t.genMs+=e.genMs,t.calls+=e.calls,t.toolsMs+=e.toolsMs,t.toolCalls+=e.toolCalls,Li(t,e,`reasoningMs`),Li(t,e,`reasoningBlocks`),Li(t,e,`textMs`),Li(t,e,`textBlocks`),Li(t,e,`toolArgMs`),Li(t,e,`toolArgBlocks`),Li(t,e,`speedTokens`),Li(t,e,`speedMs`);for(let n of Object.keys(e.tools)){let r=e.tools[n],i=t.tools[n];t.tools[n]=i===void 0?{...r}:{calls:i.calls+r.calls,ms:i.ms+r.ms}}}}return t}function Li(e,t,n){let r=e[n],i=t[n];(r!==void 0||i!==void 0)&&(e[n]=(r??0)+(i??0))}function Ri(e){let t=new Map,n=0,r=!1;for(let i of e)for(let e of i.family){if(e===null)continue;let i=Fi(e.cost);if(i===null)continue;r=!0;let a={uncachedInputTokens:i.input,cacheReadTokens:i.cacheRead,cacheWriteTokens:i.cacheWrite,outputTokens:i.output};for(let r of ae(e.current,null,a)){if(!Number.isFinite(r.value)||r.value<=0)continue;n+=r.value;let e=t.get(r.key);t.set(r.key,e===void 0?{key:r.key,color:r.color,value:r.value}:{...e,value:e.value+r.value})}}return r?{parts:[...t.values()],total:n}:null}function zi(e,t,n,r){let i=dr(...e.map(e=>e.familyCost)),a=Fi(i),o=0,s=0,c=0,l=0,u=0,d=0,f=0;for(let t of e){cr(t.familyCost,n,r)!==null&&d++,Fi(t.familyCost)!==null&&f++,o+=Di(t.timeline);let e=t.timeline?.timing;s+=e?.toolCalls??0,c+=e?.toolsMs??0,l+=e?.calls??0,u+=e?.wallMs??0}return{sessions:e.length,listed:t,tokens:a?.total??0,turns:o,cost:cr(i,n,r),costSessions:d,cacheHit:a===null?null:Vt(a.cacheRead,a.input+a.cacheRead+a.cacheWrite),usageSessions:f,toolCalls:s,toolsMs:c,calls:l,wallMs:u,tokenParts:Ri(e),timing:Ii(e)}}function Bi(e,t,n){let r={},i=r;for(let t of e)if(t.activity!==null)for(let e of Object.keys(t.activity.days)){let n=t.activity.days[e];if(n.tokens<=0&&n.requests<=0)continue;let a=i[e];a===void 0?r[e]={tokens:n.tokens,requests:n.requests,sessions:1,fees:n.cost===void 0?[]:[n.cost]}:(a.tokens+=n.tokens,a.requests+=n.requests,a.sessions++,n.cost!==void 0&&a.fees.push(n.cost))}let a={};for(let[e,i]of Object.entries(r))a[e]={tokens:i.tokens,requests:i.requests,sessions:i.sessions,cost:cr(dr(...i.fees),t,n)};return a}function Vi(e){try{let t=e.get(`sessions`);if(t===void 0||typeof t.refresh!=`function`)return;Promise.resolve(t.refresh()).catch(()=>{})}catch{}}function Hi(){try{fetch(`/api/dsh-context/backfill`,{method:`POST`}).catch(()=>{})}catch{}}function Ui(e,t,n){let r=n-t;if(!Number.isFinite(r)||r<6e4)return e(`ov.time.now`);let i=Math.floor(r/6e4);if(i<60)return e(`ov.time.m`,{n:i});let a=Math.floor(i/60);return a<24?e(`ov.time.h`,{n:a}):e(`ov.time.d`,{n:Math.floor(a/24)})}function Wi(e){let t=U(e)?.skills;if(!Array.isArray(t))return null;let n=[];for(let e of t){let t=U(e);t!==null&&typeof t.name==`string`&&t.name!==``&&n.push({name:t.name,description:typeof t.description==`string`?t.description:``,...typeof t.path==`string`&&t.path!==``?{path:t.path}:{},...typeof t.source==`string`&&t.source!==``?{source:t.source}:{}})}return n}async function Gi(e,t){try{let n=await fetch(`/api/dsh-context/skills`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e===void 0?{}:{cwd:e},...t===void 0?{}:{sessionId:t}})});if(!n.ok)return null;let r=U(await n.json()),i=r===null||r.ok!==!0?null:Wi(r.value);return i===null||i.length===0?null:new Map(i.map(e=>[e.name,e]))}catch{return null}}let Ki=async e=>{let t=globalThis.navigator?.clipboard;if(typeof t?.writeText!=`function`)throw Error(`clipboard unavailable`);await t.writeText.call(t,e)};async function qi(e){try{return await Ki(e),!0}catch{return!1}}let Ji=new Set([`Plugins`,`插件`]);function Yi(e){return[...e.querySelectorAll(`button`)]}function Xi(e){return Yi(e).find(e=>Ji.has(e.getAttribute(`aria-label`)??``))}function Zi(e){let t=e.querySelector(`[data-plugin-package="dsh-context"]`);if(t===null)return;let n=[...t.querySelectorAll(`button`)].filter(e=>e.getAttribute(`role`)!==`switch`);return n.length===1?n[0]:void 0}function Qi(e=document,t=(e,t)=>{window.setTimeout(e,t)}){try{let n=Xi(e);if(n===void 0)return;n.click();let r=n=>{try{let t=Zi(e);if(t!==void 0){t.click();return}}catch{}n>0&&t(()=>{r(n-1)},100)};t(()=>{r(40)},200)}catch{}}let $i=`dsh-context:platform-balance`;function ea(e){let t=typeof e==`string`?Number(e):e;return typeof t==`number`&&Number.isFinite(t)&&t>=0?t:null}function ta(e){let t=U(e);if(t===null)return null;let n=Array.isArray(t.balances)?t.balances:[],r=[];for(let e of n)try{let t=U(e);if(t===null)continue;let n=t.currency,i=ea(t.total),a=ea(t.granted),o=ea(t.toppedUp);if(typeof n!=`string`||n===``||i===null||a===null||o===null)continue;r.push({currency:n,total:i,granted:a,toppedUp:o})}catch{continue}return r.length>0?{isAvailable:t.isAvailable===!0,balances:r}:null}function na(e,t){if(e==null||e.balances.length===0)return null;let n=t===`cny`?`CNY`:`USD`;return e.balances.find(e=>e.currency===n)??e.balances[0]}let ra=null,ia=null,aa=new Set,oa;function sa(){if(oa!==void 0)return oa;try{oa=globalThis.localStorage??null}catch{oa=null}return oa}function ca(){try{let e=sa()?.getItem($i);return e==null?null:ta(JSON.parse(e))}catch{return null}}function la(e){try{sa()?.setItem($i,JSON.stringify(e))}catch{}}async function ua(){try{let e=await fetch(`/api/dsh-context/balance`,{method:`POST`,headers:{"content-type":`application/json`}});if(!e.ok)return null;let t=U(await e.json());return t===null||t.ok!==!0||t.value===null||t.value===void 0?null:ta(t.value)}catch{return null}}function da(e){return aa.add(e),ia===null&&(ia=(async()=>{let e=await ua();if(e!==null){ra=e,la(e);for(let t of aa)t(e)}})().finally(()=>{ia=null,aa.clear()})),ra??ca()}function fa(e){return e===`CNY`?`¥`:e===`USD`?`$`:e+` `}function pa(e,t){let{t:n}=t;return function(){let[t,r]=(0,u.useState)(()=>da(e=>{r(e)})),i=e.locale,a=na(t,(typeof i.getLocale==`function`?i.getLocale().active:`en`)===`zh`?`cny`:`usd`);if(a===null)return null;let o=e=>fa(a.currency)+e.toFixed(2),s=[...a.toppedUp>0?[n(`balance.tip.toppedUp`)+`: `+o(a.toppedUp)]:[],...a.granted>0?[n(`balance.tip.granted`)+`: `+o(a.granted)]:[]];return(0,d.jsxs)(`a`,{className:`lc-ov-balance`,"aria-label":s.length>0?s.join(`
29
17
  `):void 0,...s.length>0?{"data-lc-tip":s.join(`
30
- `),"data-lc-tip-side":`bottom`}:{},href:`https://platform.deepseek.com/usage`,target:`_blank`,rel:`noreferrer`,children:[(0,d.jsx)(`span`,{className:`lc-ov-balance-label`,children:n(`balance.title`)}),(0,d.jsx)(`span`,{className:`lc-ov-balance-value`,children:o(a.total)})]})}}function Zi(e,t){let n=Rr(e);if(n===null||t<1)return null;let r=Lr(n,-7*(t-1));if(r===null)return null;let i=[];for(let n=0;n<t;n++){let t=Lr(r,7*n);if(t===null)return null;let a=[];for(let n=0;n<7;n++){let r=Lr(t,n);if(r===null)return null;a.push({key:r,future:r>e,entry:void 0})}i.push(a)}return i}function Qi(e,t){if(e<=0||t<=0)return 0;let n=e/t;return n<=.25?1:n<=.5?2:n<=.75?3:4}function $i(e){let{t}=e;return function(e){let n=e.weeks??8,r=e.metric??`steps`,i=Zi(e.today,n);if(i===null)return(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.heat.empty`)});let a=e.days,o=0,s=0,c=!1;for(let e of i)for(let t of e){let e=a[t.key];e===void 0||e.tokens<=0&&e.requests<=0||(t.entry=e,c=!0,e.sessions>o&&(o=e.sessions),e.requests>s&&(s=e.requests))}if(!c)return(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.heat.empty`)});let l=r===`sessions`?o:s,u=e=>r===`sessions`?e.sessions:e.requests,f={1:t(`ov.heat.wd.1`),3:t(`ov.heat.wd.3`),5:t(`ov.heat.wd.5`)};return(0,d.jsxs)(`div`,{className:`lc-heat-wrap`,children:[(0,d.jsxs)(`div`,{className:`lc-heat`,role:`group`,"aria-label":t(`ov.heat.title`),children:[(0,d.jsx)(`div`,{className:`lc-heat-wds`,"aria-hidden":`true`,children:[0,1,2,3,4,5,6].map(e=>(0,d.jsx)(`span`,{className:`lc-heat-wd`,children:f[e]??``},e))}),(0,d.jsx)(`div`,{className:`lc-heat-cols`,children:i.map((n,r)=>{let i=r===0||n[0].key.slice(0,7)!==n[6].key.slice(0,7)||n[0].key.slice(8,10)===`01`;return(0,d.jsxs)(`div`,{className:`lc-heat-col`,children:[i&&(0,d.jsx)(`span`,{className:`lc-heat-mon`,"aria-hidden":`true`,children:t(`ov.heat.mon.`+n[6].key.slice(5,7))}),n.map(n=>{if(n.future)return(0,d.jsx)(`span`,{className:`lc-heat-cell lc-heat-future`,"aria-hidden":`true`},n.key);let r=n.entry===void 0?0:Qi(u(n.entry),l);if(n.entry===void 0)return(0,d.jsx)(`span`,{className:`lc-heat-cell lc-heat-0`,"data-lc-tip":n.key},n.key);let i=e.selected===n.key,a=`${n.key}\n${t(`ov.heat.sessions`,{n:n.entry.sessions})}\n${t(`ov.heat.steps`,{n:n.entry.requests})}`;return(0,d.jsx)(`button`,{type:`button`,className:`lc-heat-cell lc-heat-${String(r)}${i?` lc-heat-on`:``}`,"data-lc-tip":a,"aria-label":a,"aria-pressed":i,onClick:()=>{e.onSelect!==void 0&&e.onSelect(i?null:n.key)}},n.key)})]},r)})})]}),(0,d.jsxs)(`div`,{className:`lc-heat-legend`,"aria-hidden":`true`,children:[(0,d.jsx)(`span`,{className:`lc-heat-key`,children:t(`ov.heat.less`)}),[0,1,2,3,4].map(e=>(0,d.jsx)(`span`,{className:`lc-heat-cell lc-heat-${String(e)}`},e)),(0,d.jsx)(`span`,{className:`lc-heat-key`,children:t(`ov.heat.more`)})]})]})}}function ea(){return Ir(Date.now())??``}function ta(){return function(e){let t=e.size??118,n=0;for(let t of e.segments)Number.isFinite(t.value)&&t.value>0&&(n+=t.value);let r=[],i=0;if(n>0)for(let t of e.segments){let e=Number.isFinite(t.value)&&t.value>0?t.value:0;if(e===0)continue;let a=e/n*100;r.push({key:t.key,color:t.color,len:a,offset:100-i+25}),i+=a}if(r.length>1)for(let e of r){let t=Math.min(.5/2,e.len/4);e.len-=t*2,e.offset-=t}let a=e.hoverKey!==null&&e.hoverKey!==void 0&&r.some(t=>t.key===e.hoverKey);return(0,d.jsxs)(`div`,{className:`lc-donut @max-[240px]/lc-card:mx-auto`+(a?` lc-donut-dim`:``),style:{width:t,height:t},onMouseLeave:()=>{e.onHoverKey!==void 0&&e.onHoverKey(null)},children:[(0,d.jsx)(`svg`,{viewBox:`0 0 42 42`,width:t,height:t,"aria-hidden":`true`,children:r.length===0?(0,d.jsx)(`circle`,{className:`lc-donut-track fill-none stroke-4`,cx:`21`,cy:`21`,r:`15.9155`}):r.map((t,n)=>(0,d.jsx)(`circle`,{className:`lc-donut-seg fill-none stroke-4 animate-lc-donut-in motion-reduce:animate-none`+(e.hoverKey===t.key?` lc-donut-seg-on`:``),cx:`21`,cy:`21`,r:`15.9155`,strokeDasharray:`${t.len} ${100-t.len}`,strokeDashoffset:t.offset,style:{"--lc-i":n,stroke:t.color},onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(t.key)}},t.key))}),(0,d.jsxs)(`div`,{className:`lc-donut-center`,children:[(0,d.jsx)(`b`,{style:{fontSize:Math.max(11,Math.round(t*.13))},children:e.centerTop}),e.centerSub===void 0?null:(0,d.jsx)(`span`,{style:{fontSize:Math.max(9,Math.round(t*.105))},children:e.centerSub})]})]})}}let na=`lc-hovertip-bubble`;function ra(e){return e instanceof Element?e.closest(`[data-lc-tip]`):null}function ia(e){let t=e.getAttribute(`data-lc-tip`);if(t===null||t===``)return null;let n=e.getBoundingClientRect();return{anchor:e,label:t,side:e.getAttribute(`data-lc-tip-side`)===`bottom`?`bottom`:`top`,rect:{left:n.left,top:n.top,width:n.width,height:n.height,bottom:n.bottom}}}function aa(){let[e,t]=(0,u.useState)(null),[n,r]=(0,u.useState)(null),i=(0,u.useRef)(null),a=(0,u.useCallback)(e=>{t(t=>{if(t?.anchor===e)return t;t?.anchor.removeAttribute(`aria-describedby`);let n=ia(e);return n===null?null:(e.setAttribute(`aria-describedby`,na),n)})},[]),o=(0,u.useCallback)(()=>{t(e=>(e?.anchor.removeAttribute(`aria-describedby`),null))},[]),s=(0,u.useCallback)(e=>{let t=ra(e.target);t!==null&&a(t)},[a]),c=(0,u.useCallback)(e=>{ra(e.target)!==null&&ra(e.relatedTarget)===null&&o()},[o]),l=(0,u.useCallback)(e=>{let t=ra(e.target);t!==null&&a(t)},[a]),f=(0,u.useCallback)(e=>{ra(e.target)!==null&&ra(e.relatedTarget)===null&&o()},[o]),m=(0,u.useCallback)(()=>{o()},[o]);(0,u.useEffect)(()=>{if(e===null)return;let t=()=>{o()};return window.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t)}},[e,o]),(0,u.useLayoutEffect)(()=>{if(e===null||n?.tip===e)return;let t=i.current;if(t===null)return;let a=t.offsetWidth,o=t.offsetHeight,{rect:s}=e,c=Math.max(8,Math.min(s.left+s.width/2-a/2,window.innerWidth-a-8)),l=e.side===`top`?s.top-o-6:s.bottom+6;e.side===`top`&&l<8?l=s.bottom+6:e.side===`bottom`&&l+o>window.innerHeight-8&&(l=s.top-o-6),r({tip:e,left:c,top:Math.max(8,l)})},[e,n]);let h=n!==null&&n.tip===e?n:null;return{zoneProps:{onMouseOver:s,onMouseOut:c,onFocusCapture:l,onBlurCapture:f,onScrollCapture:m},bubble:e===null?null:(0,p.createPortal)((0,d.jsx)(`div`,{ref:i,id:na,role:`tooltip`,className:`lc-tip lc-hovertip`,style:h===null?{left:0,top:0,visibility:`hidden`}:{left:h.left,top:h.top,opacity:1},children:e.label}),document.body)}}function oa(){return function(e){return(0,d.jsx)(`div`,{className:`lc-sl flex-auto @max-[240px]/lc-card:basis-full`,onMouseLeave:()=>{e.onHoverKey!==void 0&&e.onHoverKey(null)},children:e.rows.map(t=>(0,d.jsxs)(`div`,{className:`lc-sl-row`+(t.dim?` lc-sl-row-dim`:``)+(e.hoverKey!==void 0&&e.hoverKey===t.key?` lc-sl-row-on`:``),onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(t.key)},children:[(0,d.jsxs)(`div`,{className:`lc-sl-main`,children:[(0,d.jsx)(`i`,{className:`lc-sl-dot`,style:{background:t.color}}),(0,d.jsx)(`span`,{className:`lc-sl-label`,title:t.label,children:t.label}),(0,d.jsx)(`span`,{className:`lc-sl-pct`,children:t.pct})]}),t.count===``?null:(0,d.jsx)(`div`,{className:`lc-sl-sub`,title:t.count,children:t.count})]},t.key))})}}function sa(e,t){let{t:n,fmt:r,fmtShare:i,catLabel:a}=e,o=oa();return function(e){let[s,c]=(0,u.useState)(null),l=e.tokens,f=l?.total??0,p=l!==null&&f>0?l.parts.filter(e=>e.value>0):[],m=p.map(e=>({key:e.key,color:e.color,label:e.key===`output`?n(`tokens.output`):a(e.key),pct:i(e.value,f),count:e.key===`output`?`${r(e.value)} · ${n(`tokens.outputNote`)}`:`≈`+r(e.value)}));return(0,d.jsxs)(`div`,{className:`lc-card lc-col-donut flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsx)(`div`,{className:`lc-card-title`,children:(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`tokens.title`)})}),p.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(`ov.stats.empty`)}):(0,d.jsxs)(`div`,{className:`lc-donut-row flex items-center justify-start gap-3 min-w-0 @max-[320px]/lc-card:gap-2 @max-[240px]/lc-card:flex-wrap`,children:[(0,d.jsx)(t,{segments:p.map(e=>({key:e.key,color:e.color,value:e.value})),size:96,centerTop:r(f),centerSub:n(`tokens.total`),hoverKey:s,onHoverKey:c}),(0,d.jsx)(o,{rows:m,hoverKey:s,onHoverKey:c})]})]})}}function ca(e){let t=[];for(let n=-6;n<=0;n++){let r=Lr(e,n);if(r===null)return[];t.push(r)}return t}let la=[0,25,50,75,100];function ua(e){let{t,fmt:n}=e;return function(e){let r=ca(e.today),i=e.days,a=r.map(e=>({key:e,entry:i[e]})),o=a.every(e=>e.entry===void 0||e.entry.tokens<=0&&e.entry.cost===null),s=0,c=0;for(let e of a)e.entry!==void 0&&(e.entry.tokens>s&&(s=e.entry.tokens),e.entry.cost!==null&&e.entry.cost>c&&(c=e.entry.cost));let l=(e,t)=>t<=0||e<=0?`0%`:`${Math.max(4,Math.round(e/t*100))}%`,u=e=>n(Math.round(s*e/100)),f=t=>c<=0?`—`:t===0?`0`:ur(c*t/100,e.currency);return(0,d.jsxs)(`div`,{className:`lc-card lc-ov-usage`,children:[(0,d.jsx)(`div`,{className:`lc-card-title`,children:(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:t(`ov.usage.title`)})}),o||r.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.usage.empty`)}):(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(`div`,{className:`lc-ov-usage-plot`,role:`group`,"aria-label":t(`ov.usage.title`),children:[(0,d.jsx)(`div`,{className:`lc-ov-usage-rail lc-ov-usage-rail-l`,"aria-hidden":`true`,children:la.map(e=>(0,d.jsx)(`span`,{className:`lc-ov-usage-tick`,style:{top:`${100-e}%`},children:u(e)},e))}),(0,d.jsxs)(`div`,{className:`lc-ov-usage-grid`,children:[la.map(e=>(0,d.jsx)(`span`,{className:`lc-ov-usage-line`+(e===0?` lc-ov-usage-line-0`:``),style:{bottom:`${e}%`},"aria-hidden":`true`},e)),(0,d.jsx)(`div`,{className:`lc-ov-usage-cols`,children:a.map(r=>{let i=r.entry?.tokens??0,a=r.entry?.cost??null,o=`${r.key}\n${t(`ov.usage.tokens`)} ${n(i)}\n${t(`ov.usage.costTip`)} ${a===null?`—`:ur(a,e.currency)}`;return(0,d.jsx)(`div`,{className:`lc-ov-usage-col`,"data-lc-tip":o,children:(0,d.jsxs)(`div`,{className:`lc-ov-usage-bars`,children:[(0,d.jsx)(`span`,{className:`lc-ov-usage-bar lc-ov-usage-tokens`,style:{height:l(i,s)}}),(0,d.jsx)(`span`,{className:`lc-ov-usage-bar lc-ov-usage-cost`,style:{height:a===null?`0%`:l(a,c)}})]})},r.key)})})]}),(0,d.jsx)(`div`,{className:`lc-ov-usage-rail lc-ov-usage-rail-r`,"aria-hidden":`true`,children:la.map(e=>(0,d.jsx)(`span`,{className:`lc-ov-usage-tick`,style:{top:`${100-e}%`},children:f(e)},e))}),(0,d.jsx)(`div`,{className:`lc-ov-usage-days`,"aria-hidden":`true`,children:a.map(e=>(0,d.jsx)(`span`,{className:`lc-ov-usage-day`,children:e.key.slice(5)},e.key))})]})}),(0,d.jsxs)(`div`,{className:`lc-ov-usage-key`,"aria-hidden":`true`,children:[(0,d.jsx)(`span`,{className:`lc-ov-usage-swatch lc-ov-usage-tokens`}),(0,d.jsx)(`span`,{className:`lc-ov-usage-key-label`,children:t(`ov.usage.tokens`)}),(0,d.jsx)(`span`,{className:`lc-ov-usage-swatch lc-ov-usage-cost`}),(0,d.jsx)(`span`,{className:`lc-ov-usage-key-label`,children:t(`ov.usage.cost`)})]})]})}}let da={ttft:`var(--color-blue-500)`,reasoning:`var(--color-violet-500)`,text:`var(--color-pink-500)`,toolarg:`var(--color-amber-500)`,tools:`var(--color-teal-500)`,other:`var(--color-slate-400)`},fa={ttft:`timing.ttft`,reasoning:`timing.reasoning`,text:`timing.text`,toolarg:`timing.toolArgs`,tools:`timing.tools`,other:`timing.other`},pa=[0,.25,.5,.75,1];function ma(e){let{t,fmtDuration:n,fmtTime:r}=e;return function(e){let[i,a]=(0,u.useState)(null),o=e.spans.filter(e=>Object.hasOwn(da,e.kind)&&Number.isFinite(e.start)&&Number.isFinite(e.end)&&e.end>e.start);if(o.length===0)return null;let s=0;for(let e of o)s+=e.end-e.start;let c=0,l=o.map((e,i)=>{let a=c/s*100;return c+=e.end-e.start,{key:i,kind:e.kind,leftPct:a,widthPct:(e.end-e.start)/s*100,tip:`${t(fa[e.kind])} ${n(e.end-e.start)} · ${r(e.start)}`}}),f=e.hoverKey,p=f!=null&&l.some(e=>e.kind===f),m=null;for(let e of l)if(e.key===i){m={text:e.tip,leftPct:Math.max(10,Math.min(e.leftPct+e.widthPct/2,90))};break}return(0,d.jsxs)(`div`,{className:`lc-tstrip`,role:`img`,"aria-label":t(`timing.strip`),children:[(0,d.jsxs)(`div`,{className:`lc-tstrip-wrap`,children:[(0,d.jsx)(`div`,{className:`lc-tstrip-bar`+(p?` lc-tstrip-dim`:``),onMouseLeave:()=>{a(null),e.onHoverKey?.(null)},children:l.map((t,n)=>(0,d.jsx)(`div`,{className:`lc-tstrip-seg animate-lc-stacked-in motion-reduce:animate-none`+(f===t.kind?` lc-tstrip-seg-on`:``),style:{left:`${t.leftPct}%`,width:`${t.widthPct}%`,background:da[t.kind],"--lc-i":Math.min(n,8)},onMouseEnter:()=>{a(t.key),e.onHoverKey?.(t.kind)}},t.key))}),(0,d.jsx)(`div`,{className:`lc-tip lc-bar-tip`+(m===null?``:` lc-bar-tip-on`),style:{left:`${m===null?50:m.leftPct}%`},children:m===null?``:m.text})]}),(0,d.jsx)(`div`,{className:`lc-tstrip-axis`,children:pa.map((e,t)=>{let r=s*e;return(0,d.jsx)(`span`,{className:`lc-tstrip-tick`+(t===0?` lc-tstrip-tick-first`:t===pa.length-1?` lc-tstrip-tick-last`:``),style:{left:`${e*100}%`},children:r===0?`0`:n(r)},e)})})]})}}let ha=da;function ga(e){let t=Math.max(0,e);return String(t>=10?Math.round(t):Math.round(t*10)/10)}function _a(e,t){let{t:n,fmt:r,fmtDuration:i,fmtShare:a}=e,o=oa(),s=ma(e);return function(e){let[c,l]=(0,u.useState)(null),f=e.timing,p=f!==null&&Number.isFinite(f.wallMs)&&f.wallMs>0?f.wallMs:0,m=f!==null&&typeof f.speedMs==`number`&&Number.isFinite(f.speedMs)&&f.speedMs>0&&typeof f.speedTokens==`number`&&Number.isFinite(f.speedTokens)&&f.speedTokens>=0?ga(f.speedTokens/(f.speedMs/1e3)):null,h=[],g=[];if(f!==null&&(p>0||f.calls>0||f.toolCalls>0)){let e=n(`timing.callTimes`,{n:r(f.calls)}),t=[{key:`ttft`,color:ha.ttft,label:n(`timing.ttft`),ms:f.ttftMs,times:e}],o=e=>e!==void 0&&e>0?n(`timing.blockTimes`,{n:r(e)}):void 0,s=[[`reasoning`,ha.reasoning,n(`timing.reasoning`),f.reasoningMs??0,o(f.reasoningBlocks)],[`text`,ha.text,n(`timing.text`),f.textMs??0,o(f.textBlocks)],[`toolarg`,ha.toolarg,n(`timing.toolArgs`),f.toolArgMs??0,o(f.toolArgBlocks)]];if(s.some(([,,,e])=>e>0))for(let[e,n,r,i,a]of s)t.push({key:e,color:n,label:r,ms:i,...a===void 0?{}:{times:a}});else t.push({key:`gen`,color:ha.reasoning,label:n(`timing.gen`),ms:f.genMs});let c=Math.min(f.ttftMs,p),l=Math.max(0,Math.min(f.genMs,p-c)),u=[c],d=c,m=c+l;for(let e of t.slice(1)){let t=Math.max(0,Math.min(e.ms,m-d));u.push(t),d+=t}let _=Math.max(0,Math.min(f.toolsMs,p-c-l)),v=Math.max(0,p-c-l-_),y=e=>p>0?e/p:0,b=(e,t)=>{let n=i(e);return t===void 0?n:e>0?`${n} · ${t}`:t},x=t.map((e,t)=>({key:e.key,color:e.color,value:y(u[t])})),S={key:`tools`,color:ha.tools,label:n(`timing.tools`),ms:f.toolsMs,times:n(`timing.toolTimes`,{n:r(f.toolCalls)})},C={key:`other`,color:ha.other,label:n(`timing.other`),ms:v};h=[...x,{key:`tools`,color:ha.tools,value:y(_)},{key:`other`,color:ha.other,value:y(v)}];let w=e=>({key:e.key,color:e.color,label:e.label,dim:e.ms===0,pct:a(e.ms,p),count:b(e.ms,e.times)});g=[...t.map(w),w(S),w(C)].filter(e=>!e.dim)}return(0,d.jsxs)(`div`,{className:`lc-card lc-col-donut flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`timing.title`)}),m!==null&&(0,d.jsx)(`span`,{className:`lc-card-rate`,title:n(`timing.tpsTip`),children:n(`timing.tps`,{tps:m})})]}),g.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(`timing.empty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`lc-donut-row flex items-center justify-start gap-3 min-w-0 @max-[320px]/lc-card:gap-2 @max-[240px]/lc-card:flex-wrap`,children:[(0,d.jsx)(t,{segments:h,size:96,centerTop:p>0?i(p):`—`,centerSub:n(`timing.total`),hoverKey:c,onHoverKey:l}),(0,d.jsx)(o,{rows:g,hoverKey:c,onHoverKey:l})]}),e.spans!==void 0&&e.spans.length>0?(0,d.jsx)(s,{spans:e.spans,hoverKey:c,onHoverKey:l}):null]})]})}}function va(e){let{t}=e,n=ta();return function(e){let{row:r}=e,i=r.timeline,a=li(r),o=i!==null&&typeof i.contextWindow==`number`&&i.contextWindow>0?Ht(i.current.total,i.contextWindow):null,s=ui(i),c=i?.counts?.steps,l=c===void 0?String(s):t(`ov.card.turns`,{n:s,s:c}),u=ti(r.cwd),f=e.group!==void 0&&e.group!==u?e.group:void 0,p=di(r.activity),m=i?.lastUser;return(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-session`+(r.current?` lc-ov-session-current`:``),onClick:()=>{e.onOpen(r.id)},children:[(0,d.jsxs)(`span`,{className:`lc-ov-session-head`,children:[r.running&&(0,d.jsx)(`span`,{className:`lc-ov-running`,title:t(`ov.running`)}),(0,d.jsx)(`span`,{className:`lc-ov-session-title`,title:r.title,children:r.title}),r.current&&(0,d.jsx)(`span`,{className:`lc-ov-current`,children:t(`ov.current`)}),(0,d.jsxs)(`span`,{className:`lc-ov-session-times`,children:[(0,d.jsx)(`span`,{className:`lc-ov-session-time`,children:Ei(t,r.updatedAt,e.now)}),p!==void 0&&(0,d.jsx)(`span`,{className:`lc-ov-session-created`,children:p})]})]}),(f!==void 0||u!==void 0)&&(0,d.jsxs)(`span`,{className:`lc-ov-session-crumb`,title:r.cwd,children:[f!==void 0&&(0,d.jsx)(`span`,{className:`lc-ov-crumb-group`,children:f}),f!==void 0&&u!==void 0&&(0,d.jsx)(`span`,{className:`lc-ov-crumb-sep`,children:`/`}),u!==void 0&&(0,d.jsx)(`span`,{className:`lc-ov-crumb-project`,children:u})]}),i===null?(0,d.jsx)(`span`,{className:`lc-ov-session-empty`,children:t(`ov.list.noData`)}):(0,d.jsxs)(`span`,{className:`lc-ov-session-body`,children:[(0,d.jsx)(n,{size:64,segments:R(i.current),centerTop:Lt(i.current.total),centerSub:o??void 0}),(0,d.jsxs)(`span`,{className:`lc-ov-mini-stats`,children:[(0,d.jsxs)(`span`,{className:`lc-ov-mini-stat`,children:[(0,d.jsx)(`span`,{className:`lc-ov-mini-label`,children:t(`stats.turns`)}),(0,d.jsx)(`span`,{className:`lc-ov-mini-value`,children:l})]}),(0,d.jsxs)(`span`,{className:`lc-ov-mini-stat`,children:[(0,d.jsx)(`span`,{className:`lc-ov-mini-label`,children:t(`ov.card.teamUsage`)}),(0,d.jsx)(`span`,{className:`lc-ov-mini-value`,children:a===null?`—`:Lt(a)})]}),(0,d.jsxs)(`span`,{className:`lc-ov-mini-stat`,children:[(0,d.jsx)(`span`,{className:`lc-ov-mini-label`,children:t(`ov.card.teamCost`)}),(0,d.jsx)(`span`,{className:`lc-ov-mini-value`,children:e.costLabel})]})]})]}),m!==void 0&&(0,d.jsxs)(`span`,{className:`lc-ov-session-preview`,title:m,children:[(0,d.jsx)(`span`,{className:`lc-ov-session-preview-label`,children:t(`ov.card.lastUser`)}),(0,d.jsx)(`span`,{className:`lc-ov-session-preview-text`,children:m})]})]})}}let ya=`lc-skilltip-bubble`,ba=[`var(--color-blue-500)`,`var(--color-green-500)`,`var(--color-purple-500)`,`var(--color-orange-500)`,`var(--color-teal-500)`,`var(--color-pink-500)`,`var(--color-indigo-500)`,`var(--color-amber-500)`],xa=[`loads`,`recent`];function Sa(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)>>>0;return ba[t%ba.length]}function Ca(e,t){let n=t.source;return n===`project-dsh`||n===`project-agents`?e(`ov.skills.src.project`):n===`user-dsh`||n===`user-agents`?e(`ov.skills.src.user`):n===`bundled`?e(`ov.skills.src.bundled`):n??``}function wa(e){let t=e.description.replace(/\s+/g,` `).trim();return t.length>160?t.slice(0,160)+`…`:t}function Ta(e,t){return`${e.t(`ov.skills.loads`,{n:e.fmt(t.loads)})} · ${e.t(`ov.skills.sessions`,{n:e.fmt(t.sessions)})}`}function Ea(e,t){return`${Ir(t.last)??``} ${e.fmtTime(t.last)}`.trim()}function Da(e,t){return`${Ta(e,t)} · ${Ea(e,t)}`}function Oa(e){return(0,d.jsxs)(`div`,{className:`lc-skilld-head`,children:[(0,d.jsx)(`i`,{className:`lc-ov-skill-dot`,style:{background:Sa(e.name)}}),(0,d.jsx)(`span`,{className:`lc-skilld-name`,children:e.name}),e.origin!==``&&(0,d.jsx)(`span`,{className:`lc-skilld-chip`,children:e.origin})]})}function ka(e){let{t,fmt:n}=e;return function(r){let{stats:i}=r,a=i.reduce((e,t)=>e+t.loads,0),o=i.reduce((e,t)=>Math.max(e,t.loads),0),[s,c]=(0,u.useState)(null),[l,f]=(0,u.useState)(null),m=(0,u.useRef)(null),h=s===null?void 0:i.find(e=>e.name===s.name);(0,u.useEffect)(()=>{if(s===null)return;let e=()=>{c(null)};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[s]),(0,u.useLayoutEffect)(()=>{if(s===null)return;let e=m.current;if(e===null)return;let t=e.offsetWidth,n=e.offsetHeight,{rect:r}=s,i=Math.max(8,Math.min(r.left+r.width/2-t/2,window.innerWidth-t-8)),a=r.top-n-6<8?r.bottom+6:r.top-n-6;f({forRow:s,left:i,top:a})},[s]);let[g,_]=(0,u.useState)(!1),v=(0,u.useRef)(null);(0,u.useEffect)(()=>{_(!1)},[r.selected]),(0,u.useEffect)(()=>()=>{v.current!==null&&clearTimeout(v.current)},[]);let y=async e=>{await Ai(e)&&(_(!0),v.current!==null&&clearTimeout(v.current),v.current=setTimeout(()=>{_(!1)},1500))},b=r.selected,x=b==null?void 0:i.find(e=>e.name===b),S=b==null?void 0:r.catalog?.get(b),C=b==null||S===void 0&&x===void 0?null:{name:b,origin:S===void 0?``:Ca(t,S),description:S===void 0?``:wa(S),path:S?.path},w=C?.path,T=C===null?null:(0,d.jsxs)(`div`,{className:`lc-ov-skill-detail`,children:[x===void 0&&(0,d.jsx)(Oa,{name:C.name,origin:``}),C.description!==``&&(0,d.jsx)(`p`,{className:`lc-skilld-desc`,children:C.description}),(0,d.jsxs)(`div`,{className:`lc-skilld-grid`,children:[C.origin!==``&&(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-skilld-k`,children:t(`ov.skills.k.source`)}),(0,d.jsx)(`span`,{className:`lc-skilld-v`,children:C.origin})]}),x!==void 0&&(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-skilld-k`,children:t(`ov.skills.k.usage`)}),(0,d.jsx)(`span`,{className:`lc-skilld-v`,children:Ta(e,x)}),(0,d.jsx)(`span`,{className:`lc-skilld-k`,children:t(`ov.skills.k.last`)}),(0,d.jsx)(`span`,{className:`lc-skilld-v`,children:Ea(e,x)})]}),w!==void 0&&(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-skilld-k`,children:t(`ov.skills.k.path`)}),(0,d.jsxs)(`button`,{type:`button`,className:`lc-skilld-v lc-skilld-pathv`,"data-lc-tip":t(`ov.skills.copyPath`),onClick:()=>{y(w)},children:[(0,d.jsx)(`span`,{className:`lc-skilld-pathv-text`,children:g?t(`ov.skills.copied`):w}),g?(0,d.jsx)(an,{size:12}):(0,d.jsx)(on,{size:12})]})]})]})]}),E=b!=null&&i.slice(0,20).some(e=>e.name===b),ee=h===void 0?null:(()=>{let n=r.catalog?.get(h.name),i=n===void 0?``:Ca(t,n),a=n===void 0?``:wa(n),o=r.selected===h.name,c=l!==null&&l.forRow===s?l:null;return(0,p.createPortal)((0,d.jsxs)(`div`,{ref:m,id:ya,role:`tooltip`,className:`lc-tip lc-skilltip`,style:c===null?{left:0,top:0,visibility:`hidden`}:{left:c.left,top:c.top,opacity:1},children:[(0,d.jsx)(Oa,{name:h.name,origin:i}),a!==``&&(0,d.jsx)(`p`,{className:`lc-skilld-desc`,children:a}),n?.path!==void 0&&(0,d.jsx)(`div`,{className:`lc-skilld-path`,children:n.path}),(0,d.jsxs)(`div`,{className:`lc-skilld-foot`,children:[(0,d.jsx)(`span`,{children:Da(e,h)}),(0,d.jsx)(`span`,{className:`lc-skilld-hint`,children:t(o?`ov.skills.clickRelease`:`ov.skills.clickFilter`)})]})]}),document.body)})(),te=r.sort??`loads`;return(0,d.jsxs)(`div`,{className:`lc-card lc-ov-skills-card`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:t(`stats.skills`)}),r.day!==null&&r.day!==void 0&&(0,d.jsx)(`span`,{className:`lc-card-sub`,children:r.day}),i.length>1&&(0,d.jsx)(`div`,{className:`lc-gran`,role:`group`,"aria-label":t(`ov.skills.sortLabel`),children:xa.map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(te===e?` lc-gran-on`:``),"aria-pressed":te===e,onClick:()=>{r.onSort?.(e)},children:t(`ov.skills.sort.`+e)},e))})]}),i.length>0&&(0,d.jsx)(`div`,{className:`lc-card-sub lc-ov-skills-sub`,children:t(`ov.skills.summary`,{skills:n(i.length),loads:n(a)})}),i.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.skills.empty`)}):(0,d.jsxs)(`div`,{className:`lc-ov-skills`,role:`group`,"aria-label":t(`stats.skills`),children:[i.slice(0,20).map(e=>{let i=Sa(e.name),a=r.selected===e.name,l=Math.round(e.loads/Math.max(o,1)*100),f=(0,d.jsx)(`i`,{className:`lc-ov-skill-bar`,style:{width:`calc(${l}% - ${Math.round(l*12)/100}px)`,background:i}}),p=(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-skill`,"aria-pressed":a,"aria-describedby":s?.name===e.name?ya:void 0,onMouseEnter:t=>{let n=t.currentTarget.getBoundingClientRect();c({name:e.name,rect:{left:n.left,top:n.top,width:n.width,bottom:n.bottom}})},onMouseLeave:()=>{c(null)},onFocus:t=>{let n=t.currentTarget.getBoundingClientRect();c({name:e.name,rect:{left:n.left,top:n.top,width:n.width,bottom:n.bottom}})},onBlur:()=>{c(null)},onClick:()=>{r.onSelect?.(a?null:e.name)},children:[(0,d.jsx)(`i`,{className:`lc-ov-skill-dot`,style:{background:i}}),(0,d.jsx)(`span`,{className:`lc-ov-skill-name`,children:e.name}),(0,d.jsxs)(`span`,{className:`lc-ov-skill-count`,children:[`×`,n(e.loads)]}),(0,d.jsx)(`span`,{className:`lc-ov-skill-last`,children:Ei(t,e.last,r.now)}),f]});return a?(0,d.jsxs)(`div`,{className:`lc-ov-skill-unit`,children:[p,T]},e.name):(0,d.jsx)(u.Fragment,{children:p},e.name)}),i.length>20&&(0,d.jsx)(`div`,{className:`lc-ov-skill-more`,children:t(`ov.skills.more`,{n:i.length-20})})]}),!E&&T,ee]})}}let Aa=[`24h`,`7d`,`30d`,`all`],ja=[`recent`,`tokens`,`context`],Ma=[`sessions`,`steps`];function Na(e,t){let{t:n,fmtDuration:r}=t,i=$i(t),a=va(t),o=Xi(e,t),s=ta(),c=sa(t,s),l=_a(t,s),f=ua(t),p=ka(t),m=Un(n);function h(){let t=e.locale;return(typeof t.getLocale==`function`?t.getLocale().active:`en`)===`zh`?`cny`:`usd`}function g(t){let{book:s}=Dr(),m=Qr(t),g=$r(t),[_,v]=(0,u.useState)(`30d`),[y,b]=(0,u.useState)(null),[x,S]=(0,u.useState)(``),[C,w]=(0,u.useState)(null),[T,E]=(0,u.useState)(null),[ee,te]=(0,u.useState)(`loads`),[D,O]=(0,u.useState)(`recent`),[k,A]=(0,u.useState)(`steps`),[j,M]=(0,u.useState)(0),{zoneProps:N,bubble:P}=aa(),F=(0,u.useMemo)(()=>ai(m,g),[m,g]),I=(0,u.useMemo)(()=>ei(g),[g]),[L,ne]=(0,u.useState)(null),re=(F??[]).find(e=>e.current),R=re?.cwd,ie=re?.id;(0,u.useEffect)(()=>{let e=!0;return ne(null),Oi(R,ie).then(t=>{e&&t!==null&&ne(t)}),()=>{e=!1}},[R,ie]),(0,u.useEffect)(()=>{Ti(),wi(e)},[]),(0,u.useEffect)(()=>{M(0)},[_,y,x,C,T,D]);let z=h(),B=Date.now(),V=F??[],H=fi(V,{range:_,day:null,query:``},B),ae=fi(H,{range:`all`,day:y,query:x},B),oe=ni(ae,g),se=C!==null&&!oe.some(e=>e.key===C)?[...oe,{key:C,count:0}]:oe,U=pi((C===null?ae:ae.filter(e=>ri(e,C,I))).filter(e=>T===null||_i(e,T,{range:_,day:y},B)),D),W=mi(U,j),G=Si(H,V.length,s,z),K=Ci(V,s,z),ce=t=>{je(e,t)};return(0,d.jsxs)(`section`,{className:`lc-ov-page`,"aria-label":n(`ov.title`),...N,children:[P,(0,d.jsx)(`div`,{className:`lc-ov-pagescroll`,children:(0,d.jsxs)(`div`,{className:`lc-ov-pagecontent`,children:[(0,d.jsxs)(`div`,{className:`lc-ov-pagehead`,children:[(0,d.jsx)(`h1`,{className:`lc-ov-pagetitle`,children:n(`ov.title`)}),(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-settings`,title:n(`plugin.settingsOpen`),onClick:()=>{Fi()},children:[(0,d.jsx)(cn,{size:14}),n(`plugin.settings`)]}),(0,d.jsx)(o,{}),(0,d.jsx)(`div`,{className:`lc-gran lc-ov-range`,role:`group`,"aria-label":n(`ov.range.label`),children:Aa.map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(_===e?` lc-gran-on`:``),onClick:()=>{v(e)},children:n(`ov.range.`+e)},e))})]}),F===null?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(`ov.unavailable`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`lc-ov-first`,children:[(0,d.jsxs)(`div`,{className:`lc-ov-kpis`,children:[(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`ov.kpi.sessions`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:G.sessions}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.ofTotal`,{n:G.listed})})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`ov.kpi.tokens`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:Lt(G.tokens)}),(0,d.jsxs)(`span`,{className:`lc-stat-sub`,children:[n(`stats.turns`),` `,Lt(G.turns)]})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`stats.cost`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:G.cost===null?`—`:ur(G.cost,z)}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.pricedSub`,{n:G.costSessions,total:G.sessions})})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`stats.cacheHit`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:G.cacheHit===null?`—`:G.cacheHit+`%`}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.sessionsSub`,{n:G.usageSessions})})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`stats.toolCalls`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:Lt(G.toolCalls)}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.toolSub`,{dur:r(G.toolsMs)})})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`timing.total`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:r(G.wallMs)}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.wallSub`,{n:Lt(G.calls)})})]})]}),(0,d.jsx)(f,{days:K,currency:z,today:ea()})]}),(0,d.jsxs)(`div`,{className:`lc-ov-stats`,children:[(0,d.jsx)(c,{tokens:G.tokenParts}),(0,d.jsx)(l,{timing:G.timing})]}),(0,d.jsxs)(`div`,{className:`lc-ov-body`,children:[(0,d.jsxs)(`div`,{className:`lc-ov-left`,children:[(0,d.jsxs)(`div`,{className:`lc-card lc-ov-heat-card`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`ov.heat.title`)}),(0,d.jsxs)(`span`,{className:`lc-heat-ctl`,children:[(0,d.jsx)(`span`,{className:`lc-card-sub`,children:n(`ov.heat.sub`)}),(0,d.jsx)(`div`,{className:`lc-gran`,role:`group`,"aria-label":n(`ov.heat.metric`),children:Ma.map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(k===e?` lc-gran-on`:``),onClick:()=>{A(e)},children:n(`ov.heat.metric.`+e)},e))})]})]}),(0,d.jsx)(i,{days:K,metric:k,selected:y,onSelect:b,today:ea()})]}),(0,d.jsx)(p,{stats:gi(H,{range:_,day:y,sort:ee},B),day:y,selected:T,onSelect:E,sort:ee,onSort:te,catalog:L,now:B})]}),(0,d.jsxs)(`div`,{className:`lc-ov-right`,children:[(0,d.jsxs)(`div`,{className:`lc-ov-list-head`,children:[(0,d.jsx)(`span`,{className:`lc-ov-list-title`,children:n(`ov.list.title`)}),(0,d.jsx)(`span`,{className:`lc-ov-list-count`,children:U.length}),y!==null&&(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-day-chip`,title:n(`ov.list.dayClear`),onClick:()=>{b(null)},children:[n(`ov.list.dayFilter`,{day:y}),` ×`]}),T!==null&&(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-day-chip`,title:n(`ov.list.skillClear`),onClick:()=>{E(null)},children:[n(`node.skillTag`,{name:T}),` ×`]}),(0,d.jsx)(`input`,{className:`lc-ov-search`,type:`search`,value:x,placeholder:n(`ov.list.search`),"aria-label":n(`ov.list.search`),onChange:e=>{S(e.target.value)}}),(0,d.jsx)(`div`,{className:`lc-gran`,role:`group`,"aria-label":n(`ov.list.sortLabel`),children:ja.map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(D===e?` lc-gran-on`:``),onClick:()=>{O(e)},children:n(`ov.list.sort.`+e)},e))})]}),se.length>0&&(0,d.jsxs)(`div`,{className:`lc-ov-groups`,role:`group`,"aria-label":n(`ov.group.label`),children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-chip`+(C===null?` lc-ov-chip-on`:``),onClick:()=>{w(null)},children:[n(`ov.range.all`),(0,d.jsx)(`span`,{className:`lc-ov-chip-n`,children:ae.length})]}),se.map(e=>(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-chip`+(C===e.key?` lc-ov-chip-on`:``),onClick:()=>{w(C===e.key?null:e.key)},children:[e.key===`__ungrouped__`?n(`ov.group.ungrouped`):e.key,(0,d.jsx)(`span`,{className:`lc-ov-chip-n`,children:e.count})]},e.key))]}),U.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(V.length===0?`ov.list.empty`:`ov.list.noMatch`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{className:`lc-ov-grid`,children:W.items.map(e=>(0,d.jsx)(a,{row:e,...I?.[e.id]===void 0?{}:{group:I[e.id]},costLabel:Pa(e,s,z),now:B,onOpen:ce},e.id))}),W.count>1&&(0,d.jsxs)(`div`,{className:`lc-ov-pager`,role:`navigation`,"aria-label":n(`ov.list.pager`),children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-ov-pager-btn`,disabled:W.index===0,"aria-label":n(`ov.list.prev`),onClick:()=>{M(W.index-1)},children:`‹`}),(0,d.jsx)(`span`,{className:`lc-ov-pager-n`,children:n(`ov.list.page`,{n:W.index+1,total:W.count})}),(0,d.jsx)(`button`,{type:`button`,className:`lc-ov-pager-btn`,disabled:W.index===W.count-1,"aria-label":n(`ov.list.next`),onClick:()=>{M(W.index+1)},children:`›`})]})]})]})]})]})]})})]})}return function(e){return(0,d.jsx)(m,{children:(0,d.jsx)(g,{...e})})}}function Pa(e,t,n){if(e.familyCost===null)return`—`;let r=or(e.familyCost,t,n);return r===null?`—`:ur(r,n)}function Fa(e){let[t,n]=(0,u.useState)(!1),r=e.options.find(t=>t.id===e.value)?.label??e.value;return(0,d.jsxs)(`div`,{className:`lc-settings-row`,children:[(0,d.jsx)(`span`,{className:`lc-settings-label`,children:e.label}),(0,d.jsx)(f.Menu,{open:t,onClose:()=>{n(!1)},items:e.options,selectedId:e.value,onSelect:t=>{n(!1),e.onPick(t)},align:`end`,portal:!0,anchor:(0,d.jsxs)(`button`,{type:`button`,className:`lc-settings-select hover:enabled:bg-(--dsw-alias-interactive-bg-hover) disabled:opacity-50 disabled:cursor-default`,disabled:e.disabled,"aria-haspopup":`menu`,"aria-expanded":t,onClick:()=>{n(e=>!e)},children:[r,(0,d.jsx)(ln,{})]})})]})}function Ia(e){let{t,state:n,set:r}=e,i=n.status!==`ready`||!n.writable;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Fa,{label:t(`settings.placement`),value:n.placement,disabled:i,options:[{id:`all`,label:t(`placement.all`)},{id:`tab`,label:t(`placement.tab`)},{id:`sidebar`,label:t(`placement.sidebar`)}],onPick:e=>{r?.(`defaultPlacement`,e)}}),(0,d.jsx)(Fa,{label:t(`settings.insightsEntry`),value:n.insightsEntry,disabled:i,options:[{id:`show`,label:t(`insightsEntry.show`)},{id:`hide`,label:t(`insightsEntry.hide`)}],onPick:e=>{r?.(`insightsEntry`,e)}}),(0,d.jsx)(Fa,{label:t(`settings.gran`),value:n.granularity,disabled:i,options:[{id:`step`,label:t(`gran.step`)},{id:`turn`,label:t(`gran.turn`)}],onPick:e=>{r?.(`defaultGranularity`,e)}}),(0,d.jsx)(Fa,{label:t(`settings.mode`),value:n.mode,disabled:i,options:[{id:`total`,label:t(`gran.total`)},{id:`delta`,label:t(`gran.delta`)}],onPick:e=>{r?.(`defaultTrendMode`,e)}}),(0,d.jsx)(Fa,{label:t(`settings.durationCurve`),value:n.durationCurve,disabled:i,options:[{id:`show`,label:t(`insightsEntry.show`)},{id:`hide`,label:t(`insightsEntry.hide`)}],onPick:e=>{r?.(`defaultDurationCurve`,e)}}),(0,d.jsx)(Fa,{label:t(`settings.deltaBase`),value:n.deltaBase,disabled:i,options:[{id:`step`,label:t(`browser.base.step`)},{id:`turn`,label:t(`browser.base.turn`)}],onPick:e=>{r?.(`defaultDeltaBase`,e)}}),(0,d.jsx)(Fa,{label:t(`settings.toolSort`),value:n.toolSort,disabled:i,options:[{id:`size`,label:t(`tool.sort.size`)},{id:`count`,label:t(`tool.sort.count`)},{id:`name`,label:t(`tool.sort.name`)}],onPick:e=>{r?.(`defaultToolSort`,e)}}),(0,d.jsx)(Fa,{label:t(`settings.fileSort`),value:n.fileSort,disabled:i,options:[{id:`count`,label:t(`files.sort.count`)},{id:`latest`,label:t(`files.sort.latest`)},{id:`path`,label:t(`files.sort.path`)}],onPick:e=>{r?.(`defaultFileSort`,e)}})]})}function La(e){let{t}=e;return function(e){let n=typeof e.useContextSettings==`function`?e.useContextSettings(e=>e):void 0;return n===void 0||n.status===`unavailable`?null:(0,d.jsxs)(`div`,{className:`lc-settings-prefs`,children:[!n.writable&&n.status===`ready`?(0,d.jsx)(`p`,{className:`lc-settings-note`,role:`status`,children:t(`settings.readOnly`)}):null,(0,d.jsx)(Ia,{t,state:n,set:e.set})]})}}let Ra=`dsh-context`;function za(e,t,n,r,i){let a=!1,o=[],s=e=>{typeof e==`function`&&o.push(e)},c=()=>{s(e.slots.inject(`main`,()=>e.slots.register({name:`main`,key:Ra,locale:i},n))),s(e.slots.inject(`sidebar.panellist`,()=>e.slots.register({name:`sidebar.panellist`,id:Ra,order:20,label:()=>r(`ov.title`),locale:i},e=>(0,u.createElement)(T,{size:typeof e.size==`number`?e.size:void 0}))))},l=()=>{for(;o.length>0;)o.pop()?.()},d=e=>{e===`show`&&!a?(a=!0,c()):e===`hide`&&a&&(a=!1,l())};d(t.insightsEntry());let f=t.store.subscribe(()=>{d(t.insightsEntry())});return()=>{f(),a&&(a=!1,l())}}function Ba(e){if(typeof e!=`object`||!e)return{};let t=e;return{...t.defaultPlacement===`all`||t.defaultPlacement===`tab`||t.defaultPlacement===`sidebar`?{placement:t.defaultPlacement}:{},...t.defaultGranularity===`step`||t.defaultGranularity===`turn`?{granularity:t.defaultGranularity}:{},...t.defaultTrendMode===`total`||t.defaultTrendMode===`delta`?{mode:t.defaultTrendMode}:{},...t.defaultDeltaBase===`step`||t.defaultDeltaBase===`turn`?{deltaBase:t.defaultDeltaBase}:{},...t.defaultToolSort===`size`||t.defaultToolSort===`count`||t.defaultToolSort===`name`?{toolSort:t.defaultToolSort}:{},...t.defaultFileSort===`count`||t.defaultFileSort===`latest`||t.defaultFileSort===`path`?{fileSort:t.defaultFileSort}:{},...t.insightsEntry===`show`||t.insightsEntry===`hide`?{insightsEntry:t.insightsEntry}:{},...t.defaultDurationCurve===`show`||t.defaultDurationCurve===`hide`?{durationCurve:t.defaultDurationCurve}:{}}}function Va(){let e={status:`loading`,placement:`all`,granularity:`step`,mode:`total`,deltaBase:`step`,toolSort:`count`,fileSort:`count`,insightsEntry:`show`,durationCurve:`show`,writable:!1},t,n=new Set,r=t=>{if(t.status!==e.status||t.placement!==e.placement||t.granularity!==e.granularity||t.mode!==e.mode||t.deltaBase!==e.deltaBase||t.toolSort!==e.toolSort||t.fileSort!==e.fileSort||t.insightsEntry!==e.insightsEntry||t.durationCurve!==e.durationCurve||t.writable!==e.writable){e=t;for(let e of n)e()}},i=t=>{let n=t.getSnapshot(),i=Ba(n.value),a=n.value!==null&&typeof n.value==`object`?n.value:void 0;return r({status:n.status===`ready`||n.status===`unavailable`?n.status:`loading`,placement:i.placement??(a?.defaultPlacement===void 0?e.placement:`all`),granularity:i.granularity??e.granularity,mode:i.mode??e.mode,deltaBase:i.deltaBase??e.deltaBase,toolSort:i.toolSort??e.toolSort,fileSort:i.fileSort??e.fileSort,insightsEntry:i.insightsEntry??(a?.insightsEntry===void 0?e.insightsEntry:`show`),durationCurve:i.durationCurve??(a?.defaultDurationCurve===void 0?e.durationCurve:`show`),writable:n.writable}),{placement:i.placement,insightsEntry:i.insightsEntry}};return{store:{subscribe(e){return n.add(e),()=>{n.delete(e)}},getSnapshot:()=>e},defaultPlacement:()=>e.placement,defaultGranularity:()=>e.granularity,defaultTrendMode:()=>e.mode,defaultDeltaBase:()=>e.deltaBase,defaultToolSort:()=>e.toolSort,defaultFileSort:()=>e.fileSort,insightsEntry:()=>e.insightsEntry,defaultDurationCurve:()=>e.durationCurve,attach(e){return t=e,i(e),e.subscribe(()=>{i(e)})},set(n,a){r({...e,...Ba({[n]:a})});let o=t;o!==void 0&&o.set(n,a).catch(()=>{let t=i(o);n===`defaultPlacement`&&t.placement===void 0&&r({...e,placement:`all`}),n===`insightsEntry`&&t.insightsEntry===void 0&&r({...e,insightsEntry:`show`})})}}}function Ha(e){return[...e.nodes,...e.archive].sort((e,t)=>e.seq-t.seq)}function Ua(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1;e[i].seq<t?n=i+1:r=i}return n}function Wa(e,t,n){if(n<0||n>=t.length)return null;let r=t[n],i=Ua(e,r.seq),a=i<e.length&&e[i].seq===r.seq?e[i]:void 0,o=a!==void 0&&a.cat===`assistant`?a:void 0,s=n===0||(t[n-1].turn??0)!==(r.turn??0),c=n;for(;c>0&&(t[c-1].turn??0)===(r.turn??0);)c--;let l=t[c].seq,u=c>0?t[c-1].seq:-1,d;for(let t=Ua(e,l)-1;t>=0;t--){let n=e[t];if(n.seq<=u)break;if(n.cat===`user`){d=n;break}}let f=[];if(!s){let i=t[n-1].seq;for(let t=Ua(e,i+1);t<e.length&&e[t].seq<r.seq;t++)f.push(e[t])}return{opener:d,inputs:f,response:o}}function Ga(e,t){return e===`read_image`||Ka.test(t)?`image`:t.endsWith(`/`)?`dir`:`text`}let Ka=/\.(png|jpe?g|gif|webp|svg|bmp|ico|avif)$/i,qa=[[[`test`,`tests`,`__tests__`,`spec`,`specs`,`e2e`],`🧪`,`files.glyph.tests`],[[`doc`,`docs`,`documentation`],`📚`,`files.glyph.docs`],[[`node_modules`,`vendor`,`third_party`,`third-party`,`packages`],`📦`,`files.glyph.deps`],[[`dist`,`build`,`out`,`target`,`release`,`debug`,`coverage`,`artifacts`],`🏗️`,`files.glyph.build`],[[`scripts`,`tools`,`bin`],`🛠️`,`files.glyph.scripts`],[[`config`,`configs`,`settings`,`.config`],`⚙️`,`files.glyph.config`],[[`assets`,`static`,`public`,`images`,`fonts`,`icons`,`media`],`🎨`,`files.glyph.assets`]],Ja=[`package-lock.json`,`pnpm-lock.yaml`,`npm-shrinkwrap.json`],Ya=[`makefile`,`justfile`,`cmakelists.txt`],Xa=/(^|[^a-z0-9])test([^a-z0-9]|$)|\.test\./,Za=[[[`tsx`],`TSX`,`#3178c6`,`files.glyph.lang.ts`],[[`ts`],`TS`,`#3178c6`,`files.glyph.lang.ts`],[[`js`,`jsx`,`mjs`,`cjs`],`JS`,`#f7df1e`,`files.glyph.lang.js`],[[`py`,`pyi`,`pyw`],`PY`,`#3572a5`,`files.glyph.python`],[[`ipynb`],`NB`,`#da5b0b`,`files.glyph.notebook`],[[`go`],`GO`,`#00add8`,`files.glyph.lang.go`],[[`rs`],`RS`,`#dea584`,`files.glyph.lang.rust`],[[`java`],`JV`,`#b07219`,`files.glyph.lang.java`],[[`kt`,`kts`],`KT`,`#a97bff`,`files.glyph.lang.kotlin`],[[`rb`],`RB`,`#701516`,`files.glyph.lang.ruby`],[[`php`],`PHP`,`#4f5d95`,`files.glyph.lang.php`],[[`c`,`h`],`C`,`#555555`,`files.glyph.lang.c`],[[`cpp`,`cc`,`cxx`,`hpp`],`C++`,`#f34b7d`,`files.glyph.lang.cpp`],[[`cs`],`C#`,`#178600`,`files.glyph.lang.csharp`],[[`scala`],`SC`,`#c22d40`,`files.glyph.lang.scala`],[[`lua`],`LUA`,`#000080`,`files.glyph.lang.lua`],[[`dart`],`DA`,`#00b4ab`,`files.glyph.lang.dart`],[[`swift`],`SW`,`#f05138`,`files.glyph.lang.swift`],[[`vue`],`VUE`,`#41b883`,`files.glyph.lang.vue`],[[`svelte`],`SV`,`#ff3e00`,`files.glyph.lang.svelte`],[[`sh`,`bash`,`zsh`,`fish`,`ps1`],`SH`,`#89e051`,`files.glyph.shell`],[[`html`,`htm`,`xhtml`],`HT`,`#e34c26`,`files.glyph.lang.html`],[[`css`,`scss`,`sass`,`less`,`styl`],`CSS`,`#563d7c`,`files.glyph.style`],[[`sql`],`SQL`,`#e38c00`,`files.glyph.database`]];function Qa(e){let t=parseInt(e.slice(1),16);return(.299*(t>>16&255)+.587*(t>>8&255)+.114*(t&255))/255<.6?`#ffffff`:`#1f2328`}let $a=[[[`yaml`,`yml`,`toml`,`ini`,`conf`,`cfg`,`properties`,`env`],`⚙️`,`files.glyph.config`],[[`json`,`jsonc`,`json5`,`jsonl`,`ndjson`,`xml`],`🧾`,`files.glyph.data`],[[`md`,`mdx`,`markdown`,`rst`,`adoc`,`org`],`📝`,`files.glyph.markdown`],[[`log`],`📜`,`files.glyph.log`],[[`csv`,`tsv`,`xls`,`xlsx`,`ods`],`📊`,`files.glyph.sheet`],[[`pdf`,`doc`,`docx`,`odt`,`rtf`],`📕`,`files.glyph.document`],[[`zip`,`gz`,`tgz`,`tar`,`bz2`,`xz`,`7z`,`rar`,`jar`],`🗜️`,`files.glyph.archive`],[[`ttf`,`otf`,`woff`,`woff2`,`eot`],`🔤`,`files.glyph.font`],[[`mp4`,`mov`,`mkv`,`webm`,`mp3`,`wav`,`flac`,`ogg`],`🎬`,`files.glyph.media`]];function eo(e){if(e===``||e===`.`)return{glyph:`🏠`,tip:`files.glyph.root`};let t=e.toLowerCase();for(let[e,n,r]of qa)if(e.includes(t))return{glyph:n,tip:r};return t.startsWith(`.`)?{glyph:`🗄️`,tip:`files.glyph.hidden`}:{glyph:`📁`,tip:`files.form.dir`}}function to(e){let t=e.toLowerCase(),n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1):``;if(t.endsWith(`.lock`)||Ja.includes(t))return{glyph:`🔒`,tip:`files.glyph.lock`};if(Xa.test(t))return{glyph:`🧪`,tip:`files.glyph.tests`};if(t===`dockerfile`||t.startsWith(`dockerfile.`))return{glyph:`🐳`,tip:`files.glyph.docker`};if(Ya.includes(t))return{glyph:`🛠️`,tip:`files.glyph.scripts`};if(t===`.gitignore`||t===`.gitattributes`)return{glyph:`🚫`,tip:`files.glyph.ignore`};if(t===`license`||t.startsWith(`license.`)||t===`copying`)return{glyph:`⚖️`,tip:`files.glyph.license`};if(t===`.env`||t.startsWith(`.env.`))return{glyph:`⚙️`,tip:`files.glyph.config`};if(r!==``){for(let[e,t,n,i]of Za)if(e.includes(r))return{glyph:t,tip:i,color:n,text:Qa(n)};for(let[e,t,n]of $a)if(e.includes(r))return{glyph:t,tip:n}}return{glyph:`📄`,tip:`files.form.text`}}function no(e,t){if(t===`image`)return{glyph:`🖼`,tip:`files.form.image`};let n=e.endsWith(`/`)?e.slice(0,-1):e,r=n.slice(n.lastIndexOf(`/`)+1);return t===`dir`?eo(r):to(r)}let ro=/^[a-zA-Z]:[\\/]/;function io(e,t){if(e.startsWith(`/`)||ro.test(e))return e;if(!(t===void 0||t===``||e.startsWith(`.`)))return t.replace(/\/+$/,``)+`/`+e.replace(/^\/+/,``)}function ao(e,t,n,r,i){if(n!==!0&&t!==`dir`&&r!==void 0&&r!==``)try{return Pr(r,i,e)}catch{return}}function oo(e,t){let n=t!==void 0&&t.length>1?t.replace(/\/+$/,``):void 0;if(n!==void 0){if(e===n)return`./`;if(e.startsWith(n+`/`))return`./`+e.slice(n.length+1)}return e.startsWith(`/`)||ro.test(e)||e.startsWith(`.`)?e:`./`+e}function so(e,t){let n={read:{files:0,ops:0},write:{files:0,ops:0},search:{files:0,ops:0},image:{files:0,ops:0},added:0,removed:0},r=new Map;for(let i of e){let e=i.parent??i.seq;if(t!==null&&e>=t)continue;n[i.kind].ops++;let a=r.get(i.path);a===void 0&&(a={path:i.path,form:Ga(i.tool,i.path),reads:0,writes:0,searches:0,added:0,removed:0,errs:0,ops:[],...i.pattern===!0?{pattern:!0}:{}},r.set(i.path,a)),i.kind===`read`?a.reads++:i.kind===`write`?a.writes++:a.searches++,a.added+=i.added,a.removed+=i.removed,i.err&&a.errs++,a.ops.push(i)}let i=[...r.values()];for(let e of i)e.ops.sort((e,t)=>t.seq-e.seq),e.reads>0&&n.read.files++,e.writes>0&&n.write.files++,e.searches>0&&n.search.files++,e.form===`image`&&(n.image.files++,n.image.ops+=e.ops.length),n.added+=e.added,n.removed+=e.removed;return i.sort((e,t)=>t.ops[0].seq-e.ops[0].seq),{entries:i,totals:n}}function co(e,t,n){let r=new Map;for(let e of t)e.gone!==void 0&&r.set(e.seq,e.gone);return so(e.map(e=>{let t=r.get(e.parent??e.seq);return t!==void 0&&e.gone===void 0?{...e,gone:t}:e}),n)}function lo(e){let t=e;if(t.kind!==`tool-result`||t.call===null||typeof t.call!=`object`)return null;let n=t.call;return typeof n.name!=`string`||typeof n.argsRaw!=`string`||typeof t.seq!=`number`||!Number.isFinite(t.seq)?null:{name:n.name,argsRaw:n.argsRaw,seq:t.seq,...typeof t.time==`number`?{time:t.time}:{},...t.isError===!0?{err:!0}:{err:!1},...Array.isArray(t.subCalls)?{subCalls:t.subCalls}:{}}}function uo(e){let t=ct(e?.call?.argsRaw)?.description;return typeof t==`string`&&t!==``?t:void 0}function fo(e,t,n,r,i,a){if(!(a>8))for(let o of e){if(typeof o!=`object`||!o||i.has(o))continue;i.add(o);let e=lo(o);e!==null&&(r.push(...St({seq:e.seq,tool:e.name,argsRaw:e.argsRaw,err:e.err,...e.time===void 0?{}:{time:e.time},...t.gone===void 0?{}:{gone:t.gone},parent:t.seq,...n===void 0?{}:{program:n}})),e.subCalls!==void 0&&fo(e.subCalls,t,n,r,i,a+1))}}function po(e,t,n){let r=[];for(let i of e){if(i.cat!==`tool`||n!==null&&i.seq>=n)continue;let e=i.tool;if(e!==void 0)try{let n=t(i.seq);r.push(...St({seq:i.seq,tool:e,argsRaw:n?.call?.argsRaw,meta:n?.meta,err:i.err===!0||n?.isError===!0,...i.time===void 0?{}:{time:i.time},...i.gone===void 0?{}:{gone:i.gone}}));let a=n?.subCalls;a!==void 0&&a.length>0&&fo(a,i,uo(n),r,new Set,1)}catch{}}return so(r,null)}function mo(e,t,n){for(let r of e)if(r.seq>t&&(n===void 0||n>r.seq))return r.seq;return n===void 0?`live`:null}function ho(){let e=new Map;return{headOf(t){let n=e.get(t);if(n!==void 0)return n;let r=Ye(t),i=r===void 0?Promise.resolve(null):r().then(e=>e?.head??null);return e.set(t,i),i}}}function go(e){let t=(0,u.useCallback)(t=>e===null||e.list===void 0?()=>{}:e.list.subscribe(t),[e]),n=(0,u.useCallback)(()=>e===null||e.list===void 0?null:e.list.getSnapshot(),[e]);return(0,u.useSyncExternalStore)(t,n)}function _o(e){return e===null?`var(--dsw-alias-border-l1)`:e>=90?`var(--color-red-500)`:e>=70?`var(--color-amber-500)`:`var(--color-green-500)`}function vo(e,t,n=ho()){let{t:r,fmt:i,catLabel:a}=t;function o(t){let o=(0,u.useMemo)(()=>Yr(e),[]),s=go(o),c=t.sessionId,[l,f]=(0,u.useState)(null),p=(0,u.useRef)(null),[m,h]=(0,u.useState)(0);(0,u.useEffect)(()=>{let e=p.current;if(e===null||typeof ResizeObserver!=`function`)return;h(e.clientWidth);let t=new ResizeObserver(()=>{h(e.clientWidth)});return t.observe(e),()=>{t.disconnect()}},[]),(0,u.useEffect)(()=>{let e=p.current;if(e!==null)return kt(e)},[]),(0,u.useEffect)(()=>{o!==null&&typeof c==`string`&&c!==``&&typeof o.refreshSubagents==`function`&&o.refreshSubagents(c).catch(()=>{})},[o,c]);let[g,_]=(0,u.useState)(new Map),v=(0,u.useMemo)(()=>{let e=Ur(s,c,t.self,g);return e===null?null:{forest:e,layout:Gr(e,m)}},[s,c,t.self,m,g]);if((0,u.useEffect)(()=>{if(v===null)return;let e=(e,t)=>{e.then(e=>{e!==null&&_(n=>n.get(t)===e?n:new Map(n).set(t,e))}).catch(()=>{})};for(let t of v.forest.nodes)t.isCurrent||t.head!==null&&t.head.parts.length>0||e(n.headOf(t.id),t.id)},[v,n]),v===null)return null;let{forest:y,layout:b}=v,x=new Map(y.nodes.map(e=>[e.id,e])),S=y.nodes.find(e=>e.isCurrent)??y.nodes[0],C=(l===null?void 0:x.get(l))??S,w=y.nodes.filter(e=>e.running).length,T=0;for(let e of y.nodes)T+=e.head===null?0:e.head.tokens;let E=t=>{t!==S.id&&je(e,t)},ee=e=>t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),E(e))};return(0,d.jsxs)(`div`,{className:`lc-card lc-agents`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`agents.title`)}),(0,d.jsx)(`span`,{className:`lc-card-sub`,children:r(`agents.sub`)})]}),(0,d.jsxs)(`div`,{className:`lc-agents-chips`,children:[(0,d.jsx)(`span`,{className:`lc-agents-chip`,children:r(`agents.chip.count`,{n:y.nodes.length+y.overflow})}),(0,d.jsx)(`span`,{className:`lc-agents-chip`+(w>0?` lc-agents-chip-on`:``),children:r(`agents.chip.running`,{n:w})}),T>0?(0,d.jsx)(`span`,{className:`lc-agents-chip`,children:r(`agents.chip.tokens`,{n:i(T)})}):null,y.overflow>0?(0,d.jsx)(`span`,{className:`lc-agents-chip`,children:r(`agents.more`,{n:y.overflow})}):null]}),(0,d.jsx)(`div`,{className:`lc-agents-stage`,ref:p,children:(0,d.jsxs)(`svg`,{className:`lc-agents-svg`,width:b.width,height:b.height,viewBox:`0 0 ${b.width} ${b.height}`,children:[b.links.map(e=>{let t=`M ${e.x1} ${e.y1} L ${e.x2} ${e.y2}`;return(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{className:`lc-agents-link stroke-[1.5px] stroke-opacity-45`+(e.running?` lc-agents-link-live`:``),d:t,stroke:e.color,fill:`none`}),e.running?(0,d.jsx)(`path`,{className:`lc-agents-flow animate-lc-agent-flow fill-none stroke-2`,d:t,stroke:e.color}):null]},e.to)}),y.nodes.map(e=>{let t=b.points.find(t=>t.id===e.id);return t===void 0?null:(0,d.jsx)(yo,{node:e,x:t.x,y:t.y,captionW:b.captionW,hovered:l===e.id,onHover:f,onOpen:E,onKeyOpen:ee(e.id),t:r,fmt:i},e.id)})]})}),y.solo?(0,d.jsx)(`div`,{className:`lc-empty lc-agents-solo`,children:r(`agents.solo`)}):null,(0,d.jsx)(bo,{node:C,t:r,fmt:i}),(0,d.jsxs)(`div`,{className:`lc-agents-legend`,children:[L.map(e=>(0,d.jsxs)(`span`,{className:`lc-agents-legend-item`,children:[(0,d.jsx)(`i`,{style:{background:e.color}}),a(e.key)]},e.key)),(0,d.jsxs)(`span`,{className:`lc-agents-legend-item`,children:[(0,d.jsx)(`i`,{className:`lc-agents-legend-free`}),r(`agents.legend.free`)]}),(0,d.jsxs)(`span`,{className:`lc-agents-legend-item`,children:[(0,d.jsx)(`i`,{className:`lc-agents-legend-edge`}),r(`agents.running`)]})]})]})}return o}function yo(e){let{node:t,x:n,y:r,captionW:i}=e,a=t.head===null?null:t.head.pct,o=2*Math.PI*20,s=t.head===null?[]:Jr(t.head.parts,a,20,_o(a)),c=`lc-agent-node`+(t.isCurrent?` lc-agent-self`:``)+(t.running?` lc-agent-running`:``)+(t.completed&&!t.running?` lc-agent-done`:``)+(e.hovered?` lc-agent-hover`:``)+(t.isCurrent?``:` lc-agent-clickable`)+` group/agent`;return(0,d.jsxs)(`g`,{className:c,transform:`translate(${n}, ${r})`,"data-agent":t.id,role:t.isCurrent?`img`:`button`,tabIndex:t.isCurrent?void 0:0,onClick:()=>{e.onOpen(t.id)},onKeyDown:e.onKeyOpen,onMouseEnter:()=>{e.onHover(t.id)},onMouseLeave:()=>{e.onHover(null)},children:[(0,d.jsx)(`circle`,{className:`lc-agent-halo fill-transparent group-hover/agent:fill-[var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))] group-focus-visible/agent:fill-[var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))]`+(t.running?` animate-lc-agent-glow`:``),r:35}),(0,d.jsx)(`circle`,{className:`lc-agent-track fill-(--dsw-alias-bg-layer-1) stroke-(--dsw-alias-border-l1) stroke-[1.5px]`,r:26}),s.map(e=>(0,d.jsx)(`circle`,{className:`lc-agent-seg fill-none stroke-9`+(e.free?` lc-agent-free`:``),r:20,strokeDasharray:`${e.len} ${o-e.len}`,strokeDashoffset:-e.offset,style:{stroke:e.free?void 0:e.color},transform:`rotate(-90)`},e.key)),(0,d.jsx)(`text`,{className:`lc-agent-pct fill-(--dsw-alias-label-primary)`,textAnchor:`middle`,dy:`0.32em`,children:a===null?t.head===null?`—`:e.fmt(t.head.tokens):`${a}%`}),(0,d.jsx)(`foreignObject`,{x:-i/2,y:34,width:i,height:60,children:(0,d.jsxs)(`div`,{className:`lc-agent-caption`,children:[(0,d.jsxs)(`div`,{className:`lc-agent-label`,children:[t.label,t.isCurrent?(0,d.jsx)(`span`,{className:`lc-agents-badge lc-agent-self-badge`,children:e.t(`agents.self`)}):null]}),(0,d.jsx)(`div`,{className:`lc-agent-tokens`,children:t.head===null?`—`:e.fmt(t.head.tokens)})]})})]})}function bo(e){let{node:t,t:n,fmt:r}=e,i=[];if(t.head!==null){let e=t.head,n=e.window===void 0?``:` / ${r(e.window)}`,a=e.pct===null?``:` · ${e.pct}%`;i.push(`${r(e.tokens)}${n}${a}`)}return t.requests>0&&i.push(n(`agents.requests`,{n:t.requests})),t.billed!==null&&t.billed>0&&i.push(n(`agents.billed`,{n:r(t.billed)})),t.durationMs!==null&&i.push(Xr(t.durationMs)),(0,d.jsxs)(`div`,{className:`lc-agents-inspector`,children:[(0,d.jsx)(`b`,{className:`lc-agents-inspector-name`,children:t.label}),t.isCurrent?(0,d.jsx)(`span`,{className:`lc-agents-badge`,children:n(`agents.self`)}):null,t.running?(0,d.jsx)(`span`,{className:`lc-agents-badge lc-agents-badge-on`,children:n(`agents.running`)}):null,t.identity===null?null:(0,d.jsx)(`span`,{className:`lc-agents-badge`,children:n(t.identity.mode===`one-shot`?`agents.oneshot`:`agents.continuable`)}),(0,d.jsx)(`span`,{className:`lc-agents-inspector-stats`,children:i.join(` · `)}),t.isCurrent?null:(0,d.jsx)(`span`,{className:`lc-agents-inspector-open`,children:n(`agents.open`)})]})}let xo={compaction:`✂`,prune:`✂`,mode:`⇄`};function So(e){function t(t){if(t.kind===`compaction`)return e(`ev.compaction`,{n:t.count||0});if(t.kind===`prune`)return e(`ev.prune`);if(t.kind===`model`)return e(`ev.model`,{a:t.from||`?`,b:t.to||`?`});if(t.kind===`mode`)return e(`ev.mode.`+(t.name||`?`));if(t.sub===`skill`)return e(`ev.skill`,{name:t.name||`?`});let n=e(`form.`+(t.form||`context`)),r=t.name?n+` · `+t.name:n;return t.detail&&(r+=` · `+t.detail),r}function n(t){return t.kind===`compaction`||t.kind===`prune`?typeof t.turn==`number`&&typeof t.step==`number`?typeof t.fromTurn==`number`&&typeof t.fromStep==`number`?t.fromTurn===t.turn?e(`events.range`,{t:t.turn,a:t.fromStep,b:t.step}):e(`events.rangeTo`,{a:t.fromTurn,as:t.fromStep,b:t.turn,bs:t.step}):e(`events.at`,{t:t.turn,s:t.step}):null:typeof t.turn==`number`&&typeof t.step==`number`?e(`events.at`,{t:t.turn,s:t.step}):null}return{eventLabel:t,eventAt:n}}function Co(e){for(let t of e.querySelectorAll(`.lc-event-label`))t.title=t.scrollWidth>t.clientWidth&&t.textContent||``}function wo(e){let{t,fmt:n,fmtTime:r,eventLabel:i,eventAt:a}=e,o=Dt(e);return function(e){let s=(0,u.useRef)(null);if((0,u.useLayoutEffect)(()=>{let e=s.current;e&&Co(e)},[e.events]),(0,u.useEffect)(()=>{let e=()=>{let e=s.current;e!==null&&Co(e)};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),e.events.length===0)return e.state===`loading`?(0,d.jsx)(o,{state:`loading`}):e.state===`failed`&&e.onRetry!==void 0?(0,d.jsx)(o,{state:`failed`,onRetry:e.onRetry}):(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`events.empty`)});let c=e.events.slice().reverse();return(0,d.jsx)(`div`,{className:`lc-events`,ref:s,children:c.map(e=>{let o=i(e),s=a(e),c=e.kind===`inject`?(0,d.jsx)(rn,{}):e.kind===`model`?(0,d.jsx)(nn,{}):xo[e.kind]||`•`;return(0,d.jsxs)(`div`,{className:`lc-event @max-[380px]/lc-card:flex-wrap`,children:[(0,d.jsx)(`span`,{className:`lc-event-icon lc-event-`+e.kind,children:c}),(0,d.jsx)(`span`,{className:`lc-kind lc-kind-`+e.kind,children:t(`kind.`+e.kind)}),(0,d.jsx)(`span`,{className:`lc-event-label flex-1 @max-[380px]/lc-card:basis-[calc(100%-92px)]`,children:o}),s===null?null:(0,d.jsx)(`span`,{className:`lc-event-at`,children:s}),e.tokens?(0,d.jsx)(`span`,{className:`lc-event-tokens`+(e.kind===`inject`?` lc-up`:` lc-down`),children:(e.kind===`inject`?`+`:`−`)+n(e.tokens)}):null,(0,d.jsx)(`span`,{className:`lc-event-time`,children:r(e.time)})]},e.seq)})})}}function To(e,t){let{t:n,fmt:r,fmtTime:i}=e,a=Dt(e);function o(e,t){return t===`all`?!0:t===`image`?e.form===`image`:t===`read`?e.reads>0:t===`write`?e.writes>0:e.searches>0}function s(e){return(0,d.jsxs)(`span`,{className:`lc-fa-delta`,children:[e.added>0?(0,d.jsx)(`span`,{className:`lc-fa-up`,children:`+`+r(e.added)}):null,e.removed>0?(0,d.jsx)(`span`,{className:`lc-fa-down`,children:`−`+r(e.removed)}):null]})}return(0,u.memo)(function(e){let{activity:c}=e,[l,f]=(0,u.useState)(`all`),[p,m]=(0,u.useState)(()=>t.defaultFileSort()),[h,g]=(0,u.useState)(``),[_,v]=(0,u.useState)(null),y=h.trim().toLowerCase(),b=t=>t.pattern===!0?t.path:oo(t.path,e.workspace),x=e=>l===`read`?e.reads:l===`write`?e.writes:l===`search`?e.searches:e.ops.length,S=c.entries.filter(e=>o(e,l)&&(y===``||b(e).toLowerCase().includes(y))).sort((e,t)=>p===`count`?x(t)-x(e)||t.ops[0].seq-e.ops[0].seq:p===`latest`?t.ops[0].seq-e.ops[0].seq:e.path<t.path?-1:1),C=[{key:`all`,files:c.entries.length,ops:c.totals.read.ops+c.totals.write.ops+c.totals.search.ops},{key:`read`,files:c.totals.read.files,ops:c.totals.read.ops},{key:`write`,files:c.totals.write.files,ops:c.totals.write.ops},{key:`search`,files:c.totals.search.files,ops:c.totals.search.ops},{key:`image`,files:c.totals.image.files,ops:c.totals.image.ops}],w=e=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-fa-op-tool`,title:e.tool,children:e.tool}),e.read===void 0?null:(0,d.jsx)(`span`,{className:`lc-fa-read`,title:`est`in e.read?n(`files.readEst`):n(`files.readTip`,{a:r(e.read.start),b:r(e.read.start+e.read.count-1)}),children:(`est`in e.read?`≈`:`>>`)+r(e.read.count)}),e.detail===void 0?null:(0,d.jsx)(`span`,{className:`lc-fa-op-detail`,children:e.detail}),e.hits===void 0?null:(0,d.jsx)(`span`,{className:`lc-fa-op-detail`,children:n(`files.hits`,{n:r(e.hits)})}),e.detail===void 0&&e.hits===void 0&&e.program!==void 0?(0,d.jsx)(`span`,{className:`lc-fa-op-detail`,children:e.program}):null,e.added+e.removed>0?(0,d.jsx)(s,{added:e.added,removed:e.removed}):null,e.err?(0,d.jsx)(`span`,{className:`lc-br-err-dot`,title:n(`node.failed`)}):null,(0,d.jsx)(`span`,{className:`lc-fa-op-time`,children:e.time===void 0?`—`:i(e.time)})]});return(0,d.jsxs)(`div`,{className:`lc-card lc-col flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`files.title`)}),(0,d.jsx)(`span`,{className:`lc-card-sub`,children:e.scope})]}),c.entries.length===0&&e.state===`loading`?(0,d.jsx)(a,{state:`loading`}):c.entries.length===0&&e.state===`failed`&&e.onRetry!==void 0?(0,d.jsx)(a,{state:`failed`,onRetry:e.onRetry}):c.entries.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(`files.empty`)}):(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`lc-fa-ctl`,children:[(0,d.jsx)(`div`,{className:`lc-gran @max-[380px]/lc-card:flex-wrap`,children:C.map(e=>(0,d.jsxs)(`button`,{type:`button`,className:`lc-gran-btn`+(l===e.key?` lc-gran-on`:``)+(e.key===`read`||e.key===`write`||e.key===`search`?` lc-fa-chip-`+e.key:``),title:n(`files.chipTip`,{files:e.files,ops:e.ops}),onClick:()=>{f(t=>t===e.key?`all`:e.key)},children:[n(`files.kind.`+e.key),(0,d.jsx)(`b`,{className:`lc-fa-n`,children:r(e.ops)})]},e.key))}),(0,d.jsx)(`input`,{className:`lc-fa-search focus:border-(--dsw-alias-label-dimmed)`,value:h,placeholder:n(`files.search`),onChange:e=>{g(e.target.value)}})]}),(0,d.jsxs)(`div`,{className:`lc-fa-meta`,children:[(0,d.jsx)(`span`,{children:n(`files.files`,{n:c.entries.length})}),c.totals.added+c.totals.removed>0?(0,d.jsxs)(`span`,{className:`lc-fa-meta-delta group/tip`,children:[(0,d.jsx)(s,{added:c.totals.added,removed:c.totals.removed}),(0,d.jsx)(`span`,{className:`lc-tip lc-fa-meta-tip group-hover/tip:opacity-100`,role:`tooltip`,children:n(`files.deltaTip`)})]}):null,(0,d.jsx)(`span`,{className:`lc-gran lc-fa-sort`,role:`group`,title:n(`files.sortTip`),children:[`count`,`latest`,`path`].map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(p===e?` lc-gran-on`:``),onClick:()=>{m(e)},children:n(`files.sort.`+e)},e))})]}),S.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(`files.noMatch`)}):(0,d.jsx)(`div`,{className:`lc-fa-list`,children:S.map(t=>{let a=_===t.path,o=b(t),c=o.endsWith(`/`)?o.slice(0,-1):o,l=c.lastIndexOf(`/`),u=l>=0?c.slice(0,l+1):``,f=l>=0?c.slice(l+1):c,p=no(t.path,t.form),m=t.pattern===!0?void 0:io(t.path,e.workspace),h=e.onPreview!==void 0&&t.pattern!==!0&&t.form!==`dir`,g=h||m!==void 0&&e.onOpen!==void 0;return(0,d.jsxs)(`div`,{className:`lc-fa-item`+(a?` lc-fa-item-on`:``),children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-fa-row hover:bg-(--dsw-alias-interactive-bg-hover) @max-[380px]/lc-card:flex-wrap`,title:t.path,onClick:()=>{v(a?null:t.path)},children:[(0,d.jsx)(`span`,{className:`lc-br-chev`+(a?` lc-br-chev-on`:``)}),(0,d.jsx)(`span`,{className:`lc-fa-form`,title:n(p.tip),children:p.color===void 0?p.glyph:(0,d.jsx)(`span`,{className:`lc-fa-lang`,style:{background:p.color,color:p.text},children:p.glyph})}),(0,d.jsxs)(`span`,{className:`lc-fa-path flex-1 @max-[380px]/lc-card:basis-[calc(100%-46px)]`,children:[u===``?null:(0,d.jsx)(`em`,{children:u}),g?(0,d.jsx)(`b`,{className:`lc-fa-file hover:underline`,title:n(h?`files.preview`:`files.open`),onClick:n=>{n.stopPropagation(),!(h&&e.onPreview?.(t)===!0)&&m!==void 0&&e.onOpen?.(m)},children:f}):(0,d.jsx)(`b`,{children:f})]}),t.reads>0?(0,d.jsxs)(`span`,{className:`lc-fa-badge lc-fa-b-read`,title:n(`files.kind.read`),children:[(0,d.jsx)(`i`,{}),r(t.reads)]}):null,t.writes>0?(0,d.jsxs)(`span`,{className:`lc-fa-badge lc-fa-b-write`,title:n(`files.kind.write`),children:[(0,d.jsx)(`i`,{}),r(t.writes)]}):null,t.searches>0?(0,d.jsxs)(`span`,{className:`lc-fa-badge lc-fa-b-search`,title:n(`files.kind.search`),children:[(0,d.jsx)(`i`,{}),r(t.searches)]}):null,t.added+t.removed>0?(0,d.jsx)(s,{added:t.added,removed:t.removed}):null,t.errs>0?(0,d.jsx)(`span`,{className:`lc-br-err-dot`,title:n(`files.errs`,{n:t.errs})}):null,t.ops[0].time===void 0?null:(0,d.jsx)(`span`,{className:`lc-fa-time`,children:i(t.ops[0].time)})]}),a?(0,d.jsx)(`div`,{className:`lc-fa-ops`,children:t.ops.map((t,r)=>{let i=e.onLocate,a=`${t.seq}:${r}`;return i===void 0?(0,d.jsx)(`div`,{className:`lc-fa-op`,children:w(t)},a):(0,d.jsx)(`button`,{type:`button`,className:`lc-fa-op lc-fa-op-link hover:bg-(--dsw-alias-interactive-bg-hover)`,title:n(`files.locate`),onClick:()=>{i(t)},children:w(t)},a)})}):null]},t.path)})})]})]})})}let Eo=`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>`,Do=`</title><path d="`,Oo=`"/></svg>`,ko={title:`DeepSeek`,slug:`deepseek`,get svg(){return Eo+`DeepSeek`+Do+this.path+Oo},path:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`,source:`https://www.deepseek.com`,hex:`5786FE`},Ao={title:`GitHub`,slug:`github`,get svg(){return Eo+`GitHub`+Do+this.path+Oo},path:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`,source:`https://github.com/logos`,hex:`181717`,guidelines:`https://github.com/logos`},jo=`https://github.com/bowenliang123/dsh-context`,Mo=jo.replace(/^https?:\/\/github\.com\//,``),No=[`https://registry.npmjs.org`,`https://registry.npmmirror.com`],Po=null;function Fo(e){return fetch(e+`/dsh-context/latest`).then(e=>e.ok?e.json():null).then(e=>e!==null&&typeof e.version==`string`?e.version:null).catch(()=>null)}function Io(){return(!Po||Date.now()-Po.at>=36e5)&&(Po={at:Date.now(),promise:(async()=>{for(let e of No){let t=await Fo(e);if(t!==null)return t}return null})()}),Po.promise}function Lo(e,t){let n=e=>e.replace(/^v/,``).split(`-`,1)[0].split(`.`).map(e=>parseInt(e,10)||0),r=n(e),i=n(t);for(let e=0;e<Math.max(r.length,i.length);e++){let t=r[e]||0,n=i[e]||0;if(t!==n)return t>n}return!1}function Ro({icon:e}){return(0,d.jsx)(`svg`,{width:12,height:12,className:`lc-pi-labelicon`,viewBox:`-2 -2 28 28`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:e.path,fill:`currentColor`})})}function zo(e){let{t}=e,n=(e,t,n,r,i)=>(0,d.jsxs)(`a`,{className:`lc-pi-row group/pi`,href:r,target:`_blank`,rel:`noreferrer`,children:[(0,d.jsxs)(`div`,{className:`lc-pi-label`,children:[e,t]}),(0,d.jsx)(`div`,{className:`lc-pi-value group-hover/pi:underline`,title:i,children:n})]});return function(){let[e,r]=(0,u.useState)(null);(0,u.useEffect)(()=>{if(`0.66.0`.includes(`-dev`))return;let e=!0;return Io().then(t=>{e&&t&&r(t)}),()=>{e=!1}},[]);let i=e!==null&&Lo(e,`0.66.0`)?e:null,a=`dsh-context (v0.66.0)`,o=[a];return i&&o.push((0,d.jsx)(`span`,{className:`lc-pi-update`,children:`↑ v`+i},`update`)),(0,d.jsxs)(`div`,{className:`lc-card flex-1 min-w-[min(240px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:t(`plugin.title`)}),(0,d.jsx)(`a`,{className:`lc-card-sub lc-pi-hint hover:underline`,href:jo,target:`_blank`,rel:`noreferrer`,children:t(`plugin.hint`)})]}),(0,d.jsxs)(`div`,{className:`lc-pi-grid`,children:[n((0,d.jsx)(Ro,{icon:ko}),t(`plugin.name`),o,jo,i===null?a:a+` ↑ v`+i),n((0,d.jsx)(Ro,{icon:Ao}),t(`plugin.github`),Mo,jo,Mo),(0,d.jsxs)(`button`,{type:`button`,className:`lc-pi-row lc-pi-row-btn group/pi`,onClick:()=>{Fi()},children:[(0,d.jsxs)(`div`,{className:`lc-pi-label`,children:[(0,d.jsx)(cn,{size:12,className:`lc-pi-labelicon`}),t(`plugin.settings`)]}),(0,d.jsx)(`div`,{className:`lc-pi-value group-hover/pi:underline`,title:t(`plugin.settingsOpen`),children:t(`plugin.settingsOpen`)})]})]})]})}}let Bo=new Set;function Vo(e){let{t}=e;return function(e){let n=typeof e.sessionId==`string`?e.sessionId:``,[r,i]=(0,u.useState)(null),a=r===n||Bo.has(n),o=(0,u.useCallback)(()=>{Bo.add(n),i(n)},[n]);return Wn(!a,o),a?null:(0,d.jsx)(`div`,{className:`lc-modal-backdrop`,onClick:o,children:(0,d.jsxs)(`div`,{className:`lc-modal-card lc-gate-card`,onClick:e=>{e.stopPropagation()},children:[(0,d.jsxs)(`div`,{className:`lc-modal-head`,children:[(0,d.jsx)(`span`,{className:`lc-modal-title`,children:t(`gate.title`)}),(0,d.jsx)(`button`,{className:`lc-modal-close hover:text-(--dsw-alias-label-primary) hover:bg-(--dsw-alias-bg-layer-2)`,"aria-label":t(`cmd.close`),onClick:o,children:`×`})]}),(0,d.jsx)(`div`,{className:`lc-gate-body`,children:t(`gate.body`,{minimum:e.minimum})}),(0,d.jsxs)(`div`,{className:`lc-gate-versions`,children:[(0,d.jsxs)(`span`,{className:`lc-gate-version`,children:[(0,d.jsx)(`span`,{className:`lc-gate-version-label`,children:t(`gate.current`)}),(0,d.jsxs)(`span`,{className:`lc-gate-version-value`,children:[`v`,e.current]})]}),(0,d.jsxs)(`span`,{className:`lc-gate-version`,children:[(0,d.jsx)(`span`,{className:`lc-gate-version-label`,children:t(`gate.minimum`)}),(0,d.jsxs)(`span`,{className:`lc-gate-version-value`,children:[`v`,e.minimum,(0,d.jsx)(`span`,{className:`lc-gate-or-newer`,children:t(`gate.orNewer`)})]})]})]}),(0,d.jsx)(`div`,{className:`lc-gate-actions`,children:(0,d.jsx)(`button`,{type:`button`,className:`lc-gate-ok hover:brightness-110`,onClick:o,children:t(`gate.ok`)})})]})})}}function Ho(e,t){let{t:n,fmt:r,fmtTime:i,catLabel:a,eventLabel:o,eventAt:s}=e;function c(e){let t=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`span`,{className:`lc-brief-tag group/tip`,children:[e.tag,(0,d.jsx)(`span`,{className:`lc-tip lc-brief-tip group-hover/tip:opacity-100`,role:`tooltip`,children:e.tagTip})]}),e.children]});if(e.node===void 0||e.onLocate===void 0)return(0,d.jsx)(`div`,{className:`lc-brief-row`,children:t});let n=e.node,r=e.onLocate;return(0,d.jsx)(`button`,{type:`button`,className:`lc-brief-row lc-brief-row-link hover:bg-(--dsw-alias-interactive-bg-hover)`,onClick:()=>{r(n,e.isResponse)},children:t})}function l(e,t){if(e.cat===`tool`){let r=wt(t);return e.tool===void 0?{tag:null,text:r??n(`node.toolResult`)}:{tag:e.tool,text:r??``}}if(e.cat===`skill`)return{tag:e.skill===void 0?n(`form.`+(e.form??`context`)):n(`node.skillTag`,{name:e.skill}),text:e.text??wt(t)??``};if(e.cat===`assistant`){let r=e.calls!==void 0&&e.calls.length>0?e.calls:Et(t),i=e.text!==void 0&&e.text!==``?e.text:Tt(t)??``;return{tag:r.length>0?r.join(` › `):null,text:i===``?r.length>0?``:n(`node.empty`):i}}if(e.cat===`inject`){let t=e.text!==void 0&&e.text!==``?e.form===`snapshot`?n(`node.snapshot`)+e.text:e.text:``;return{tag:n(`form.`+(e.form??`context`)),text:t}}let r=e.imgs??0;return{tag:r>0?n(`attach.image`)+(r>1?` ×`+String(r):``):null,text:e.text??``}}function f(e,t){return e===null?t:t===``?e:e+` · `+t}function p(e){let{opener:t,inputs:r,response:i}=e.brief??{inputs:[]},a=e.convOf??(()=>void 0),o=e.onLocate===void 0?``:` — `+n(`brief.locate`),s=e.onLocate===void 0?void 0:t=>n=>{n?.stopPropagation(),e.onLocate?.(t,!1)},u=(e,t,n=!1)=>{let{tag:r,text:i}=l(e,a(e.seq));return(0,d.jsxs)(`span`,{className:`lc-brief-chip`+(n?` lc-brief-chip-grow`:``)+(t===void 0?``:` lc-brief-chip-link hover:bg-(--dsw-alias-interactive-bg-hover)`),title:f(r,i)+o,onClick:t,children:[e.err===!0?(0,d.jsx)(`span`,{className:`lc-br-err-dot`}):null,r===null?null:(0,d.jsx)(`span`,{className:`lc-brief-chip-tag`,children:r}),i===``?null:(0,d.jsx)(`span`,{className:`lc-brief-chip-text`,children:i})]},e.seq)},p=t===void 0?null:l(t,a(t.seq));return(0,d.jsxs)(`div`,{className:`lc-brief`,children:[t!==void 0&&p!==null?(0,d.jsxs)(c,{tag:n(`brief.turn`),tagTip:n(`brief.turnTip`),node:t,isResponse:!1,onLocate:e.onLocate,children:[p.tag===null?null:(0,d.jsx)(`span`,{className:`lc-brief-fact`,children:p.tag}),p.text===``?null:(0,d.jsx)(`span`,{className:`lc-brief-text`,title:f(p.tag,p.text)+o,children:p.text})]}):null,(0,d.jsx)(c,{tag:n(`brief.input`),tagTip:n(`brief.inputTip`),node:r[0],isResponse:!1,onLocate:e.onLocate,children:r.length>0?(0,d.jsxs)(d.Fragment,{children:[r.slice(0,3).map(e=>u(e,s?.(e))),r.length>3?(0,d.jsx)(`span`,{className:`lc-brief-more`,children:n(`brief.more`,{n:r.length-3})}):null]}):(0,d.jsx)(`span`,{className:`lc-brief-empty`,children:n(`brief.noInputs`)})}),i===void 0?null:(0,d.jsx)(c,{tag:n(`brief.reply`),tagTip:n(`brief.replyTip`),node:i,isResponse:!0,onLocate:e.onLocate,children:u(i,void 0,!0)})]})}return(0,u.memo)(function(e){let c=e.request;if(!c)return null;let l=c.stepCount!==void 0&&c.stepCount>1,u=l?n(`detail.turn`,{t:c.turn??0,n:c.stepCount??0}):n(`detail.step`,{t:c.turn??0,s:c.step??0,n:e.stepsOf?.(c.turn)??1}),f=e.marker??null,m=f===null?null:s(f),h=e.prev!==void 0,g=e.prev??null,_=L.map(e=>h?(c[e.key]||0)-(g===null?0:g[e.key]||0):0),v=0,y=0;if(h)for(let e of _)v+=e,Math.abs(e)>y&&(y=Math.abs(e));let b=h?L.map((e,t)=>({key:e.key,color:e.color,value:Math.abs(_[t])})):R(c);return(0,d.jsxs)(`div`,{className:`lc-detail`,children:[(0,d.jsxs)(`div`,{className:`lc-detail-head`,children:[(0,d.jsx)(`b`,{children:u}),f!==null&&m!==null?(0,d.jsx)(`span`,{className:`lc-detail-marker`,title:o(f),children:`✂ `+m}):null,l?(0,d.jsx)(`span`,{className:`lc-detail-tag`,children:n(`detail.lastStep`)}):null,h?(0,d.jsx)(`span`,{className:`lc-detail-tag`,children:n(`gran.delta`)}):null,(0,d.jsx)(`span`,{className:`lc-detail-time`,children:i(c.time)}),h?(0,d.jsx)(`span`,{className:`lc-detail-metric`+(v>0?` lc-detail-metric-up`:v<0?` lc-detail-metric-down`:``),children:n(`tip.delta`,{n:(v>0?`+`:``)+r(v)})}):null,!h&&c.prompt!==void 0?(0,d.jsx)(`span`,{className:`lc-detail-metric`,children:n(`detail.actual`,{n:r(c.prompt)})}):null,!h&&c.output!==void 0?(0,d.jsx)(`span`,{className:`lc-detail-metric`,children:n(`detail.output`,{n:r(c.output)})}):null,!h&&c.prompt!==void 0&&c.cacheRead!==void 0?(0,d.jsx)(`span`,{className:`lc-detail-metric`,children:n(`detail.cache`,{n:zt(c.cacheRead,c.prompt)??`—`})}):null]}),(0,d.jsx)(p,{brief:e.brief,convOf:e.convOf,onLocate:e.onLocate}),(0,d.jsx)(t,{parts:b,height:10,hoverKey:e.hoverKey,tip:!1}),(0,d.jsx)(`div`,{className:`lc-detail-rows`,children:L.map((t,n)=>{let i=h?_[n]:c[t.key]||0,o=Math.abs(i);return(0,d.jsxs)(`div`,{className:`lc-detail-row`+(e.hoverKey===t.key?` lc-detail-row-on`:``),children:[(0,d.jsx)(`i`,{style:{background:t.color}}),(0,d.jsx)(`span`,{className:`lc-detail-label`,children:a(t.key)}),(0,d.jsx)(`span`,{className:`lc-bar-track`,children:h?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-bar-zero`}),i===0?null:(0,d.jsx)(`span`,{className:`lc-bar-fill `+(i>0?`lc-bar-fill-up`:`lc-bar-fill-down`),style:{width:`${o/y*50}%`,background:t.color}})]}):(0,d.jsx)(`span`,{className:`lc-bar-fill`,style:{width:`${c.total>0?i/c.total*100:0}%`,background:t.color}})}),h?(0,d.jsx)(`span`,{className:`lc-detail-num`+(i>0?` lc-detail-num-up`:i<0?` lc-detail-num-down`:``),children:(i>0?`+`:``)+r(i)}):(0,d.jsx)(`span`,{className:`lc-detail-num`,children:`≈`+r(i)}),(0,d.jsx)(`span`,{className:`lc-detail-pct`,children:!h&&c.total>0?`${Math.round(i/c.total*100)}%`:``})]},t.key)})})]})})}function Uo(e){try{for(let t=e.parentElement;t!==null&&t!==document.body;t=t.parentElement){let n=window.getComputedStyle(t).overflowY;if((n===`auto`||n===`scroll`)&&t.scrollHeight>t.clientHeight)return t.scrollTop+=e.getBoundingClientRect().top-t.getBoundingClientRect().top,!0}}catch{}return!1}let Wo=[[`hit`,`stats.costHit`],[`miss`,`stats.costMiss`],[`write`,`stats.costWrite`],[`out`,`stats.costOut`]];function Go(e,t){if(e===void 0||t===null)return[];let n=[];for(let r of Object.keys(e)){let i=W(e[r]);if(i!==null)for(let e of Object.keys(i)){let i=ir(t,r,e);i!==null&&n.push({key:r+`/`+e,face:i})}}return n}function Ko(e,t){let n=new Set;for(let t of e)n.add(t.turn??0);let r=0,i=0,a=0,o=new Set;for(let e of t)e.kind===`inject`?r++:e.kind===`compaction`?i++:e.kind===`prune`&&a++,e.sub===`skill`&&typeof e.name==`string`&&e.name!==``&&o.add(e.name);return{turns:n.size,steps:e.length,injects:r,compactions:i,prunes:a,skills:o.size}}function qo(e,t){return function(n){let r=go((0,u.useMemo)(()=>Yr(e),[])),[i,a]=(0,u.useState)(new Map),o=(0,u.useMemo)(()=>Wr(r,n,i),[r,n,i]);return(0,u.useEffect)(()=>{for(let e of o.cold)t.headOf(e).then(t=>{t!==null&&a(n=>n.get(e)===t?n:new Map(n).set(e,t))}).catch(()=>{})},[o,t]),{usage:o.usage,count:o.count}}}let Jo=[`inputs`,`events`,`session`,`tools`,`cost`],Yo=[{from:`inputs`,to:`session`,fromAt:.5,toAt:1/3,color:`var(--color-green-500)`},{from:`events`,to:`session`,fromAt:.5,toAt:2/3,color:`var(--color-purple-500)`},{from:`session`,to:`tools`,fromAt:1/3,toAt:.5,color:`var(--color-teal-500)`},{from:`session`,to:`cost`,fromAt:2/3,toAt:.5,color:`var(--color-pink-500)`}],Xo=[{kind:`inject`,tally:`injects`,cls:`lc-kind-inject`},{kind:`compaction`,tally:`compactions`,cls:`lc-kind-compaction`},{kind:`prune`,tally:`prunes`,cls:`lc-kind-prune`}];function Zo(e){let t=new Map;for(let n of e)(n.cat===`tool`||n.cat===`skill`&&n.tool!==void 0)&&typeof n.tool==`string`&&n.tool!==``&&t.set(n.tool,(t.get(n.tool)??0)+1);return[...t].sort((e,t)=>t[1]-e[1]||(e[0]<t[0]?-1:1))}function Qo(e,t,n){switch(t){case`left`:return{x:e.x,y:e.y+e.h*n,dx:-1,dy:0};case`right`:return{x:e.x+e.w,y:e.y+e.h*n,dx:1,dy:0};case`top`:return{x:e.x+e.w*n,y:e.y,dx:0,dy:-1};case`bottom`:return{x:e.x+e.w*n,y:e.y+e.h,dx:0,dy:1}}}function $o(e,t){let n=Math.max(18,(e.dx===0?Math.abs(t.y-e.y):Math.abs(t.x-e.x))/2);return`M ${e.x} ${e.y} C ${e.x+e.dx*n} ${e.y+e.dy*n} ${t.x+t.dx*n} ${t.y+t.dy*n} ${t.x} ${t.y}`}function es(e,t){let n=t?`right`:`bottom`,r=t?`left`:`top`;return Yo.map(t=>({d:$o(Qo(e[t.from],n,t.fromAt),Qo(e[t.to],r,t.toAt)),color:t.color}))}function ts(e,t){let{t:n,fmt:r}=e;return function(e){let i=e.locale===`zh`?`cny`:`usd`,{book:a,failed:o}=Dr(),s=t(e.sessionId),c=s.usage,l=lr(e.cost,c)??void 0,f=or(l,a,i),p=or(c,a,i),m=e=>dr(Yn(e,i),i),h=Go(l,a),g=Go(c??void 0,a),_=l!==void 0&&Object.keys(l).some(e=>Jn(e)),v=c!==null&&Object.keys(c).some(e=>Jn(e)),y=h.length===0&&l!==void 0&&Object.keys(l).length>0&&(o||a!==null),b=g.length===0&&c!==null&&(o||a!==null),x=e=>e.length>0?(0,d.jsxs)(`span`,{className:`lc-stat-tip-prices`,children:[(0,d.jsx)(`span`,{className:`lc-stat-tip-head`,children:n(`stats.costPriceHead`)}),e.map(e=>(0,d.jsxs)(`span`,{className:`lc-stat-tip-row`,children:[Wo.filter(([t])=>e.face.rate[t]>0).map(([t,r])=>(0,d.jsxs)(`span`,{className:`lc-stat-tip-band`,children:[(0,d.jsx)(`i`,{children:n(r)}),` `,(0,d.jsx)(`b`,{children:m(e.face.rate[t])})]},t)),(0,d.jsx)(`span`,{className:`lc-stat-tip-by`,children:n(`stats.costPriceBy`,{p:e.face.pid,m:e.face.mid})})]},e.key))]},`prices`):null,S=e=>[i===`cny`?(0,d.jsx)(`span`,{children:n(`stats.costTipCny`)},`cny`):null,e?(0,d.jsx)(`span`,{children:n(`stats.costTipDeepseek`)},`peak`):null].filter(e=>e!==null),C=[n(`stats.costTip`),(0,d.jsx)(`span`,{className:`lc-stat-tip-row`,children:n(`stats.billedTip`)},`billed`),x(h),...S(_),y?(0,d.jsx)(`span`,{children:n(`stats.costUnavailable`)},`unavailable`):null],w=[n(`stats.subCostTip`),(0,d.jsx)(`span`,{className:`lc-stat-tip-row`,children:n(`stats.billedTip`)},`billed`),x(g),...S(v),b?(0,d.jsx)(`span`,{children:n(`stats.costUnavailable`)},`unavailable`):null],T=(0,u.useRef)(null),E=(0,u.useRef)(new Map),[ee,te]=(0,u.useState)([]),[,D]=(0,u.useState)(0),O=e=>t=>{t===null?E.current.delete(e):E.current.set(e,t)};(0,u.useLayoutEffect)(()=>{let e=T.current;if(e===null)return;let t=e.getBoundingClientRect(),n={};for(let e of Jo){let r=E.current.get(e);if(r===void 0)return;let i=r.getBoundingClientRect();n[e]={x:i.left-t.left,y:i.top-t.top,w:i.width,h:i.height}}let r=es(n,e.clientWidth>559);te(e=>e.length===r.length&&e.every((e,t)=>e.d===r[t].d&&e.color===r[t].color)?e:r)}),(0,u.useEffect)(()=>{let e=T.current;if(e===null||typeof ResizeObserver!=`function`)return;let t=new ResizeObserver(()=>{D(e=>e+1)});return t.observe(e),()=>{t.disconnect()}},[]);let k=(e,t,n,r)=>{let i=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`span`,{className:`lc-flow-label`,children:[e,n!==void 0&&(0,d.jsx)(`i`,{className:`lc-stat-q group-hover/tip:text-(--dsw-alias-label-primary) group-hover/tip:border-(--dsw-alias-label-primary)`,"aria-hidden":`true`,children:`?`})]}),(0,d.jsx)(`b`,{className:`lc-flow-total`,children:t}),n!==void 0&&(0,d.jsx)(`span`,{className:`lc-tip lc-stat-tip group-hover/tip:opacity-100`,role:`tooltip`,children:n})]}),a=`lc-flow-head`+(n===void 0?``:` lc-stat-tipped group/tip`);return r===void 0?(0,d.jsx)(`div`,{className:a,children:i}):(0,d.jsx)(`a`,{className:a,href:r,target:`_blank`,rel:`noreferrer noopener`,children:i})},A=(e,t,n=``,i)=>(0,d.jsxs)(`span`,{className:`lc-flow-pill`+n+(t===0?` lc-flow-pill-dim`:``)+(i===void 0?``:` lc-stat-tipped group/tip`),children:[(0,d.jsxs)(`span`,{className:`lc-flow-pill-label`,children:[e,i!==void 0&&(0,d.jsx)(`i`,{className:`lc-stat-q group-hover/tip:text-(--dsw-alias-label-primary) group-hover/tip:border-(--dsw-alias-label-primary)`,"aria-hidden":`true`,children:`?`})]}),(0,d.jsx)(`b`,{children:r(t)}),i!==void 0&&(0,d.jsx)(`span`,{className:`lc-tip lc-stat-tip group-hover/tip:opacity-100`,role:`tooltip`,children:i})]},e),j=e.onFigureClick,M=(e,t,n,i)=>(0,d.jsxs)(`span`,{role:j===void 0?void 0:`button`,tabIndex:j===void 0?void 0:0,className:`lc-flow-kv`+(j===void 0?``:` lc-flow-kv-btn`),title:j===void 0?void 0:i,onClick:j===void 0?void 0:()=>{j(e)},onKeyDown:j===void 0?void 0:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),j(e))},children:[(0,d.jsx)(`b`,{children:r(t)}),(0,d.jsx)(`i`,{children:n})]},e),N=new Set(h.map(e=>e.face.pid).filter(e=>e!==``)),P=N.size===1?`https://models.dev/providers/`+[...N][0]+`/`:void 0,F=or(e.cost,a,i),I=sr(l),L=sr(e.cost),ne=sr(c),re=(e,t)=>(0,d.jsxs)(`span`,{className:`lc-flow-pair`,children:[(0,d.jsx)(`b`,{children:r(e)}),(0,d.jsx)(`i`,{children:`/`}),(0,d.jsx)(`b`,{children:t})]}),R=f===null?`—`:ur(f,i),ie=F===null?`—`:ur(F,i),z=p===null?`—`:ur(p,i),B=()=>{let e=T.current?.closest(`.lc-root`)?.querySelector(`.lc-agents`)??null;e!==null&&Uo(e)},V=e=>{e.target.closest(`a`)===null&&B()},H=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),B())},ae=(e.humanInputs??0)+e.files.reads+e.files.writes+e.files.searches+e.files.images,oe=e.toolCalls??e.tools.reduce((e,[,t])=>e+t,0),se=e.tools.slice(0,3),U=e.tools.length-se.length;return(0,d.jsxs)(`div`,{className:`lc-card flex-[3] min-w-[min(360px,100%)]`,children:[(0,d.jsx)(`div`,{className:`lc-card-title`,children:(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`stats.title`)})}),(0,d.jsxs)(`div`,{className:`lc-stats lc-flow`,ref:T,children:[(0,d.jsx)(`svg`,{className:`lc-flow-svg`,"aria-hidden":`true`,children:ee.map((e,t)=>(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{className:`lc-flow-ribbon`,d:e.d,stroke:e.color}),(0,d.jsx)(`path`,{className:`lc-flow-dash animate-lc-agent-flow motion-reduce:animate-none`,d:e.d,stroke:e.color})]},t))}),(0,d.jsxs)(`div`,{className:`lc-flow-col`,children:[(0,d.jsxs)(`div`,{className:`lc-flow-node`,ref:O(`inputs`),children:[k(n(`stats.io`),r(ae)),(0,d.jsxs)(`div`,{className:`lc-flow-pills`,children:[A(n(`stats.humanInputs`),e.humanInputs??0,``,n(`stats.humanInputsTip`)),A(n(`files.kind.read`),e.files.reads),A(n(`files.kind.write`),e.files.writes),e.files.searches>0?A(n(`files.kind.search`),e.files.searches):null,e.files.images>0?A(n(`files.kind.image`),e.files.images):null]})]}),(0,d.jsxs)(`div`,{className:`lc-flow-node`,ref:O(`events`),children:[k(n(`stats.events`),r(e.counts.injects+e.counts.compactions+e.counts.prunes)),(0,d.jsx)(`div`,{className:`lc-flow-pills`,children:Xo.map(t=>A(n(`kind.`+t.kind),e.counts[t.tally],` lc-flow-pill-tint `+t.cls))})]})]}),(0,d.jsx)(`div`,{className:`lc-flow-mid`,children:(0,d.jsxs)(`div`,{className:`lc-flow-node lc-flow-self`,ref:O(`session`),children:[(0,d.jsx)(`span`,{className:`lc-flow-label`,children:n(`stats.session`)}),(0,d.jsxs)(`span`,{className:`lc-flow-self-stats`,children:[(0,d.jsxs)(`span`,{className:`lc-flow-kv`,children:[(0,d.jsx)(`b`,{children:r(e.counts.turns)}),(0,d.jsx)(`i`,{children:n(`stats.turns`)})]}),(0,d.jsxs)(`span`,{className:`lc-flow-kv`,children:[(0,d.jsx)(`b`,{children:r(e.counts.steps)}),(0,d.jsx)(`i`,{children:n(`stats.steps`)})]})]}),(0,d.jsxs)(`span`,{className:`lc-flow-self-stats`,children:[M(`skills`,e.counts.skills??0,n(`stats.skills`),n(`stats.skillsJump`)),M(`answers`,e.answers??0,n(`stats.answers`),n(`stats.answersJump`))]})]})}),(0,d.jsxs)(`div`,{className:`lc-flow-col lc-flow-col-r`,children:[(0,d.jsxs)(`div`,{className:`lc-flow-node`,ref:O(`tools`),children:[k(n(`stats.toolCalls`),r(oe)),se.length>0?(0,d.jsxs)(`div`,{className:`lc-flow-pills`,children:[se.map(([e,t])=>(0,d.jsxs)(`span`,{className:`lc-flow-pill`,title:e,children:[(0,d.jsx)(`span`,{className:`lc-flow-pill-label`,children:e}),(0,d.jsx)(`b`,{children:r(t)})]},e)),U>0?(0,d.jsx)(`span`,{className:`lc-flow-pill lc-flow-pill-dim`,children:(0,d.jsx)(`span`,{className:`lc-flow-pill-label`,children:n(`stats.toolsMore`,{n:U})})}):null]}):null]}),(0,d.jsxs)(`div`,{className:`lc-flow-node lc-flow-team`,ref:O(`cost`),role:`button`,tabIndex:0,onClick:V,onKeyDown:H,children:[k(n(`agents.title`),re(I,R),C,P),(0,d.jsxs)(`div`,{className:`lc-flow-rows`,children:[(0,d.jsxs)(`div`,{className:`lc-flow-row`,children:[(0,d.jsx)(`span`,{className:`lc-flow-row-label`,children:n(`stats.currentAgent`)}),re(L,ie)]}),(0,d.jsxs)(`div`,{className:`lc-flow-row lc-stat-tipped group/tip`,children:[(0,d.jsxs)(`span`,{className:`lc-flow-row-label`,children:[n(`stats.teamSubs`,{n:s.count}),(0,d.jsx)(`i`,{className:`lc-stat-q group-hover/tip:text-(--dsw-alias-label-primary) group-hover/tip:border-(--dsw-alias-label-primary)`,"aria-hidden":`true`,children:`?`})]}),re(ne,z),(0,d.jsx)(`span`,{className:`lc-tip lc-stat-tip group-hover/tip:opacity-100`,role:`tooltip`,children:w})]})]})]})]})]})]})}}let ns={uncachedInputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0};function rs(e,t){let{t:n,fmt:r,fmtShare:i,catLabel:a}=e,o=oa();return function(e){let[s,c]=(0,u.useState)(null),l=e.usage===null?0:G(e.usage.uncachedInputTokens)+G(e.usage.cacheReadTokens)+G(e.usage.cacheWriteTokens),f=l+(e.usage===null?0:G(e.usage.outputTokens)),p=e.usage===null?null:zt(G(e.usage.cacheReadTokens),l),m=B(e.current,e.breakdown,e.usage??ns),h=f>0?m.filter(e=>e.value>0):m,g=h.map(e=>({key:e.key,color:e.color,label:e.key===`output`?n(`tokens.output`):a(e.key),pct:i(e.value,f),count:e.key===`output`?`${r(e.value)} · ${n(`tokens.outputNote`)}`:`≈`+r(e.value)}));return(0,d.jsxs)(`div`,{className:`lc-card lc-col-donut flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`tokens.title`)}),p!==null&&(0,d.jsxs)(`span`,{className:`lc-card-rate`,title:n(`stats.cacheHitTip`),children:[n(`stats.cacheHit`),` `,p,`%`]})]}),(0,d.jsxs)(`div`,{className:`lc-donut-row flex items-center justify-start gap-3 min-w-0 @max-[320px]/lc-card:gap-2 @max-[240px]/lc-card:flex-wrap`,children:[(0,d.jsx)(t,{segments:h,size:96,centerTop:e.usage===null?`—`:r(f),centerSub:n(`tokens.total`),hoverKey:s,onHoverKey:c}),(0,d.jsx)(o,{rows:g,hoverKey:s,onHoverKey:c})]})]})}}let is=`dsh-context`,as=`dsh-context`;function os(e,t,n,r){let i=e.inject([`sidebarRightTabs`],e=>{let i=e,a=[],o=e=>{typeof e==`function`&&a.push(e)};try{let e=i.sidebarRightTabs;if(e===void 0||typeof e.register!=`function`)return;o(e.register({id:is,kind:as,title:()=>n(`tab`),guide:[{order:20,title:()=>n(`tab`),description:()=>n(`sidebar.guideDescription`),icon:w}]})),o(i.slots.inject(`sidebar.right.pane.tab`,()=>i.slots.register({name:`sidebar.right.pane.tab`,key:is,locale:r},e=>t({...e,host:`sidebar`})))),o(i.slots.inject(`sidebar.right.pane.tab.title`,()=>i.slots.register({name:`sidebar.right.pane.tab.title`,key:is},E(n))))}catch{for(let e of a)e();return}return()=>{for(let e of a)e()}});return()=>{i?.dispose?.()}}let ss=new Map,cs=new Set;function ls(e,t){ss.set(e,t);for(let e of cs)e()}function us(e){return cs.add(e),()=>{cs.delete(e)}}function ds(e){let t=ss.get(e);return t===void 0?null:(ss.delete(e),t)}function fs(e){try{let t=W(e.get(`sidebarRight`));return t===null||typeof t.openTab!=`function`?!1:(t.openTab.call(t,as),!0)}catch{return!1}}function ps(e){let t=document.querySelectorAll(`button[role="tab"]`);for(let n of t)if(n.textContent.trim()===e)return n.getAttribute(`aria-selected`)!==`true`&&n.click(),!0;return!1}let ms=new Map,hs=[`inject`,`compaction`,`prune`,`model`,`mode`];function gs(e,t,n){let{t:r}=t,i=Bn(t),a=Hn(t,i,Vn(t)),o=Pt(t),s=Ho(t,i),c=wo(t),l=To(t,n),f=ta(),p=ho(),m=ts(t,qo(e,p)),h=_a(t,f),g=rs(t,f),_=zo(t),v=Vo(t),y=Dt(t),b=zn(t,i,n),x=vo(e,t,p),S=Un(r);function C(i){let f=i.sessionId,p=i.host===`sidebar`,S=et(i),C=S.data,w=U(i,`contextPressure`,he),T=U(i,`tokenUsage`,_e),E=U(i,`contextBreakdown`,ge),ee=U(i,`contextHeaders`,Se),[te,D]=(0,u.useState)(null),[O,k]=(0,u.useState)(null),[A,j]=(0,u.useState)(null),[M,N]=(0,u.useState)(()=>n.defaultGranularity()),[P,F]=(0,u.useState)(()=>n.defaultTrendMode()),[I,L]=(0,u.useState)(!1),[ne,re]=(0,u.useState)(!1),[R,ie]=(0,u.useState)(()=>n.defaultDurationCurve()===`show`),[z,B]=(0,u.useState)(null),[V,ae]=(0,u.useState)(null),[W,K]=(0,u.useState)(null),[ce,q]=(0,u.useState)(null),[J,ue]=(0,u.useState)([...hs]),de=e=>{ue(t=>t.length===hs.length?[e]:t.includes(e)?t.length===1?[...hs]:t.filter(t=>t!==e):[...t,e])},[fe,pe]=(0,u.useState)(null),Y=(0,u.useCallback)(()=>{pe(null)},[]),me=(0,u.useMemo)(()=>oe(e,typeof f==`string`?f:void 0),[e,f]),ve=Ve(),ye=(0,u.useMemo)(()=>typeof f==`string`&&f!==``&&ve!==void 0?Ge(f):void 0,[f,ve]),be=(0,u.useMemo)(()=>typeof f==`string`&&f!==``&&ve!==void 0?qe(f):void 0,[f,ve]),xe=(0,u.useRef)(null),Ce=(0,u.useRef)(null),we=(0,u.useRef)(null),[Te,Ee]=(0,u.useState)(null),je=(0,u.useCallback)(()=>{Ee(null)},[]),Me=(0,u.useCallback)(e=>{Ee(e===`skills`?{cat:`skill`}:{cat:`assistant`,kind:`answer`});let t=xe.current?.querySelector(`.lc-col-browser`)??null;t!==null&&Uo(t)},[]);(0,u.useLayoutEffect)(()=>{if(typeof f!=`string`||f===``||C===null||we.current===f)return;we.current=f;let e=xe.current===null?null:xe.current.closest(`[data-conversation-scroll]`);e!==null&&(Ce.current=e,e.scrollTop=ms.get(f)??0)},[f,C]),(0,u.useLayoutEffect)(()=>()=>{if(typeof f!=`string`||f===``)return;let e=Ce.current;e!==null&&ms.set(f,e.scrollTop)},[f]);let X=C?C.requests:[],Ne=C?C.events:[],Pe=C?.counts??Ko(X,Ne),Fe={inject:Pe.injects,compaction:Pe.compactions,prune:Pe.prunes},Ie=J.length===hs.length?Ne:Ne.filter(e=>J.includes(e.kind)),Z=(0,u.useMemo)(()=>M===`turn`?At(X):X,[X,M]),Le=(0,u.useMemo)(()=>jt(X),[X]),Re=(0,u.useMemo)(()=>Mt(Z,Ne),[Z,Ne]),ze=(0,u.useMemo)(()=>I&&C!==null?Z.map(e=>at(rt(C,ee,e.seq))):null,[I,C,ee,Z]),Be=(0,u.useCallback)((e,t)=>{pe({step:e,key:t.key,cat:t.cat})},[]);(0,u.useEffect)(()=>{if(typeof f!=`string`||f===``)return;let e=()=>{let e=ds(f);e!==null&&ae(e)};return e(),us(e)},[f]);let He=S.detailState===`ready`||S.detailState===`legacy`;(0,u.useEffect)(()=>{if(V===null||C===null||!He)return;ae(null);let e=Nt(At(X),V);if(e===null)return;N(`turn`),D(e.seq),B(e.turn??0);let t=xe.current?.querySelector(`[data-lc-current]`)??null;t!==null&&Uo(t)},[V,C,X,He]);let Ue=(0,u.useMemo)(()=>C?Ha(C):[],[C]),We=se(i),Ke=(0,u.useMemo)(()=>{let e=new Map;for(let t of We??[])e.set(t.seq,t);return e},[We]),Je=-1;for(let e=0;e<Z.length;e++)Z[e].seq===te&&(Je=e);let Ye=Je>=0?Z[Je]:null,Q=-1;if(O!==null){for(let e=0;e<Z.length;e++)if(Z[e].seq===O){Q=e;break}}Q<0&&(Q=Je),Q<0&&Z.length>0&&(Q=Z.length-1);let $=Q>=0?Z[Q]:null,Xe=null;if($!==null){let e=X.findIndex(e=>e.seq===$.seq);Xe=e+1<X.length?X[e+1].seq:null}let Ze=(0,u.useMemo)(()=>$===null?null:Wa(Ue,Z,Q),[$,Ue,Z,Q]),Qe=(0,u.useCallback)(e=>Ke.get(e),[Ke]),$e=(0,u.useMemo)(()=>C!==null&&C.fileOps!==void 0?co(C.fileOps,C.archive,Xe):po(Ue,Qe,Xe),[C,Ue,Qe,Xe]),tt=(0,u.useMemo)(()=>{let e=(C!==null&&C.fileOps!==void 0?co(C.fileOps,C.archive,null):po(Ue,Qe,null)).totals;return{reads:e.read.ops,writes:e.write.ops,searches:e.search.ops,images:e.image.ops}},[C,Ue,Qe]),nt=(0,u.useMemo)(()=>C?Zo(C.nodes):[],[C]),it=typeof e.get==`function`?De(e,typeof f==`string`?f:void 0):void 0,[ot,st]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let t=!0;return Oe(e).then(e=>{t&&st(e)}),()=>{t=!1}},[e]);let ct=(0,u.useMemo)(()=>ot?ke(e):void 0,[ot,e]),lt=(0,u.useMemo)(()=>Ae(e),[e]),ut=typeof f==`string`?f:void 0,dt=(0,u.useMemo)(()=>lt===void 0?void 0:e=>{let t=ao(e.path,e.form,e.pattern,ut,it);return t!==void 0&&lt(t)},[lt,ut,it]),ft=(0,u.useCallback)(e=>{let t=e.parent??e.seq,n=mo(X,t,e.gone);n!==null&&pe({step:n,key:`n`+String(t),cat:`tool`})},[X]),pt=(0,u.useCallback)((e,t)=>{if($===null)return;let n=t&&Q+1<Z.length?Z[Q+1]:null,r=t?n===null?`live`:n.seq:$.seq;pe({step:r,key:`n`+String(e.seq),cat:e.cat})},[$,Q,Z]);if(!C)return(0,d.jsx)(`div`,{className:`lc-root`,ref:xe,children:S.detailState===`failed`?(0,d.jsx)(y,{state:`failed`,onRetry:S.retryDetail}):(0,d.jsx)(`div`,{className:`lc-empty`,children:r(`loading`)})});let mt=e=>{let t=Z.indexOf(e);return t>=0?Re[t]:void 0},ht=H(C,w,E),gt=r(`files.scopeLatest`);$!==null&&Xe!==null&&(gt=$.stepCount!==void 0&&$.stepCount>1?r(`detail.turn`,{t:$.turn??0,n:$.stepCount}):r(`detail.step`,{t:$.turn??0,s:$.step??0,n:Le($.turn)}));let _t=A;if(_t===null&&O!==null){for(let e of Z)if(e.seq===O){_t=e.turn??null;break}}let vt=W!==null&&W!==`free`?W:null,yt=e.get(`locale`),bt=yt!==void 0&&typeof yt.getLocale==`function`?yt.getLocale().active:`en`,xt=(C.model??``)+(C.provider?` · `+C.provider:``),St=le(C.unsupported),Ct=(0,d.jsx)(a,{head:ht,subtitle:xt,hoverKey:W,onHoverKey:K}),wt=(0,d.jsxs)(`div`,{className:`lc-card`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`trend.title`)}),(0,d.jsxs)(`span`,{className:`lc-gran lc-trend-mods`,role:`group`,children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(I?` lc-gran-on`:``),title:r(`trend.dnaTip`),onClick:()=>{L(e=>!e)},children:r(`trend.dna`)}),(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(ne?` lc-gran-on`:``),title:r(`trend.adaptiveHint`),onClick:()=>{re(e=>!e)},children:r(`trend.adaptive`)}),(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(R?` lc-gran-on`:``),title:r(`trend.durationTip`),onClick:()=>{ie(e=>!e)},children:r(`trend.duration`)})]}),(0,d.jsxs)(`div`,{className:`lc-trend-ctl`,children:[(0,d.jsxs)(`div`,{className:`lc-gran`,children:[(0,d.jsx)(`button`,{className:`lc-gran-btn`+(M===`step`?` lc-gran-on`:``),onClick:()=>{N(`step`)},children:r(`gran.step`)}),(0,d.jsx)(`button`,{className:`lc-gran-btn`+(M===`turn`?` lc-gran-on`:``),onClick:()=>{N(`turn`)},children:r(`gran.turn`)})]}),(0,d.jsxs)(`div`,{className:`lc-gran`,title:r(`gran.modeHint`),children:[(0,d.jsx)(`button`,{className:`lc-gran-btn`+(P===`total`?` lc-gran-on`:``),onClick:()=>{F(`total`)},children:r(`gran.total`)}),(0,d.jsx)(`button`,{className:`lc-gran-btn`+(P===`delta`?` lc-gran-on`:``),onClick:()=>{F(`delta`)},children:r(`gran.delta`)})]})]})]}),Z.length===0?He?(0,d.jsx)(`div`,{className:`lc-empty`,children:r(`trend.empty`)}):(0,d.jsx)(y,{state:S.detailState===`failed`?`failed`:`loading`,onRetry:S.retryDetail}):(0,d.jsxs)(`div`,{children:[(0,d.jsx)(o,{requests:Z,markers:Re,selectedSeq:Ye?Ye.seq:null,hoveredSeq:O,activeTurn:_t,granularity:M,mode:P,focusTurn:z,hoverCat:vt,focusCat:ce,adaptive:ne,durationCurve:R,dna:ze,onPickBand:Be,onSelect:D,onHover:k,onHoverTurn:j,onPickTurn:e=>{N(`turn`),B(e)},onFocusTurnHandled:()=>{B(null)}},f),(0,d.jsx)(s,{request:$,prev:P===`delta`&&Q>=0?Q>0?Z[Q-1]:null:void 0,marker:$===null?void 0:mt($),brief:Ze,convOf:Qe,stepsOf:Le,onLocate:pt,hoverKey:vt})]})]}),Tt=(0,d.jsx)(b,{data:C,headers:ee,convNodes:We,fetchContent:ye,fetchHeader:be,previewSeq:O,pinSeq:Ye===null?null:Ye.seq,hoverKey:W,onHoverKey:K,onOpenCat:q,nodeFocus:fe,onNodeFocusHandled:Y,loadImage:me,detailState:S.detailState,onDetailRetry:S.retryDetail,catFocus:Te,onCatFocusHandled:je,dna:I,onDnaChange:L});return(0,d.jsxs)(`div`,{className:`lc-root`,ref:xe,children:[p?null:(0,d.jsxs)(`div`,{className:`lc-cols lc-head`,children:[(0,d.jsx)(m,{counts:Pe,humanInputs:C.humanInputs,answers:C.answers,toolCalls:C.toolCalls,files:tt,tools:nt,cost:C.cost,locale:bt,sessionId:typeof f==`string`?f:void 0,onFigureClick:Me}),(0,d.jsx)(_,{})]}),(0,d.jsxs)(`div`,{className:`lc-cols lc-head`,children:[(0,d.jsx)(g,{usage:T,current:C.current,breakdown:E}),(0,d.jsx)(h,{timing:C.timing??null,spans:C.spans})]}),(0,d.jsxs)(`div`,{className:`lc-cols lc-cols-main`,children:[(0,d.jsxs)(`div`,{className:`lc-col flex-1 min-w-[min(360px,100%)]`,children:[Ct,wt]}),(0,d.jsx)(`div`,{className:`lc-col lc-col-browser flex-1 min-w-[min(360px,100%)]`,children:Tt})]}),(0,d.jsxs)(`div`,{className:`lc-cols`,children:[(0,d.jsxs)(`div`,{className:`lc-card lc-col flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`events.title`)}),(0,d.jsx)(`div`,{className:`lc-kinds @max-[380px]/lc-card:flex-wrap`,children:hs.map(e=>{let n=Fe[e];return(0,d.jsxs)(`button`,{"data-kind":e,className:`lc-gran-btn`+(J.includes(e)?` lc-gran-on lc-kind-`+e:``),onClick:()=>{de(e)},children:[r(`kind.`+e),n===void 0?null:(0,d.jsx)(`span`,{className:`lc-kind-n`,children:t.fmt(n)})]},e)})})]}),(0,d.jsx)(c,{events:Ie,state:S.detailState,onRetry:S.retryDetail})]}),(0,d.jsx)(l,{activity:$e,scope:gt,workspace:it,onPreview:dt,onOpen:ct,onLocate:ft,state:S.detailState,onRetry:S.retryDetail})]}),(0,d.jsx)(x,{sessionId:typeof f==`string`?f:void 0,self:{head:ht,billed:T===null?null:G(T.uncachedInputTokens)+G(T.outputTokens)+G(T.cacheReadTokens)+G(T.cacheWriteTokens),requests:X.length}}),(0,d.jsx)(`div`,{className:`lc-foot`,children:r(`footer`)}),St!==null&&(0,d.jsx)(v,{sessionId:f,current:St.current,minimum:St.minimum})]})}return function(e){return(0,u.createElement)(S,null,(0,u.createElement)(C,e))}}function _s(e,t){for(let n of e??[])try{if(n.kind!==`assistant`||n.messageId!==t)continue;return typeof n.seq==`number`&&Number.isFinite(n.seq)?n.seq:null}catch{continue}return null}function vs(){return(0,d.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,className:`fill-none`,"aria-hidden":`true`,children:[(0,d.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`2`,rx:`1`,className:`fill-current`}),(0,d.jsx)(`rect`,{x:`2`,y:`7`,width:`8.5`,height:`2`,rx:`1`,className:`fill-current`}),(0,d.jsx)(`rect`,{x:`2`,y:`11`,width:`5.5`,height:`2`,rx:`1`,className:`fill-current`})]})}function ys(e,t){let{t:n}=t;return function(t){let r=se(t),i=t.messageId;if(typeof i!=`string`||i===``)return null;let a=_s(r,i);return(0,d.jsx)(f.Tooltip,{label:n(`jump.title`),side:`bottom`,children:(0,d.jsx)(`button`,{type:`button`,className:`lc-jump hover:bg-(--dsw-alias-interactive-bg-hover) hover:text-(--dsw-alias-label-secondary)`,"aria-label":n(`jump.title`),onClick:()=>{let r=t.sessionId;a!==null&&typeof r==`string`&&r!==``&&ls(r,a),fs(e)||ps(n(`tab`))},children:(0,d.jsx)(vs,{})})})}}function bs(e,t){let n,r,i=e=>typeof e==`function`?e:void 0,a=e=>{let a=e!==`sidebar`,o=e!==`tab`;a&&n===void 0&&(n=i(t.tab())),!a&&n!==void 0&&(n(),n=void 0),o&&r===void 0&&(r=i(t.sidebar())),!o&&r!==void 0&&(r(),r=void 0)};a(e.defaultPlacement());let o=e.store.subscribe(()=>{a(e.defaultPlacement())});return()=>{o(),n?.(),r?.(),n=void 0,r=void 0}}function xs(e){let{eventLabel:t,eventAt:n}=So(e);return{t:e,fmt:Lt,fmtTime:Vt,fmtDuration:Ut,fmtShare:Ht,catLabel:t=>e(`cat.`+t),eventLabel:t,eventAt:n}}let Ss=`dsh-context/tailwind.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ss)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ss,e.textContent=`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
31
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}:root,:host{--spacing:4px;--color-red-500:oklch(63.7% .237 25.331);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-500:oklch(76.9% .188 70.08);--color-green-500:oklch(72.3% .219 149.579);--color-teal-500:oklch(70.4% .14 182.503);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-500:oklch(65.6% .241 354.308);--color-slate-400:oklch(70.4% .04 256.788);--color-neutral-500:oklch(55.6% 0 none);--animate-lc-donut-in:lc-donut-in .45s cubic-bezier(.4, 0, .2, 1) calc(var(--lc-i,0) * 50ms) backwards;--animate-lc-stacked-in:lc-stacked-in .4s cubic-bezier(.4, 0, .2, 1) calc(var(--lc-i,0) * 40ms) backwards;--animate-lc-bar-in:lc-bar-in .35s cubic-bezier(.4, 0, .2, 1) calc(var(--lc-i,0) * 15ms) backwards;--animate-lc-agent-flow:lc-agent-flow .9s linear infinite;--animate-lc-agent-glow:lc-agent-glow 1.8s ease-in-out infinite}.\\@container{container-type:inline-size}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.container{width:100%}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.min-w-0{min-width:0}.min-w-\\[min\\(240px\\,100\\%\\)\\]{min-width:min(240px,100%)}.min-w-\\[min\\(360px\\,100\\%\\)\\]{min-width:min(360px,100%)}.flex-1{flex:1}.flex-\\[3\\]{flex:3}.flex-auto{flex:auto}.shrink{flex-shrink:1}.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-lc-agent-flow{animation:var(--animate-lc-agent-flow)}.animate-lc-agent-glow{animation:var(--animate-lc-agent-glow)}.animate-lc-bar-in{animation:var(--animate-lc-bar-in)}.animate-lc-donut-in{animation:var(--animate-lc-donut-in)}.animate-lc-stacked-in{animation:var(--animate-lc-stacked-in)}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-start{justify-content:flex-start}.gap-3{gap:calc(var(--spacing) * 3)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.border{border-style:var(--tw-border-style);border-width:1px}.fill-\\(--dsw-alias-bg-layer-1\\){fill:var(--dsw-alias-bg-layer-1)}.fill-\\(--dsw-alias-label-primary\\){fill:var(--dsw-alias-label-primary)}.fill-current{fill:currentColor}.fill-none{fill:none}.fill-transparent{fill:#0000}.stroke-\\(--dsw-alias-border-l1\\){stroke:var(--dsw-alias-border-l1)}.stroke-2{stroke-width:2px}.stroke-4{stroke-width:4px}.stroke-9{stroke-width:9px}.stroke-\\[1\\.5px\\]{stroke-width:1.5px}.underline{text-decoration-line:underline}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}@media (hover:hover){.group-hover\\/agent\\:fill-\\[var\\(--dsw-alias-interactive-bg-hover\\,var\\(--dsw-alias-bg-layer-2\\)\\)\\]:is(:where(.group\\/agent):hover *){fill:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))}.group-hover\\/pi\\:underline:is(:where(.group\\/pi):hover *){text-decoration-line:underline}.group-hover\\/tip\\:border-\\(--dsw-alias-label-primary\\):is(:where(.group\\/tip):hover *){border-color:var(--dsw-alias-label-primary)}.group-hover\\/tip\\:text-\\(--dsw-alias-label-primary\\):is(:where(.group\\/tip):hover *){color:var(--dsw-alias-label-primary)}.group-hover\\/tip\\:opacity-100:is(:where(.group\\/tip):hover *){opacity:1}}.group-focus-visible\\/agent\\:fill-\\[var\\(--dsw-alias-interactive-bg-hover\\,var\\(--dsw-alias-bg-layer-2\\)\\)\\]:is(:where(.group\\/agent):focus-visible *){fill:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))}@media (hover:hover){.hover\\:border-\\(--dsw-alias-label-dimmed\\):hover{border-color:var(--dsw-alias-label-dimmed)}.hover\\:border-\\(--dsw-alias-label-primary\\):hover{border-color:var(--dsw-alias-label-primary)}.hover\\:bg-\\(--dsw-alias-bg-layer-2\\):hover{background-color:var(--dsw-alias-bg-layer-2)}.hover\\:bg-\\(--dsw-alias-interactive-bg-hover\\):hover{background-color:var(--dsw-alias-interactive-bg-hover)}.hover\\:bg-\\[var\\(--dsw-alias-interactive-bg-hover\\,var\\(--dsw-alias-bg-layer-2\\)\\)\\]:hover{background-color:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))}.hover\\:text-\\(--dsw-alias-label-primary\\):hover{color:var(--dsw-alias-label-primary)}.hover\\:text-\\(--dsw-alias-label-secondary\\):hover{color:var(--dsw-alias-label-secondary)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\\:brightness-\\[1\\.15\\]:hover{--tw-brightness:brightness(1.15);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:border-\\(--dsw-alias-label-dimmed\\):focus{border-color:var(--dsw-alias-label-dimmed)}@media (hover:hover){.hover\\:enabled\\:bg-\\(--dsw-alias-interactive-bg-hover\\):hover:enabled{background-color:var(--dsw-alias-interactive-bg-hover)}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-50:disabled{opacity:.5}@media (prefers-reduced-motion:reduce){.motion-reduce\\:animate-none{animation:none}}@container lc-card (width<380px){.\\@max-\\[380px\\]\\/lc-card\\:basis-\\[calc\\(100\\%-46px\\)\\]{flex-basis:calc(100% - 46px)}.\\@max-\\[380px\\]\\/lc-card\\:basis-\\[calc\\(100\\%-92px\\)\\]{flex-basis:calc(100% - 92px)}.\\@max-\\[380px\\]\\/lc-card\\:flex-wrap{flex-wrap:wrap}}@container lc-card (width<320px){.\\@max-\\[320px\\]\\/lc-card\\:gap-2{gap:calc(var(--spacing) * 2)}}@container lc-card (width<240px){.\\@max-\\[240px\\]\\/lc-card\\:mx-auto{margin-inline:auto}.\\@max-\\[240px\\]\\/lc-card\\:basis-full{flex-basis:100%}.\\@max-\\[240px\\]\\/lc-card\\:flex-wrap{flex-wrap:wrap}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes lc-donut-in{0%{stroke-dasharray:0 100}}@keyframes lc-stacked-in{0%{transform:scaleX(0)}}@keyframes lc-bar-in{0%{transform:scaleY(0)}}@keyframes lc-agent-flow{to{stroke-dashoffset:-9px}}@keyframes lc-agent-glow{0%,to{opacity:1}50%{opacity:.4}}`,document.head.appendChild(e)}let Cs=`dsh-context/base.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Cs)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Cs,e.textContent=`.lc-root{box-sizing:border-box;height:100%;color:var(--dsw-alias-label-primary);padding:16px 20px 32px;font-size:13px;overflow-y:auto}[data-sidebar-right-open] .lc-root,[data-sidebar-right-float-host] .lc-root{padding:12px}.lc-title-icon{flex:none}.lc-title-label{padding-right:30px}.lc-card{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;margin-bottom:14px;padding:14px 16px}.lc-root .lc-card{box-sizing:border-box;margin-bottom:7px;padding:7px 8px;container:lc-card/inline-size}.lc-root .lc-cols{gap:7px;margin-bottom:7px}.lc-card-title{flex-wrap:wrap;align-items:baseline;gap:8px;margin-bottom:10px;font-weight:600;display:flex}.lc-card-title-text{white-space:nowrap;flex:none}.lc-gran,.lc-kinds{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;gap:2px;margin-left:auto;padding:1px;display:flex}.lc-trend-ctl,.lc-heat-ctl{align-items:center;gap:6px;margin-left:auto;display:flex}.lc-trend-ctl .lc-gran,.lc-heat-ctl .lc-gran,.lc-heat-ctl .lc-card-sub{margin-left:0}.lc-trend-mods{flex:none;margin-left:0}.lc-gran-btn{color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:5px;padding:3px 8px;font-family:inherit;font-size:11px;line-height:1}.lc-gran-btn:hover{color:var(--dsw-alias-label-primary)}.lc-gran-btn:disabled{opacity:.4;cursor:not-allowed}.lc-gran-btn:disabled:hover{color:var(--dsw-alias-label-secondary)}.lc-gran-on,.lc-gran-on:hover{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.lc-kind-n{font-variant-numeric:tabular-nums;opacity:.65;margin-left:4px}.lc-gran-on .lc-kind-n{opacity:.85}.lc-tip{z-index:6;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);width:max-content;color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-shadow-lv3,0 2px 8px #0000002e);pointer-events:none;opacity:0;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;padding:6px 10px;font-size:12px;position:absolute}.lc-events,.lc-fa-list{flex-direction:column;gap:2px;height:320px;display:flex;overflow-y:auto}.lc-cols{flex-wrap:wrap;gap:14px;margin-bottom:14px;display:flex}.lc-cols>.lc-card,.lc-col>.lc-card:last-child{margin-bottom:0}.lc-col-browser{flex-direction:column;display:flex}.lc-col-browser>.lc-card{flex:1}.lc-head>.lc-card:has(.lc-stats){flex-direction:column;display:flex}.lc-head .lc-stats{flex:1}.lc-empty{color:var(--dsw-alias-label-secondary);text-align:center;padding:18px 0}.lc-error{flex-direction:column;align-items:center;gap:8px;padding:40px 16px;display:flex}.lc-error-msg{font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);overflow-wrap:anywhere;border-radius:6px;max-width:100%;padding:4px 8px;font-size:12px}.lc-error-retry{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;padding:4px 14px;font-size:12px}.lc-foot{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:12px}[data-conversation-scroll]:has(.lc-root)>[data-composer-seat]:not(:has([data-approval-key],[data-question-key],[data-plan-review-key])),[data-conversation-scroll]:has(.lc-root,.lc-modal-backdrop)~[data-width-handle]{display:none}`,document.head.appendChild(e)}let ws=`dsh-context/stats.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(ws)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=ws,e.textContent=`.lc-stat{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;flex-direction:column;gap:2px;min-width:0;padding:6px;display:flex}.lc-stat-label{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;font-weight:600;overflow:hidden}.lc-stat-value{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;text-align:center;font-size:14px;font-weight:600;overflow:hidden}.lc-stat-sub{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.lc-stat-tipped{position:relative}.lc-stat-q{text-align:center;width:11px;height:11px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);cursor:help;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:50%;margin-left:4px;font-size:9px;font-style:normal;font-weight:700;line-height:11px;display:inline-block}.lc-stat-tip{max-width:280px;font-weight:400;line-height:1.5;top:calc(100% + 6px);left:0}.lc-stat-tip-prices{border-top:1px dashed var(--dsw-alias-border-l1);margin-top:5px;padding-top:5px;display:block}.lc-stat-tip-head{font-weight:600;display:block}.lc-card-rate{font-variant-numeric:tabular-nums;cursor:default;flex:none;margin-left:auto;font-size:12px;font-weight:400;line-height:18px}.lc-stat-tip-row{margin-top:2px;display:block}.lc-stat-tip-band{justify-content:space-between;gap:2rem;display:flex}.lc-stat-tip-band i{font-style:normal}.lc-stat-tip-by{color:var(--dsw-alias-label-secondary);margin-top:3px;display:block}.lc-card-sub{color:var(--dsw-alias-label-secondary);margin-left:auto;font-size:12px;font-weight:400}.lc-overview-num{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.lc-overview-num>b{font-size:20px}.lc-overview-num span{color:var(--dsw-alias-label-secondary)}.lc-overview-pct{margin-left:auto;font-size:11px}.lc-overview-pct b{color:var(--dsw-alias-label-primary);margin-right:4px;font-size:20px}.lc-col-donut{flex-direction:column;display:flex}.lc-col-donut .lc-donut-row{flex:1}.lc-donut{flex:none;position:relative}.lc-donut svg{display:block}.lc-donut-track{stroke:color-mix(in srgb, var(--color-neutral-500) 18%, transparent)}.lc-donut-seg{transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-donut-dim .lc-donut-seg{opacity:.35}.lc-donut-dim .lc-donut-seg-on{opacity:1}.lc-donut-center{pointer-events:none;text-align:center;box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:0 7px;display:flex;position:absolute;inset:0}.lc-donut-center b{white-space:nowrap;text-overflow:ellipsis;max-width:100%;line-height:1.15;overflow:hidden}.lc-donut-center span{color:var(--dsw-alias-label-secondary);white-space:nowrap}.lc-sl{grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr));gap:4px 8px;min-width:0;display:grid;overflow:hidden}.lc-sl-row{min-width:0;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;flex-direction:column;gap:1px;margin:0 -6px;padding:1px 6px;font-size:12px;display:flex}.lc-sl-row-on{background:var(--dsw-alias-interactive-bg-hover)}.lc-sl-row-dim{opacity:.55}.lc-sl-main{align-items:center;gap:6px;min-width:0;display:flex}.lc-sl-dot{border-radius:2px;flex:none;width:8px;height:8px}.lc-sl-label{white-space:nowrap;text-overflow:ellipsis;flex:auto;min-width:0;font-weight:600;line-height:1.25;overflow:hidden}.lc-sl-pct{text-align:right;font-variant-numeric:tabular-nums;flex:none;min-width:30px;font-weight:700}.lc-sl-sub{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;margin-left:14px;font-size:11px;line-height:1.3;overflow:hidden}.lc-pi-grid{grid-template-columns:1fr;gap:8px;display:grid}.lc-pi-row-btn{appearance:none;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;width:100%;padding:0}.lc-pi-row{min-width:0;color:inherit;flex-direction:row;justify-content:space-between;align-items:baseline;gap:12px;text-decoration:none;display:flex}.lc-pi-hint{text-decoration:none}.lc-pi-update{color:var(--dsw-alias-state-warn-primary);white-space:nowrap;margin-left:6px;font-size:11px}.lc-pi-label{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;flex:none;font-size:11px;font-weight:600;overflow:hidden}.lc-pi-labelicon{vertical-align:-2px;margin-right:4px;display:inline-block}.lc-pi-value{min-width:0;color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;text-align:right;font-size:13px;font-weight:600;overflow:hidden}.lc-flow{align-items:stretch;display:flex;position:relative}.lc-flow-svg{pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.lc-flow-ribbon{fill:none;stroke-width:14px;stroke-opacity:.13;stroke-linecap:round}.lc-flow-dash{fill:none;stroke-width:1.5px;stroke-opacity:.55;stroke-linecap:round;stroke-dasharray:2 7}.lc-flow-col{z-index:1;flex-direction:column;flex:1 1 0;justify-content:center;gap:8px;min-width:0;display:flex;position:relative}.lc-flow-mid{z-index:1;justify-content:center;align-items:center;margin:0 30px;display:flex;position:relative}.lc-flow-node{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;flex-direction:column;gap:2px;min-width:0;padding:6px 10px;display:flex}.lc-flow-head{align-items:baseline;gap:6px;min-width:0;display:flex}a.lc-flow-head{color:inherit;cursor:pointer;text-decoration:none}a.lc-flow-head:hover .lc-flow-label{color:var(--dsw-alias-label-primary)}.lc-flow-label{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;font-weight:600;overflow:hidden}.lc-flow-total{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;flex:none;margin-left:auto;font-size:13px;font-weight:700}.lc-flow-pills{flex-wrap:wrap;gap:4px;margin-top:4px;display:flex}.lc-flow-pill{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;align-items:center;gap:5px;padding:2px 8px;font-size:11px;display:inline-flex}.lc-flow-pill-label{text-overflow:ellipsis;min-width:0;max-width:140px;overflow:hidden}.lc-flow-pill b{color:var(--dsw-alias-label-primary);font-weight:700}.lc-flow-pill-tint b{color:inherit}.lc-flow-pill-dim{opacity:.45}.lc-flow-rows{flex-direction:column;gap:3px;margin-top:4px;display:flex}.lc-flow-row{color:var(--dsw-alias-label-secondary);align-items:baseline;gap:6px;min-width:0;font-size:11px;display:flex}.lc-flow-row-label{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.lc-flow-pair{font-variant-numeric:tabular-nums;flex:none;align-items:baseline;gap:5px;margin-left:auto;display:inline-flex}.lc-flow-pair b{color:var(--dsw-alias-label-primary);font-weight:700}.lc-flow-pair i{opacity:.55;font-style:normal}.lc-flow-team{cursor:pointer}.lc-flow-team:hover{border-color:var(--dsw-alias-label-secondary)}.lc-flow-self{background:var(--dsw-alias-bg-layer-1);border-color:color-mix(in srgb, var(--dsw-alias-brand-primary) 40%, transparent);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, transparent);align-items:center;gap:6px;padding:8px 14px}.lc-flow-self-stats{align-self:stretch;gap:16px;display:flex}.lc-flow-kv{flex-direction:column;flex:1;align-items:center;min-width:0;display:flex}.lc-flow-kv-btn{cursor:pointer;border-radius:6px}.lc-flow-kv-btn:hover{background:var(--dsw-alias-bg-layer-2)}.lc-flow-kv-btn:hover i{color:var(--dsw-alias-label-primary)}.lc-flow-kv-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.lc-flow-kv b{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:17px;font-weight:700;line-height:1.2}.lc-flow-kv i{color:var(--dsw-alias-label-secondary);font-size:11px;font-style:normal}.lc-flow .lc-flow-col-r .lc-stat-tip{left:auto;right:0}@container lc-card (width<=559px){.lc-flow{flex-direction:column}.lc-flow-col{flex-direction:row;align-items:stretch}.lc-flow-col>.lc-flow-node{flex:1 1 0}.lc-flow-mid{margin:26px 0}}.lc-tstrip{margin-top:10px}.lc-tstrip-wrap{position:relative}.lc-tstrip-bar{background:color-mix(in srgb, var(--color-neutral-500) 18%, transparent);border-radius:4px;width:100%;height:12px;position:relative;overflow:hidden}.lc-tstrip-seg{transform-origin:0;height:100%;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);position:absolute;top:0}.lc-tstrip-seg-on{filter:brightness(1.18)}.lc-tstrip-dim .lc-tstrip-seg{opacity:.35}.lc-tstrip-dim .lc-tstrip-seg-on{opacity:1}.lc-tstrip-axis{height:13px;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;margin-top:5px;font-size:10px;line-height:13px;position:relative}.lc-tstrip-tick{white-space:nowrap;position:absolute;transform:translate(-50%)}.lc-tstrip-tick:before{content:"";background:var(--dsw-alias-border-l1);width:1px;height:3px;position:absolute;top:-4px;left:50%}.lc-tstrip-tick-first{transform:none}.lc-tstrip-tick-first:before{left:0}.lc-tstrip-tick-last{transform:translate(-100%)}.lc-tstrip-tick-last:before{left:auto;right:0}`,document.head.appendChild(e)}let Ts=`dsh-context/jump.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ts)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ts,e.textContent=`.lc-jump{width:calc(28px + var(--dsh-content-font-delta,0px));height:calc(28px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-tertiary);cursor:pointer;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}.lc-jump svg{width:calc(16px + var(--dsh-content-font-delta,0px));height:calc(16px + var(--dsh-content-font-delta,0px))}`,document.head.appendChild(e)}let Es=`dsh-context/settings.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Es)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Es,e.textContent=`.lc-settings-prefs{padding:4px 0}.lc-settings-row{align-items:center;gap:8px;padding:8px 0;display:flex}.lc-settings-label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:14px}.lc-settings-select{background:var(--dsw-alias-bg-module-platform);height:36px;font:inherit;color:var(--dsw-alias-label-primary);cursor:pointer;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border:none;border-radius:18px;align-items:center;gap:12px;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.lc-settings-note{color:var(--dsw-alias-label-tertiary);margin:12px 0 4px;font-size:12px;line-height:1.5}`,document.head.appendChild(e)}let Ds=`dsh-context/stackedBar.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ds)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ds,e.textContent=`.lc-stacked-wrap{width:100%;position:relative}.lc-stacked{background:color-mix(in srgb, var(--color-neutral-500) 18%, transparent);border-radius:5px;width:100%;display:flex;position:relative;overflow:hidden}.lc-occupied-box{border:2px solid var(--dsw-alias-label-tertiary);box-sizing:border-box;pointer-events:none;opacity:0;box-shadow:0 0 0 1px var(--dsw-alias-bg-layer-2);transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:5px;position:absolute;top:0;bottom:0;left:0}.lc-occupied-box-on{opacity:1}.lc-bar-tip{z-index:5;white-space:nowrap;padding:3px 8px;bottom:calc(100% + 6px);transform:translate(-50%)}.lc-bar-tip-on{opacity:1}.lc-stacked>div{height:100%}.lc-stacked-seg-pick{cursor:pointer}.lc-stacked-seg{transition:filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-stacked-free{box-sizing:border-box;transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-stacked-seg,.lc-stacked-free{transform-origin:0}.lc-stacked-seg-on{filter:brightness(1.18)}.lc-reserve{z-index:1;pointer-events:auto;cursor:help;background:repeating-linear-gradient(45deg, color-mix(in srgb, var(--dsw-alias-state-warn-primary) 24%, transparent) 0 5px, transparent 5px 10px);position:absolute;top:0;bottom:0}.lc-stacked-free-on{border:2px dashed var(--dsw-alias-label-secondary);border-radius:3px}.lc-stacked-dim .lc-stacked-seg{opacity:.35}.lc-stacked-dim .lc-stacked-seg-on{opacity:1}.lc-stacked-dim .lc-stacked-free{opacity:.35}.lc-stacked-dim .lc-stacked-free-on{opacity:1}.lc-legend{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:6px 14px;margin-top:10px;display:grid}.lc-chip{min-width:0;color:var(--dsw-alias-label-primary);cursor:pointer;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;align-items:center;gap:5px;padding:1px 6px;display:flex}.lc-chip-label{white-space:nowrap;text-overflow:ellipsis;min-width:0;font-weight:600;overflow:hidden}.lc-chip-nums{white-space:nowrap;flex:none;align-items:baseline;gap:6px;margin-left:auto;display:inline-flex}.lc-chip i,.lc-detail-row i{border-radius:2px;width:8px;height:8px;display:inline-block}.lc-chip i{transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-chip em{color:var(--dsw-alias-label-secondary);font-style:normal}.lc-chip-on{background:var(--dsw-alias-interactive-bg-hover);font-weight:600}.lc-chip-on i{box-shadow:0 0 0 1px var(--dsw-alias-brand-primary)}`,document.head.appendChild(e)}let Os=`dsh-context/trendChart.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Os)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Os,e.textContent=`.lc-chartrow{align-items:stretch;gap:6px;display:flex}.lc-axis{box-sizing:border-box;width:40px;height:150px;color:var(--dsw-alias-label-secondary);padding-top:18px;font-size:11px;position:relative}.lc-axis span{line-height:1;position:absolute;right:0}.lc-axis-r{flex:none;width:34px}.lc-axis-r span{left:0;right:auto}.lc-axis-top{top:13px}.lc-axis-q3{top:41px}.lc-axis-mid{top:69px}.lc-axis-q1{top:97px}.lc-axis-bot{top:125px}.lc-chart-wrap{flex:1;min-width:0;position:relative}.lc-chart-scroll{overscroll-behavior-x:contain;scrollbar-gutter:stable;padding-bottom:var(--dsh-scrollbar-width,8px);overflow:auto hidden}.lc-chart{box-sizing:border-box;align-items:flex-end;gap:2px;width:max-content;min-width:100%;height:130px;padding:18px 2px 0;display:flex;position:relative}.lc-grid{border-top:1px dashed var(--dsw-alias-border-l2);pointer-events:none;position:absolute;left:0;right:0}.lc-grid-top{top:18px}.lc-grid-q3{top:46px}.lc-grid-mid{top:74px}.lc-grid-q1{top:102px}.lc-grid-zero{border-top-style:solid;border-top-color:color-mix(in srgb, var(--color-neutral-500) 50%, transparent);top:130px}.lc-bar{cursor:pointer;outline-offset:1px;width:14px;height:100%;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), outline-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:2px;outline:1px dashed #0000;flex:none;align-items:flex-end;display:flex;position:relative}.lc-chart-dim .lc-bar{opacity:.35}.lc-chart-dim .lc-bar-in-turn{opacity:1}.lc-chart-dim .lc-turn{opacity:.35}.lc-chart-dim .lc-turn-on{opacity:1}.lc-chart-tip{z-index:5;box-sizing:border-box;overflow-wrap:break-word;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);max-width:100%;color:var(--dsw-alias-label-primary);pointer-events:none;border-radius:6px;flex-direction:column;gap:2px;padding:3px 8px;font-size:12px;display:flex;position:absolute;bottom:calc(100% + 4px);left:0;box-shadow:0 2px 8px #0000002e}.lc-chart-tip span+span{color:var(--dsw-alias-label-secondary)}.lc-bar-hovered{outline-color:var(--dsw-alias-brand-primary)}.lc-bar-selected{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.lc-bar-in-turn{background:color-mix(in srgb, var(--color-neutral-500) 14%, transparent)}.lc-bar-stack{flex-direction:column-reverse;width:100%;display:flex}.lc-bar-stack>div{width:100%}.lc-bar-dna{border-radius:2px;width:100%}.lc-bar-stack,.lc-bar-up,.lc-bar-down,.lc-bar-dna{transform-origin:50% 100%}.lc-bar-down{transform-origin:50% 0}.lc-bar-stack>div:first-child{border-radius:0 0 2px 2px}.lc-bar-stack>div:last-child{border-radius:2px 2px 0 0}.lc-bar-stack>div:only-child{border-radius:2px}.lc-bar-up,.lc-bar-down{width:100%;display:flex;position:absolute;left:0}.lc-bar-up{flex-direction:column-reverse}.lc-bar-down{flex-direction:column}.lc-bar-up>div,.lc-bar-down>div{width:100%}.lc-bar-up>div:last-child{border-radius:2px 2px 0 0}.lc-bar-down>div:last-child{border-radius:0 0 2px 2px}.lc-cat-seg{transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-chart[data-catdim] .lc-cat-seg{opacity:.35}.lc-chart[data-catdim=system] .lc-cat-seg[data-cat=system],.lc-chart[data-catdim=tools] .lc-cat-seg[data-cat=tools],.lc-chart[data-catdim=user] .lc-cat-seg[data-cat=user],.lc-chart[data-catdim=inject] .lc-cat-seg[data-cat=inject],.lc-chart[data-catdim=skill] .lc-cat-seg[data-cat=skill],.lc-chart[data-catdim=assistant] .lc-cat-seg[data-cat=assistant],.lc-chart[data-catdim=tool] .lc-cat-seg[data-cat=tool]{opacity:1}.lc-dna-hl{z-index:1;pointer-events:none;align-items:stretch;gap:2px;display:flex;position:absolute;inset:18px 2px 0}.lc-dna-cell{flex:none;width:14px;position:relative}.lc-dna-slice{box-sizing:border-box;border:1px solid var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 26%, transparent);border-radius:1px;width:100%;position:absolute;left:0}.lc-duration{z-index:1;pointer-events:none;position:absolute;top:18px;left:2px;overflow:visible}.lc-duration polyline,.lc-duration circle{fill:none;stroke:var(--dsw-alias-label-tertiary);stroke-width:1.25px;stroke-linejoin:round;stroke-linecap:round}.lc-duration circle{fill:var(--dsw-alias-label-tertiary)}.lc-duration .lc-dur-halo{stroke:var(--dsw-alias-bg-layer-1);stroke-width:3px;opacity:.85}.lc-duration circle.lc-dur-halo{stroke:none;fill:var(--dsw-alias-bg-layer-1)}.lc-chart-dim .lc-duration{opacity:.35}.lc-bar-marker{z-index:2;color:var(--dsw-alias-state-warn-primary);font-size:11px;position:absolute;top:-16px;left:50%;transform:translate(-50%)}.lc-step-flag{z-index:2;background:color-mix(in srgb, var(--color-neutral-500) 45%, transparent);pointer-events:none;width:1px;position:absolute;top:-17px;bottom:0;right:-1px}.lc-step-flag-label{box-sizing:border-box;border:1px solid color-mix(in srgb, var(--color-neutral-500) 45%, transparent);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:3px;padding:1px 3px;font-size:9px;font-weight:600;line-height:1;position:absolute;top:0;right:0}.lc-turns{box-sizing:border-box;gap:2px;width:max-content;min-width:100%;margin-top:4px;padding:0 2px;display:flex;overflow:hidden}.lc-turn{box-sizing:border-box;text-align:center;color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;height:14px;transition:filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:3px;flex:none;font-size:10px;font-weight:600;line-height:14px}.lc-turn-on{filter:brightness(1.35);color:var(--dsw-alias-label-primary)}.lc-turn-label{display:inline-block}`,document.head.appendChild(e)}let ks=`dsh-context/requestDetail.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(ks)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=ks,e.textContent=`.lc-detail{border-top:1px solid var(--dsw-alias-border-l1);margin-top:12px;padding-top:12px}.lc-detail-head{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:6px 8px;margin-bottom:10px;display:flex}.lc-detail-head b{color:var(--dsw-alias-label-primary);font-size:13px}.lc-detail-time{font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:auto;font-size:12px}.lc-detail-marker{color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent);border-radius:6px;padding:1px 7px;font-size:11px}.lc-detail-tag{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);border-radius:4px;padding:0 6px;font-size:11px}.lc-detail-metric{font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-secondary) 14%, transparent);border-radius:6px;padding:2px 8px;font-size:12px;font-weight:600}.lc-detail-metric-up{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 15%, transparent)}.lc-detail-metric-down{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 15%, transparent)}.lc-detail-rows{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:4px 24px;margin-top:10px;display:grid}.lc-brief{flex-direction:column;gap:2px;min-height:76px;margin:-4px 0 10px;display:flex}.lc-brief-row{min-width:0;color:var(--dsw-alias-label-primary);text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:6px;align-items:center;gap:8px;margin-left:-6px;margin-right:-6px;padding:3px 6px;font-family:inherit;font-size:12px;line-height:1.5;display:flex}button.lc-brief-row-link{cursor:pointer}.lc-brief-tag{box-sizing:border-box;text-align:center;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);min-width:56px;color:var(--dsw-alias-label-secondary);border-radius:4px;flex:none;padding:0 6px;font-size:11px;position:relative}.lc-brief-tip{white-space:normal;text-align:left;max-width:240px;font-weight:400;line-height:1.5;bottom:calc(100% + 6px);left:0}.lc-brief-text{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.lc-brief-empty{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-tertiary);flex:1;overflow:hidden}.lc-brief-fact{box-sizing:border-box;text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);max-width:160px;color:var(--dsw-alias-label-secondary);border-radius:4px;flex:none;padding:0 6px;font-size:11px;overflow:hidden}.lc-brief-chip{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);min-width:0;max-width:260px;color:var(--dsw-alias-label-primary);transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:5px;align-items:center;gap:5px;padding:0 7px;font-size:12px;display:inline-flex;overflow:hidden}.lc-brief-chip-grow{flex:1;max-width:none}.lc-brief-chip-tag{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);max-width:120px;color:var(--dsw-alias-label-secondary);border-radius:4px;flex:none;padding:0 6px;font-size:11px;overflow:hidden}.lc-brief-chip-text{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.lc-brief-chip-link{cursor:pointer}.lc-brief-more{color:var(--dsw-alias-label-secondary);flex:none;font-size:11px}.lc-detail-row{transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:4px;align-items:center;gap:8px;margin:-1px -4px;padding:1px 4px;display:flex}.lc-detail-row i{transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-detail-row-on{background:var(--dsw-alias-interactive-bg-hover)}.lc-detail-row-on i{box-shadow:0 0 0 1px var(--dsw-alias-brand-primary)}.lc-detail-row-on .lc-detail-label{font-weight:600}.lc-detail-label{white-space:nowrap;min-width:70px;color:var(--dsw-alias-label-secondary)}.lc-bar-track{background:color-mix(in srgb, var(--color-neutral-500) 18%, transparent);border-radius:3px;flex:1;height:5px;display:block;position:relative;overflow:hidden}.lc-bar-fill{border-radius:3px;height:100%;display:block}.lc-bar-zero{border-left:1px solid color-mix(in srgb, var(--color-neutral-500) 45%, transparent);position:absolute;top:0;bottom:0;left:50%}.lc-bar-fill-up,.lc-bar-fill-down{height:100%;display:block;position:absolute;top:0}.lc-bar-fill-up{border-radius:0 3px 3px 0;left:50%}.lc-bar-fill-down{border-radius:3px 0 0 3px;right:50%}.lc-detail-num{text-align:right;font-variant-numeric:tabular-nums;width:52px}.lc-detail-num-up{color:var(--dsw-alias-state-success-primary)}.lc-detail-num-down{color:var(--dsw-alias-state-error-primary)}.lc-detail-pct{text-align:right;width:34px;color:var(--dsw-alias-label-secondary)}`,document.head.appendChild(e)}let As=`dsh-context/events.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(As)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=As,e.textContent=`.lc-event{align-items:center;gap:8px;padding:3px 0;display:flex}.lc-event-icon{text-align:center;width:18px;color:var(--dsw-alias-state-warn-primary)}.lc-event-icon.lc-event-inject{color:var(--color-purple-500)}.lc-event-icon.lc-event-model{color:var(--dsw-alias-brand-primary)}.lc-event-icon.lc-event-mode{color:var(--dsw-alias-label-secondary)}.lc-kind{white-space:nowrap;border-radius:4px;flex:none;padding:1px 6px;font-size:10px;font-weight:600}.lc-kind-inject{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 15%, transparent);color:var(--dsw-alias-state-success-primary)}.lc-kind-compaction{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 15%, transparent);color:var(--dsw-alias-state-error-primary)}.lc-kind-prune{background:color-mix(in srgb, var(--color-violet-500) 15%, transparent);color:var(--color-violet-500)}.lc-kind-model{background:color-mix(in srgb, var(--dsw-alias-brand-primary) 15%, transparent);color:var(--dsw-alias-brand-primary)}.lc-kind-mode{background:color-mix(in srgb, var(--dsw-alias-label-secondary) 15%, transparent);color:var(--dsw-alias-label-secondary)}.lc-event-label{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.lc-event-at{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px}.lc-event-tokens{color:var(--dsw-alias-state-success-primary);white-space:nowrap;font-weight:600}.lc-event-tokens.lc-up{color:var(--dsw-alias-state-warn-primary)}.lc-event-time{color:var(--dsw-alias-label-secondary);font-size:12px}`,document.head.appendChild(e)}let js=`dsh-context/fileCard.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(js)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=js,e.textContent=`.lc-fa-ctl,.lc-br-toolctl{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px;display:flex}.lc-fa-ctl .lc-gran{margin-left:0}.lc-fa-n{opacity:.75;margin-left:4px;font-weight:700}.lc-fa-search,.lc-br-tool-search,.lc-find-input{min-width:80px;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;outline:none;flex:1;padding:3px 8px;font-size:12px}.lc-fa-meta{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:6px;font-size:12px;display:flex}.lc-fa-meta .lc-fa-sort{flex:none}.lc-fa-meta-delta{position:relative}.lc-fa-meta-tip{white-space:normal;max-width:260px;line-height:1.5;top:calc(100% + 6px);left:0}.lc-fa-item{transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border:1px solid #0000;border-radius:8px}.lc-fa-item-on{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-border-l2)}.lc-fa-row{width:100%;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:7px;align-items:center;gap:7px;padding:6px 8px;font-size:12px;display:flex}.lc-fa-form{opacity:.85;flex:none;justify-content:center;align-items:center;width:20px;height:14px;font-size:11px;display:flex}.lc-fa-lang{border-radius:4px;justify-content:center;align-items:center;min-width:16px;height:13px;padding:0 2px;font-size:8px;font-weight:700;line-height:1;display:inline-flex}.lc-fa-row .lc-br-chev{margin-right:-2px}.lc-fa-path{word-break:break-all;min-width:0}.lc-fa-file{cursor:pointer}.lc-fa-path em{color:var(--dsw-alias-label-secondary);font-style:normal}.lc-fa-badge{font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;flex:none;align-items:center;gap:4px;padding:1px 7px;font-size:11px;font-weight:600;display:inline-flex}.lc-fa-badge i{background:currentColor;border-radius:50%;width:5px;height:5px;display:inline-block}.lc-fa-b-read{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent)}.lc-fa-b-write{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 14%, transparent)}.lc-fa-b-search{color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent)}.lc-fa-chip-read,.lc-fa-chip-read:hover{color:var(--dsw-alias-brand-primary)}.lc-fa-chip-write,.lc-fa-chip-write:hover{color:var(--dsw-alias-state-success-primary)}.lc-fa-chip-search,.lc-fa-chip-search:hover{color:var(--dsw-alias-state-warn-primary)}.lc-fa-chip-read.lc-gran-on,.lc-fa-chip-read.lc-gran-on:hover{background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent);color:var(--dsw-alias-brand-primary)}.lc-fa-chip-write.lc-gran-on,.lc-fa-chip-write.lc-gran-on:hover{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 14%, transparent);color:var(--dsw-alias-state-success-primary)}.lc-fa-chip-search.lc-gran-on,.lc-fa-chip-search.lc-gran-on:hover{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent);color:var(--dsw-alias-state-warn-primary)}.lc-fa-delta{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;gap:5px;font-size:11px;font-weight:600;display:inline-flex}.lc-fa-up{color:var(--dsw-alias-state-success-primary)}.lc-fa-down{color:var(--dsw-alias-state-error-primary)}.lc-fa-time{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.lc-fa-ops{border-left:2px solid var(--dsw-alias-border-l1);flex-direction:column;gap:1px;margin:0 8px 8px 15px;padding:2px 0 2px 10px;display:flex}.lc-fa-op{min-width:0;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:5px;align-items:center;gap:8px;padding:3px 6px;font-size:11px;display:flex}.lc-fa-op-link{cursor:pointer}.lc-fa-op-time{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;margin-left:auto}.lc-fa-op-tool{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);max-width:220px;color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:0 6px;font-size:11px;overflow:hidden}.lc-fa-op-detail{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary);flex:1;overflow:hidden}.lc-fa-read{color:var(--dsw-alias-brand-primary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;font-weight:600}`,document.head.appendChild(e)}let Ms=`dsh-context/modal.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ms)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ms,e.textContent=`.lc-modal-backdrop{z-index:200;background:var(--dsw-alias-bg-mask-1,#00000073);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.lc-modal-card{box-sizing:border-box;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);width:min(720px,100% - 48px);max-height:min(82vh,760px);box-shadow:var(--dsw-shadow-lv3,0 12px 32px #0006);color:var(--dsw-alias-label-primary);border-radius:12px;padding:16px 18px 18px;font-size:13px;overflow-y:auto}.lc-modal-head{align-items:baseline;gap:8px;margin-bottom:12px;display:flex}.lc-modal-title{font-size:14px;font-weight:600}.lc-modal-close{color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:6px;margin-left:auto;padding:2px 6px;font-family:inherit;font-size:18px;line-height:1}.lc-gate-card{width:min(440px,100vw - 48px)}.lc-gate-body{color:var(--dsw-alias-label-secondary);line-height:1.7}.lc-gate-versions{gap:24px;margin-top:14px;display:flex}.lc-gate-version{flex-direction:column;gap:2px;display:flex}.lc-gate-version-label{color:var(--dsw-alias-label-secondary);font-size:11px}.lc-gate-version-value{font-weight:600;font-family:var(--dsw-font-family-mono,monospace);color:var(--dsw-alias-label-primary)}.lc-gate-or-newer{color:var(--dsw-alias-label-secondary);margin-left:6px;font-family:inherit;font-size:11px;font-weight:400}.lc-gate-actions{justify-content:flex-end;margin-top:16px;display:flex}.lc-gate-ok{cursor:pointer;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);transition:filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border:0;border-radius:6px;padding:6px 16px;font-family:inherit;font-size:12px}`,document.head.appendChild(e)}let Ns=`dsh-context/browser.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ns)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ns,e.textContent=`.lc-br-dna-ctl{flex:none;margin-left:0}.lc-br-bar-dna .lc-stacked-seg{background-image:linear-gradient(to right, transparent calc(100% - min(.5px, 12.5%)), var(--dsw-alias-bg-layer-1) 0)}.lc-br-pick{font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;max-width:240px;padding:3px 6px;font-size:12px}.lc-br-meta{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:6px 16px;margin-bottom:8px;display:flex}.lc-br-meta b{color:var(--dsw-alias-label-primary)}.lc-br-meta .lc-est{margin-left:auto}.lc-br-note{color:var(--dsw-alias-label-secondary);margin-top:8px;font-size:12px}.lc-br-retry{color:var(--dsw-alias-brand-primary);font:inherit;cursor:pointer;text-underline-offset:2px;transition:filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;padding:0;font-size:12px;text-decoration:underline}.lc-br-cats{flex-direction:column;gap:4px;margin-top:10px;display:flex}.lc-br-cat{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:8px;overflow:hidden}.lc-br-cat-empty{opacity:.55}.lc-br-cat-row{width:100%;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;align-items:center;gap:8px;padding:7px 10px;display:flex}.lc-br-cat-on{background:var(--dsw-alias-interactive-bg-hover)}.lc-br-cat-on i{box-shadow:0 0 0 1px var(--dsw-alias-brand-primary)}.lc-br-cat-open{background:var(--dsw-alias-interactive-bg-hover)}.lc-br-cat-row i{width:8px;height:8px;transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:2px;flex:none;display:inline-block}.lc-br-cat-label{font-weight:600}.lc-br-cat-count{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:12px}.lc-br-count-grp{flex:1;align-items:center;gap:4px;min-width:0;display:inline-flex}.lc-br-chev{width:12px;height:14px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:flex}.lc-br-chev:before{content:"";width:5px;height:5px;transition:transform var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-bottom:1px solid;border-right:1px solid;transform:rotate(-45deg)}.lc-br-chev-on:before{transform:rotate(45deg)}.lc-br-tokens{color:var(--dsw-alias-label-secondary);flex:none;font-size:12px}.lc-br-delta,.lc-br-tdelta{white-space:nowrap;border-radius:4px;flex:none;padding:0 5px;font-size:11px;font-weight:600}.lc-br-delta-up,.lc-br-tdelta-up{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 15%, transparent)}.lc-br-delta-down,.lc-br-tdelta-down{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 15%, transparent)}.lc-br-tokens-grp{flex:none;align-items:center;gap:4px;min-width:0;display:inline-flex}.lc-br-pct{text-align:right;width:36px;color:var(--dsw-alias-label-secondary);flex:none;font-size:12px}.lc-br-body{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:2px;padding:4px 6px;display:flex}.lc-br-elem{border-radius:6px}.lc-br-elem-on{background:var(--dsw-alias-interactive-bg-active)}.lc-br-elem-row{width:100%;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:6px;align-items:center;gap:8px;padding:5px 6px;font-size:12px;display:flex}.lc-br-err-dot{background:var(--dsw-alias-state-error-primary);width:6px;height:6px;box-shadow:0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);border-radius:50%;flex:none}.lc-br-tag{min-width:0;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);text-overflow:ellipsis;white-space:nowrap;border-radius:4px;max-width:220px;padding:0 6px;font-size:11px;overflow:hidden}.lc-br-tags{align-items:center;gap:4px;min-width:0;display:inline-flex}.lc-br-tool-plugin{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent);border-color:#0000;border-radius:6px;font-size:12px}.lc-br-preview{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.lc-br-time{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px}.lc-br-time-pending{text-underline-offset:2px;text-decoration:underline dotted}.lc-br-hits{color:var(--dsw-alias-label-secondary);flex:none;font-size:11px}.lc-br-content{flex-direction:column;gap:6px;padding:2px 6px 8px 26px;display:flex}.lc-br-dim{color:var(--dsw-alias-label-secondary)}`,document.head.appendChild(e)}let Ps=`dsh-context/detailSections.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ps)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ps,e.textContent=`.lc-ts-card{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;min-width:0;overflow:hidden}.lc-ts-card-head{color:var(--dsw-alias-label-secondary);border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:8px;padding:6px 10px;font-size:11px;font-weight:600;display:flex}.lc-ts-card-head-wrap{flex-wrap:wrap}.lc-ts-card-head b{color:var(--dsw-alias-label-primary)}.lc-ts-call-name{font-size:13px;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.lc-ts-card-count{margin-left:auto}.lc-ts-card-right{align-items:center;gap:8px;margin-left:auto;display:inline-flex}.lc-ts-card-meta{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px;font-weight:400}.lc-ts-call-state{white-space:nowrap;font-size:11px;font-weight:600;line-height:1;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);border-radius:999px;flex:none;align-items:center;gap:4px;padding:2px 7px;display:inline-flex}.lc-ts-call-state i{background:currentColor;border-radius:50%;flex:none;width:6px;height:6px}.lc-ts-call-ok{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent)}.lc-ts-call-err{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent)}.lc-ts-desc-body{color:var(--dsw-alias-label-primary);white-space:pre-wrap;word-break:break-word;scrollbar-width:thin;max-height:320px;margin:0;padding:8px 10px;font-size:12px;line-height:1.55;overflow-y:auto}.lc-ts-lines{counter-reset:lc-line}.lc-ts-line{padding-left:26px;display:block;position:relative}.lc-ts-line:before{content:counter(lc-line);counter-increment:lc-line;text-align:right;width:20px;color:var(--dsw-alias-label-tertiary);user-select:none;padding-right:6px;font-size:11px;position:absolute;left:0}.lc-ts-line:empty:after{content:"​"}.lc-ts-param-row{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:minmax(0,140px) minmax(0,90px) 56px minmax(0,1fr);align-items:baseline;gap:2px 10px;padding:6px 10px;font-size:12px;display:grid}.lc-ts-param-row:first-of-type{border-top:0}.lc-ts-param-name{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.lc-ts-param-type{color:var(--dsw-alias-label-secondary);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.lc-ts-param-req{color:var(--dsw-alias-state-warn-primary);font-size:11px;font-weight:600}.lc-ts-param-req-off{color:var(--dsw-alias-label-secondary);font-size:11px}.lc-ts-param-desc{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;grid-column:1/-1;line-height:1.5}.lc-ts-params-empty{color:var(--dsw-alias-label-secondary);padding:8px 10px;font-size:12px}.lc-ts-arg-row{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:minmax(0,96px) 1fr;align-items:start;column-gap:12px;padding:6px 10px;font-size:12px;display:grid}.lc-ts-arg-row:first-of-type{border-top:0}.lc-ts-arg-row .lc-ts-param-name{text-overflow:unset;white-space:normal;overflow-wrap:anywhere;overflow:visible}.lc-ts-arg-val{color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);white-space:pre-wrap;word-break:break-word;scrollbar-width:thin;max-height:200px;font-size:12px;line-height:1.55;overflow-y:auto}.lc-ts-json{flex-direction:column;gap:4px;display:flex}.lc-ts-json-toggle{color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;align-self:flex-start;padding:0;font-size:11px}.lc-rich-copy,.lc-find-btn{color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:5px;align-items:center;padding:2px;display:inline-flex}.lc-rich-copy:hover,.lc-find-btn:hover{color:var(--dsw-alias-label-primary)}.lc-rich-copy-on,.lc-rich-copy-on:hover{color:var(--dsw-alias-state-success-primary)}.lc-find-btn:disabled{opacity:.4;cursor:default}.lc-find-btn:disabled:hover{color:var(--dsw-alias-label-secondary)}.lc-find-btn-on,.lc-find-btn-on:hover{color:var(--dsw-alias-label-primary)}.lc-find{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:6px;padding:6px 10px;display:flex}.lc-find-count{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px}.lc-find-mark{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 25%, transparent);color:inherit;border-radius:2px}.lc-find-mark-on{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 65%, transparent)}.lc-ts-desc-md{color:var(--dsw-alias-label-primary);word-break:break-word;overflow-wrap:anywhere;scrollbar-width:thin;min-width:0;max-height:320px;padding:4px 10px;font-size:12px;line-height:1.55;overflow:hidden auto}.lc-ts-desc-md>div{font-size:13px;line-height:1.55}.lc-ts-desc-md div :is(h1,h2,h3,h4,h5,h6){margin:10px 0 4px;font-size:13px;font-weight:600}.lc-ts-desc-md div p{white-space:pre-line;margin:6px 0}.lc-ts-desc-md div p br{display:none}.lc-ts-desc-md div pre{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;margin:6px 0}.lc-ts-desc-md div :not(pre)>code{box-decoration-break:clone;padding:1px 5px;line-height:1.3;font-size:1em!important}.lc-ts-desc-md div table code{font-size:inherit}`,document.head.appendChild(e)}let Fs=`dsh-context/attachments.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Fs)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Fs,e.textContent=`.lc-att-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:8px 10px;display:grid}.lc-att-item{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:100%;min-width:0;font:inherit;text-align:left;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border-radius:8px;align-items:center;gap:8px;padding:6px;display:flex}.lc-att-thumb{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:6px;flex:none;justify-content:center;align-items:center;width:64px;height:64px;padding:0;display:flex;overflow:hidden}.lc-att-thumb img{object-fit:cover;width:100%;height:100%;display:block}.lc-att-ph,.lc-att-err{color:var(--dsw-alias-label-secondary);text-align:center;padding:2px;font-size:10px}.lc-att-meta{flex-direction:column;gap:2px;min-width:0;display:flex}.lc-att-name{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;word-break:break-word;font-size:12px;line-height:1.3}.lc-att-row{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:11px}.lc-att-row-label{min-width:3.2em;font-weight:400;display:inline-block}`,document.head.appendChild(e)}let Is=`dsh-context/agentGraph.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Is)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Is,e.textContent=`.lc-agents-chips{flex-wrap:wrap;gap:6px;margin-bottom:10px;display:flex}.lc-agents-chip{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;border-radius:999px;padding:2px 8px;font-size:11px}.lc-agents-chip-on{color:var(--dsw-alias-state-success-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 40%, transparent)}.lc-agents-stage{overscroll-behavior-x:contain;margin:0 -4px;padding:0 4px;overflow-x:auto}.lc-agents-svg{max-width:none;margin:0 auto;display:block}.lc-agents-link-live{stroke-opacity:.85}.lc-agents-flow{stroke-linecap:round;stroke-dasharray:2 7}.lc-agent-node{outline:none}.lc-agent-clickable{cursor:pointer}.lc-agent-halo{transition:fill var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-agent-self .lc-agent-halo{fill:var(--dsw-alias-bg-layer-2)}.lc-agent-running .lc-agent-halo{fill:color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent)}.lc-agent-done .lc-agent-halo{fill:color-mix(in srgb, var(--dsw-alias-state-success-primary) 7%, transparent)}.lc-agent-seg{transition:stroke-dasharray .3s,stroke-dashoffset .3s}.lc-agent-free{stroke:color-mix(in srgb, var(--dsw-alias-label-secondary) 18%, transparent)}.lc-agent-pct{font-variant-numeric:tabular-nums;pointer-events:none;font-size:11px;font-weight:600}.lc-agent-caption{text-align:center;pointer-events:none;width:100%;line-height:1.25}.lc-agent-label{color:var(--dsw-alias-label-primary);overflow-wrap:break-word;-webkit-line-clamp:3;-webkit-box-orient:vertical;font-size:11px;display:-webkit-box;overflow:hidden}.lc-agent-tokens{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:10px}.lc-agents-solo{padding:4px 0 10px}.lc-agents-inspector{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:8px;flex-wrap:wrap;align-items:baseline;gap:4px 8px;min-width:0;margin-top:10px;padding:7px 10px;font-size:12px;display:flex}.lc-agents-inspector-name{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}.lc-agents-badge{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 6px;font-size:10px}.lc-agent-self-badge{vertical-align:1px;margin-left:5px}.lc-agents-badge-on{color:var(--dsw-alias-state-success-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 40%, transparent)}.lc-agents-inspector-stats{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.lc-agents-inspector-open{color:var(--dsw-alias-brand-primary,var(--color-blue-500));flex:none;margin-left:auto}.lc-agents-legend{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:4px 14px;margin-top:8px;font-size:11px;display:flex}.lc-agents-legend-item{align-items:center;gap:5px;display:inline-flex}.lc-agents-legend-item i{border-radius:2px;width:8px;height:8px}.lc-agents-legend-free{background:color-mix(in srgb, var(--dsw-alias-label-secondary) 18%, transparent)}.lc-agents-legend-edge{border-top:2px dashed var(--dsw-alias-label-secondary);border-radius:0!important;width:14px!important;height:0!important}`,document.head.appendChild(e)}let Ls=`dsh-context/overview.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ls)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ls,e.textContent=`.lc-ov-page{box-sizing:border-box;background:var(--dsw-alias-bg-base);width:100%;min-width:0;height:100%;min-height:0;color:var(--dsw-alias-label-primary);flex-direction:column;font-size:13px;display:flex;overflow:hidden;container:lc-ov/inline-size}.lc-ov-pagescroll{scrollbar-gutter:stable;flex:auto;min-height:0;overflow-y:auto}.lc-ov-pagecontent{padding:0 clamp(24px,4vw,48px) 48px}.lc-ov-pagehead{flex-wrap:wrap;align-items:center;gap:16px;margin-bottom:24px;padding-top:28px;display:flex}[data-platform=darwin] .lc-ov-pagehead{padding-top:calc(28px + var(--dsh-frame-top-clearance,0px))}.lc-ov-pagetitle{flex:0 auto;min-width:0;margin:0;font-size:20px;font-weight:500;line-height:28px}.lc-ov-settings{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);font:inherit;color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:999px;flex:none;align-items:center;gap:6px;padding:3px 12px;font-size:12px;line-height:18px;display:inline-flex}.lc-ov-settings:hover{border-color:var(--dsw-alias-label-secondary);color:var(--dsw-alias-label-primary)}.lc-ov-balance{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);max-width:100%;color:inherit;border-radius:999px;flex:none;align-items:center;gap:6px;padding:2px 10px;font-size:12px;line-height:18px;text-decoration:none;display:inline-flex}.lc-ov-balance:hover .lc-ov-balance-value{text-decoration:underline}.lc-ov-balance-label{color:var(--dsw-alias-label-secondary);white-space:nowrap}.lc-ov-balance-value{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}.lc-hovertip{z-index:300;white-space:pre-line;max-width:min(320px,50vw);position:fixed}.lc-ov-first{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:10px;display:grid}.lc-ov-kpis{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.lc-ov-kpi{align-items:center;padding:8px}.lc-ov-kpi .lc-stat-value{font-size:20px}@container lc-ov (width<=932px){.lc-ov-first{grid-template-columns:minmax(0,1fr)}}@container lc-ov (width<=640px){.lc-ov-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}.lc-ov-usage{box-sizing:border-box;flex-direction:column;flex:auto;min-width:0;margin-bottom:0;display:flex}.lc-ov-usage-plot{flex:auto;grid-template-rows:minmax(56px,1fr) auto;grid-template-columns:42px minmax(0,1fr) 42px;gap:6px;min-height:0;display:grid}.lc-ov-usage-rail-l{grid-area:1/1}.lc-ov-usage-grid{grid-area:1/2;min-width:0;display:flex;position:relative}.lc-ov-usage-rail-r{grid-area:1/3}.lc-ov-usage-rail{width:42px;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:9px;line-height:1.2;position:relative}.lc-ov-usage-rail-l .lc-ov-usage-tick{right:0}.lc-ov-usage-rail-r .lc-ov-usage-tick{left:0}.lc-ov-usage-tick{white-space:nowrap;position:absolute;transform:translateY(-50%)}.lc-ov-usage-line{background:color-mix(in srgb, var(--dsw-alias-border-l2) 70%, transparent);height:1px;position:absolute;left:0;right:0}.lc-ov-usage-line-0{background:var(--dsw-alias-border-l2)}.lc-ov-usage-cols{flex:auto;align-items:stretch;gap:6px;min-width:0;display:flex;position:relative}.lc-ov-usage-col{flex-direction:column;flex:1 1 0;min-width:0;display:flex}.lc-ov-usage-bars{flex:auto;justify-content:center;align-items:flex-end;gap:3px;width:100%;display:flex}.lc-ov-usage-bar{border-radius:3px 3px 0 0;flex:none;width:10px}.lc-ov-usage-tokens{background:color-mix(in srgb, var(--color-blue-500) 72%, transparent)}.lc-ov-usage-cost{background:color-mix(in srgb, var(--color-green-500) 72%, transparent)}.lc-ov-usage-days{grid-area:2/2;gap:6px;display:flex}.lc-ov-usage-day{text-align:center;min-width:0;color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;flex:1 1 0;font-size:9px;line-height:1.2}@container lc-ov (width<=400px){.lc-ov-usage-day:nth-child(2n){visibility:hidden}}.lc-ov-usage-key{flex:none;justify-content:flex-end;align-items:center;gap:5px;padding-top:5px;display:flex}.lc-ov-usage-swatch{border-radius:2px;flex:none;width:10px;height:8px}.lc-ov-usage-key-label{color:var(--dsw-alias-label-secondary);font-size:9px}.lc-ov-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:10px;display:grid}.lc-ov-stats>.lc-card{box-sizing:border-box;min-width:0;margin-bottom:0}@container lc-ov (width<=700px){.lc-ov-stats{grid-template-columns:minmax(0,1fr)}}.lc-ov-body{grid-template-columns:minmax(0,3fr) minmax(0,7fr);align-items:start;gap:10px;display:grid}.lc-ov-left{flex-direction:column;gap:10px;min-width:0;display:flex}.lc-ov-right{min-width:0}@container lc-ov (width<=932px){.lc-ov-body{display:block}.lc-ov-left{margin-bottom:12px}}.lc-ov-left>.lc-card{box-sizing:border-box;min-width:0;margin-bottom:0}.lc-ov-heat-card{flex-direction:column;display:flex}.lc-heat-wrap{flex-direction:column;flex:1;display:flex}.lc-heat{flex:1;justify-content:center;align-items:center;gap:8px;display:flex}.lc-heat-wds,.lc-heat-col{padding-top:18px}.lc-heat-wds{flex-direction:column;gap:3px;display:flex}.lc-heat-wd{height:20px;color:var(--dsw-alias-label-secondary);text-align:center;white-space:nowrap;flex:none;justify-content:center;align-items:center;font-size:9px;display:flex}.lc-heat-cols{gap:3px;display:flex}.lc-heat-col{flex-direction:column;gap:3px;display:flex;position:relative}.lc-heat-mon{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:9px;line-height:18px;position:absolute;top:0;left:0}.lc-heat-cell{box-sizing:border-box;background:var(--dsw-alias-bg-layer-2);cursor:default;border:0;border-radius:20%;width:20px;height:20px;padding:0}button.lc-heat-cell{cursor:pointer}button.lc-heat-cell:hover{box-shadow:0 0 0 1.5px color-mix(in srgb, var(--color-blue-500) 70%, transparent)}.lc-heat-future{background:0 0}.lc-heat-0{background:color-mix(in srgb, var(--dsw-alias-label-secondary) 16%, transparent)}.lc-heat-1{background:color-mix(in srgb, var(--color-blue-500) 28%, transparent)}.lc-heat-2{background:color-mix(in srgb, var(--color-blue-500) 50%, transparent)}.lc-heat-3{background:color-mix(in srgb, var(--color-blue-500) 72%, transparent)}.lc-heat-4{background:color-mix(in srgb, var(--color-blue-500) 92%, transparent)}.lc-heat-on{box-shadow:0 0 0 1.5px var(--color-blue-500)}.lc-heat-legend{justify-content:flex-end;align-items:center;gap:3px;padding-top:6px;display:flex}.lc-heat-key{color:var(--dsw-alias-label-secondary);font-size:9px}.lc-ov-skills{flex-direction:column;gap:2px;display:flex}.lc-ov-skills-sub{margin:-4px 0 8px}.lc-ov-skill{width:100%;min-width:0;font:inherit;color:inherit;text-align:left;cursor:pointer;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:6px;align-items:baseline;gap:7px;padding:2px 6px 4px;font-size:12px;line-height:1.7;display:flex;position:relative}.lc-ov-skill:hover{background:var(--dsw-alias-bg-layer-2)}.lc-ov-skill-unit{background:var(--dsw-alias-bg-layer-2);box-shadow:0 0 0 1.5px color-mix(in srgb, var(--color-blue-500) 45%, transparent);border-radius:8px}.lc-ov-skill-unit .lc-ov-skill-detail{background:0 0;margin-top:0;padding:4px 6px 8px}.lc-ov-skill-dot{border-radius:50%;flex:none;align-self:center;width:7px;height:7px}.lc-ov-skill-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-primary);flex:auto;font-size:11px;overflow:hidden}.lc-ov-skill-count{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);flex:none}.lc-ov-skill-last{text-align:right;min-width:56px;color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px}.lc-ov-skill-bar{opacity:.45;pointer-events:none;border-radius:1px;height:2px;position:absolute;bottom:1px;left:6px}.lc-ov-skill-more{color:var(--dsw-alias-label-secondary);padding-top:4px;font-size:11px}.lc-skilltip{z-index:300;white-space:normal;border-radius:10px;max-width:min(300px,60vw);padding:10px 12px;line-height:1.5;position:fixed}.lc-skilld-head{align-items:center;gap:7px;display:flex}.lc-skilld-name{overflow-wrap:anywhere;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-primary);flex:auto;font-size:12px;font-weight:600}.lc-skilld-chip{color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2);white-space:nowrap;border-radius:4px;flex:none;padding:0 5px;font-size:10px;line-height:1.5}.lc-skilld-desc{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:3;-webkit-box-orient:vertical;margin:6px 0 0;font-size:11.5px;line-height:1.55;display:-webkit-box;overflow:hidden}.lc-skilld-path{text-overflow:ellipsis;white-space:nowrap;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-tertiary);margin-top:6px;font-size:11px;overflow:hidden}.lc-skilld-foot{border-top:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:baseline;gap:2px 10px;margin-top:8px;padding-top:7px;font-size:11px;display:flex}.lc-skilld-foot>span:first-child{white-space:nowrap}.lc-skilld-hint{color:var(--color-blue-500);white-space:nowrap;flex:none;margin-left:auto}.lc-ov-skill-detail{background:var(--dsw-alias-bg-layer-2);border-radius:8px;margin:4px 0 2px;padding:8px 10px 9px}.lc-ov-skill-detail>:first-child{margin-top:0}.lc-skilld-grid{grid-template-columns:auto minmax(0,1fr);gap:2px 12px;margin-top:7px;font-size:11px;line-height:1.6;display:grid}.lc-skilld-k{color:var(--dsw-alias-label-tertiary);white-space:nowrap}.lc-skilld-v{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary);overflow:hidden}.lc-skilld-pathv{font:inherit;cursor:copy;text-align:left;background:0 0;border:0;align-items:center;gap:5px;padding:0;display:flex}.lc-skilld-pathv-text{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);overflow:hidden}.lc-skilld-pathv svg{color:var(--dsw-alias-label-tertiary);transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);flex:none}.lc-skilld-pathv:hover .lc-skilld-pathv-text,.lc-skilld-pathv:hover svg{color:var(--dsw-alias-label-primary)}.lc-ov-list-head{flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:10px;display:flex}.lc-ov-list-title{white-space:nowrap;font-weight:600}.lc-ov-list-count{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;background:var(--dsw-alias-bg-layer-2);border-radius:8px;padding:1px 7px;font-size:11px}.lc-ov-day-chip{border:1px solid color-mix(in srgb, var(--color-blue-500) 45%, transparent);color:var(--color-blue-500);background:color-mix(in srgb, var(--color-blue-500) 10%, transparent);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:999px;max-width:100%;padding:1px 10px;font-family:inherit;font-size:11px;line-height:1.4;overflow:hidden}.lc-ov-search{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);min-width:110px;font:inherit;color:var(--dsw-alias-label-primary);transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;outline:none;flex:150px;padding:4px 10px;font-size:12px}.lc-ov-search:focus{border-color:var(--dsw-alias-label-secondary)}.lc-ov-search::placeholder{color:var(--dsw-alias-label-secondary)}.lc-ov-groups{flex-wrap:wrap;gap:6px;margin:-2px 0 10px;display:flex}.lc-ov-chip{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;max-width:220px;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border-radius:999px;align-items:baseline;gap:5px;padding:2px 10px;font-size:11px;line-height:1.5;display:inline-flex;overflow:hidden}.lc-ov-chip:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-secondary)}.lc-ov-chip-on,.lc-ov-chip-on:hover{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);border-color:#0000}.lc-ov-chip-n{font-variant-numeric:tabular-nums;opacity:.65;font-size:10px}.lc-ov-chip-on .lc-ov-chip-n{opacity:.85}.lc-ov-grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px;display:grid}.lc-ov-session{text-align:left;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;font:inherit;color:inherit;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:10px;flex-direction:column;gap:6px;padding:10px 12px;display:flex}.lc-ov-session:hover{border-color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2)}.lc-ov-session-current{border-color:color-mix(in srgb, var(--color-blue-500) 65%, transparent)}.lc-ov-session-head{align-items:flex-start;gap:6px;min-width:0;display:flex}.lc-ov-running{background:var(--color-green-500);border-radius:50%;flex:none;width:7px;height:7px}.lc-ov-session-title{-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;flex:auto;min-width:0;font-weight:600;display:-webkit-box;overflow:hidden}.lc-ov-current{color:var(--color-blue-500);border:1px solid color-mix(in srgb, var(--color-blue-500) 45%, transparent);border-radius:4px;flex:none;padding:0 4px;font-size:10px;line-height:1.5}.lc-ov-session-times{flex-direction:column;flex:none;align-items:flex-end;gap:1px;display:flex}.lc-ov-session-time{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:11px}.lc-ov-session-created{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:10px;line-height:1.4}.lc-ov-session-crumb{min-width:0;color:var(--dsw-alias-label-secondary);white-space:nowrap;align-items:center;gap:5px;font-size:11px;display:flex;overflow:hidden}.lc-ov-crumb-group{text-overflow:ellipsis;flex:none;max-width:55%;overflow:hidden}.lc-ov-crumb-sep{opacity:.55;flex:none}.lc-ov-crumb-project{text-overflow:ellipsis;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-secondary) 16%, transparent);border-radius:999px;flex:0 auto;padding:0 8px;font-size:10px;line-height:1.6;overflow:hidden}.lc-ov-session-body{align-items:center;gap:14px;min-width:0;display:flex}.lc-ov-mini-stats{flex-direction:column;flex:auto;gap:3px;min-width:0;display:flex}.lc-ov-mini-stat{justify-content:space-between;align-items:baseline;gap:10px;font-size:11px;display:flex}.lc-ov-mini-label{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none}.lc-ov-mini-value{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}.lc-ov-session-empty{color:var(--dsw-alias-label-secondary);padding:6px 0;font-size:11px;line-height:1.5}.lc-ov-session-preview{border-top:1px solid color-mix(in srgb, var(--dsw-alias-border-l2) 60%, transparent);align-items:baseline;gap:6px;min-width:0;margin-top:auto;padding-top:6px;display:flex}.lc-ov-session-preview-label{color:var(--dsw-alias-label-secondary);flex:none;font-size:10px}.lc-ov-session-preview-text{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary);flex:0 auto;font-size:11px;line-height:1.5;overflow:hidden}.lc-ov-pager{justify-content:center;align-items:center;gap:10px;margin-top:12px;display:flex}.lc-ov-pager-btn{border:1px solid var(--dsw-alias-border-l2);width:26px;height:22px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border-radius:6px;flex:none;justify-content:center;align-items:center;line-height:1;display:flex}.lc-ov-pager-btn:hover:enabled{border-color:var(--dsw-alias-label-secondary)}.lc-ov-pager-btn:disabled{opacity:.4;cursor:default}.lc-ov-pager-n{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:11px}`,document.head.appendChild(e)}let Rs=`dsh-context`;function zs(e){e.effect(()=>e.locale.register(Rs,{zh:m,en:h}),`dsh-context: dictionaries`);let t=e.locale.bind(Rs),n=xs(t);He(e);let r=Va(),i=gs(e,n,r);e.effect(()=>bs(r,{tab:()=>e.slots.inject(`conversation.view`,()=>e.slots.register({name:`conversation.view`,id:`context`,order:20,locale:Rs,label:()=>t(`tab`)},e=>(0,u.createElement)(i,e))),sidebar:()=>os(e,i,t,Rs)}),`dsh-context: placement`);let a=ys(e,n);e.slots.inject(`conversation.chat.assistant-actions`,()=>e.slots.register({name:`conversation.chat.assistant-actions`,id:`context-jump`,order:20,locale:Rs},e=>(0,u.createElement)(a,e))),M(e,n);let o=Gn(e,n,r);e.slots.inject(`conversation.input.overlay`,()=>e.slots.register({name:`conversation.input.overlay`,id:`context-modal`,order:10,locale:Rs,inject:(e=``)=>({hooks:{contextModal:te(e)}})},e=>(0,u.createElement)(o,e)));let s=Na(e,n);e.effect(()=>za(e,r,e=>(0,u.createElement)(s,e),t,Rs),`dsh-context: insight page`);let c=()=>({hooks:{contextSettings:r.store},set:(e,t)=>{r.set(e,t)}});e.inject([`configForms`],e=>{let t=e,i=t.configForms;if(i===void 0||typeof i.get!=`function`||typeof i.whileServed!=`function`)return;t.effect(()=>r.attach(i.get(Rs)),`dsh-context: config forms`);let a=La(n);t.effect(()=>i.whileServed([Rs],()=>t.slots.inject(`plugins.bundle.config`,()=>t.slots.register({name:`plugins.bundle.config`,key:Rs,locale:Rs,inject:c},e=>(0,u.createElement)(a,e)))),`dsh-context: plugins-page card`)})}return t.exports={name:`dsh-context`,inject:[`slots`,`locale`],apply:zs},t.exports}});
18
+ `),"data-lc-tip-side":`bottom`}:{},href:`https://platform.deepseek.com/usage`,target:`_blank`,rel:`noreferrer`,children:[(0,d.jsx)(`span`,{className:`lc-ov-balance-label`,children:n(`balance.title`)}),(0,d.jsx)(`span`,{className:`lc-ov-balance-value`,children:o(a.total)})]})}}let ma=`lc-dp-day`;function ha(e){return e===`ArrowLeft`?-1:e===`ArrowRight`?1:e===`ArrowUp`?-7:e===`ArrowDown`?7:null}function ga(e,t){if(!Rr.test(e))return e;let n=new Date(Number(e.slice(0,4)),Number(e.slice(5,7))-1,1);return new Intl.DateTimeFormat(t,{year:`numeric`,month:`long`}).format(n)}function _a(e){let{t}=e;return function(e){let[n,r]=(0,u.useState)(!1),[i,a]=(0,u.useState)(``),[o,s]=(0,u.useState)(``),[c,l]=(0,u.useState)(null),[f,m]=(0,u.useState)(null),[h,g]=(0,u.useState)(null),_=(0,u.useRef)(null),v=(0,u.useRef)(null),y=()=>{r(!1)};Kn(n,y),(0,u.useEffect)(()=>{if(!n)return;let e=e=>{let t=e.target;t instanceof Node&&_.current?.contains(t)!==!0&&v.current?.contains(t)!==!0&&y()};return window.addEventListener(`mousedown`,e),window.addEventListener(`scroll`,y,!0),window.addEventListener(`resize`,y),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`scroll`,y,!0),window.removeEventListener(`resize`,y)}},[n]),(0,u.useLayoutEffect)(()=>{let e=_.current,t=v.current;if(!n||e===null||t===null)return;let r=e.getBoundingClientRect(),i=Math.max(8,Math.min(r.right-t.offsetWidth,window.innerWidth-t.offsetWidth-8)),a=r.bottom+6,o=a+t.offsetHeight>window.innerHeight-8?Math.max(8,r.top-t.offsetHeight-6):a;g(e=>e!==null&&Object.is(e.left,i)&&Object.is(e.top,o)?e:{left:i,top:o})});let b=c===null?e.value:Si(c,f??c),x=n?qr(i):null,S=()=>{let t=e.today.slice(0,7);a(t),s(`${t}-01`),l(null),m(null),r(!0)},C=t=>{if(c===null){l(t),m(null);return}let n=Si(c,t);l(null),m(null),r(!1),e.onChange(n)},w=e=>{let t=Kr(i,e);t!==null&&(a(t),s(`${t}-01`))},T=t=>{if(t.key===`Enter`||t.key===` `){t.preventDefault(),C(o);return}let n=ha(t.key);if(n===null)return;t.preventDefault();let r=Vr(o,n);r!==null&&r<=e.today&&r.slice(0,7)===i&&s(r)},E=h!==null&&n?h:null,D=b?.from,O=c!==null&&f===null?void 0:b?.to;return(0,d.jsxs)(`div`,{className:`lc-dp`,ref:_,children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-dp-trigger`+(e.picked?` lc-dp-trigger-on`:``),"aria-haspopup":`dialog`,"aria-expanded":x!==null,"aria-label":t(`ov.date.open`),onClick:()=>{n?y():S()},children:[(0,d.jsx)(`span`,{className:`lc-dp-half`+(D===void 0?` lc-dp-half-empty`:``),children:D??t(`ov.date.from`)}),(0,d.jsx)(`span`,{className:`lc-dp-sep`,children:`→`}),(0,d.jsx)(`span`,{className:`lc-dp-half`+(O===void 0?` lc-dp-half-empty`:``),children:O??t(`ov.date.to`)}),(0,d.jsx)(dn,{size:12})]}),x===null?null:(0,p.createPortal)((0,d.jsxs)(`div`,{ref:v,className:`lc-tip lc-dp-panel`,role:`dialog`,"aria-label":t(`ov.date.label`),style:E===null?{left:0,top:0,visibility:`hidden`}:{left:E.left,top:E.top},children:[(0,d.jsxs)(`div`,{className:`lc-dp-nav`,children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-dp-navbtn`,"aria-label":t(`ov.date.prev`),onClick:()=>{w(-1)},children:`‹`}),(0,d.jsx)(`span`,{className:`lc-dp-month`,children:ga(i,e.locale)}),(0,d.jsx)(`button`,{type:`button`,className:`lc-dp-navbtn`,"aria-label":t(`ov.date.next`),disabled:i>=e.today.slice(0,7),onClick:()=>{w(1)},children:`›`})]}),(0,d.jsx)(`div`,{className:`lc-dp-wds`,"aria-hidden":`true`,children:[0,1,2,3,4,5,6].map(e=>(0,d.jsx)(`span`,{className:`lc-dp-wd`,children:t(`ov.date.wd.${String(e)}`)},e))}),(0,d.jsx)(`div`,{className:`lc-dp-grid`,role:`grid`,tabIndex:0,"aria-label":t(`ov.date.pick`),"aria-activedescendant":ma,onKeyDown:T,children:x.map((t,n)=>(0,d.jsx)(`div`,{className:`lc-dp-week`,role:`row`,children:t.map((t,n)=>{if(t===null)return(0,d.jsx)(`span`,{className:`lc-dp-cell lc-dp-blank`},n);let r=t>e.today,i=b!==null&&(t===b.from||t===b.to),a=`lc-dp-cell`+(b!==null&&t>=b.from&&t<=b.to?` lc-dp-in`:``)+(i?` lc-dp-edge`:``)+(t===o?` lc-dp-cursor`:``)+(t===e.today?` lc-dp-today`:``)+(r?` lc-dp-future`:``),s=String(Number(t.slice(8,10)));return r?(0,d.jsx)(`span`,{className:a,role:`gridcell`,"aria-disabled":`true`,"aria-label":t,children:s},n):(0,d.jsx)(`span`,{className:a,role:`gridcell`,id:t===o?ma:void 0,"aria-label":t,"aria-selected":i,onMouseEnter:()=>{c!==null&&m(t)},onClick:()=>{C(t)},children:s},n)})},n))}),(0,d.jsxs)(`div`,{className:`lc-dp-foot`,children:[(0,d.jsx)(`span`,{className:`lc-dp-hint`,children:t(c===null?`ov.date.hint`:`ov.date.hintEnd`)}),e.picked&&(0,d.jsx)(`button`,{type:`button`,className:`lc-dp-clear`,onClick:()=>{e.onChange(null)},children:t(`ov.date.clear`)})]})]}),document.body)]})}}function va(e,t){let n=Ur(e);if(n===null||t<1)return null;let r=Vr(n,-7*(t-1));if(r===null)return null;let i=[];for(let n=0;n<t;n++){let t=Vr(r,7*n);if(t===null)return null;let a=[];for(let n=0;n<7;n++){let r=Vr(t,n);if(r===null)return null;a.push({key:r,future:r>e,entry:void 0})}i.push(a)}return i}function ya(e,t){if(e<=0||t<=0)return 0;let n=e/t;return n<=.25?1:n<=.5?2:n<=.75?3:4}function ba(e){let{t}=e;return function(e){let n=e.weeks??8,r=e.metric??`steps`,i=va(e.today,n);if(i===null)return(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.heat.empty`)});let a=e.days,o=0,s=0,c=!1;for(let e of i)for(let t of e){let e=a[t.key];e===void 0||e.tokens<=0&&e.requests<=0||(t.entry=e,c=!0,e.sessions>o&&(o=e.sessions),e.requests>s&&(s=e.requests))}if(!c)return(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.heat.empty`)});let l=r===`sessions`?o:s,u=e=>r===`sessions`?e.sessions:e.requests,f={1:t(`ov.heat.wd.1`),3:t(`ov.heat.wd.3`),5:t(`ov.heat.wd.5`)};return(0,d.jsxs)(`div`,{className:`lc-heat-wrap`,children:[(0,d.jsxs)(`div`,{className:`lc-heat`,role:`group`,"aria-label":t(`ov.heat.title`),children:[(0,d.jsx)(`div`,{className:`lc-heat-wds`,"aria-hidden":`true`,children:[0,1,2,3,4,5,6].map(e=>(0,d.jsx)(`span`,{className:`lc-heat-wd`,children:f[e]??``},e))}),(0,d.jsx)(`div`,{className:`lc-heat-cols`,children:i.map((n,r)=>{let i=r===0||n[0].key.slice(0,7)!==n[6].key.slice(0,7)||n[0].key.slice(8,10)===`01`;return(0,d.jsxs)(`div`,{className:`lc-heat-col`,children:[i&&(0,d.jsx)(`span`,{className:`lc-heat-mon`,"aria-hidden":`true`,children:t(`ov.heat.mon.`+n[6].key.slice(5,7))}),n.map(n=>{if(n.future)return(0,d.jsx)(`span`,{className:`lc-heat-cell lc-heat-future`,"aria-hidden":`true`},n.key);let r=n.entry===void 0?0:ya(u(n.entry),l);if(n.entry===void 0)return(0,d.jsx)(`span`,{className:`lc-heat-cell lc-heat-0`,"data-lc-tip":n.key},n.key);let i=e.selected===n.key,a=`${n.key}\n${t(`ov.heat.sessions`,{n:n.entry.sessions})}\n${t(`ov.heat.steps`,{n:n.entry.requests})}`;return(0,d.jsx)(`button`,{type:`button`,className:`lc-heat-cell lc-heat-${String(r)}${i?` lc-heat-on`:``}`,"data-lc-tip":a,"aria-label":a,"aria-pressed":i,onClick:()=>{e.onSelect!==void 0&&e.onSelect(i?null:n.key)}},n.key)})]},r)})})]}),(0,d.jsxs)(`div`,{className:`lc-heat-legend`,"aria-hidden":`true`,children:[(0,d.jsx)(`span`,{className:`lc-heat-key`,children:t(`ov.heat.less`)}),[0,1,2,3,4].map(e=>(0,d.jsx)(`span`,{className:`lc-heat-cell lc-heat-${String(e)}`},e)),(0,d.jsx)(`span`,{className:`lc-heat-key`,children:t(`ov.heat.more`)})]})]})}}function xa(){return zr(Date.now())??``}function Sa(e){let t=e.size??118,n=0;for(let t of e.segments)Number.isFinite(t.value)&&t.value>0&&(n+=t.value);let r=[],i=0;if(n>0)for(let t of e.segments){let e=Number.isFinite(t.value)&&t.value>0?t.value:0;if(e===0)continue;let a=e/n*100;r.push({key:t.key,color:t.color,len:a,offset:100-i+25}),i+=a}if(r.length>1)for(let e of r){let t=Math.min(.5/2,e.len/4);e.len-=t*2,e.offset-=t}let a=e.hoverKey!==null&&e.hoverKey!==void 0&&r.some(t=>t.key===e.hoverKey);return(0,d.jsxs)(`div`,{className:`lc-donut @max-[240px]/lc-card:mx-auto`+(a?` lc-donut-dim`:``),style:{width:t,height:t},onMouseLeave:()=>{e.onHoverKey!==void 0&&e.onHoverKey(null)},children:[(0,d.jsx)(`svg`,{viewBox:`0 0 42 42`,width:t,height:t,"aria-hidden":`true`,children:r.length===0?(0,d.jsx)(`circle`,{className:`lc-donut-track fill-none stroke-4`,cx:`21`,cy:`21`,r:`15.9155`}):r.map((t,n)=>(0,d.jsx)(`circle`,{className:`lc-donut-seg fill-none stroke-4 animate-lc-donut-in motion-reduce:animate-none`+(e.hoverKey===t.key?` lc-donut-seg-on`:``),cx:`21`,cy:`21`,r:`15.9155`,strokeDasharray:`${t.len} ${100-t.len}`,strokeDashoffset:t.offset,style:{"--lc-i":n,stroke:t.color},onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(t.key)}},t.key))}),(0,d.jsxs)(`div`,{className:`lc-donut-center`,children:[(0,d.jsx)(`b`,{style:{fontSize:Math.max(11,Math.round(t*.13))},children:e.centerTop}),e.centerSub===void 0?null:(0,d.jsx)(`span`,{style:{fontSize:Math.max(9,Math.round(t*.105))},children:e.centerSub})]})]})}let Ca=`lc-hovertip-bubble`;function wa(e){return e instanceof Element?e.closest(`[data-lc-tip]`):null}function Ta(e){let t=e.getAttribute(`data-lc-tip`);if(t===null||t===``)return null;let n=e.getBoundingClientRect();return{anchor:e,label:t,side:e.getAttribute(`data-lc-tip-side`)===`bottom`?`bottom`:`top`,rect:{left:n.left,top:n.top,width:n.width,height:n.height,bottom:n.bottom}}}function Ea(){let[e,t]=(0,u.useState)(null),[n,r]=(0,u.useState)(null),i=(0,u.useRef)(null),a=(0,u.useCallback)(e=>{t(t=>{if(t?.anchor===e)return t;t?.anchor.removeAttribute(`aria-describedby`);let n=Ta(e);return n===null?null:(e.setAttribute(`aria-describedby`,Ca),n)})},[]),o=(0,u.useCallback)(()=>{t(e=>(e?.anchor.removeAttribute(`aria-describedby`),null))},[]),s=(0,u.useCallback)(e=>{let t=wa(e.target);t!==null&&a(t)},[a]),c=(0,u.useCallback)(e=>{wa(e.target)!==null&&wa(e.relatedTarget)===null&&o()},[o]),l=(0,u.useCallback)(e=>{let t=wa(e.target);t!==null&&a(t)},[a]),f=(0,u.useCallback)(e=>{wa(e.target)!==null&&wa(e.relatedTarget)===null&&o()},[o]),m=(0,u.useCallback)(()=>{o()},[o]);(0,u.useEffect)(()=>{if(e===null)return;let t=()=>{o()};return window.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t)}},[e,o]),(0,u.useLayoutEffect)(()=>{if(e===null||n?.tip===e)return;let t=i.current;if(t===null)return;let a=t.offsetWidth,o=t.offsetHeight,{rect:s}=e,c=Math.max(8,Math.min(s.left+s.width/2-a/2,window.innerWidth-a-8)),l=e.side===`top`?s.top-o-6:s.bottom+6;e.side===`top`&&l<8?l=s.bottom+6:e.side===`bottom`&&l+o>window.innerHeight-8&&(l=s.top-o-6),r({tip:e,left:c,top:Math.max(8,l)})},[e,n]);let h=n!==null&&n.tip===e?n:null;return{zoneProps:{onMouseOver:s,onMouseOut:c,onFocusCapture:l,onBlurCapture:f,onScrollCapture:m},bubble:e===null?null:(0,p.createPortal)((0,d.jsx)(`div`,{ref:i,id:Ca,role:`tooltip`,className:`lc-tip lc-hovertip`,style:h===null?{left:0,top:0,visibility:`hidden`}:{left:h.left,top:h.top,opacity:1},children:e.label}),document.body)}}function Da(e){return(0,d.jsx)(`div`,{className:`lc-sl flex-auto @max-[240px]/lc-card:basis-full`,onMouseLeave:()=>{e.onHoverKey!==void 0&&e.onHoverKey(null)},children:e.rows.map(t=>(0,d.jsxs)(`div`,{className:`lc-sl-row`+(t.dim?` lc-sl-row-dim`:``)+(e.hoverKey!==void 0&&e.hoverKey===t.key?` lc-sl-row-on`:``),onMouseEnter:()=>{e.onHoverKey!==void 0&&e.onHoverKey(t.key)},children:[(0,d.jsxs)(`div`,{className:`lc-sl-main`,children:[(0,d.jsx)(`i`,{className:`lc-sl-dot`,style:{background:t.color}}),(0,d.jsx)(`span`,{className:`lc-sl-label`,title:t.label,children:t.label}),(0,d.jsx)(`span`,{className:`lc-sl-pct`,children:t.pct})]}),t.count===``?null:(0,d.jsx)(`div`,{className:`lc-sl-sub`,title:t.count,children:t.count})]},t.key))})}function Oa(e,t){let{t:n,fmt:r,fmtShare:i,catLabel:a}=e;return function(e){let[o,s]=(0,u.useState)(null),c=e.tokens,l=c?.total??0,f=c!==null&&l>0?c.parts.filter(e=>e.value>0):[],p=f.map(e=>({key:e.key,color:e.color,label:e.key===`output`?n(`tokens.output`):a(e.key),pct:i(e.value,l),count:e.key===`output`?`${r(e.value)} · ${n(`tokens.outputNote`)}`:`≈`+r(e.value)}));return(0,d.jsxs)(`div`,{className:`lc-card lc-col-donut flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsx)(`div`,{className:`lc-card-title`,children:(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`tokens.title`)})}),f.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(`ov.stats.empty`)}):(0,d.jsxs)(`div`,{className:`lc-donut-row flex items-center justify-start gap-3 min-w-0 @max-[320px]/lc-card:gap-2 @max-[240px]/lc-card:flex-wrap`,children:[(0,d.jsx)(t,{segments:f.map(e=>({key:e.key,color:e.color,value:e.value})),size:96,centerTop:r(l),centerSub:n(`tokens.total`),hoverKey:o,onHoverKey:s}),(0,d.jsx)(Da,{rows:p,hoverKey:o,onHoverKey:s})]})]})}}function ka(e){let t=[];for(let n=-6;n<=0;n++){let r=Vr(e,n);if(r===null)return[];t.push(r)}return t}let Aa=[0,25,50,75,100];function ja(e){let{t,fmt:n}=e;return function(e){let r=ka(e.today),i=e.days,a=r.map(e=>({key:e,entry:i[e]})),o=a.every(e=>e.entry===void 0||e.entry.tokens<=0&&e.entry.cost===null),s=0,c=0;for(let e of a)e.entry!==void 0&&(e.entry.tokens>s&&(s=e.entry.tokens),e.entry.cost!==null&&e.entry.cost>c&&(c=e.entry.cost));let l=(e,t)=>t<=0||e<=0?`0%`:`${Math.max(4,Math.round(e/t*100))}%`,u=e=>n(Math.round(s*e/100)),f=t=>c<=0?`—`:t===0?`0`:fr(c*t/100,e.currency);return(0,d.jsxs)(`div`,{className:`lc-card lc-ov-usage`,children:[(0,d.jsx)(`div`,{className:`lc-card-title`,children:(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:t(`ov.usage.title`)})}),o||r.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.usage.empty`)}):(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(`div`,{className:`lc-ov-usage-plot`,role:`group`,"aria-label":t(`ov.usage.title`),children:[(0,d.jsx)(`div`,{className:`lc-ov-usage-rail lc-ov-usage-rail-l`,"aria-hidden":`true`,children:Aa.map(e=>(0,d.jsx)(`span`,{className:`lc-ov-usage-tick`,style:{top:`${100-e}%`},children:u(e)},e))}),(0,d.jsxs)(`div`,{className:`lc-ov-usage-grid`,children:[Aa.map(e=>(0,d.jsx)(`span`,{className:`lc-ov-usage-line`+(e===0?` lc-ov-usage-line-0`:``),style:{bottom:`${e}%`},"aria-hidden":`true`},e)),(0,d.jsx)(`div`,{className:`lc-ov-usage-cols`,children:a.map(r=>{let i=r.entry?.tokens??0,a=r.entry?.cost??null,o=`${r.key}\n${t(`ov.usage.tokens`)} ${n(i)}\n${t(`ov.usage.costTip`)} ${a===null?`—`:fr(a,e.currency)}`;return(0,d.jsx)(`div`,{className:`lc-ov-usage-col`,"data-lc-tip":o,children:(0,d.jsxs)(`div`,{className:`lc-ov-usage-bars`,children:[(0,d.jsx)(`span`,{className:`lc-ov-usage-bar lc-ov-usage-tokens`,style:{height:l(i,s)}}),(0,d.jsx)(`span`,{className:`lc-ov-usage-bar lc-ov-usage-cost`,style:{height:a===null?`0%`:l(a,c)}})]})},r.key)})})]}),(0,d.jsx)(`div`,{className:`lc-ov-usage-rail lc-ov-usage-rail-r`,"aria-hidden":`true`,children:Aa.map(e=>(0,d.jsx)(`span`,{className:`lc-ov-usage-tick`,style:{top:`${100-e}%`},children:f(e)},e))}),(0,d.jsx)(`div`,{className:`lc-ov-usage-days`,"aria-hidden":`true`,children:a.map(e=>(0,d.jsx)(`span`,{className:`lc-ov-usage-day`,children:e.key.slice(5)},e.key))})]})}),(0,d.jsxs)(`div`,{className:`lc-ov-usage-key`,"aria-hidden":`true`,children:[(0,d.jsx)(`span`,{className:`lc-ov-usage-swatch lc-ov-usage-tokens`}),(0,d.jsx)(`span`,{className:`lc-ov-usage-key-label`,children:t(`ov.usage.tokens`)}),(0,d.jsx)(`span`,{className:`lc-ov-usage-swatch lc-ov-usage-cost`}),(0,d.jsx)(`span`,{className:`lc-ov-usage-key-label`,children:t(`ov.usage.cost`)})]})]})}}let Ma={ttft:`var(--color-blue-500)`,reasoning:`var(--color-violet-500)`,text:`var(--color-pink-500)`,toolarg:`var(--color-amber-500)`,tools:`var(--color-teal-500)`,other:`var(--color-slate-400)`},Na={ttft:`timing.ttft`,reasoning:`timing.reasoning`,text:`timing.text`,toolarg:`timing.toolArgs`,tools:`timing.tools`,other:`timing.other`},Pa=[0,.25,.5,.75,1];function Fa(e){let{t,fmtDuration:n,fmtTime:r}=e;return function(e){let[i,a]=(0,u.useState)(null),o=e.spans.filter(e=>Object.hasOwn(Ma,e.kind)&&Number.isFinite(e.start)&&Number.isFinite(e.end)&&e.end>e.start);if(o.length===0)return null;let s=0;for(let e of o)s+=e.end-e.start;let c=0,l=o.map((e,i)=>{let a=c/s*100;return c+=e.end-e.start,{key:i,kind:e.kind,leftPct:a,widthPct:(e.end-e.start)/s*100,tip:`${t(Na[e.kind])} ${n(e.end-e.start)} · ${r(e.start)}`}}),f=e.hoverKey,p=f!=null&&l.some(e=>e.kind===f),m=null;for(let e of l)if(e.key===i){m={text:e.tip,leftPct:Math.max(10,Math.min(e.leftPct+e.widthPct/2,90))};break}return(0,d.jsxs)(`div`,{className:`lc-tstrip`,role:`img`,"aria-label":t(`timing.strip`),children:[(0,d.jsxs)(`div`,{className:`lc-tstrip-wrap`,children:[(0,d.jsx)(`div`,{className:`lc-tstrip-bar`+(p?` lc-tstrip-dim`:``),onMouseLeave:()=>{a(null),e.onHoverKey?.(null)},children:(0,d.jsx)(`div`,{className:`lc-tstrip-fill animate-lc-stacked-in motion-reduce:animate-none`,children:l.map(t=>(0,d.jsx)(`div`,{className:`lc-tstrip-seg`+(f===t.kind?` lc-tstrip-seg-on`:``),style:{left:`${t.leftPct}%`,width:`${t.widthPct}%`,background:Ma[t.kind]},onMouseEnter:()=>{a(t.key),e.onHoverKey?.(t.kind)}},t.key))})}),(0,d.jsx)(`div`,{className:`lc-tip lc-bar-tip`+(m===null?``:` lc-bar-tip-on`),style:{left:`${m===null?50:m.leftPct}%`},children:m===null?``:m.text})]}),(0,d.jsx)(`div`,{className:`lc-tstrip-axis`,children:Pa.map((e,t)=>{let r=s*e;return(0,d.jsx)(`span`,{className:`lc-tstrip-tick`+(t===0?` lc-tstrip-tick-first`:t===Pa.length-1?` lc-tstrip-tick-last`:``),style:{left:`${e*100}%`},children:r===0?`0`:n(r)},e)})})]})}}let Ia=Ma;function La(e){let t=Math.max(0,e);return String(t>=10?Math.round(t):Math.round(t*10)/10)}function Ra(e,t){let{t:n,fmt:r,fmtDuration:i,fmtShare:a}=e,o=Fa(e);return function(e){let[s,c]=(0,u.useState)(null),l=e.timing,f=l!==null&&Number.isFinite(l.wallMs)&&l.wallMs>0?l.wallMs:0,p=l!==null&&typeof l.speedMs==`number`&&Number.isFinite(l.speedMs)&&l.speedMs>0&&typeof l.speedTokens==`number`&&Number.isFinite(l.speedTokens)&&l.speedTokens>=0?La(l.speedTokens/(l.speedMs/1e3)):null,m=[],h=[];if(l!==null&&(f>0||l.calls>0||l.toolCalls>0)){let e=n(`timing.callTimes`,{n:r(l.calls)}),t=[{key:`ttft`,color:Ia.ttft,label:n(`timing.ttft`),ms:l.ttftMs,times:e}],o=e=>e!==void 0&&e>0?n(`timing.blockTimes`,{n:r(e)}):void 0,s=[[`reasoning`,Ia.reasoning,n(`timing.reasoning`),l.reasoningMs??0,o(l.reasoningBlocks)],[`text`,Ia.text,n(`timing.text`),l.textMs??0,o(l.textBlocks)],[`toolarg`,Ia.toolarg,n(`timing.toolArgs`),l.toolArgMs??0,o(l.toolArgBlocks)]];if(s.some(([,,,e])=>e>0))for(let[e,n,r,i,a]of s)t.push({key:e,color:n,label:r,ms:i,...a===void 0?{}:{times:a}});else t.push({key:`gen`,color:Ia.reasoning,label:n(`timing.gen`),ms:l.genMs});let c=Math.min(l.ttftMs,f),u=Math.max(0,Math.min(l.genMs,f-c)),d=[c],p=c,g=c+u;for(let e of t.slice(1)){let t=Math.max(0,Math.min(e.ms,g-p));d.push(t),p+=t}let _=Math.max(0,Math.min(l.toolsMs,f-c-u)),v=Math.max(0,f-c-u-_),y=e=>f>0?e/f:0,b=(e,t)=>{let n=i(e);return t===void 0?n:e>0?`${n} · ${t}`:t},x=t.map((e,t)=>({key:e.key,color:e.color,value:y(d[t])})),S={key:`tools`,color:Ia.tools,label:n(`timing.tools`),ms:l.toolsMs,times:n(`timing.toolTimes`,{n:r(l.toolCalls)})},C={key:`other`,color:Ia.other,label:n(`timing.other`),ms:v};m=[...x,{key:`tools`,color:Ia.tools,value:y(_)},{key:`other`,color:Ia.other,value:y(v)}];let w=e=>({key:e.key,color:e.color,label:e.label,dim:e.ms===0,pct:a(e.ms,f),count:b(e.ms,e.times)});h=[...t.map(w),w(S),w(C)].filter(e=>!e.dim)}return(0,d.jsxs)(`div`,{className:`lc-card lc-col-donut flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`timing.title`)}),p!==null&&(0,d.jsx)(`span`,{className:`lc-card-rate`,title:n(`timing.tpsTip`),children:n(`timing.tps`,{tps:p})})]}),h.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(`timing.empty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`lc-donut-row flex items-center justify-start gap-3 min-w-0 @max-[320px]/lc-card:gap-2 @max-[240px]/lc-card:flex-wrap`,children:[(0,d.jsx)(t,{segments:m,size:96,centerTop:f>0?i(f):`—`,centerSub:n(`timing.total`),hoverKey:s,onHoverKey:c}),(0,d.jsx)(Da,{rows:h,hoverKey:s,onHoverKey:c})]}),e.spans!==void 0&&e.spans.length>0?(0,d.jsx)(o,{spans:e.spans,hoverKey:s,onHoverKey:c}):null]})]})}}function za(e){let{t}=e;return function(e){let{row:n}=e,r=n.timeline,i=Ei(n),a=r!==null&&typeof r.contextWindow==`number`&&r.contextWindow>0?Wt(r.current.total,r.contextWindow):null,o=Di(r),s=r?.counts?.steps,c=s===void 0?String(o):t(`ov.card.turns`,{n:o,s}),l=mi(n.cwd),u=e.group!==void 0&&e.group!==l?e.group:void 0,f=Oi(n.activity),p=r?.lastUser;return(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-session`+(n.current?` lc-ov-session-current`:``),onClick:()=>{e.onOpen(n.id)},children:[(0,d.jsxs)(`span`,{className:`lc-ov-session-head`,children:[n.running&&(0,d.jsx)(`span`,{className:`lc-ov-running`,title:t(`ov.running`)}),(0,d.jsx)(`span`,{className:`lc-ov-session-title`,title:n.title,children:n.title}),n.current&&(0,d.jsx)(`span`,{className:`lc-ov-current`,children:t(`ov.current`)}),(0,d.jsxs)(`span`,{className:`lc-ov-session-times`,children:[(0,d.jsx)(`span`,{className:`lc-ov-session-time`,children:Ui(t,n.updatedAt,e.now)}),f!==void 0&&(0,d.jsx)(`span`,{className:`lc-ov-session-created`,children:f})]})]}),(u!==void 0||l!==void 0)&&(0,d.jsxs)(`span`,{className:`lc-ov-session-crumb`,title:n.cwd,children:[u!==void 0&&(0,d.jsx)(`span`,{className:`lc-ov-crumb-group`,children:u}),u!==void 0&&l!==void 0&&(0,d.jsx)(`span`,{className:`lc-ov-crumb-sep`,children:`/`}),l!==void 0&&(0,d.jsx)(`span`,{className:`lc-ov-crumb-project`,children:l})]}),r===null?(0,d.jsx)(`span`,{className:`lc-ov-session-empty`,children:t(`ov.list.noData`)}):(0,d.jsxs)(`span`,{className:`lc-ov-session-body`,children:[(0,d.jsx)(Sa,{size:64,segments:z(r.current),centerTop:zt(r.current.total),centerSub:a??void 0}),(0,d.jsxs)(`span`,{className:`lc-ov-mini-stats`,children:[(0,d.jsxs)(`span`,{className:`lc-ov-mini-stat`,children:[(0,d.jsx)(`span`,{className:`lc-ov-mini-label`,children:t(`stats.turns`)}),(0,d.jsx)(`span`,{className:`lc-ov-mini-value`,children:c})]}),(0,d.jsxs)(`span`,{className:`lc-ov-mini-stat`,children:[(0,d.jsx)(`span`,{className:`lc-ov-mini-label`,children:t(`ov.card.teamUsage`)}),(0,d.jsx)(`span`,{className:`lc-ov-mini-value`,children:i===null?`—`:zt(i)})]}),(0,d.jsxs)(`span`,{className:`lc-ov-mini-stat`,children:[(0,d.jsx)(`span`,{className:`lc-ov-mini-label`,children:t(`ov.card.teamCost`)}),(0,d.jsx)(`span`,{className:`lc-ov-mini-value`,children:e.costLabel})]})]})]}),p!==void 0&&(0,d.jsxs)(`span`,{className:`lc-ov-session-preview`,title:p,children:[(0,d.jsx)(`span`,{className:`lc-ov-session-preview-label`,children:t(`ov.card.lastUser`)}),(0,d.jsx)(`span`,{className:`lc-ov-session-preview-text`,children:p})]})]})}}let Ba=`lc-skilltip-bubble`,Va=[`var(--color-blue-500)`,`var(--color-green-500)`,`var(--color-purple-500)`,`var(--color-orange-500)`,`var(--color-teal-500)`,`var(--color-pink-500)`,`var(--color-indigo-500)`,`var(--color-amber-500)`],Ha=[`loads`,`recent`];function Ua(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)>>>0;return Va[t%Va.length]}function Wa(e,t){let n=t.source;return n===`project-dsh`||n===`project-agents`?e(`ov.skills.src.project`):n===`user-dsh`||n===`user-agents`?e(`ov.skills.src.user`):n===`bundled`?e(`ov.skills.src.bundled`):n??``}function Ga(e){let t=e.description.replace(/\s+/g,` `).trim();return t.length>160?t.slice(0,160)+`…`:t}function Ka(e,t){return`${e.t(`ov.skills.loads`,{n:e.fmt(t.loads)})} · ${e.t(`ov.skills.sessions`,{n:e.fmt(t.sessions)})}`}function qa(e,t){return`${zr(t.last)??``} ${e.fmtTime(t.last)}`.trim()}function Ja(e,t){return`${Ka(e,t)} · ${qa(e,t)}`}function Ya(e){return(0,d.jsxs)(`div`,{className:`lc-skilld-head`,children:[(0,d.jsx)(`i`,{className:`lc-ov-skill-dot`,style:{background:Ua(e.name)}}),(0,d.jsx)(`span`,{className:`lc-skilld-name`,children:e.name}),e.origin!==``&&(0,d.jsx)(`span`,{className:`lc-skilld-chip`,children:e.origin})]})}function Xa(e){let{t,fmt:n}=e;return function(r){let{stats:i}=r,a=i.reduce((e,t)=>Math.max(e,t.loads),0),[o,s]=(0,u.useState)(``),c=o.trim().toLowerCase(),l=c===``?i:i.filter(e=>e.name.toLowerCase().includes(c)),f=l.reduce((e,t)=>e+t.loads,0),[m,h]=(0,u.useState)(null),[g,_]=(0,u.useState)(null),v=(0,u.useRef)(null),y=m===null?void 0:i.find(e=>e.name===m.name);(0,u.useEffect)(()=>{if(m===null)return;let e=()=>{h(null)};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[m]),(0,u.useLayoutEffect)(()=>{if(m===null)return;let e=v.current;if(e===null)return;let t=e.offsetWidth,n=e.offsetHeight,{rect:r}=m,i=Math.max(8,Math.min(r.left+r.width/2-t/2,window.innerWidth-t-8)),a=r.top-n-6<8?r.bottom+6:r.top-n-6;_({forRow:m,left:i,top:a})},[m]);let[b,x]=(0,u.useState)(!1),S=(0,u.useRef)(null);(0,u.useEffect)(()=>{x(!1)},[r.selected]),(0,u.useEffect)(()=>()=>{S.current!==null&&clearTimeout(S.current)},[]);let C=async e=>{await qi(e)&&(x(!0),S.current!==null&&clearTimeout(S.current),S.current=setTimeout(()=>{x(!1)},1500))},w=r.selected,T=w==null?void 0:i.find(e=>e.name===w),E=w==null?void 0:r.catalog?.get(w),D=w==null||E===void 0&&T===void 0?null:{name:w,origin:E===void 0?``:Wa(t,E),description:E===void 0?``:Ga(E),path:E?.path},O=D?.path,k=w!=null&&l.slice(0,20).some(e=>e.name===w),A=D===null?null:(0,d.jsxs)(`div`,{className:`lc-ov-skill-detail`,children:[!k&&(0,d.jsx)(Ya,{name:D.name,origin:``}),D.description!==``&&(0,d.jsx)(`p`,{className:`lc-skilld-desc`,children:D.description}),(0,d.jsxs)(`div`,{className:`lc-skilld-grid`,children:[D.origin!==``&&(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-skilld-k`,children:t(`ov.skills.k.source`)}),(0,d.jsx)(`span`,{className:`lc-skilld-v`,children:D.origin})]}),T!==void 0&&(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-skilld-k`,children:t(`ov.skills.k.usage`)}),(0,d.jsx)(`span`,{className:`lc-skilld-v`,children:Ka(e,T)}),(0,d.jsx)(`span`,{className:`lc-skilld-k`,children:t(`ov.skills.k.last`)}),(0,d.jsx)(`span`,{className:`lc-skilld-v`,children:qa(e,T)})]}),O!==void 0&&(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-skilld-k`,children:t(`ov.skills.k.path`)}),(0,d.jsxs)(`button`,{type:`button`,className:`lc-skilld-v lc-skilld-pathv`,"data-lc-tip":t(`ov.skills.copyPath`),onClick:()=>{C(O)},children:[(0,d.jsx)(`span`,{className:`lc-skilld-pathv-text`,children:b?t(`ov.skills.copied`):O}),b?(0,d.jsx)(sn,{size:12}):(0,d.jsx)(cn,{size:12})]})]})]})]}),j=y===void 0?null:(()=>{let n=r.catalog?.get(y.name),i=n===void 0?``:Wa(t,n),a=n===void 0?``:Ga(n),o=r.selected===y.name,s=g!==null&&g.forRow===m?g:null;return(0,p.createPortal)((0,d.jsxs)(`div`,{ref:v,id:Ba,role:`tooltip`,className:`lc-tip lc-skilltip`,style:s===null?{left:0,top:0,visibility:`hidden`}:{left:s.left,top:s.top,opacity:1},children:[(0,d.jsx)(Ya,{name:y.name,origin:i}),a!==``&&(0,d.jsx)(`p`,{className:`lc-skilld-desc`,children:a}),n?.path!==void 0&&(0,d.jsx)(`div`,{className:`lc-skilld-path`,children:n.path}),(0,d.jsxs)(`div`,{className:`lc-skilld-foot`,children:[(0,d.jsx)(`span`,{children:Ja(e,y)}),(0,d.jsx)(`span`,{className:`lc-skilld-hint`,children:t(o?`ov.skills.clickRelease`:`ov.skills.clickFilter`)})]})]}),document.body)})(),M=r.sort??`loads`;return(0,d.jsxs)(`div`,{className:`lc-card lc-ov-skills-card`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:t(`stats.skills`)}),r.day!==null&&r.day!==void 0&&(0,d.jsx)(`span`,{className:`lc-card-sub`,children:r.day}),i.length>1&&(0,d.jsx)(`div`,{className:`lc-gran`,role:`group`,"aria-label":t(`ov.skills.sortLabel`),children:Ha.map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(M===e?` lc-gran-on`:``),"aria-pressed":M===e,onClick:()=>{r.onSort?.(e)},children:t(`ov.skills.sort.`+e)},e))})]}),i.length>0&&(0,d.jsxs)(`div`,{className:`lc-ov-skills-sub`,children:[(0,d.jsx)(`span`,{className:`lc-card-sub lc-ov-skills-sub-n`,children:t(`ov.skills.summary`,{skills:n(l.length),loads:n(f)})}),i.length>1&&(0,d.jsx)(`input`,{className:`lc-ov-search lc-ov-skills-search`,type:`search`,value:o,placeholder:t(`ov.skills.search`),"aria-label":t(`ov.skills.search`),onChange:e=>{s(e.target.value)}})]}),i.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.skills.empty`)}):l.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:t(`ov.skills.noMatch`)}):(0,d.jsxs)(`div`,{className:`lc-ov-skills`,role:`group`,"aria-label":t(`stats.skills`),children:[l.slice(0,20).map(e=>{let i=Ua(e.name),o=r.selected===e.name,s=Math.round(e.loads/Math.max(a,1)*100),c=(0,d.jsx)(`i`,{className:`lc-ov-skill-bar`,style:{width:`calc(${s}% - ${Math.round(s*12)/100}px)`,background:i}}),l=(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-skill`,"aria-pressed":o,"aria-describedby":m?.name===e.name?Ba:void 0,onMouseEnter:t=>{let n=t.currentTarget.getBoundingClientRect();h({name:e.name,rect:{left:n.left,top:n.top,width:n.width,bottom:n.bottom}})},onMouseLeave:()=>{h(null)},onFocus:t=>{let n=t.currentTarget.getBoundingClientRect();h({name:e.name,rect:{left:n.left,top:n.top,width:n.width,bottom:n.bottom}})},onBlur:()=>{h(null)},onClick:()=>{r.onSelect?.(o?null:e.name)},children:[(0,d.jsx)(`i`,{className:`lc-ov-skill-dot`,style:{background:i}}),(0,d.jsx)(`span`,{className:`lc-ov-skill-name`,children:e.name}),(0,d.jsxs)(`span`,{className:`lc-ov-skill-count`,children:[`×`,n(e.loads)]}),(0,d.jsx)(`span`,{className:`lc-ov-skill-last`,children:Ui(t,e.last,r.now)}),c]});return o?(0,d.jsxs)(`div`,{className:`lc-ov-skill-unit`,children:[l,A]},e.name):(0,d.jsx)(u.Fragment,{children:l},e.name)}),l.length>20&&(0,d.jsx)(`div`,{className:`lc-ov-skill-more`,children:t(`ov.skills.more`,{n:l.length-20})})]}),!k&&A,j]})}}let Za=[`today`,`7d`,`30d`,`all`],Qa=[`recent`,`tokens`,`context`],$a=[`sessions`,`steps`];function eo(e,t){let{t:n,fmtDuration:r}=t,i=ba(t),a=za(t),o=pa(e,t),s=_a(t),c=Oa(t,Sa),l=Ra(t,Sa),f=ja(t),p=Xa(t),m=Gn(n);function h(){let t=e.locale;return typeof t.getLocale==`function`?t.getLocale().active:`en`}function g(){return h()===`zh`?`cny`:`usd`}function _(t){let{book:m}=kr(),_=di(t),v=fi(t),[y,b]=(0,u.useState)(`30d`),[x,S]=(0,u.useState)(null),[C,w]=(0,u.useState)(null),[T,E]=(0,u.useState)(``),[D,O]=(0,u.useState)(null),[k,A]=(0,u.useState)(null),[j,M]=(0,u.useState)(`loads`),[N,ee]=(0,u.useState)(`recent`),[P,F]=(0,u.useState)(`steps`),[I,L]=(0,u.useState)(0),{zoneProps:R,bubble:te}=Ea(),ne=(0,u.useMemo)(()=>vi(_,v),[_,v]),z=(0,u.useMemo)(()=>pi(v),[v]),[re,ie]=(0,u.useState)(null),ae=(ne??[]).find(e=>e.current),B=ae?.cwd,oe=ae?.id;(0,u.useEffect)(()=>{let e=!0;return ie(null),Gi(B,oe).then(t=>{e&&t!==null&&ie(t)}),()=>{e=!1}},[B,oe]),(0,u.useEffect)(()=>{Hi(),Vi(e)},[]),(0,u.useEffect)(()=>{L(0)},[y,x,C,T,D,k,N]);let V=g(),se=Date.now(),ce=ne??[],H=(x===null?null:Ti(x))??Ci(y,se),U=H.start===null?null:zr(H.start),W=H.start===null?null:zr(H.end??se),G=U!==null&&W!==null?{from:U,to:W}:null,le=ki(ce,{scope:H,day:null,query:``}),ue=ki(le,{scope:H,day:C,query:T}),K=hi(ue,v),q=D!==null&&!K.some(e=>e.key===D)?[...K,{key:D,count:0}]:K,de=Ai((D===null?ue:ue.filter(e=>gi(e,D,z))).filter(e=>k===null||Pi(e,k,{scope:H,day:C})),N),J=ji(de,I),Y=zi(le,ce.length,m,V),fe=Bi(ce,m,V),X=t=>{Ae(e,t)};return(0,d.jsxs)(`section`,{className:`lc-ov-page`,"aria-label":n(`ov.title`),...R,children:[te,(0,d.jsx)(`div`,{className:`lc-ov-pagescroll`,children:(0,d.jsxs)(`div`,{className:`lc-ov-pagecontent`,children:[(0,d.jsxs)(`div`,{className:`lc-ov-pagehead`,children:[(0,d.jsx)(`h1`,{className:`lc-ov-pagetitle`,children:n(`ov.title`)}),(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-settings`,title:n(`plugin.settingsOpen`),onClick:()=>{Qi()},children:[(0,d.jsx)(un,{size:14}),n(`plugin.settings`)]}),(0,d.jsx)(o,{}),(0,d.jsxs)(`div`,{className:`lc-ov-headctl`,children:[(0,d.jsx)(s,{value:G,picked:x!==null,onChange:e=>{S(e)},today:xa(),locale:h()}),(0,d.jsx)(`div`,{className:`lc-gran lc-ov-range`,role:`group`,"aria-label":n(`ov.range.label`),children:Za.map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(x===null&&y===e?` lc-gran-on`:``),onClick:()=>{b(e),S(null)},children:n(`ov.range.`+e)},e))})]})]}),ne===null?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(`ov.unavailable`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`lc-ov-first`,children:[(0,d.jsxs)(`div`,{className:`lc-ov-kpis`,children:[(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`ov.kpi.sessions`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:Y.sessions}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.ofTotal`,{n:Y.listed})})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`ov.kpi.tokens`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:zt(Y.tokens)}),(0,d.jsxs)(`span`,{className:`lc-stat-sub`,children:[n(`stats.turns`),` `,zt(Y.turns)]})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`stats.cost`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:Y.cost===null?`—`:fr(Y.cost,V)}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.pricedSub`,{n:Y.costSessions,total:Y.sessions})})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`stats.cacheHit`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:Y.cacheHit===null?`—`:Y.cacheHit+`%`}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.sessionsSub`,{n:Y.usageSessions})})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`stats.toolCalls`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:zt(Y.toolCalls)}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.toolSub`,{dur:r(Y.toolsMs)})})]}),(0,d.jsxs)(`div`,{className:`lc-stat lc-ov-kpi`,children:[(0,d.jsx)(`span`,{className:`lc-stat-label`,children:n(`timing.total`)}),(0,d.jsx)(`span`,{className:`lc-stat-value`,children:r(Y.wallMs)}),(0,d.jsx)(`span`,{className:`lc-stat-sub`,children:n(`ov.kpi.wallSub`,{n:zt(Y.calls)})})]})]}),(0,d.jsx)(f,{days:fe,currency:V,today:xa()})]}),(0,d.jsxs)(`div`,{className:`lc-ov-stats`,children:[(0,d.jsx)(c,{tokens:Y.tokenParts}),(0,d.jsx)(l,{timing:Y.timing})]}),(0,d.jsxs)(`div`,{className:`lc-ov-body`,children:[(0,d.jsxs)(`div`,{className:`lc-ov-left`,children:[(0,d.jsxs)(`div`,{className:`lc-card lc-ov-heat-card`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`ov.heat.title`)}),(0,d.jsxs)(`span`,{className:`lc-heat-ctl`,children:[(0,d.jsx)(`span`,{className:`lc-card-sub`,children:n(`ov.heat.sub`)}),(0,d.jsx)(`div`,{className:`lc-gran`,role:`group`,"aria-label":n(`ov.heat.metric`),children:$a.map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(P===e?` lc-gran-on`:``),onClick:()=>{F(e)},children:n(`ov.heat.metric.`+e)},e))})]})]}),(0,d.jsx)(i,{days:fe,metric:P,selected:C,onSelect:w,today:xa()})]}),(0,d.jsx)(p,{stats:Ni(le,{scope:H,day:C,sort:j}),day:C,selected:k,onSelect:A,sort:j,onSort:M,catalog:re,now:se})]}),(0,d.jsxs)(`div`,{className:`lc-ov-right`,children:[(0,d.jsxs)(`div`,{className:`lc-ov-list-head`,children:[(0,d.jsx)(`span`,{className:`lc-ov-list-title`,children:n(`ov.list.title`)}),(0,d.jsx)(`span`,{className:`lc-ov-list-count`,children:de.length}),C!==null&&(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-day-chip`,title:n(`ov.list.dayClear`),onClick:()=>{w(null)},children:[n(`ov.list.dayFilter`,{day:C}),` ×`]}),k!==null&&(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-day-chip`,title:n(`ov.list.skillClear`),onClick:()=>{A(null)},children:[n(`node.skillTag`,{name:k}),` ×`]}),(0,d.jsx)(`input`,{className:`lc-ov-search`,type:`search`,value:T,placeholder:n(`ov.list.search`),"aria-label":n(`ov.list.search`),onChange:e=>{E(e.target.value)}}),(0,d.jsx)(`div`,{className:`lc-gran`,role:`group`,"aria-label":n(`ov.list.sortLabel`),children:Qa.map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(N===e?` lc-gran-on`:``),onClick:()=>{ee(e)},children:n(`ov.list.sort.`+e)},e))})]}),q.length>0&&(0,d.jsxs)(`div`,{className:`lc-ov-groups`,role:`group`,"aria-label":n(`ov.group.label`),children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-chip`+(D===null?` lc-ov-chip-on`:``),onClick:()=>{O(null)},children:[n(`ov.range.all`),(0,d.jsx)(`span`,{className:`lc-ov-chip-n`,children:ue.length})]}),q.map(e=>(0,d.jsxs)(`button`,{type:`button`,className:`lc-ov-chip`+(D===e.key?` lc-ov-chip-on`:``),onClick:()=>{O(D===e.key?null:e.key)},children:[e.key===`__ungrouped__`?n(`ov.group.ungrouped`):e.key,(0,d.jsx)(`span`,{className:`lc-ov-chip-n`,children:e.count})]},e.key))]}),de.length===0?(0,d.jsx)(`div`,{className:`lc-empty`,children:n(ce.length===0?`ov.list.empty`:`ov.list.noMatch`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{className:`lc-ov-grid`,children:J.items.map(e=>(0,d.jsx)(a,{row:e,...z?.[e.id]===void 0?{}:{group:z[e.id]},costLabel:to(e,m,V),now:se,onOpen:X},e.id))}),J.count>1&&(0,d.jsxs)(`div`,{className:`lc-ov-pager`,role:`navigation`,"aria-label":n(`ov.list.pager`),children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-ov-pager-btn`,disabled:J.index===0,"aria-label":n(`ov.list.prev`),onClick:()=>{L(J.index-1)},children:`‹`}),(0,d.jsx)(`span`,{className:`lc-ov-pager-n`,children:n(`ov.list.page`,{n:J.index+1,total:J.count})}),(0,d.jsx)(`button`,{type:`button`,className:`lc-ov-pager-btn`,disabled:J.index===J.count-1,"aria-label":n(`ov.list.next`),onClick:()=>{L(J.index+1)},children:`›`})]})]})]})]})]})]})})]})}return function(e){return(0,d.jsx)(m,{children:(0,d.jsx)(_,{...e})})}}function to(e,t,n){if(e.familyCost===null)return`—`;let r=cr(e.familyCost,t,n);return r===null?`—`:fr(r,n)}function no(e){let[t,n]=(0,u.useState)(!1),r=e.options.find(t=>t.id===e.value)?.label??e.value;return(0,d.jsxs)(`div`,{className:`lc-settings-row`,children:[(0,d.jsx)(`span`,{className:`lc-settings-label`,children:e.label}),(0,d.jsx)(f.Menu,{open:t,onClose:()=>{n(!1)},items:e.options,selectedId:e.value,onSelect:t=>{n(!1),e.onPick(t)},align:`end`,portal:!0,anchor:(0,d.jsxs)(`button`,{type:`button`,className:`lc-settings-select hover:enabled:bg-(--dsw-alias-interactive-bg-hover) disabled:opacity-50 disabled:cursor-default`,disabled:e.disabled,"aria-haspopup":`menu`,"aria-expanded":t,onClick:()=>{n(e=>!e)},children:[r,(0,d.jsx)(dn,{})]})})]})}function ro(e){let{t,state:n,set:r}=e,i=n.status!==`ready`||!n.writable;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(no,{label:t(`settings.placement`),value:n.placement,disabled:i,options:[{id:`all`,label:t(`placement.all`)},{id:`tab`,label:t(`placement.tab`)},{id:`sidebar`,label:t(`placement.sidebar`)}],onPick:e=>{r?.(`defaultPlacement`,e)}}),(0,d.jsx)(no,{label:t(`settings.insightsEntry`),value:n.insightsEntry,disabled:i,options:[{id:`show`,label:t(`insightsEntry.show`)},{id:`hide`,label:t(`insightsEntry.hide`)}],onPick:e=>{r?.(`insightsEntry`,e)}}),(0,d.jsx)(no,{label:t(`settings.gran`),value:n.granularity,disabled:i,options:[{id:`step`,label:t(`gran.step`)},{id:`turn`,label:t(`gran.turn`)}],onPick:e=>{r?.(`defaultGranularity`,e)}}),(0,d.jsx)(no,{label:t(`settings.mode`),value:n.mode,disabled:i,options:[{id:`total`,label:t(`gran.total`)},{id:`delta`,label:t(`gran.delta`)}],onPick:e=>{r?.(`defaultTrendMode`,e)}}),(0,d.jsx)(no,{label:t(`settings.durationCurve`),value:n.durationCurve,disabled:i,options:[{id:`show`,label:t(`insightsEntry.show`)},{id:`hide`,label:t(`insightsEntry.hide`)}],onPick:e=>{r?.(`defaultDurationCurve`,e)}}),(0,d.jsx)(no,{label:t(`settings.deltaBase`),value:n.deltaBase,disabled:i,options:[{id:`step`,label:t(`browser.base.step`)},{id:`turn`,label:t(`browser.base.turn`)}],onPick:e=>{r?.(`defaultDeltaBase`,e)}}),(0,d.jsx)(no,{label:t(`settings.toolSort`),value:n.toolSort,disabled:i,options:[{id:`size`,label:t(`tool.sort.size`)},{id:`count`,label:t(`tool.sort.count`)},{id:`name`,label:t(`tool.sort.name`)}],onPick:e=>{r?.(`defaultToolSort`,e)}}),(0,d.jsx)(no,{label:t(`settings.fileSort`),value:n.fileSort,disabled:i,options:[{id:`count`,label:t(`files.sort.count`)},{id:`latest`,label:t(`files.sort.latest`)},{id:`path`,label:t(`files.sort.path`)}],onPick:e=>{r?.(`defaultFileSort`,e)}})]})}function io(e){let{t}=e;return function(e){let n=typeof e.useContextSettings==`function`?e.useContextSettings(e=>e):void 0;return n===void 0||n.status===`unavailable`?null:(0,d.jsxs)(`div`,{className:`lc-settings-prefs`,children:[!n.writable&&n.status===`ready`?(0,d.jsx)(`p`,{className:`lc-settings-note`,role:`status`,children:t(`settings.readOnly`)}):null,(0,d.jsx)(ro,{t,state:n,set:e.set})]})}}let ao=`dsh-context`;function oo(e,t,n,r,i){let a=!1,o=[],s=e=>{typeof e==`function`&&o.push(e)},c=()=>{s(e.slots.inject(`main`,()=>e.slots.register({name:`main`,key:ao,locale:i},n))),s(e.slots.inject(`sidebar.panellist`,()=>e.slots.register({name:`sidebar.panellist`,id:ao,order:20,label:()=>r(`ov.title`),locale:i},e=>(0,u.createElement)(T,{size:typeof e.size==`number`?e.size:void 0}))))},l=()=>{for(;o.length>0;)o.pop()?.()},d=e=>{e===`show`&&!a?(a=!0,c()):e===`hide`&&a&&(a=!1,l())};d(t.insightsEntry());let f=t.store.subscribe(()=>{d(t.insightsEntry())});return()=>{f(),a&&(a=!1,l())}}function so(e){if(typeof e!=`object`||!e)return{};let t=e;return{...t.defaultPlacement===`all`||t.defaultPlacement===`tab`||t.defaultPlacement===`sidebar`?{placement:t.defaultPlacement}:{},...t.defaultGranularity===`step`||t.defaultGranularity===`turn`?{granularity:t.defaultGranularity}:{},...t.defaultTrendMode===`total`||t.defaultTrendMode===`delta`?{mode:t.defaultTrendMode}:{},...t.defaultDeltaBase===`step`||t.defaultDeltaBase===`turn`?{deltaBase:t.defaultDeltaBase}:{},...t.defaultToolSort===`size`||t.defaultToolSort===`count`||t.defaultToolSort===`name`?{toolSort:t.defaultToolSort}:{},...t.defaultFileSort===`count`||t.defaultFileSort===`latest`||t.defaultFileSort===`path`?{fileSort:t.defaultFileSort}:{},...t.insightsEntry===`show`||t.insightsEntry===`hide`?{insightsEntry:t.insightsEntry}:{},...t.defaultDurationCurve===`show`||t.defaultDurationCurve===`hide`?{durationCurve:t.defaultDurationCurve}:{}}}function co(){let e={status:`loading`,placement:`all`,granularity:`step`,mode:`total`,deltaBase:`step`,toolSort:`count`,fileSort:`count`,insightsEntry:`show`,durationCurve:`show`,writable:!1},t,n=new Set,r=t=>{if(t.status!==e.status||t.placement!==e.placement||t.granularity!==e.granularity||t.mode!==e.mode||t.deltaBase!==e.deltaBase||t.toolSort!==e.toolSort||t.fileSort!==e.fileSort||t.insightsEntry!==e.insightsEntry||t.durationCurve!==e.durationCurve||t.writable!==e.writable){e=t;for(let e of n)e()}},i=t=>{let n=t.getSnapshot(),i=so(n.value),a=n.value!==null&&typeof n.value==`object`?n.value:void 0;return r({status:n.status===`ready`||n.status===`unavailable`?n.status:`loading`,placement:i.placement??(a?.defaultPlacement===void 0?e.placement:`all`),granularity:i.granularity??e.granularity,mode:i.mode??e.mode,deltaBase:i.deltaBase??e.deltaBase,toolSort:i.toolSort??e.toolSort,fileSort:i.fileSort??e.fileSort,insightsEntry:i.insightsEntry??(a?.insightsEntry===void 0?e.insightsEntry:`show`),durationCurve:i.durationCurve??(a?.defaultDurationCurve===void 0?e.durationCurve:`show`),writable:n.writable}),{placement:i.placement,insightsEntry:i.insightsEntry}};return{store:{subscribe(e){return n.add(e),()=>{n.delete(e)}},getSnapshot:()=>e},defaultPlacement:()=>e.placement,defaultGranularity:()=>e.granularity,defaultTrendMode:()=>e.mode,defaultDeltaBase:()=>e.deltaBase,defaultToolSort:()=>e.toolSort,defaultFileSort:()=>e.fileSort,insightsEntry:()=>e.insightsEntry,defaultDurationCurve:()=>e.durationCurve,attach(e){return t=e,i(e),e.subscribe(()=>{i(e)})},set(n,a){r({...e,...so({[n]:a})});let o=t;o!==void 0&&o.set(n,a).catch(()=>{let t=i(o);n===`defaultPlacement`&&t.placement===void 0&&r({...e,placement:`all`}),n===`insightsEntry`&&t.insightsEntry===void 0&&r({...e,insightsEntry:`show`})})}}}function lo(e){return[...e.nodes,...e.archive].sort((e,t)=>e.seq-t.seq)}function uo(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1;e[i].seq<t?n=i+1:r=i}return n}function fo(e,t,n){if(n<0||n>=t.length)return null;let r=t[n],i=uo(e,r.seq),a=i<e.length&&e[i].seq===r.seq?e[i]:void 0,o=a!==void 0&&a.cat===`assistant`?a:void 0,s=n===0||(t[n-1].turn??0)!==(r.turn??0),c=n;for(;c>0&&(t[c-1].turn??0)===(r.turn??0);)c--;let l=t[c].seq,u=c>0?t[c-1].seq:-1,d;for(let t=uo(e,l)-1;t>=0;t--){let n=e[t];if(n.seq<=u)break;if(n.cat===`user`){d=n;break}}let f=[];if(!s){let i=t[n-1].seq;for(let t=uo(e,i+1);t<e.length&&e[t].seq<r.seq;t++)f.push(e[t])}return{opener:d,inputs:f,response:o}}function po(e,t){return e===`read_image`||mo.test(t)?`image`:t.endsWith(`/`)?`dir`:`text`}let mo=/\.(png|jpe?g|gif|webp|svg|bmp|ico|avif)$/i,ho=[[[`test`,`tests`,`__tests__`,`spec`,`specs`,`e2e`],`🧪`,`files.glyph.tests`],[[`doc`,`docs`,`documentation`],`📚`,`files.glyph.docs`],[[`node_modules`,`vendor`,`third_party`,`third-party`,`packages`],`📦`,`files.glyph.deps`],[[`dist`,`build`,`out`,`target`,`release`,`debug`,`coverage`,`artifacts`],`🏗️`,`files.glyph.build`],[[`scripts`,`tools`,`bin`],`🛠️`,`files.glyph.scripts`],[[`config`,`configs`,`settings`,`.config`],`⚙️`,`files.glyph.config`],[[`assets`,`static`,`public`,`images`,`fonts`,`icons`,`media`],`🎨`,`files.glyph.assets`]],go=[`package-lock.json`,`pnpm-lock.yaml`,`npm-shrinkwrap.json`],_o=[`makefile`,`justfile`,`cmakelists.txt`],vo=/(^|[^a-z0-9])test([^a-z0-9]|$)|\.test\./,yo=[[[`tsx`],`TSX`,`#3178c6`,`files.glyph.lang.ts`],[[`ts`],`TS`,`#3178c6`,`files.glyph.lang.ts`],[[`js`,`jsx`,`mjs`,`cjs`],`JS`,`#f7df1e`,`files.glyph.lang.js`],[[`py`,`pyi`,`pyw`],`PY`,`#3572a5`,`files.glyph.python`],[[`ipynb`],`NB`,`#da5b0b`,`files.glyph.notebook`],[[`go`],`GO`,`#00add8`,`files.glyph.lang.go`],[[`rs`],`RS`,`#dea584`,`files.glyph.lang.rust`],[[`java`],`JV`,`#b07219`,`files.glyph.lang.java`],[[`kt`,`kts`],`KT`,`#a97bff`,`files.glyph.lang.kotlin`],[[`rb`],`RB`,`#701516`,`files.glyph.lang.ruby`],[[`php`],`PHP`,`#4f5d95`,`files.glyph.lang.php`],[[`c`,`h`],`C`,`#555555`,`files.glyph.lang.c`],[[`cpp`,`cc`,`cxx`,`hpp`],`C++`,`#f34b7d`,`files.glyph.lang.cpp`],[[`cs`],`C#`,`#178600`,`files.glyph.lang.csharp`],[[`scala`],`SC`,`#c22d40`,`files.glyph.lang.scala`],[[`lua`],`LUA`,`#000080`,`files.glyph.lang.lua`],[[`dart`],`DA`,`#00b4ab`,`files.glyph.lang.dart`],[[`swift`],`SW`,`#f05138`,`files.glyph.lang.swift`],[[`vue`],`VUE`,`#41b883`,`files.glyph.lang.vue`],[[`svelte`],`SV`,`#ff3e00`,`files.glyph.lang.svelte`],[[`sh`,`bash`,`zsh`,`fish`,`ps1`],`SH`,`#89e051`,`files.glyph.shell`],[[`html`,`htm`,`xhtml`],`HT`,`#e34c26`,`files.glyph.lang.html`],[[`css`,`scss`,`sass`,`less`,`styl`],`CSS`,`#563d7c`,`files.glyph.style`],[[`sql`],`SQL`,`#e38c00`,`files.glyph.database`]];function bo(e){let t=parseInt(e.slice(1),16);return(.299*(t>>16&255)+.587*(t>>8&255)+.114*(t&255))/255<.6?`#ffffff`:`#1f2328`}let xo=[[[`yaml`,`yml`,`toml`,`ini`,`conf`,`cfg`,`properties`,`env`],`⚙️`,`files.glyph.config`],[[`json`,`jsonc`,`json5`,`jsonl`,`ndjson`,`xml`],`🧾`,`files.glyph.data`],[[`md`,`mdx`,`markdown`,`rst`,`adoc`,`org`],`📝`,`files.glyph.markdown`],[[`log`],`📜`,`files.glyph.log`],[[`csv`,`tsv`,`xls`,`xlsx`,`ods`],`📊`,`files.glyph.sheet`],[[`pdf`,`doc`,`docx`,`odt`,`rtf`],`📕`,`files.glyph.document`],[[`zip`,`gz`,`tgz`,`tar`,`bz2`,`xz`,`7z`,`rar`,`jar`],`🗜️`,`files.glyph.archive`],[[`ttf`,`otf`,`woff`,`woff2`,`eot`],`🔤`,`files.glyph.font`],[[`mp4`,`mov`,`mkv`,`webm`,`mp3`,`wav`,`flac`,`ogg`],`🎬`,`files.glyph.media`]];function So(e){if(e===``||e===`.`)return{glyph:`🏠`,tip:`files.glyph.root`};let t=e.toLowerCase();for(let[e,n,r]of ho)if(e.includes(t))return{glyph:n,tip:r};return t.startsWith(`.`)?{glyph:`🗄️`,tip:`files.glyph.hidden`}:{glyph:`📁`,tip:`files.form.dir`}}function Co(e){let t=e.toLowerCase(),n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1):``;if(t.endsWith(`.lock`)||go.includes(t))return{glyph:`🔒`,tip:`files.glyph.lock`};if(vo.test(t))return{glyph:`🧪`,tip:`files.glyph.tests`};if(t===`dockerfile`||t.startsWith(`dockerfile.`))return{glyph:`🐳`,tip:`files.glyph.docker`};if(_o.includes(t))return{glyph:`🛠️`,tip:`files.glyph.scripts`};if(t===`.gitignore`||t===`.gitattributes`)return{glyph:`🚫`,tip:`files.glyph.ignore`};if(t===`license`||t.startsWith(`license.`)||t===`copying`)return{glyph:`⚖️`,tip:`files.glyph.license`};if(t===`.env`||t.startsWith(`.env.`))return{glyph:`⚙️`,tip:`files.glyph.config`};if(r!==``){for(let[e,t,n,i]of yo)if(e.includes(r))return{glyph:t,tip:i,color:n,text:bo(n)};for(let[e,t,n]of xo)if(e.includes(r))return{glyph:t,tip:n}}return{glyph:`📄`,tip:`files.form.text`}}function wo(e,t){if(t===`image`)return{glyph:`🖼`,tip:`files.form.image`};let n=e.endsWith(`/`)?e.slice(0,-1):e,r=n.slice(n.lastIndexOf(`/`)+1);return t===`dir`?So(r):Co(r)}let To=/^[a-zA-Z]:[\\/]/;function Eo(e,t){if(e.startsWith(`/`)||To.test(e))return e;if(!(t===void 0||t===``||e.startsWith(`.`)))return t.replace(/\/+$/,``)+`/`+e.replace(/^\/+/,``)}function Do(e,t,n,r,i){if(n!==!0&&t!==`dir`&&r!==void 0&&r!==``)try{return Ir(r,i,e)}catch{return}}function Oo(e,t){let n=t!==void 0&&t.length>1?t.replace(/\/+$/,``):void 0;if(n!==void 0){if(e===n)return`./`;if(e.startsWith(n+`/`))return`./`+e.slice(n.length+1)}return e.startsWith(`/`)||To.test(e)||e.startsWith(`.`)?e:`./`+e}function ko(e,t){let n={read:{files:0,ops:0},write:{files:0,ops:0},search:{files:0,ops:0},image:{files:0,ops:0},added:0,removed:0},r=new Map;for(let i of e){let e=i.parent??i.seq;if(t!==null&&e>=t)continue;n[i.kind].ops++;let a=r.get(i.path);a===void 0&&(a={path:i.path,form:po(i.tool,i.path),reads:0,writes:0,searches:0,added:0,removed:0,errs:0,ops:[],...i.pattern===!0?{pattern:!0}:{}},r.set(i.path,a)),i.kind===`read`?a.reads++:i.kind===`write`?a.writes++:a.searches++,a.added+=i.added,a.removed+=i.removed,i.err&&a.errs++,a.ops.push(i)}let i=[...r.values()];for(let e of i)e.ops.sort((e,t)=>t.seq-e.seq),e.reads>0&&n.read.files++,e.writes>0&&n.write.files++,e.searches>0&&n.search.files++,e.form===`image`&&(n.image.files++,n.image.ops+=e.ops.length),n.added+=e.added,n.removed+=e.removed;return i.sort((e,t)=>t.ops[0].seq-e.ops[0].seq),{entries:i,totals:n}}function Ao(e,t,n){let r=new Map;for(let e of t)e.gone!==void 0&&r.set(e.seq,e.gone);return ko(e.map(e=>{let t=r.get(e.parent??e.seq);return t!==void 0&&e.gone===void 0?{...e,gone:t}:e}),n)}function jo(e){let t=e;if(t.kind!==`tool-result`||t.call===null||typeof t.call!=`object`)return null;let n=t.call;return typeof n.name!=`string`||typeof n.argsRaw!=`string`||typeof t.seq!=`number`||!Number.isFinite(t.seq)?null:{name:n.name,argsRaw:n.argsRaw,seq:t.seq,...typeof t.time==`number`?{time:t.time}:{},...t.isError===!0?{err:!0}:{err:!1},...Array.isArray(t.subCalls)?{subCalls:t.subCalls}:{}}}function Mo(e){let t=lt(e?.call?.argsRaw)?.description;return typeof t==`string`&&t!==``?t:void 0}function No(e,t,n,r,i,a){if(!(a>8))for(let o of e){if(typeof o!=`object`||!o||i.has(o))continue;i.add(o);let e=jo(o);e!==null&&(r.push(...Ct({seq:e.seq,tool:e.name,argsRaw:e.argsRaw,err:e.err,...e.time===void 0?{}:{time:e.time},...t.gone===void 0?{}:{gone:t.gone},parent:t.seq,...n===void 0?{}:{program:n}})),e.subCalls!==void 0&&No(e.subCalls,t,n,r,i,a+1))}}function Po(e,t,n){let r=[];for(let i of e){if(i.cat!==`tool`||n!==null&&i.seq>=n)continue;let e=i.tool;if(e!==void 0)try{let n=t(i.seq);r.push(...Ct({seq:i.seq,tool:e,argsRaw:n?.call?.argsRaw,meta:n?.meta,err:i.err===!0||n?.isError===!0,...i.time===void 0?{}:{time:i.time},...i.gone===void 0?{}:{gone:i.gone}}));let a=n?.subCalls;a!==void 0&&a.length>0&&No(a,i,Mo(n),r,new Set,1)}catch{}}return ko(r,null)}function Fo(e,t,n){for(let r of e)if(r.seq>t&&(n===void 0||n>r.seq))return r.seq;return n===void 0?`live`:null}function Io(){let e=new Map;return{headOf(t){let n=e.get(t);if(n!==void 0)return n;let r=Je(t),i=r===void 0?Promise.resolve(null):r().then(e=>e?.head??null);return e.set(t,i),i}}}function Lo(e){let t=(0,u.useCallback)(t=>e===null||e.list===void 0?()=>{}:e.list.subscribe(t),[e]),n=(0,u.useCallback)(()=>e===null||e.list===void 0?null:e.list.getSnapshot(),[e]);return(0,u.useSyncExternalStore)(t,n)}function Ro(e,t,n,r){let i=Math.min(96,Math.max(24,(r-t)*.5));return`M ${e} ${t} C ${e} ${t+i}, ${n} ${r-i}, ${n} ${r}`}function zo(e,t,n=Io()){let{t:r,fmt:i,catLabel:a}=t;function o(){let t=e.locale;return typeof t.getLocale==`function`&&t.getLocale().active===`zh`?`cny`:`usd`}function s(t){let s=(0,u.useMemo)(()=>ci(e),[]),c=Lo(s),l=t.sessionId,[f,p]=(0,u.useState)(null),{book:m}=kr(),h=o(),g=(0,u.useRef)(null),[_,v]=(0,u.useState)(0);(0,u.useEffect)(()=>{let e=g.current;if(e===null||typeof ResizeObserver!=`function`)return;let t=new ResizeObserver(([e])=>{v(e.contentRect.width)});return t.observe(e),()=>{t.disconnect()}},[]),(0,u.useEffect)(()=>{let e=g.current;if(e!==null)return At(e)},[]),(0,u.useEffect)(()=>{s!==null&&typeof l==`string`&&l!==``&&typeof s.refreshSubagents==`function`&&s.refreshSubagents(l).catch(()=>{})},[s,l]);let[y,b]=(0,u.useState)(new Map),x=(0,u.useMemo)(()=>{let e=ei(c,l,t.self,y);return e===null?null:{forest:e,layout:ni(e,_)}},[c,l,t.self,_,y]);if((0,u.useEffect)(()=>{if(x===null)return;let e=(e,t)=>{e.then(e=>{e!==null&&b(n=>n.get(t)===e?n:new Map(n).set(t,e))}).catch(()=>{})};for(let t of x.forest.nodes)t.isCurrent||t.head!==null&&t.head.parts.length>0||e(n.headOf(t.id),t.id)},[x,n]),x===null)return null;let{forest:S,layout:C}=x,w=new Map(S.nodes.map(e=>[e.id,e])),T=S.nodes.find(e=>e.isCurrent)??S.nodes[0],E=(f===null?void 0:w.get(f))??T,D=S.nodes.filter(e=>e.running).length,O=0;for(let e of S.nodes)O+=e.head===null?0:e.head.tokens;let k=ai(S,f),A=t=>{t!==T.id&&Ae(e,t)},j=e=>t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),A(e))};return(0,d.jsxs)(`div`,{className:`lc-card lc-agents`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`agents.title`)}),(0,d.jsx)(`span`,{className:`lc-card-sub`,children:r(`agents.sub`)})]}),(0,d.jsxs)(`div`,{className:`lc-agents-chips`,children:[(0,d.jsx)(`span`,{className:`lc-agents-chip`,children:r(`agents.chip.count`,{n:S.nodes.length+S.overflow})}),(0,d.jsx)(`span`,{className:`lc-agents-chip`+(D>0?` lc-agents-chip-on`:``),children:r(`agents.chip.running`,{n:D})}),O>0?(0,d.jsx)(`span`,{className:`lc-agents-chip`,children:r(`agents.chip.tokens`,{n:i(O)})}):null,S.overflow>0?(0,d.jsx)(`span`,{className:`lc-agents-chip`,children:r(`agents.more`,{n:S.overflow})}):null]}),(0,d.jsx)(`div`,{className:`lc-agents-stage`,ref:g,children:(0,d.jsxs)(`div`,{className:`lc-agents-canvas`,style:{width:C.width,height:C.height},children:[(0,d.jsx)(`svg`,{className:`lc-agents-links`+(k===null?``:` lc-agents-focus`),width:C.width,height:C.height,viewBox:`0 0 ${C.width} ${C.height}`,children:C.links.map(e=>{let t=Ro(e.x1,e.y1,e.x2,e.y2),n=k!==null&&k.has(e.to);return(0,d.jsxs)(`g`,{className:n?`lc-agents-on`:void 0,children:[(0,d.jsx)(`path`,{className:`lc-agents-link stroke-[1.5px]`+(e.running?` lc-agents-link-live`:``),d:t,stroke:e.color,fill:`none`}),e.running?(0,d.jsx)(`path`,{className:`lc-agents-flow animate-lc-agent-flow fill-none stroke-2`,d:t,stroke:e.color}):null,(0,d.jsx)(`circle`,{className:`lc-agents-joint`,cx:e.x1,cy:e.y1,r:2,fill:e.color}),(0,d.jsx)(`circle`,{className:`lc-agents-joint`,cx:e.x2,cy:e.y2,r:3,fill:e.color})]},e.to)})}),S.nodes.map((e,t)=>{let n=C.points.find(t=>t.id===e.id);return n===void 0?null:(0,d.jsx)(Bo,{node:e,x:n.x,y:n.y,width:C.cardW,index:t,hovered:f===e.id,onHover:p,onOpen:A,onKeyOpen:j(e.id),book:m,currency:h,t:r,fmt:i},e.id)})]})}),S.solo?(0,d.jsx)(`div`,{className:`lc-empty lc-agents-solo`,children:r(`agents.solo`)}):null,(0,d.jsx)(Vo,{node:E,t:r,fmt:i,catLabel:a}),(0,d.jsxs)(`div`,{className:`lc-agents-legend`,children:[R.map(e=>(0,d.jsxs)(`span`,{className:`lc-agents-legend-item`,children:[(0,d.jsx)(`i`,{style:{background:e.color}}),a(e.key)]},e.key)),(0,d.jsxs)(`span`,{className:`lc-agents-legend-item`,children:[(0,d.jsx)(`i`,{className:`lc-agents-legend-free`}),r(`agents.legend.free`)]}),(0,d.jsxs)(`span`,{className:`lc-agents-legend-item`,children:[(0,d.jsx)(`i`,{className:`lc-agents-legend-edge`}),r(`agents.running`)]})]})]})}return s}function Bo(e){let{node:t,x:n,y:r,width:i}=e,a=t.head===null?null:t.head.pct,o=t.head===null?[]:si(t.head.parts,a,oi(a)),s=t.billed!==null&&t.billed>0?t.billed:t.costUsage===null?null:lr(t.costUsage),c=cr(t.costUsage,e.book,e.currency),l=[];s!==null&&s>0&&l.push(e.fmt(s)),c!==null&&l.push(fr(c,e.currency));let u=[];t.durationMs!==null&&u.push(li(t.durationMs)),t.requests>0&&u.push(e.t(`agents.steps`,{n:t.requests}));let p=`lc-agent-card animate-lc-agent-in motion-reduce:animate-none`+(t.isCurrent?` lc-agent-self`:``)+(e.hovered?` lc-agent-hover`:``)+(t.isCurrent?``:` lc-agent-clickable`);return(0,d.jsxs)(`div`,{className:p,style:{left:n-i/2,top:r,width:i,"--lc-i":Math.min(e.index,8)},"data-agent":t.id,role:t.isCurrent?void 0:`button`,tabIndex:t.isCurrent?void 0:0,onClick:()=>{e.onOpen(t.id)},onKeyDown:e.onKeyOpen,onMouseEnter:()=>{e.onHover(t.id)},onMouseLeave:()=>{e.onHover(null)},onFocus:()=>{e.onHover(t.id)},onBlur:()=>{e.onHover(null)},children:[(0,d.jsxs)(`div`,{className:`lc-agent-card-head`,children:[t.running||t.completed?(0,d.jsx)(f.StateDot,{state:t.running?`ongoing`:`done`,size:11,className:`lc-agent-state`}):null,(0,d.jsx)(`div`,{className:`lc-agent-label`,children:t.label}),t.isCurrent?(0,d.jsx)(`span`,{className:`lc-agents-badge lc-agent-self-badge`,children:e.t(`agents.self`)}):null]}),(0,d.jsx)(`div`,{className:`lc-agent-metric`,children:(0,d.jsx)(`b`,{className:`lc-agent-tokens`,children:l.length>0?l.join(` · `):`—`})}),(0,d.jsx)(`div`,{className:`lc-agent-bar`,children:o.filter(e=>!e.free).map((e,t)=>(0,d.jsx)(`i`,{className:`lc-agent-bar-seg animate-lc-stacked-in motion-reduce:animate-none`,style:{width:`${e.share*100}%`,background:e.color,"--lc-i":Math.min(t,8)}},e.key))}),u.length>0||a!==null?(0,d.jsxs)(`div`,{className:`lc-agent-meta`,children:[(0,d.jsx)(`span`,{className:`lc-agent-meta-text`,children:u.join(` · `)}),a===null?null:(0,d.jsxs)(`span`,{className:`lc-agent-pct`,style:{color:oi(a)},children:[a,`%`]})]}):null]})}function Vo(e){let{node:t,t:n,fmt:r,catLabel:i}=e,a=[];if(t.head!==null){let e=t.head,n=e.window===void 0?``:` / ${r(e.window)}`,i=e.pct===null?``:` · ${e.pct}%`;a.push(`${r(e.tokens)}${n}${i}`)}t.requests>0&&a.push(n(`agents.steps`,{n:t.requests})),t.billed!==null&&t.billed>0&&a.push(n(`agents.billed`,{n:r(t.billed)})),t.durationMs!==null&&a.push(li(t.durationMs));let o=t.head===null?[]:t.head.parts.filter(e=>(e.raw??e.value)>0),s=0;for(let e of o)s+=e.raw??e.value;return(0,d.jsxs)(`div`,{className:`lc-agents-inspector`,children:[(0,d.jsxs)(`div`,{className:`lc-agents-inspector-row`,children:[(0,d.jsx)(`b`,{className:`lc-agents-inspector-name`,children:t.label}),t.isCurrent?(0,d.jsx)(`span`,{className:`lc-agents-badge`,children:n(`agents.self`)}):null,t.running?(0,d.jsx)(`span`,{className:`lc-agents-badge lc-agents-badge-on`,children:n(`agents.running`)}):null,t.identity===null?null:(0,d.jsx)(`span`,{className:`lc-agents-badge`,children:n(t.identity.mode===`one-shot`?`agents.oneshot`:`agents.continuable`)}),(0,d.jsx)(`span`,{className:`lc-agents-inspector-stats`,children:a.join(` · `)}),t.isCurrent?null:(0,d.jsx)(`span`,{className:`lc-agents-inspector-open`,children:n(`agents.open`)})]}),o.length>0?(0,d.jsx)(`div`,{className:`lc-agents-inspector-parts`,children:o.map(e=>{let t=e.raw??e.value;return(0,d.jsxs)(`span`,{className:`lc-agents-part`,children:[(0,d.jsx)(`i`,{style:{background:e.color}}),i(e.key),(0,d.jsx)(`em`,{children:`≈${r(t)} (${Math.round(t/s*100)}%)`})]},e.key)})}):null]})}let Ho={compaction:`✂`,prune:`✂`,mode:`⇄`};function Uo(e){function t(t){if(t.kind===`compaction`)return e(`ev.compaction`,{n:t.count||0});if(t.kind===`prune`)return e(`ev.prune`);if(t.kind===`model`)return e(`ev.model`,{a:t.from||`?`,b:t.to||`?`});if(t.kind===`mode`)return e(`ev.mode.`+(t.name||`?`));if(t.sub===`skill`)return e(`ev.skill`,{name:t.name||`?`});let n=e(`form.`+(t.form||`context`)),r=t.name?n+` · `+t.name:n;return t.detail&&(r+=` · `+t.detail),r}function n(t){return t.kind===`compaction`||t.kind===`prune`?typeof t.turn==`number`&&typeof t.step==`number`?typeof t.fromTurn==`number`&&typeof t.fromStep==`number`?t.fromTurn===t.turn?e(`events.range`,{t:t.turn,a:t.fromStep,b:t.step}):e(`events.rangeTo`,{a:t.fromTurn,as:t.fromStep,b:t.turn,bs:t.step}):e(`events.at`,{t:t.turn,s:t.step}):null:typeof t.turn==`number`&&typeof t.step==`number`?e(`events.at`,{t:t.turn,s:t.step}):null}return{eventLabel:t,eventAt:n}}function Wo(e){for(let t of e.querySelectorAll(`.lc-event-label`))t.title=t.scrollWidth>t.clientWidth&&t.textContent||``}function Go(e){let{t,fmt:n,fmtTime:r,eventLabel:i,eventAt:a}=e,o=Ot(e);return function(e){let s=(0,u.useRef)(null);if((0,u.useLayoutEffect)(()=>{let e=s.current;e&&Wo(e)},[e.events]),(0,u.useEffect)(()=>{let e=()=>{let e=s.current;e!==null&&Wo(e)};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),e.events.length===0)return e.state===`loading`?(0,d.jsx)(o,{state:`loading`,className:`lc-empty lc-lane`}):e.state===`failed`&&e.onRetry!==void 0?(0,d.jsx)(o,{state:`failed`,onRetry:e.onRetry,className:`lc-empty lc-lane`}):(0,d.jsx)(`div`,{className:`lc-empty lc-lane`,children:t(`events.empty`)});let c=e.events.slice().reverse();return(0,d.jsx)(`div`,{className:`lc-events`,ref:s,children:c.map(e=>{let o=i(e),s=a(e),c=e.kind===`inject`?(0,d.jsx)(on,{}):e.kind===`model`?(0,d.jsx)(an,{}):Ho[e.kind]||`•`;return(0,d.jsxs)(`div`,{className:`lc-event @max-[380px]/lc-card:flex-wrap`,children:[(0,d.jsx)(`span`,{className:`lc-event-icon lc-event-`+e.kind,children:c}),(0,d.jsx)(`span`,{className:`lc-kind lc-kind-`+e.kind,children:t(`kind.`+e.kind)}),(0,d.jsx)(`span`,{className:`lc-event-label flex-1 @max-[380px]/lc-card:basis-[calc(100%-92px)]`,children:o}),s===null?null:(0,d.jsx)(`span`,{className:`lc-event-at`,children:s}),e.tokens?(0,d.jsx)(`span`,{className:`lc-event-tokens`+(e.kind===`inject`?` lc-up`:` lc-down`),children:(e.kind===`inject`?`+`:`−`)+n(e.tokens)}):null,(0,d.jsx)(`span`,{className:`lc-event-time`,children:r(e.time)})]},e.seq)})})}}function Ko(e,t){let{t:n,fmt:r,fmtTime:i}=e,a=Ot(e);function o(e,t){return t===`all`?!0:t===`image`?e.form===`image`:t===`read`?e.reads>0:t===`write`?e.writes>0:e.searches>0}function s(e){return(0,d.jsxs)(`span`,{className:`lc-fa-delta`,children:[e.added>0?(0,d.jsx)(`span`,{className:`lc-fa-up`,children:`+`+r(e.added)}):null,e.removed>0?(0,d.jsx)(`span`,{className:`lc-fa-down`,children:`−`+r(e.removed)}):null]})}return(0,u.memo)(function(e){let{activity:c}=e,[l,f]=(0,u.useState)(`all`),[p,m]=(0,u.useState)(()=>t.defaultFileSort()),[h,g]=(0,u.useState)(``),[_,v]=(0,u.useState)(null),y=h.trim().toLowerCase(),b=t=>t.pattern===!0?t.path:Oo(t.path,e.workspace),x=e=>l===`read`?e.reads:l===`write`?e.writes:l===`search`?e.searches:e.ops.length,S=c.entries.filter(e=>o(e,l)&&(y===``||b(e).toLowerCase().includes(y))).sort((e,t)=>p===`count`?x(t)-x(e)||t.ops[0].seq-e.ops[0].seq:p===`latest`?t.ops[0].seq-e.ops[0].seq:e.path<t.path?-1:1),C=[{key:`all`,files:c.entries.length,ops:c.totals.read.ops+c.totals.write.ops+c.totals.search.ops},{key:`read`,files:c.totals.read.files,ops:c.totals.read.ops},{key:`write`,files:c.totals.write.files,ops:c.totals.write.ops},{key:`search`,files:c.totals.search.files,ops:c.totals.search.ops},{key:`image`,files:c.totals.image.files,ops:c.totals.image.ops}],w=e=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-fa-op-tool`,title:e.tool,children:e.tool}),e.read===void 0?null:(0,d.jsx)(`span`,{className:`lc-fa-read`,title:`est`in e.read?n(`files.readEst`):n(`files.readTip`,{a:r(e.read.start),b:r(e.read.start+e.read.count-1)}),children:(`est`in e.read?`≈`:`>>`)+r(e.read.count)}),e.detail===void 0?null:(0,d.jsx)(`span`,{className:`lc-fa-op-detail`,children:e.detail}),e.hits===void 0?null:(0,d.jsx)(`span`,{className:`lc-fa-op-detail`,children:n(`files.hits`,{n:r(e.hits)})}),e.detail===void 0&&e.hits===void 0&&e.program!==void 0?(0,d.jsx)(`span`,{className:`lc-fa-op-detail`,children:e.program}):null,e.added+e.removed>0?(0,d.jsx)(s,{added:e.added,removed:e.removed}):null,e.err?(0,d.jsx)(`span`,{className:`lc-br-err-dot`,title:n(`node.failed`)}):null,(0,d.jsx)(`span`,{className:`lc-fa-op-time`,children:e.time===void 0?`—`:i(e.time)})]});return(0,d.jsxs)(`div`,{className:`lc-card lc-col flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`files.title`)}),(0,d.jsx)(`span`,{className:`lc-card-sub`,children:e.scope})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`lc-fa-ctl`,children:[(0,d.jsx)(`div`,{className:`lc-gran @max-[380px]/lc-card:flex-wrap`,children:C.map(e=>(0,d.jsxs)(`button`,{type:`button`,className:`lc-gran-btn`+(l===e.key?` lc-gran-on`:``)+(e.key===`read`||e.key===`write`||e.key===`search`?` lc-fa-chip-`+e.key:``),title:n(`files.chipTip`,{files:e.files,ops:e.ops}),onClick:()=>{f(t=>t===e.key?`all`:e.key)},children:[n(`files.kind.`+e.key),(0,d.jsx)(`b`,{className:`lc-fa-n`,children:r(e.ops)})]},e.key))}),(0,d.jsx)(`input`,{className:`lc-fa-search focus:border-(--dsw-alias-label-dimmed)`,value:h,placeholder:n(`files.search`),onChange:e=>{g(e.target.value)}})]}),(0,d.jsxs)(`div`,{className:`lc-fa-meta`,children:[(0,d.jsx)(`span`,{children:n(`files.files`,{n:c.entries.length})}),c.totals.added+c.totals.removed>0?(0,d.jsxs)(`span`,{className:`lc-fa-meta-delta group/tip`,children:[(0,d.jsx)(s,{added:c.totals.added,removed:c.totals.removed}),(0,d.jsx)(`span`,{className:`lc-tip lc-fa-meta-tip group-hover/tip:opacity-100`,role:`tooltip`,children:n(`files.deltaTip`)})]}):null,(0,d.jsx)(`span`,{className:`lc-gran lc-fa-sort`,role:`group`,title:n(`files.sortTip`),children:[`count`,`latest`,`path`].map(e=>(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(p===e?` lc-gran-on`:``),onClick:()=>{m(e)},children:n(`files.sort.`+e)},e))})]}),c.entries.length===0&&e.state===`loading`?(0,d.jsx)(a,{state:`loading`,className:`lc-empty lc-lane`}):c.entries.length===0&&e.state===`failed`&&e.onRetry!==void 0?(0,d.jsx)(a,{state:`failed`,onRetry:e.onRetry,className:`lc-empty lc-lane`}):S.length===0?(0,d.jsx)(`div`,{className:`lc-empty lc-lane`,children:n(c.entries.length===0?`files.empty`:`files.noMatch`)}):(0,d.jsx)(`div`,{className:`lc-fa-list`,children:S.map(t=>{let a=_===t.path,o=b(t),c=o.endsWith(`/`)?o.slice(0,-1):o,l=c.lastIndexOf(`/`),u=l>=0?c.slice(0,l+1):``,f=l>=0?c.slice(l+1):c,p=wo(t.path,t.form),m=t.pattern===!0?void 0:Eo(t.path,e.workspace),h=e.onPreview!==void 0&&t.pattern!==!0&&t.form!==`dir`,g=h||m!==void 0&&e.onOpen!==void 0;return(0,d.jsxs)(`div`,{className:`lc-fa-item`+(a?` lc-fa-item-on`:``),children:[(0,d.jsxs)(`button`,{type:`button`,className:`lc-fa-row hover:bg-(--dsw-alias-interactive-bg-hover) @max-[380px]/lc-card:flex-wrap`,title:t.path,onClick:()=>{v(a?null:t.path)},children:[(0,d.jsx)(`span`,{className:`lc-br-chev`+(a?` lc-br-chev-on`:``)}),(0,d.jsx)(`span`,{className:`lc-fa-form`,title:n(p.tip),children:p.color===void 0?p.glyph:(0,d.jsx)(`span`,{className:`lc-fa-lang`,style:{background:p.color,color:p.text},children:p.glyph})}),(0,d.jsxs)(`span`,{className:`lc-fa-path flex-1 @max-[380px]/lc-card:basis-[calc(100%-46px)]`,children:[u===``?null:(0,d.jsx)(`em`,{children:u}),g?(0,d.jsx)(`b`,{className:`lc-fa-file hover:underline`,title:n(h?`files.preview`:`files.open`),onClick:n=>{n.stopPropagation(),!(h&&e.onPreview?.(t)===!0)&&m!==void 0&&e.onOpen?.(m)},children:f}):(0,d.jsx)(`b`,{children:f})]}),t.reads>0?(0,d.jsxs)(`span`,{className:`lc-fa-badge lc-fa-b-read`,title:n(`files.kind.read`),children:[(0,d.jsx)(`i`,{}),r(t.reads)]}):null,t.writes>0?(0,d.jsxs)(`span`,{className:`lc-fa-badge lc-fa-b-write`,title:n(`files.kind.write`),children:[(0,d.jsx)(`i`,{}),r(t.writes)]}):null,t.searches>0?(0,d.jsxs)(`span`,{className:`lc-fa-badge lc-fa-b-search`,title:n(`files.kind.search`),children:[(0,d.jsx)(`i`,{}),r(t.searches)]}):null,t.added+t.removed>0?(0,d.jsx)(s,{added:t.added,removed:t.removed}):null,t.errs>0?(0,d.jsx)(`span`,{className:`lc-br-err-dot`,title:n(`files.errs`,{n:t.errs})}):null,t.ops[0].time===void 0?null:(0,d.jsx)(`span`,{className:`lc-fa-time`,children:i(t.ops[0].time)})]}),a?(0,d.jsx)(`div`,{className:`lc-fa-ops`,children:t.ops.map((t,r)=>{let i=e.onLocate,a=`${t.seq}:${r}`;return i===void 0?(0,d.jsx)(`div`,{className:`lc-fa-op`,children:w(t)},a):(0,d.jsx)(`button`,{type:`button`,className:`lc-fa-op lc-fa-op-link hover:bg-(--dsw-alias-interactive-bg-hover)`,title:n(`files.locate`),onClick:()=>{i(t)},children:w(t)},a)})}):null]},t.path)})})]})]})})}let qo=`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>`,Jo=`</title><path d="`,Yo=`"/></svg>`,Xo={title:`DeepSeek`,slug:`deepseek`,get svg(){return qo+`DeepSeek`+Jo+this.path+Yo},path:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`,source:`https://www.deepseek.com`,hex:`5786FE`},Zo={title:`GitHub`,slug:`github`,get svg(){return qo+`GitHub`+Jo+this.path+Yo},path:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`,source:`https://github.com/logos`,hex:`181717`,guidelines:`https://github.com/logos`},Qo=`https://github.com/bowenliang123/dsh-context`,$o=Qo.replace(/^https?:\/\/github\.com\//,``),es=[`https://registry.npmjs.org`,`https://registry.npmmirror.com`],ts=null;function ns(e){return fetch(e+`/dsh-context/latest`).then(e=>e.ok?e.json():null).then(e=>e!==null&&typeof e.version==`string`?e.version:null).catch(()=>null)}function rs(){return(!ts||Date.now()-ts.at>=36e5)&&(ts={at:Date.now(),promise:(async()=>{for(let e of es){let t=await ns(e);if(t!==null)return t}return null})()}),ts.promise}function is(e,t){let n=e=>e.replace(/^v/,``).split(`-`,1)[0].split(`.`).map(e=>parseInt(e,10)||0),r=n(e),i=n(t);for(let e=0;e<Math.max(r.length,i.length);e++){let t=r[e]||0,n=i[e]||0;if(t!==n)return t>n}return!1}function as({icon:e}){return(0,d.jsx)(`svg`,{width:12,height:12,className:`lc-pi-labelicon`,viewBox:`-2 -2 28 28`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:e.path,fill:`currentColor`})})}function os(e){let{t}=e,n=(e,t,n,r,i)=>(0,d.jsxs)(`a`,{className:`lc-pi-row group/pi`,href:r,target:`_blank`,rel:`noreferrer`,children:[(0,d.jsxs)(`div`,{className:`lc-pi-label`,children:[e,t]}),(0,d.jsx)(`div`,{className:`lc-pi-value group-hover/pi:underline`,title:i,children:n})]});return function(){let[e,r]=(0,u.useState)(null);(0,u.useEffect)(()=>{if(`0.67.0`.includes(`-dev`))return;let e=!0;return rs().then(t=>{e&&t&&r(t)}),()=>{e=!1}},[]);let i=e!==null&&is(e,`0.67.0`)?e:null,a=`dsh-context (v0.67.0)`,o=[a];return i&&o.push((0,d.jsx)(`span`,{className:`lc-pi-update`,children:`↑ v`+i},`update`)),(0,d.jsxs)(`div`,{className:`lc-card flex-1 min-w-[min(240px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:t(`plugin.title`)}),(0,d.jsx)(`a`,{className:`lc-card-sub lc-pi-hint hover:underline`,href:Qo,target:`_blank`,rel:`noreferrer`,children:t(`plugin.hint`)})]}),(0,d.jsxs)(`div`,{className:`lc-pi-grid`,children:[n((0,d.jsx)(as,{icon:Xo}),t(`plugin.name`),o,Qo,i===null?a:a+` ↑ v`+i),n((0,d.jsx)(as,{icon:Zo}),t(`plugin.github`),$o,Qo,$o),(0,d.jsxs)(`button`,{type:`button`,className:`lc-pi-row lc-pi-row-btn group/pi`,onClick:()=>{Qi()},children:[(0,d.jsxs)(`div`,{className:`lc-pi-label`,children:[(0,d.jsx)(un,{size:12,className:`lc-pi-labelicon`}),t(`plugin.settings`)]}),(0,d.jsx)(`div`,{className:`lc-pi-value group-hover/pi:underline`,title:t(`plugin.settingsOpen`),children:t(`plugin.settingsOpen`)})]})]})]})}}let ss=new Set;function cs(e){let{t}=e;return function(e){let n=typeof e.sessionId==`string`?e.sessionId:``,[r,i]=(0,u.useState)(null),a=r===n||ss.has(n),o=(0,u.useCallback)(()=>{ss.add(n),i(n)},[n]);return Kn(!a,o),a?null:(0,d.jsx)(`div`,{className:`lc-modal-backdrop`,onClick:o,children:(0,d.jsxs)(`div`,{className:`lc-modal-card lc-gate-card`,onClick:e=>{e.stopPropagation()},children:[(0,d.jsxs)(`div`,{className:`lc-modal-head`,children:[(0,d.jsx)(`span`,{className:`lc-modal-title`,children:t(`gate.title`)}),(0,d.jsx)(`button`,{className:`lc-modal-close hover:text-(--dsw-alias-label-primary) hover:bg-(--dsw-alias-bg-layer-2)`,"aria-label":t(`cmd.close`),onClick:o,children:`×`})]}),(0,d.jsx)(`div`,{className:`lc-gate-body`,children:t(`gate.body`,{minimum:e.minimum})}),(0,d.jsxs)(`div`,{className:`lc-gate-versions`,children:[(0,d.jsxs)(`span`,{className:`lc-gate-version`,children:[(0,d.jsx)(`span`,{className:`lc-gate-version-label`,children:t(`gate.current`)}),(0,d.jsxs)(`span`,{className:`lc-gate-version-value`,children:[`v`,e.current]})]}),(0,d.jsxs)(`span`,{className:`lc-gate-version`,children:[(0,d.jsx)(`span`,{className:`lc-gate-version-label`,children:t(`gate.minimum`)}),(0,d.jsxs)(`span`,{className:`lc-gate-version-value`,children:[`v`,e.minimum,(0,d.jsx)(`span`,{className:`lc-gate-or-newer`,children:t(`gate.orNewer`)})]})]})]}),(0,d.jsx)(`div`,{className:`lc-gate-actions`,children:(0,d.jsx)(`button`,{type:`button`,className:`lc-gate-ok hover:brightness-110`,onClick:o,children:t(`gate.ok`)})})]})})}}function ls(e,t){let{t:n,fmt:r,fmtTime:i,catLabel:a,eventLabel:o,eventAt:s}=e;function c(e){let t=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`span`,{className:`lc-brief-tag group/tip`,children:[e.tag,(0,d.jsx)(`span`,{className:`lc-tip lc-brief-tip group-hover/tip:opacity-100`,role:`tooltip`,children:e.tagTip})]}),e.children]});if(e.node===void 0||e.onLocate===void 0)return(0,d.jsx)(`div`,{className:`lc-brief-row`,children:t});let n=e.node,r=e.onLocate;return(0,d.jsx)(`button`,{type:`button`,className:`lc-brief-row lc-brief-row-link hover:bg-(--dsw-alias-interactive-bg-hover)`,onClick:()=>{r(n,e.isResponse)},children:t})}function l(e,t){if(e.cat===`tool`){let r=Tt(t);return e.tool===void 0?{tag:null,text:r??n(`node.toolResult`)}:{tag:e.tool,text:r??``}}if(e.cat===`skill`)return{tag:e.skill===void 0?n(`form.`+(e.form??`context`)):n(`node.skillTag`,{name:e.skill}),text:e.text??Tt(t)??``};if(e.cat===`assistant`){let r=e.calls!==void 0&&e.calls.length>0?e.calls:Dt(t),i=e.text!==void 0&&e.text!==``?e.text:Et(t)??``;return{tag:r.length>0?r.join(` › `):null,text:i===``?r.length>0?``:n(`node.empty`):i}}if(e.cat===`inject`){let t=e.text!==void 0&&e.text!==``?e.form===`snapshot`?n(`node.snapshot`)+e.text:e.text:``;return{tag:n(`form.`+(e.form??`context`)),text:t}}let r=e.imgs??0;return{tag:r>0?n(`attach.image`)+(r>1?` ×`+String(r):``):null,text:e.text??``}}function f(e,t){return e===null?t:t===``?e:e+` · `+t}function p(e){let{opener:t,inputs:r,response:i}=e.brief??{inputs:[]},a=e.convOf??(()=>void 0),o=e.onLocate===void 0?``:` — `+n(`brief.locate`),s=e.onLocate===void 0?void 0:t=>n=>{n?.stopPropagation(),e.onLocate?.(t,!1)},u=(e,t,n=!1)=>{let{tag:r,text:i}=l(e,a(e.seq));return(0,d.jsxs)(`span`,{className:`lc-brief-chip`+(n?` lc-brief-chip-grow`:``)+(t===void 0?``:` lc-brief-chip-link hover:bg-(--dsw-alias-interactive-bg-hover)`),title:f(r,i)+o,onClick:t,children:[e.err===!0?(0,d.jsx)(`span`,{className:`lc-br-err-dot`}):null,r===null?null:(0,d.jsx)(`span`,{className:`lc-brief-chip-tag`,children:r}),i===``?null:(0,d.jsx)(`span`,{className:`lc-brief-chip-text`,children:i})]},e.seq)},p=t===void 0?null:l(t,a(t.seq));return(0,d.jsxs)(`div`,{className:`lc-brief`,children:[t!==void 0&&p!==null?(0,d.jsxs)(c,{tag:n(`brief.turn`),tagTip:n(`brief.turnTip`),node:t,isResponse:!1,onLocate:e.onLocate,children:[p.tag===null?null:(0,d.jsx)(`span`,{className:`lc-brief-fact`,children:p.tag}),p.text===``?null:(0,d.jsx)(`span`,{className:`lc-brief-text`,title:f(p.tag,p.text)+o,children:p.text})]}):null,(0,d.jsx)(c,{tag:n(`brief.input`),tagTip:n(`brief.inputTip`),node:r[0],isResponse:!1,onLocate:e.onLocate,children:r.length>0?(0,d.jsxs)(d.Fragment,{children:[r.slice(0,3).map(e=>u(e,s?.(e))),r.length>3?(0,d.jsx)(`span`,{className:`lc-brief-more`,children:n(`brief.more`,{n:r.length-3})}):null]}):(0,d.jsx)(`span`,{className:`lc-brief-empty`,children:n(`brief.noInputs`)})}),i===void 0?null:(0,d.jsx)(c,{tag:n(`brief.reply`),tagTip:n(`brief.replyTip`),node:i,isResponse:!0,onLocate:e.onLocate,children:u(i,void 0,!0)})]})}return(0,u.memo)(function(e){let c=e.request;if(!c)return null;let l=c.stepCount!==void 0&&c.stepCount>1,u=l?n(`detail.turn`,{t:c.turn??0,n:c.stepCount??0}):n(`detail.step`,{t:c.turn??0,s:c.step??0,n:e.stepsOf?.(c.turn)??1}),f=e.marker??null,m=f===null?null:s(f),h=e.prev!==void 0,g=e.prev??null,_=R.map(e=>h?(c[e.key]||0)-(g===null?0:g[e.key]||0):0),v=0,y=0;if(h)for(let e of _)v+=e,Math.abs(e)>y&&(y=Math.abs(e));let b=h?R.map((e,t)=>({key:e.key,color:e.color,value:Math.abs(_[t])})):z(c);return(0,d.jsxs)(`div`,{className:`lc-detail`,children:[(0,d.jsxs)(`div`,{className:`lc-detail-head`,children:[(0,d.jsx)(`b`,{children:u}),f!==null&&m!==null?(0,d.jsx)(`span`,{className:`lc-detail-marker`,title:o(f),children:`✂ `+m}):null,l?(0,d.jsx)(`span`,{className:`lc-detail-tag`,children:n(`detail.lastStep`)}):null,h?(0,d.jsx)(`span`,{className:`lc-detail-tag`,children:n(`gran.delta`)}):null,(0,d.jsx)(`span`,{className:`lc-detail-time`,children:i(c.time)}),(0,d.jsxs)(`span`,{className:`lc-detail-metrics`,children:[h?(0,d.jsx)(`span`,{className:`lc-detail-metric`+(v>0?` lc-detail-metric-up`:v<0?` lc-detail-metric-down`:``),children:n(`tip.delta`,{n:(v>0?`+`:``)+r(v)})}):null,!h&&c.prompt!==void 0?(0,d.jsx)(`span`,{className:`lc-detail-metric`,children:n(`detail.actual`,{n:r(c.prompt)})}):null,!h&&c.output!==void 0?(0,d.jsx)(`span`,{className:`lc-detail-metric`,children:n(`detail.output`,{n:r(c.output)})}):null,!h&&c.prompt!==void 0&&c.cacheRead!==void 0?(0,d.jsx)(`span`,{className:`lc-detail-metric`,children:n(`detail.cache`,{n:Vt(c.cacheRead,c.prompt)??`—`})}):null]})]}),(0,d.jsx)(p,{brief:e.brief,convOf:e.convOf,onLocate:e.onLocate}),(0,d.jsx)(t,{parts:b,height:10,hoverKey:e.hoverKey,tip:!1}),(0,d.jsx)(`div`,{className:`lc-detail-rows`,children:R.map((t,n)=>{let i=h?_[n]:c[t.key]||0,o=Math.abs(i);return(0,d.jsxs)(`div`,{className:`lc-detail-row`+(e.hoverKey===t.key?` lc-detail-row-on`:``),children:[(0,d.jsx)(`i`,{style:{background:t.color}}),(0,d.jsx)(`span`,{className:`lc-detail-label`,children:a(t.key)}),(0,d.jsx)(`span`,{className:`lc-bar-track`,children:h?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`span`,{className:`lc-bar-zero`}),i===0?null:(0,d.jsx)(`span`,{className:`lc-bar-fill `+(i>0?`lc-bar-fill-up`:`lc-bar-fill-down`),style:{width:`${o/y*50}%`,background:t.color}})]}):(0,d.jsx)(`span`,{className:`lc-bar-fill`,style:{width:`${c.total>0?i/c.total*100:0}%`,background:t.color}})}),h?(0,d.jsx)(`span`,{className:`lc-detail-num`+(i>0?` lc-detail-num-up`:i<0?` lc-detail-num-down`:``),children:(i>0?`+`:``)+r(i)}):(0,d.jsx)(`span`,{className:`lc-detail-num`,children:`≈`+r(i)}),(0,d.jsx)(`span`,{className:`lc-detail-pct`,children:!h&&c.total>0?`${Math.round(i/c.total*100)}%`:``})]},t.key)})})]})})}function us(e){try{for(let t=e.parentElement;t!==null&&t!==document.body;t=t.parentElement){let n=window.getComputedStyle(t).overflowY;if((n===`auto`||n===`scroll`)&&t.scrollHeight>t.clientHeight)return t.scrollTop+=e.getBoundingClientRect().top-t.getBoundingClientRect().top,!0}}catch{}return!1}let ds=[[`hit`,`stats.costHit`],[`miss`,`stats.costMiss`],[`write`,`stats.costWrite`],[`out`,`stats.costOut`]];function fs(e,t){if(e===void 0||t===null)return[];let n=[];for(let r of Object.keys(e)){let i=U(e[r]);if(i!==null)for(let e of Object.keys(i)){let i=or(t,r,e);i!==null&&n.push({key:r+`/`+e,face:i})}}return n}function ps(e,t){let n=new Set;for(let t of e)n.add(t.turn??0);let r=0,i=0,a=0,o=new Set;for(let e of t)e.kind===`inject`?r++:e.kind===`compaction`?i++:e.kind===`prune`&&a++,e.sub===`skill`&&typeof e.name==`string`&&e.name!==``&&o.add(e.name);return{turns:n.size,steps:e.length,injects:r,compactions:i,prunes:a,skills:o.size}}function ms(e,t){return function(n){let r=Lo((0,u.useMemo)(()=>ci(e),[])),[i,a]=(0,u.useState)(new Map),o=(0,u.useMemo)(()=>ti(r,n,i),[r,n,i]);return(0,u.useEffect)(()=>{for(let e of o.cold)t.headOf(e).then(t=>{t!==null&&a(n=>n.get(e)===t?n:new Map(n).set(e,t))}).catch(()=>{})},[o,t]),{usage:o.usage,count:o.count}}}let hs=[`inputs`,`events`,`session`,`tools`,`cost`],gs=[{from:`inputs`,to:`session`,fromAt:.5,toAt:1/3,color:`var(--color-green-500)`},{from:`events`,to:`session`,fromAt:.5,toAt:2/3,color:`var(--color-purple-500)`},{from:`session`,to:`tools`,fromAt:1/3,toAt:.5,color:`var(--color-teal-500)`},{from:`session`,to:`cost`,fromAt:2/3,toAt:.5,color:`var(--color-pink-500)`}],_s=[{kind:`inject`,tally:`injects`,cls:`lc-kind-inject`},{kind:`compaction`,tally:`compactions`,cls:`lc-kind-compaction`},{kind:`prune`,tally:`prunes`,cls:`lc-kind-prune`}];function vs(e){let t=new Map;for(let n of e)(n.cat===`tool`||n.cat===`skill`&&n.tool!==void 0)&&typeof n.tool==`string`&&n.tool!==``&&t.set(n.tool,(t.get(n.tool)??0)+1);return[...t].sort((e,t)=>t[1]-e[1]||(e[0]<t[0]?-1:1))}function ys(e,t,n){switch(t){case`left`:return{x:e.x,y:e.y+e.h*n,dx:-1,dy:0};case`right`:return{x:e.x+e.w,y:e.y+e.h*n,dx:1,dy:0};case`top`:return{x:e.x+e.w*n,y:e.y,dx:0,dy:-1};case`bottom`:return{x:e.x+e.w*n,y:e.y+e.h,dx:0,dy:1}}}function bs(e,t){let n=Math.max(18,(e.dx===0?Math.abs(t.y-e.y):Math.abs(t.x-e.x))/2);return`M ${e.x} ${e.y} C ${e.x+e.dx*n} ${e.y+e.dy*n} ${t.x+t.dx*n} ${t.y+t.dy*n} ${t.x} ${t.y}`}function xs(e,t){let n=t?`right`:`bottom`,r=t?`left`:`top`;return gs.map(t=>({d:bs(ys(e[t.from],n,t.fromAt),ys(e[t.to],r,t.toAt)),color:t.color}))}function Ss(e){let{tools:t,t:n,fmt:r}=e,i=(0,u.useRef)(null),a=(0,u.useRef)(null),o=(0,u.useRef)(null),[s,c]=(0,u.useState)(t.length),l=(e,t,n)=>(0,d.jsxs)(`span`,{className:`lc-flow-pill`,title:n,children:[(0,d.jsx)(`span`,{className:`lc-flow-pill-label`,children:e}),(0,d.jsx)(`b`,{children:r(t)})]},e),f=(0,u.useCallback)(()=>{let e=i.current,n=a.current,r=o.current;if(e===null||n===null||r===null)return;let s=e.getBoundingClientRect().width;if(s<=0){c(t.length);return}let l=Array.from(n.children,e=>e.getBoundingClientRect().width),u=Array.from(r.children,e=>e.getBoundingClientRect().width),d=0;for(let e=Math.min(l.length,u.length-1);e>=0;e--){let n=u[t.length-e]+e*4;for(let t=0;t<e;t++)n+=l[t];if(n<=s){d=e;break}}c(e=>e===d?e:d)},[t]);return(0,u.useLayoutEffect)(f,[f]),(0,u.useEffect)(()=>{let e=i.current;if(e===null||typeof ResizeObserver!=`function`)return;let t=new ResizeObserver(f);return t.observe(e),()=>{t.disconnect()}},[f]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`lc-flow-pills lc-flow-pills-tools`,ref:i,children:[t.slice(0,s).map(([e,t])=>l(e,t,e)),(0,d.jsx)(`span`,{className:`lc-flow-pill lc-flow-pill-dim`,children:(0,d.jsx)(`span`,{className:`lc-flow-pill-label`,children:n(`stats.toolsMore`,{n:t.length-s})})})]}),(0,d.jsxs)(`span`,{className:`lc-flow-pill-gauge`,"aria-hidden":`true`,children:[(0,d.jsx)(`div`,{className:`lc-flow-pills`,ref:a,children:t.map(([e,t])=>l(e,t))}),(0,d.jsx)(`div`,{className:`lc-flow-pills`,ref:o,children:Array.from({length:t.length+1},(e,t)=>(0,d.jsx)(`span`,{className:`lc-flow-pill lc-flow-pill-dim`,children:(0,d.jsx)(`span`,{className:`lc-flow-pill-label`,children:n(`stats.toolsMore`,{n:t})})},t))})]})]})}function Cs(e,t){let{t:n,fmt:r}=e;return function(e){let i=e.locale===`zh`?`cny`:`usd`,{book:a,failed:o}=kr(),s=t(e.sessionId),c=s.usage,l=dr(e.cost,c)??void 0,f=cr(l,a,i),p=cr(c,a,i),m=e=>pr(Zn(e,i),i),h=fs(l,a),g=fs(c??void 0,a),_=l!==void 0&&Object.keys(l).some(e=>Xn(e)),v=c!==null&&Object.keys(c).some(e=>Xn(e)),y=h.length===0&&l!==void 0&&Object.keys(l).length>0&&(o||a!==null),b=g.length===0&&c!==null&&(o||a!==null),x=e=>e.length>0?(0,d.jsxs)(`span`,{className:`lc-stat-tip-prices`,children:[(0,d.jsx)(`span`,{className:`lc-stat-tip-head`,children:n(`stats.costPriceHead`)}),e.map(e=>(0,d.jsxs)(`span`,{className:`lc-stat-tip-row`,children:[ds.filter(([t])=>e.face.rate[t]>0).map(([t,r])=>(0,d.jsxs)(`span`,{className:`lc-stat-tip-band`,children:[(0,d.jsx)(`i`,{children:n(r)}),` `,(0,d.jsx)(`b`,{children:m(e.face.rate[t])})]},t)),(0,d.jsx)(`span`,{className:`lc-stat-tip-by`,children:n(`stats.costPriceBy`,{p:e.face.pid,m:e.face.mid})})]},e.key))]},`prices`):null,S=e=>[i===`cny`?(0,d.jsx)(`span`,{children:n(`stats.costTipCny`)},`cny`):null,e?(0,d.jsx)(`span`,{children:n(`stats.costTipDeepseek`)},`peak`):null].filter(e=>e!==null),C=[n(`stats.costTip`),(0,d.jsx)(`span`,{className:`lc-stat-tip-row`,children:n(`stats.billedTip`)},`billed`),x(h),...S(_),y?(0,d.jsx)(`span`,{children:n(`stats.costUnavailable`)},`unavailable`):null],w=[n(`stats.subCostTip`),(0,d.jsx)(`span`,{className:`lc-stat-tip-row`,children:n(`stats.billedTip`)},`billed`),x(g),...S(v),b?(0,d.jsx)(`span`,{children:n(`stats.costUnavailable`)},`unavailable`):null],T=(0,u.useRef)(null),E=(0,u.useRef)(new Map),[D,O]=(0,u.useState)([]),[,k]=(0,u.useState)(0),A=e=>t=>{t===null?E.current.delete(e):E.current.set(e,t)};(0,u.useLayoutEffect)(()=>{let e=T.current;if(e===null)return;let t=e.getBoundingClientRect(),n={};for(let e of hs){let r=E.current.get(e);if(r===void 0)return;let i=r.getBoundingClientRect();n[e]={x:i.left-t.left,y:i.top-t.top,w:i.width,h:i.height}}let r=xs(n,e.clientWidth>559);O(e=>e.length===r.length&&e.every((e,t)=>e.d===r[t].d&&e.color===r[t].color)?e:r)}),(0,u.useEffect)(()=>{let e=T.current;if(e===null||typeof ResizeObserver!=`function`)return;let t=new ResizeObserver(()=>{k(e=>e+1)});return t.observe(e),()=>{t.disconnect()}},[]);let j=(e,t,n,r)=>{let i=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`span`,{className:`lc-flow-label`,children:[e,n!==void 0&&(0,d.jsx)(`i`,{className:`lc-stat-q group-hover/tip:text-(--dsw-alias-label-primary) group-hover/tip:border-(--dsw-alias-label-primary)`,"aria-hidden":`true`,children:`?`})]}),(0,d.jsx)(`b`,{className:`lc-flow-total`,children:t}),n!==void 0&&(0,d.jsx)(`span`,{className:`lc-tip lc-stat-tip group-hover/tip:opacity-100`,role:`tooltip`,children:n})]}),a=`lc-flow-head`+(n===void 0?``:` lc-stat-tipped group/tip`);return r===void 0?(0,d.jsx)(`div`,{className:a,children:i}):(0,d.jsx)(`a`,{className:a,href:r,target:`_blank`,rel:`noreferrer noopener`,children:i})},M=(e,t,n=``,i)=>(0,d.jsxs)(`span`,{className:`lc-flow-pill`+n+(t===0?` lc-flow-pill-dim`:``)+(i===void 0?``:` lc-stat-tipped group/tip`),children:[(0,d.jsxs)(`span`,{className:`lc-flow-pill-label`,children:[e,i!==void 0&&(0,d.jsx)(`i`,{className:`lc-stat-q group-hover/tip:text-(--dsw-alias-label-primary) group-hover/tip:border-(--dsw-alias-label-primary)`,"aria-hidden":`true`,children:`?`})]}),(0,d.jsx)(`b`,{children:r(t)}),i!==void 0&&(0,d.jsx)(`span`,{className:`lc-tip lc-stat-tip group-hover/tip:opacity-100`,role:`tooltip`,children:i})]},e),N=e.onFigureClick,ee=(e,t,n,i)=>(0,d.jsxs)(`span`,{role:N===void 0?void 0:`button`,tabIndex:N===void 0?void 0:0,className:`lc-flow-kv`+(N===void 0?``:` lc-flow-kv-btn`),title:N===void 0?void 0:i,onClick:N===void 0?void 0:()=>{N(e)},onKeyDown:N===void 0?void 0:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),N(e))},children:[(0,d.jsx)(`b`,{children:r(t)}),(0,d.jsx)(`i`,{children:n})]},e),P=new Set(h.map(e=>e.face.pid).filter(e=>e!==``)),F=P.size===1?`https://models.dev/providers/`+[...P][0]+`/`:void 0,I=cr(e.cost,a,i),L=lr(l),R=lr(e.cost),te=lr(c),ne=(e,t)=>(0,d.jsxs)(`span`,{className:`lc-flow-pair`,children:[(0,d.jsx)(`b`,{children:r(e)}),(0,d.jsx)(`i`,{children:`/`}),(0,d.jsx)(`b`,{children:t})]}),z=f===null?`—`:fr(f,i),re=I===null?`—`:fr(I,i),ie=p===null?`—`:fr(p,i),ae=()=>{let e=T.current?.closest(`.lc-root`)?.querySelector(`.lc-agents`)??null;e!==null&&us(e)},B=e=>{e.target.closest(`a`)===null&&ae()},oe=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),ae())},V=(e.humanInputs??0)+e.files.reads+e.files.writes+e.files.searches+e.files.images,se=e.toolCalls??e.tools.reduce((e,[,t])=>e+t,0);return(0,d.jsxs)(`div`,{className:`lc-card flex-[3] min-w-[min(360px,100%)]`,children:[(0,d.jsx)(`div`,{className:`lc-card-title`,children:(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`stats.title`)})}),(0,d.jsxs)(`div`,{className:`lc-stats lc-flow`,ref:T,children:[(0,d.jsx)(`svg`,{className:`lc-flow-svg`,"aria-hidden":`true`,children:D.map((e,t)=>(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{className:`lc-flow-ribbon`,d:e.d,stroke:e.color}),(0,d.jsx)(`path`,{className:`lc-flow-dash animate-lc-agent-flow motion-reduce:animate-none`,d:e.d,stroke:e.color})]},t))}),(0,d.jsxs)(`div`,{className:`lc-flow-col`,children:[(0,d.jsxs)(`div`,{className:`lc-flow-node`,ref:A(`inputs`),children:[j(n(`stats.io`),r(V)),(0,d.jsxs)(`div`,{className:`lc-flow-pills`,children:[M(n(`stats.humanInputs`),e.humanInputs??0,``,n(`stats.humanInputsTip`)),M(n(`files.kind.read`),e.files.reads),M(n(`files.kind.write`),e.files.writes),e.files.searches>0?M(n(`files.kind.search`),e.files.searches):null,e.files.images>0?M(n(`files.kind.image`),e.files.images):null]})]}),(0,d.jsxs)(`div`,{className:`lc-flow-node`,ref:A(`events`),children:[j(n(`stats.events`),r(e.counts.injects+e.counts.compactions+e.counts.prunes)),(0,d.jsx)(`div`,{className:`lc-flow-pills`,children:_s.map(t=>M(n(`kind.`+t.kind),e.counts[t.tally],` lc-flow-pill-tint `+t.cls))})]})]}),(0,d.jsx)(`div`,{className:`lc-flow-mid`,children:(0,d.jsxs)(`div`,{className:`lc-flow-node lc-flow-self`,ref:A(`session`),children:[(0,d.jsx)(`span`,{className:`lc-flow-label`,children:n(`stats.session`)}),(0,d.jsxs)(`span`,{className:`lc-flow-self-stats`,children:[(0,d.jsxs)(`span`,{className:`lc-flow-kv`,children:[(0,d.jsx)(`b`,{children:r(e.counts.turns)}),(0,d.jsx)(`i`,{children:n(`stats.turns`)})]}),(0,d.jsxs)(`span`,{className:`lc-flow-kv`,children:[(0,d.jsx)(`b`,{children:r(e.counts.steps)}),(0,d.jsx)(`i`,{children:n(`stats.steps`)})]})]}),(0,d.jsxs)(`span`,{className:`lc-flow-self-stats`,children:[ee(`skills`,e.counts.skills??0,n(`stats.skills`),n(`stats.skillsJump`)),ee(`answers`,e.answers??0,n(`stats.answers`),n(`stats.answersJump`))]})]})}),(0,d.jsxs)(`div`,{className:`lc-flow-col lc-flow-col-r`,children:[(0,d.jsxs)(`div`,{className:`lc-flow-node`,ref:A(`tools`),children:[j(n(`stats.toolCalls`),r(se)),(0,d.jsx)(Ss,{tools:e.tools,t:n,fmt:r})]}),(0,d.jsxs)(`div`,{className:`lc-flow-node lc-flow-team`,ref:A(`cost`),role:`button`,tabIndex:0,onClick:B,onKeyDown:oe,children:[j(n(`agents.title`),ne(L,z),C,F),(0,d.jsxs)(`div`,{className:`lc-flow-rows`,children:[(0,d.jsxs)(`div`,{className:`lc-flow-row`,children:[(0,d.jsx)(`span`,{className:`lc-flow-row-label`,children:n(`stats.currentAgent`)}),ne(R,re)]}),(0,d.jsxs)(`div`,{className:`lc-flow-row lc-stat-tipped group/tip`,children:[(0,d.jsxs)(`span`,{className:`lc-flow-row-label`,children:[n(`stats.teamSubs`,{n:s.count}),(0,d.jsx)(`i`,{className:`lc-stat-q group-hover/tip:text-(--dsw-alias-label-primary) group-hover/tip:border-(--dsw-alias-label-primary)`,"aria-hidden":`true`,children:`?`})]}),ne(te,ie),(0,d.jsx)(`span`,{className:`lc-tip lc-stat-tip group-hover/tip:opacity-100`,role:`tooltip`,children:w})]})]})]})]})]})]})}}let ws={uncachedInputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0};function Ts(e,t){let{t:n,fmt:r,fmtShare:i,catLabel:a}=e;return function(e){let[o,s]=(0,u.useState)(null),c=e.usage===null?0:W(e.usage.uncachedInputTokens)+W(e.usage.cacheReadTokens)+W(e.usage.cacheWriteTokens),l=c+(e.usage===null?0:W(e.usage.outputTokens)),f=e.usage===null?null:Vt(W(e.usage.cacheReadTokens),c),p=ae(e.current,e.breakdown,e.usage??ws),m=l>0?p.filter(e=>e.value>0):p,h=m.map(e=>({key:e.key,color:e.color,label:e.key===`output`?n(`tokens.output`):a(e.key),pct:i(e.value,l),count:e.key===`output`?`${r(e.value)} · ${n(`tokens.outputNote`)}`:`≈`+r(e.value)}));return(0,d.jsxs)(`div`,{className:`lc-card lc-col-donut flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:n(`tokens.title`)}),f!==null&&(0,d.jsxs)(`span`,{className:`lc-card-rate`,title:n(`stats.cacheHitTip`),children:[n(`stats.cacheHit`),` `,f,`%`]})]}),(0,d.jsxs)(`div`,{className:`lc-donut-row flex items-center justify-start gap-3 min-w-0 @max-[320px]/lc-card:gap-2 @max-[240px]/lc-card:flex-wrap`,children:[(0,d.jsx)(t,{segments:m,size:96,centerTop:e.usage===null?`—`:r(l),centerSub:n(`tokens.total`),hoverKey:o,onHoverKey:s}),(0,d.jsx)(Da,{rows:h,hoverKey:o,onHoverKey:s})]})]})}}let Es=`dsh-context`,Ds=`dsh-context`;function Os(e,t,n,r){let i=e.inject([`sidebarRightTabs`],e=>{let i=e,a=[],o=e=>{typeof e==`function`&&a.push(e)};try{let e=i.sidebarRightTabs;if(e===void 0||typeof e.register!=`function`)return;o(e.register({id:Es,kind:Ds,title:()=>n(`tab`),guide:[{order:20,title:()=>n(`tab`),description:()=>n(`sidebar.guideDescription`),icon:w}]})),o(i.slots.inject(`sidebar.right.pane.tab`,()=>i.slots.register({name:`sidebar.right.pane.tab`,key:Es,locale:r},e=>t({...e,host:`sidebar`})))),o(i.slots.inject(`sidebar.right.pane.tab.title`,()=>i.slots.register({name:`sidebar.right.pane.tab.title`,key:Es},E(n))))}catch{for(let e of a)e();return}return()=>{for(let e of a)e()}});return()=>{i?.dispose?.()}}let ks=new Map,As=new Set;function js(e,t){ks.set(e,t);for(let e of As)e()}function Ms(e){return As.add(e),()=>{As.delete(e)}}function Ns(e){let t=ks.get(e);return t===void 0?null:(ks.delete(e),t)}function Ps(e){try{let t=U(e.get(`sidebarRight`));return t===null||typeof t.openTab!=`function`?!1:(t.openTab.call(t,Ds),!0)}catch{return!1}}function Fs(e){let t=document.querySelectorAll(`button[role="tab"]`);for(let n of t)if(n.textContent.trim()===e)return n.getAttribute(`aria-selected`)!==`true`&&n.click(),!0;return!1}let Is=new Map,Ls=[`inject`,`compaction`,`prune`,`model`,`mode`];function Rs(e){return(0,d.jsxs)(`div`,{className:`lc-trend-lane`,children:[(0,d.jsx)(`div`,{className:`lc-trend-plot`,children:e.children}),(0,d.jsxs)(`div`,{className:`lc-detail`,children:[(0,d.jsx)(`div`,{className:`lc-detail-head`}),(0,d.jsx)(`div`,{className:`lc-brief`}),(0,d.jsx)(`div`,{className:`lc-stacked-wrap`,children:(0,d.jsx)(`div`,{className:`lc-stacked`})}),(0,d.jsx)(`div`,{className:`lc-detail-rows`,children:R.map(t=>(0,d.jsxs)(`div`,{className:`lc-detail-row`,children:[(0,d.jsx)(`i`,{style:{background:t.color}}),(0,d.jsx)(`span`,{className:`lc-detail-label`,children:e.catLabel(t.key)}),(0,d.jsx)(`span`,{className:`lc-bar-track`}),(0,d.jsx)(`span`,{className:`lc-detail-num`}),(0,d.jsx)(`span`,{className:`lc-detail-pct`})]},t.key))})]})]})}function zs(e,t,n){let{t:r,catLabel:i}=t,a=Hn(t),o=Wn(t,a,Un(t)),s=It(t),c=ls(t,a),l=Go(t),f=Ko(t,n),p=Io(),m=Cs(t,ms(e,p)),h=Ra(t,Sa),g=Ts(t,Sa),_=os(t),v=cs(t),y=Ot(t),b=Vn(t,a,n),x=zo(e,t,p),S=Gn(r);function C(a){let p=a.sessionId,S=a.host===`sidebar`,C=tt(a),w=C.data,T=H(a,`contextPressure`,me),E=H(a,`tokenUsage`,ge),D=H(a,`contextBreakdown`,he),O=H(a,`contextHeaders`,xe),[k,A]=(0,u.useState)(null),[j,M]=(0,u.useState)(null),[N,ee]=(0,u.useState)(null),[P,F]=(0,u.useState)(()=>n.defaultGranularity()),[I,L]=(0,u.useState)(()=>n.defaultTrendMode()),[R,te]=(0,u.useState)(!1),[ne,z]=(0,u.useState)(!1),[re,ie]=(0,u.useState)(()=>n.defaultDurationCurve()===`show`),[ae,B]=(0,u.useState)(null),[V,U]=(0,u.useState)(null),[G,le]=(0,u.useState)(null),[ue,q]=(0,u.useState)(null),[de,J]=(0,u.useState)([...Ls]),Y=e=>{J(t=>t.length===Ls.length?[e]:t.includes(e)?t.length===1?[...Ls]:t.filter(t=>t!==e):[...t,e])},[fe,X]=(0,u.useState)(null),pe=(0,u.useCallback)(()=>{X(null)},[]),_e=(0,u.useMemo)(()=>se(e,typeof p==`string`?p:void 0),[e,p]),ve=Be(),ye=(0,u.useMemo)(()=>typeof p==`string`&&p!==``&&ve!==void 0?We(p):void 0,[p,ve]),be=(0,u.useMemo)(()=>typeof p==`string`&&p!==``&&ve!==void 0?Ke(p):void 0,[p,ve]),Se=(0,u.useRef)(null),Ce=(0,u.useRef)(null),we=(0,u.useRef)(null),[Te,Ae]=(0,u.useState)(null),je=(0,u.useCallback)(()=>{Ae(null)},[]),Me=(0,u.useCallback)(e=>{Ae(e===`skills`?{cat:`skill`}:{cat:`assistant`,kind:`answer`});let t=Se.current?.querySelector(`.lc-col-browser`)??null;t!==null&&us(t)},[]);(0,u.useLayoutEffect)(()=>{if(typeof p!=`string`||p===``||w===null||we.current===p)return;we.current=p;let e=Se.current===null?null:Se.current.closest(`[data-conversation-scroll]`);e!==null&&(Ce.current=e,e.scrollTop=Is.get(p)??0)},[p,w]),(0,u.useLayoutEffect)(()=>()=>{if(typeof p!=`string`||p===``)return;let e=Ce.current;e!==null&&Is.set(p,e.scrollTop)},[p]);let Z=w?w.requests:[],Ne=w?w.events:[],Pe=w?.counts??ps(Z,Ne),Fe={inject:Pe.injects,compaction:Pe.compactions,prune:Pe.prunes},Ie=de.length===Ls.length?Ne:Ne.filter(e=>de.includes(e.kind)),Q=(0,u.useMemo)(()=>P===`turn`?Mt(Z):Z,[Z,P]),Le=(0,u.useMemo)(()=>Nt(Z),[Z]),Re=(0,u.useMemo)(()=>Pt(Q,Ne),[Q,Ne]),ze=(0,u.useMemo)(()=>R&&w!==null?Q.map(e=>ot(it(w,O,e.seq))):null,[R,w,O,Q]),Ve=(0,u.useCallback)((e,t)=>{X({step:e,key:t.key,cat:t.cat})},[]);(0,u.useEffect)(()=>{if(typeof p!=`string`||p===``)return;let e=()=>{let e=Ns(p);e!==null&&U(e)};return e(),Ms(e)},[p]);let He=C.detailState===`ready`||C.detailState===`legacy`;(0,u.useEffect)(()=>{if(V===null||w===null||!He)return;U(null);let e=Ft(Mt(Z),V);if(e===null)return;F(`turn`),A(e.seq),B(e.turn??0);let t=Se.current?.querySelector(`[data-lc-current]`)??null;t!==null&&us(t)},[V,w,Z,He]);let Ue=(0,u.useMemo)(()=>w?lo(w):[],[w]),Ge=ce(a),qe=(0,u.useMemo)(()=>{let e=new Map;for(let t of Ge??[])e.set(t.seq,t);return e},[Ge]),Je=-1;for(let e=0;e<Q.length;e++)Q[e].seq===k&&(Je=e);let Ye=Je>=0?Q[Je]:null,Xe=-1;if(j!==null){for(let e=0;e<Q.length;e++)if(Q[e].seq===j){Xe=e;break}}Xe<0&&(Xe=Je),Xe<0&&Q.length>0&&(Xe=Q.length-1);let $=Xe>=0?Q[Xe]:null,Ze=null;if($!==null){let e=Z.findIndex(e=>e.seq===$.seq);Ze=e+1<Z.length?Z[e+1].seq:null}let Qe=(0,u.useMemo)(()=>$===null?null:fo(Ue,Q,Xe),[$,Ue,Q,Xe]),$e=(0,u.useCallback)(e=>qe.get(e),[qe]),et=(0,u.useMemo)(()=>w!==null&&w.fileOps!==void 0?Ao(w.fileOps,w.archive,Ze):Po(Ue,$e,Ze),[w,Ue,$e,Ze]),nt=(0,u.useMemo)(()=>{let e=(w!==null&&w.fileOps!==void 0?Ao(w.fileOps,w.archive,null):Po(Ue,$e,null)).totals;return{reads:e.read.ops,writes:e.write.ops,searches:e.search.ops,images:e.image.ops}},[w,Ue,$e]),rt=(0,u.useMemo)(()=>w?vs(w.nodes):[],[w]),at=typeof e.get==`function`?Ee(e,typeof p==`string`?p:void 0):void 0,[st,ct]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let t=!0;return De(e).then(e=>{t&&ct(e)}),()=>{t=!1}},[e]);let lt=(0,u.useMemo)(()=>st?Oe(e):void 0,[st,e]),ut=(0,u.useMemo)(()=>ke(e),[e]),dt=typeof p==`string`?p:void 0,ft=(0,u.useMemo)(()=>ut===void 0?void 0:e=>{let t=Do(e.path,e.form,e.pattern,dt,at);return t!==void 0&&ut(t)},[ut,dt,at]),pt=(0,u.useCallback)(e=>{let t=e.parent??e.seq,n=Fo(Z,t,e.gone);n!==null&&X({step:n,key:`n`+String(t),cat:`tool`})},[Z]),mt=(0,u.useCallback)((e,t)=>{if($===null)return;let n=t&&Xe+1<Q.length?Q[Xe+1]:null,r=t?n===null?`live`:n.seq:$.seq;X({step:r,key:`n`+String(e.seq),cat:e.cat})},[$,Xe,Q]);if(!w)return(0,d.jsx)(`div`,{className:`lc-root`,ref:Se,children:C.detailState===`failed`?(0,d.jsx)(y,{state:`failed`,onRetry:C.retryDetail}):(0,d.jsx)(`div`,{className:`lc-empty`,children:r(`loading`)})});let ht=e=>{let t=Q.indexOf(e);return t>=0?Re[t]:void 0},gt=oe(w,T,D),_t=r(`files.scopeLatest`);$!==null&&Ze!==null&&(_t=$.stepCount!==void 0&&$.stepCount>1?r(`detail.turn`,{t:$.turn??0,n:$.stepCount}):r(`detail.step`,{t:$.turn??0,s:$.step??0,n:Le($.turn)}));let vt=N;if(vt===null&&j!==null){for(let e of Q)if(e.seq===j){vt=e.turn??null;break}}let yt=G!==null&&G!==`free`?G:null,bt=e.get(`locale`),xt=bt!==void 0&&typeof bt.getLocale==`function`?bt.getLocale().active:`en`,St=(w.model??``)+(w.provider?` · `+w.provider:``),Ct=K(w.unsupported),wt=(0,d.jsx)(o,{head:gt,subtitle:St,hoverKey:G,onHoverKey:le}),Tt=(0,d.jsxs)(`div`,{className:`lc-card`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`trend.title`)}),(0,d.jsxs)(`span`,{className:`lc-gran lc-trend-mods`,role:`group`,children:[(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(R?` lc-gran-on`:``),title:r(`trend.dnaTip`),onClick:()=>{te(e=>!e)},children:r(`trend.dna`)}),(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(ne?` lc-gran-on`:``),title:r(`trend.adaptiveHint`),onClick:()=>{z(e=>!e)},children:r(`trend.adaptive`)}),(0,d.jsx)(`button`,{type:`button`,className:`lc-gran-btn`+(re?` lc-gran-on`:``),title:r(`trend.durationTip`),onClick:()=>{ie(e=>!e)},children:r(`trend.duration`)})]}),(0,d.jsxs)(`div`,{className:`lc-trend-ctl`,children:[(0,d.jsxs)(`div`,{className:`lc-gran`,children:[(0,d.jsx)(`button`,{className:`lc-gran-btn`+(P===`step`?` lc-gran-on`:``),onClick:()=>{F(`step`)},children:r(`gran.step`)}),(0,d.jsx)(`button`,{className:`lc-gran-btn`+(P===`turn`?` lc-gran-on`:``),onClick:()=>{F(`turn`)},children:r(`gran.turn`)})]}),(0,d.jsxs)(`div`,{className:`lc-gran`,title:r(`gran.modeHint`),children:[(0,d.jsx)(`button`,{className:`lc-gran-btn`+(I===`total`?` lc-gran-on`:``),onClick:()=>{L(`total`)},children:r(`gran.total`)}),(0,d.jsx)(`button`,{className:`lc-gran-btn`+(I===`delta`?` lc-gran-on`:``),onClick:()=>{L(`delta`)},children:r(`gran.delta`)})]})]})]}),Q.length===0?He?(0,d.jsx)(Rs,{catLabel:i,children:(0,d.jsx)(`div`,{className:`lc-empty`,children:r(`trend.empty`)})}):(0,d.jsx)(Rs,{catLabel:i,children:(0,d.jsx)(y,{state:C.detailState===`failed`?`failed`:`loading`,onRetry:C.retryDetail})}):(0,d.jsxs)(`div`,{children:[(0,d.jsx)(s,{requests:Q,markers:Re,selectedSeq:Ye?Ye.seq:null,hoveredSeq:j,activeTurn:vt,granularity:P,mode:I,focusTurn:ae,hoverCat:yt,focusCat:ue,adaptive:ne,durationCurve:re,dna:ze,onPickBand:Ve,onSelect:A,onHover:M,onHoverTurn:ee,onPickTurn:e=>{F(`turn`),B(e)},onFocusTurnHandled:()=>{B(null)}},p),(0,d.jsx)(c,{request:$,prev:I===`delta`&&Xe>=0?Xe>0?Q[Xe-1]:null:void 0,marker:$===null?void 0:ht($),brief:Qe,convOf:$e,stepsOf:Le,onLocate:mt,hoverKey:yt})]})]}),Et=(0,d.jsx)(b,{data:w,headers:O,convNodes:Ge,fetchContent:ye,fetchHeader:be,previewSeq:j,pinSeq:Ye===null?null:Ye.seq,hoverKey:G,onHoverKey:le,onOpenCat:q,nodeFocus:fe,onNodeFocusHandled:pe,loadImage:_e,detailState:C.detailState,onDetailRetry:C.retryDetail,catFocus:Te,onCatFocusHandled:je,dna:R,onDnaChange:te});return(0,d.jsxs)(`div`,{className:`lc-root`,ref:Se,children:[S?null:(0,d.jsxs)(`div`,{className:`lc-cols lc-head`,children:[(0,d.jsx)(m,{counts:Pe,humanInputs:w.humanInputs,answers:w.answers,toolCalls:w.toolCalls,files:nt,tools:rt,cost:w.cost,locale:xt,sessionId:typeof p==`string`?p:void 0,onFigureClick:Me}),(0,d.jsx)(_,{})]}),(0,d.jsxs)(`div`,{className:`lc-cols lc-head`,children:[(0,d.jsx)(g,{usage:E,current:w.current,breakdown:D}),(0,d.jsx)(h,{timing:w.timing??null,spans:w.spans})]}),(0,d.jsxs)(`div`,{className:`lc-cols lc-cols-main`,children:[(0,d.jsxs)(`div`,{className:`lc-col flex-1 min-w-[min(360px,100%)]`,children:[wt,Tt]}),(0,d.jsx)(`div`,{className:`lc-col lc-col-browser flex-1 min-w-[min(360px,100%)]`,children:Et})]}),(0,d.jsxs)(`div`,{className:`lc-cols`,children:[(0,d.jsxs)(`div`,{className:`lc-card lc-col flex-1 min-w-[min(360px,100%)]`,children:[(0,d.jsxs)(`div`,{className:`lc-card-title`,children:[(0,d.jsx)(`span`,{className:`lc-card-title-text`,children:r(`events.title`)}),(0,d.jsx)(`div`,{className:`lc-kinds @max-[380px]/lc-card:flex-wrap`,children:Ls.map(e=>{let n=Fe[e];return(0,d.jsxs)(`button`,{"data-kind":e,className:`lc-gran-btn`+(de.includes(e)?` lc-gran-on lc-kind-`+e:``),onClick:()=>{Y(e)},children:[r(`kind.`+e),n===void 0?null:(0,d.jsx)(`span`,{className:`lc-kind-n`,children:t.fmt(n)})]},e)})})]}),(0,d.jsx)(l,{events:Ie,state:C.detailState,onRetry:C.retryDetail})]}),(0,d.jsx)(f,{activity:et,scope:_t,workspace:at,onPreview:ft,onOpen:lt,onLocate:pt,state:C.detailState,onRetry:C.retryDetail})]}),(0,d.jsx)(x,{sessionId:typeof p==`string`?p:void 0,self:{head:gt,billed:E===null?null:W(E.uncachedInputTokens)+W(E.outputTokens)+W(E.cacheReadTokens)+W(E.cacheWriteTokens),requests:Z.length,costUsage:w.cost??null,durationMs:w.timing!=null&&w.timing.wallMs>0?w.timing.wallMs:null}}),(0,d.jsx)(`div`,{className:`lc-foot`,children:r(`footer`)}),Ct!==null&&(0,d.jsx)(v,{sessionId:p,current:Ct.current,minimum:Ct.minimum})]})}return function(e){return(0,u.createElement)(S,null,(0,u.createElement)(C,e))}}function Bs(e,t){for(let n of e??[])try{if(n.kind!==`assistant`||n.messageId!==t)continue;return typeof n.seq==`number`&&Number.isFinite(n.seq)?n.seq:null}catch{continue}return null}function Vs(){return(0,d.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,className:`fill-none`,"aria-hidden":`true`,children:[(0,d.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`2`,rx:`1`,className:`fill-current`}),(0,d.jsx)(`rect`,{x:`2`,y:`7`,width:`8.5`,height:`2`,rx:`1`,className:`fill-current`}),(0,d.jsx)(`rect`,{x:`2`,y:`11`,width:`5.5`,height:`2`,rx:`1`,className:`fill-current`})]})}function Hs(e,t){let{t:n}=t;return function(t){let r=ce(t),i=t.messageId;if(typeof i!=`string`||i===``)return null;let a=Bs(r,i);return(0,d.jsx)(f.Tooltip,{label:n(`jump.title`),side:`bottom`,children:(0,d.jsx)(`button`,{type:`button`,className:`lc-jump hover:bg-(--dsw-alias-interactive-bg-hover) hover:text-(--dsw-alias-label-secondary)`,"aria-label":n(`jump.title`),onClick:()=>{let r=t.sessionId;a!==null&&typeof r==`string`&&r!==``&&js(r,a),Ps(e)||Fs(n(`tab`))},children:(0,d.jsx)(Vs,{})})})}}function Us(e,t){let n,r,i=e=>typeof e==`function`?e:void 0,a=e=>{let a=e!==`sidebar`,o=e!==`tab`;a&&n===void 0&&(n=i(t.tab())),!a&&n!==void 0&&(n(),n=void 0),o&&r===void 0&&(r=i(t.sidebar())),!o&&r!==void 0&&(r(),r=void 0)};a(e.defaultPlacement());let o=e.store.subscribe(()=>{a(e.defaultPlacement())});return()=>{o(),n?.(),r?.(),n=void 0,r=void 0}}function Ws(e){let{eventLabel:t,eventAt:n}=Uo(e);return{t:e,fmt:zt,fmtTime:Ut,fmtDuration:Gt,fmtShare:Wt,catLabel:t=>e(`cat.`+t),eventLabel:t,eventAt:n}}let Gs=`dsh-context/tailwind.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Gs)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Gs,e.textContent=`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
19
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}:root,:host{--spacing:4px;--color-red-500:oklch(63.7% .237 25.331);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-500:oklch(76.9% .188 70.08);--color-green-500:oklch(72.3% .219 149.579);--color-teal-500:oklch(70.4% .14 182.503);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-500:oklch(65.6% .241 354.308);--color-slate-400:oklch(70.4% .04 256.788);--color-neutral-500:oklch(55.6% 0 none);--animate-lc-donut-in:lc-donut-in .45s cubic-bezier(.4, 0, .2, 1) calc(var(--lc-i,0) * 50ms) backwards;--animate-lc-stacked-in:lc-stacked-in .4s cubic-bezier(.4, 0, .2, 1) calc(var(--lc-i,0) * 40ms) backwards;--animate-lc-bar-in:lc-bar-in .35s cubic-bezier(.4, 0, .2, 1) calc(var(--lc-i,0) * 15ms) backwards;--animate-lc-agent-flow:lc-agent-flow .9s linear infinite;--animate-lc-agent-in:lc-agent-in .35s cubic-bezier(.4, 0, .2, 1) calc(var(--lc-i,0) * 35ms) backwards}.\\@container{container-type:inline-size}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.container{width:100%}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.min-w-0{min-width:0}.min-w-\\[min\\(240px\\,100\\%\\)\\]{min-width:min(240px,100%)}.min-w-\\[min\\(360px\\,100\\%\\)\\]{min-width:min(360px,100%)}.flex-1{flex:1}.flex-\\[3\\]{flex:3}.flex-auto{flex:auto}.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-lc-agent-flow{animation:var(--animate-lc-agent-flow)}.animate-lc-agent-in{animation:var(--animate-lc-agent-in)}.animate-lc-bar-in{animation:var(--animate-lc-bar-in)}.animate-lc-donut-in{animation:var(--animate-lc-donut-in)}.animate-lc-stacked-in{animation:var(--animate-lc-stacked-in)}.resize{resize:both}.items-center{align-items:center}.justify-start{justify-content:flex-start}.gap-3{gap:calc(var(--spacing) * 3)}.border{border-style:var(--tw-border-style);border-width:1px}.fill-current{fill:currentColor}.fill-none{fill:none}.stroke-2{stroke-width:2px}.stroke-4{stroke-width:4px}.stroke-\\[1\\.5px\\]{stroke-width:1.5px}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}@media (hover:hover){.group-hover\\/pi\\:underline:is(:where(.group\\/pi):hover *){text-decoration-line:underline}.group-hover\\/tip\\:border-\\(--dsw-alias-label-primary\\):is(:where(.group\\/tip):hover *){border-color:var(--dsw-alias-label-primary)}.group-hover\\/tip\\:text-\\(--dsw-alias-label-primary\\):is(:where(.group\\/tip):hover *){color:var(--dsw-alias-label-primary)}.group-hover\\/tip\\:opacity-100:is(:where(.group\\/tip):hover *){opacity:1}.hover\\:border-\\(--dsw-alias-label-dimmed\\):hover{border-color:var(--dsw-alias-label-dimmed)}.hover\\:border-\\(--dsw-alias-label-primary\\):hover{border-color:var(--dsw-alias-label-primary)}.hover\\:bg-\\(--dsw-alias-bg-layer-2\\):hover{background-color:var(--dsw-alias-bg-layer-2)}.hover\\:bg-\\(--dsw-alias-interactive-bg-hover\\):hover{background-color:var(--dsw-alias-interactive-bg-hover)}.hover\\:bg-\\[var\\(--dsw-alias-interactive-bg-hover\\,var\\(--dsw-alias-bg-layer-2\\)\\)\\]:hover{background-color:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))}.hover\\:text-\\(--dsw-alias-label-primary\\):hover{color:var(--dsw-alias-label-primary)}.hover\\:text-\\(--dsw-alias-label-secondary\\):hover{color:var(--dsw-alias-label-secondary)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\\:brightness-\\[1\\.15\\]:hover{--tw-brightness:brightness(1.15);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:border-\\(--dsw-alias-label-dimmed\\):focus{border-color:var(--dsw-alias-label-dimmed)}@media (hover:hover){.hover\\:enabled\\:bg-\\(--dsw-alias-interactive-bg-hover\\):hover:enabled{background-color:var(--dsw-alias-interactive-bg-hover)}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-50:disabled{opacity:.5}@media (prefers-reduced-motion:reduce){.motion-reduce\\:animate-none{animation:none}}@container lc-card (width<380px){.\\@max-\\[380px\\]\\/lc-card\\:basis-\\[calc\\(100\\%-46px\\)\\]{flex-basis:calc(100% - 46px)}.\\@max-\\[380px\\]\\/lc-card\\:basis-\\[calc\\(100\\%-92px\\)\\]{flex-basis:calc(100% - 92px)}.\\@max-\\[380px\\]\\/lc-card\\:flex-wrap{flex-wrap:wrap}}@container lc-card (width<320px){.\\@max-\\[320px\\]\\/lc-card\\:gap-2{gap:calc(var(--spacing) * 2)}}@container lc-card (width<240px){.\\@max-\\[240px\\]\\/lc-card\\:mx-auto{margin-inline:auto}.\\@max-\\[240px\\]\\/lc-card\\:basis-full{flex-basis:100%}.\\@max-\\[240px\\]\\/lc-card\\:flex-wrap{flex-wrap:wrap}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes lc-donut-in{0%{stroke-dasharray:0 100}}@keyframes lc-stacked-in{0%{transform:scaleX(0)}}@keyframes lc-bar-in{0%{transform:scaleY(0)}}@keyframes lc-agent-flow{to{stroke-dashoffset:-9px}}@keyframes lc-agent-in{0%{opacity:0;transform:translateY(6px)}}`,document.head.appendChild(e)}let Ks=`dsh-context/base.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ks)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ks,e.textContent=`.lc-root{box-sizing:border-box;height:100%;color:var(--dsw-alias-label-primary);padding:16px 20px 32px;font-size:13px;overflow-y:auto}[data-sidebar-right-open] .lc-root,[data-sidebar-right-float-host] .lc-root{padding:12px}.lc-title-icon{flex:none}.lc-title-label{padding-right:30px}.lc-card{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;margin-bottom:14px;padding:14px 16px}.lc-root .lc-card{box-sizing:border-box;margin-bottom:7px;padding:7px 8px;container:lc-card/inline-size}.lc-root .lc-cols{gap:7px;margin-bottom:7px}.lc-card-title{flex-wrap:wrap;align-items:baseline;gap:8px;margin-bottom:10px;font-weight:600;display:flex}.lc-card-title:not(:has(.lc-gran,.lc-kinds)){flex-wrap:nowrap}.lc-card-title-text{white-space:nowrap;flex:none}.lc-card-sub,.lc-card-rate{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.lc-gran,.lc-kinds{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;gap:2px;margin-left:auto;padding:1px;display:flex}.lc-trend-ctl,.lc-heat-ctl{align-items:center;gap:6px;margin-left:auto;display:flex}.lc-trend-ctl .lc-gran,.lc-heat-ctl .lc-gran,.lc-heat-ctl .lc-card-sub{margin-left:0}.lc-trend-mods{flex:none;margin-left:0}.lc-gran-btn{color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:5px;padding:3px 8px;font-family:inherit;font-size:11px;line-height:1}.lc-gran-btn:hover{color:var(--dsw-alias-label-primary)}.lc-gran-btn:disabled{opacity:.4;cursor:not-allowed}.lc-gran-btn:disabled:hover{color:var(--dsw-alias-label-secondary)}.lc-gran-on,.lc-gran-on:hover{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.lc-kind-n{font-variant-numeric:tabular-nums;opacity:.65;margin-left:4px}.lc-gran-on .lc-kind-n{opacity:.85}.lc-tip{z-index:6;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);width:max-content;color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-shadow-lv3,0 2px 8px #0000002e);pointer-events:none;opacity:0;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;padding:6px 10px;font-size:12px;position:absolute}.lc-events,.lc-fa-list{flex-direction:column;gap:2px;height:320px;display:flex;overflow-y:auto}.lc-lane{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;height:320px;display:flex}.lc-cols{flex-wrap:wrap;gap:14px;margin-bottom:14px;display:flex}.lc-cols>.lc-card,.lc-col>.lc-card:last-child{margin-bottom:0}.lc-col-browser{flex-direction:column;display:flex}.lc-col-browser>.lc-card{flex:1}.lc-head>.lc-card:has(.lc-stats){flex-direction:column;display:flex}.lc-head .lc-stats{flex:1}.lc-empty{color:var(--dsw-alias-label-secondary);text-align:center;padding:18px 0}.lc-error{flex-direction:column;align-items:center;gap:8px;padding:40px 16px;display:flex}.lc-error-msg{font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);overflow-wrap:anywhere;border-radius:6px;max-width:100%;padding:4px 8px;font-size:12px}.lc-error-retry{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;padding:4px 14px;font-size:12px}.lc-foot{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:12px}[data-conversation-scroll]:has(.lc-root)>[data-composer-seat]:not(:has([data-approval-key],[data-question-key],[data-plan-review-key])),[data-conversation-scroll]:has(.lc-root,.lc-modal-backdrop)~[data-width-handle]{display:none}`,document.head.appendChild(e)}let qs=`dsh-context/stats.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(qs)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=qs,e.textContent=`.lc-stat{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;flex-direction:column;gap:2px;min-width:0;padding:6px;display:flex}.lc-stat-label{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;font-weight:600;overflow:hidden}.lc-stat-value{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;text-align:center;font-size:14px;font-weight:600;overflow:hidden}.lc-stat-sub{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.lc-stat-tipped{position:relative}.lc-stat-q{text-align:center;width:11px;height:11px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);cursor:help;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:50%;margin-left:4px;font-size:9px;font-style:normal;font-weight:700;line-height:11px;display:inline-block}.lc-stat-tip{max-width:280px;font-weight:400;line-height:1.5;top:calc(100% + 6px);left:0}.lc-stat-tip-prices{border-top:1px dashed var(--dsw-alias-border-l1);margin-top:5px;padding-top:5px;display:block}.lc-stat-tip-head{font-weight:600;display:block}.lc-card-rate{font-variant-numeric:tabular-nums;cursor:default;flex:none;margin-left:auto;font-size:12px;font-weight:400;line-height:18px}.lc-stat-tip-row{margin-top:2px;display:block}.lc-stat-tip-band{justify-content:space-between;gap:2rem;display:flex}.lc-stat-tip-band i{font-style:normal}.lc-stat-tip-by{color:var(--dsw-alias-label-secondary);margin-top:3px;display:block}.lc-card-sub{color:var(--dsw-alias-label-secondary);margin-left:auto;font-size:12px;font-weight:400}.lc-overview-num{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.lc-overview-num>b{font-size:20px}.lc-overview-num span{color:var(--dsw-alias-label-secondary)}.lc-overview-pct{margin-left:auto;font-size:11px}.lc-overview-pct b{color:var(--dsw-alias-label-primary);margin-right:4px;font-size:20px}.lc-col-donut{flex-direction:column;display:flex}.lc-col-donut .lc-donut-row{flex:1}.lc-donut{flex:none;position:relative}.lc-donut svg{display:block}.lc-donut-track{stroke:color-mix(in srgb, var(--color-neutral-500) 18%, transparent)}.lc-donut-seg{transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-donut-dim .lc-donut-seg{opacity:.35}.lc-donut-dim .lc-donut-seg-on{opacity:1}.lc-donut-center{pointer-events:none;text-align:center;box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:0 7px;display:flex;position:absolute;inset:0}.lc-donut-center b{white-space:nowrap;text-overflow:ellipsis;max-width:100%;line-height:1.15;overflow:hidden}.lc-donut-center span{color:var(--dsw-alias-label-secondary);white-space:nowrap}.lc-sl{grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr));gap:4px 8px;min-width:0;display:grid;overflow:hidden}.lc-sl-row{min-width:0;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;flex-direction:column;gap:1px;margin:0 -6px;padding:1px 6px;font-size:12px;display:flex}.lc-sl-row-on{background:var(--dsw-alias-interactive-bg-hover)}.lc-sl-row-dim{opacity:.55}.lc-sl-main{align-items:center;gap:6px;min-width:0;display:flex}.lc-sl-dot{border-radius:2px;flex:none;width:8px;height:8px}.lc-sl-label{white-space:nowrap;text-overflow:ellipsis;flex:auto;min-width:0;font-weight:600;line-height:1.25;overflow:hidden}.lc-sl-pct{text-align:right;font-variant-numeric:tabular-nums;flex:none;min-width:30px;font-weight:700}.lc-sl-sub{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;margin-left:14px;font-size:11px;line-height:1.3;overflow:hidden}.lc-pi-grid{grid-template-columns:1fr;gap:8px;display:grid}.lc-pi-row-btn{appearance:none;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;width:100%;padding:0}.lc-pi-row{min-width:0;color:inherit;flex-direction:row;justify-content:space-between;align-items:baseline;gap:12px;text-decoration:none;display:flex}.lc-pi-hint{text-decoration:none}.lc-pi-update{color:var(--dsw-alias-state-warn-primary);white-space:nowrap;margin-top:1px;font-size:11px;display:block}.lc-pi-label{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;flex:none;font-size:11px;font-weight:600;overflow:hidden}.lc-pi-labelicon{vertical-align:-2px;margin-right:4px;display:inline-block}.lc-pi-value{min-width:0;color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;text-align:right;font-size:13px;font-weight:600;overflow:hidden}.lc-flow{align-items:stretch;display:flex;position:relative}.lc-flow-svg{pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.lc-flow-ribbon{fill:none;stroke-width:14px;stroke-opacity:.13;stroke-linecap:round}.lc-flow-dash{fill:none;stroke-width:1.5px;stroke-opacity:.55;stroke-linecap:round;stroke-dasharray:2 7}.lc-flow-col{z-index:1;flex-direction:column;flex:1 1 0;justify-content:center;gap:8px;min-width:0;display:flex;position:relative}.lc-flow-mid{z-index:1;justify-content:center;align-items:center;margin:0 30px;display:flex;position:relative}.lc-flow-node{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;flex-direction:column;gap:2px;min-width:0;padding:6px 10px;display:flex}.lc-flow-head{align-items:baseline;gap:6px;min-width:0;display:flex}a.lc-flow-head{color:inherit;cursor:pointer;text-decoration:none}a.lc-flow-head:hover .lc-flow-label{color:var(--dsw-alias-label-primary)}.lc-flow-label{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;font-weight:600;overflow:hidden}.lc-flow-total{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;flex:none;margin-left:auto;font-size:13px;font-weight:700}.lc-flow-pills{flex-wrap:wrap;gap:4px;margin-top:4px;display:flex}.lc-flow-pills-tools{flex-wrap:nowrap}.lc-flow-pill-gauge{visibility:hidden;pointer-events:none;height:0;display:block;position:relative;overflow:hidden}.lc-flow-pill{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;align-items:center;gap:5px;padding:2px 8px;font-size:11px;display:inline-flex}.lc-flow-pill-label{text-overflow:ellipsis;min-width:0;max-width:140px;overflow:hidden}.lc-flow-pill b{color:var(--dsw-alias-label-primary);font-weight:700}.lc-flow-pill-tint b{color:inherit}.lc-flow-pill-dim{opacity:.45}.lc-flow-rows{flex-direction:column;gap:3px;margin-top:4px;display:flex}.lc-flow-row{color:var(--dsw-alias-label-secondary);align-items:baseline;gap:6px;min-width:0;font-size:11px;display:flex}.lc-flow-row-label{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.lc-flow-pair{font-variant-numeric:tabular-nums;flex:none;align-items:baseline;gap:5px;margin-left:auto;display:inline-flex}.lc-flow-pair b{color:var(--dsw-alias-label-primary);font-weight:700}.lc-flow-pair i{opacity:.55;font-style:normal}.lc-flow-team{cursor:pointer}.lc-flow-team:hover{border-color:var(--dsw-alias-label-secondary)}.lc-flow-self{background:var(--dsw-alias-bg-layer-1);border-color:color-mix(in srgb, var(--dsw-alias-brand-primary) 40%, transparent);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, transparent);align-items:center;gap:6px;padding:8px 14px}.lc-flow-self-stats{align-self:stretch;gap:16px;display:flex}.lc-flow-kv{flex-direction:column;flex:1;align-items:center;min-width:0;display:flex}.lc-flow-kv-btn{cursor:pointer;border-radius:6px}.lc-flow-kv-btn:hover{background:var(--dsw-alias-bg-layer-2)}.lc-flow-kv-btn:hover i{color:var(--dsw-alias-label-primary)}.lc-flow-kv-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.lc-flow-kv b{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:17px;font-weight:700;line-height:1.2}.lc-flow-kv i{color:var(--dsw-alias-label-secondary);font-size:11px;font-style:normal}.lc-flow .lc-flow-col-r .lc-stat-tip{left:auto;right:0}@container lc-card (width<=559px){.lc-flow{flex-direction:column}.lc-flow-col{flex-direction:row;align-items:stretch}.lc-flow-col>.lc-flow-node{flex:1 1 0}.lc-flow-mid{margin:26px 0}}.lc-tstrip{margin-top:10px}.lc-tstrip-wrap{position:relative}.lc-tstrip-bar{background:color-mix(in srgb, var(--color-neutral-500) 18%, transparent);border-radius:4px;width:100%;height:12px;position:relative;overflow:hidden}.lc-tstrip-fill{transform-origin:0;position:absolute;inset:0}.lc-tstrip-seg{height:100%;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);position:absolute;top:0}.lc-tstrip-seg-on{filter:brightness(1.18)}.lc-tstrip-dim .lc-tstrip-seg{opacity:.35}.lc-tstrip-dim .lc-tstrip-seg-on{opacity:1}.lc-tstrip-axis{height:13px;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;margin-top:5px;font-size:10px;line-height:13px;position:relative}.lc-tstrip-tick{white-space:nowrap;position:absolute;transform:translate(-50%)}.lc-tstrip-tick:before{content:"";background:var(--dsw-alias-border-l1);width:1px;height:3px;position:absolute;top:-4px;left:50%}.lc-tstrip-tick-first{transform:none}.lc-tstrip-tick-first:before{left:0}.lc-tstrip-tick-last{transform:translate(-100%)}.lc-tstrip-tick-last:before{left:auto;right:0}`,document.head.appendChild(e)}let Js=`dsh-context/jump.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Js)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Js,e.textContent=`.lc-jump{width:calc(28px + var(--dsh-content-font-delta,0px));height:calc(28px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-tertiary);cursor:pointer;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}.lc-jump svg{width:calc(16px + var(--dsh-content-font-delta,0px));height:calc(16px + var(--dsh-content-font-delta,0px))}`,document.head.appendChild(e)}let Ys=`dsh-context/settings.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ys)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Ys,e.textContent=`.lc-settings-prefs{padding:4px 0}.lc-settings-row{align-items:center;gap:8px;padding:8px 0;display:flex}.lc-settings-label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:14px}.lc-settings-select{background:var(--dsw-alias-bg-module-platform);height:36px;font:inherit;color:var(--dsw-alias-label-primary);cursor:pointer;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border:none;border-radius:18px;align-items:center;gap:12px;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.lc-settings-note{color:var(--dsw-alias-label-tertiary);margin:12px 0 4px;font-size:12px;line-height:1.5}`,document.head.appendChild(e)}let Xs=`dsh-context/stackedBar.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Xs)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Xs,e.textContent=`.lc-stacked-wrap{width:100%;position:relative}.lc-stacked{background:color-mix(in srgb, var(--color-neutral-500) 18%, transparent);border-radius:5px;width:100%;display:flex;position:relative;overflow:hidden}.lc-occupied-box{border:2px solid var(--dsw-alias-label-tertiary);box-sizing:border-box;pointer-events:none;opacity:0;box-shadow:0 0 0 1px var(--dsw-alias-bg-layer-2);transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:5px;position:absolute;top:0;bottom:0;left:0}.lc-occupied-box-on{opacity:1}.lc-bar-tip{z-index:5;white-space:nowrap;padding:3px 8px;bottom:calc(100% + 6px);transform:translate(-50%)}.lc-bar-tip-on{opacity:1}.lc-stacked>div{height:100%}.lc-stacked-seg-pick{cursor:pointer}.lc-stacked-seg{transition:filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-stacked-free{box-sizing:border-box;transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-stacked-seg,.lc-stacked-free{transform-origin:0}.lc-stacked-seg-on{filter:brightness(1.18)}.lc-reserve{z-index:1;pointer-events:auto;cursor:help;background:repeating-linear-gradient(45deg, color-mix(in srgb, var(--dsw-alias-state-warn-primary) 24%, transparent) 0 5px, transparent 5px 10px);position:absolute;top:0;bottom:0}.lc-stacked-free-on{border:2px dashed var(--dsw-alias-label-secondary);border-radius:3px}.lc-stacked-dim .lc-stacked-seg{opacity:.35}.lc-stacked-dim .lc-stacked-seg-on{opacity:1}.lc-stacked-dim .lc-stacked-free{opacity:.35}.lc-stacked-dim .lc-stacked-free-on{opacity:1}.lc-legend{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:6px 14px;margin-top:10px;display:grid}.lc-chip{min-width:0;color:var(--dsw-alias-label-primary);cursor:pointer;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;align-items:center;gap:5px;padding:1px 6px;display:flex}.lc-chip-label{white-space:nowrap;text-overflow:ellipsis;min-width:0;font-weight:600;overflow:hidden}.lc-chip-nums{white-space:nowrap;flex:none;align-items:baseline;gap:6px;margin-left:auto;display:inline-flex}.lc-chip i,.lc-detail-row i{border-radius:2px;width:8px;height:8px;display:inline-block}.lc-chip i{transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-chip em{color:var(--dsw-alias-label-secondary);font-style:normal}.lc-chip-on{background:var(--dsw-alias-interactive-bg-hover);font-weight:600}.lc-chip-on i{box-shadow:0 0 0 1px var(--dsw-alias-brand-primary)}`,document.head.appendChild(e)}let Zs=`dsh-context/trendChart.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Zs)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Zs,e.textContent=`.lc-chartrow{align-items:stretch;gap:6px;display:flex}.lc-trend-lane{flex-direction:column;display:flex}.lc-trend-lane>.lc-trend-plot{box-sizing:border-box;justify-content:center;align-items:center;height:156px;display:flex}.lc-trend-lane .lc-stacked{height:10px;margin:3px 0}.lc-axis{box-sizing:border-box;width:40px;height:150px;color:var(--dsw-alias-label-secondary);padding-top:18px;font-size:11px;position:relative}.lc-axis span{line-height:1;position:absolute;right:0}.lc-axis-r{flex:none;width:34px}.lc-axis-r span{left:0;right:auto}.lc-axis-top{top:13px}.lc-axis-q3{top:41px}.lc-axis-mid{top:69px}.lc-axis-q1{top:97px}.lc-axis-bot{top:125px}.lc-chart-wrap{flex:1;min-width:0;position:relative}.lc-chart-scroll{overscroll-behavior-x:contain;scrollbar-gutter:stable;padding-bottom:var(--dsh-scrollbar-width,8px);overflow:auto hidden}.lc-chart{box-sizing:border-box;align-items:flex-end;gap:2px;width:max-content;min-width:100%;height:130px;padding:18px 2px 0;display:flex;position:relative}.lc-grid{border-top:1px dashed var(--dsw-alias-border-l2);pointer-events:none;position:absolute;left:0;right:0}.lc-grid-top{top:18px}.lc-grid-q3{top:46px}.lc-grid-mid{top:74px}.lc-grid-q1{top:102px}.lc-grid-zero{border-top-style:solid;border-top-color:color-mix(in srgb, var(--color-neutral-500) 50%, transparent);top:130px}.lc-bar{cursor:pointer;outline-offset:1px;width:14px;height:100%;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), outline-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:2px;outline:1px dashed #0000;flex:none;align-items:flex-end;display:flex;position:relative}.lc-chart-dim .lc-bar{opacity:.35}.lc-chart-dim .lc-bar-in-turn{opacity:1}.lc-chart-dim .lc-turn{opacity:.35}.lc-chart-dim .lc-turn-on{opacity:1}.lc-chart-tip{z-index:5;box-sizing:border-box;overflow-wrap:break-word;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);max-width:100%;color:var(--dsw-alias-label-primary);pointer-events:none;border-radius:6px;flex-direction:column;gap:2px;padding:3px 8px;font-size:12px;display:flex;position:absolute;bottom:calc(100% + 4px);left:0;box-shadow:0 2px 8px #0000002e}.lc-chart-tip span+span{color:var(--dsw-alias-label-secondary)}.lc-bar-hovered{outline-color:var(--dsw-alias-brand-primary)}.lc-bar-selected{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.lc-bar-in-turn{background:color-mix(in srgb, var(--color-neutral-500) 14%, transparent)}.lc-bar-stack{flex-direction:column-reverse;width:100%;display:flex}.lc-bar-stack>div{width:100%}.lc-bar-dna{border-radius:2px;width:100%}.lc-bar-stack,.lc-bar-up,.lc-bar-down,.lc-bar-dna{transform-origin:50% 100%}.lc-bar-down{transform-origin:50% 0}.lc-bar-stack>div:first-child{border-radius:0 0 2px 2px}.lc-bar-stack>div:last-child{border-radius:2px 2px 0 0}.lc-bar-stack>div:only-child{border-radius:2px}.lc-bar-up,.lc-bar-down{width:100%;display:flex;position:absolute;left:0}.lc-bar-up{flex-direction:column-reverse}.lc-bar-down{flex-direction:column}.lc-bar-up>div,.lc-bar-down>div{width:100%}.lc-bar-up>div:last-child{border-radius:2px 2px 0 0}.lc-bar-down>div:last-child{border-radius:0 0 2px 2px}.lc-cat-seg{transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-chart[data-catdim] .lc-cat-seg{opacity:.35}.lc-chart[data-catdim=system] .lc-cat-seg[data-cat=system],.lc-chart[data-catdim=tools] .lc-cat-seg[data-cat=tools],.lc-chart[data-catdim=user] .lc-cat-seg[data-cat=user],.lc-chart[data-catdim=inject] .lc-cat-seg[data-cat=inject],.lc-chart[data-catdim=skill] .lc-cat-seg[data-cat=skill],.lc-chart[data-catdim=assistant] .lc-cat-seg[data-cat=assistant],.lc-chart[data-catdim=tool] .lc-cat-seg[data-cat=tool]{opacity:1}.lc-dna-hl{z-index:1;pointer-events:none;align-items:stretch;gap:2px;display:flex;position:absolute;inset:18px 2px 0}.lc-dna-cell{flex:none;width:14px;position:relative}.lc-dna-slice{box-sizing:border-box;border:1px solid var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 26%, transparent);border-radius:1px;width:100%;position:absolute;left:0}.lc-duration{z-index:1;pointer-events:none;position:absolute;top:18px;left:2px;overflow:visible}.lc-duration polyline,.lc-duration circle{fill:none;stroke:var(--dsw-alias-label-tertiary);stroke-width:1.25px;stroke-linejoin:round;stroke-linecap:round}.lc-duration circle{fill:var(--dsw-alias-label-tertiary)}.lc-duration .lc-dur-halo{stroke:var(--dsw-alias-bg-layer-1);stroke-width:3px;opacity:.85}.lc-duration circle.lc-dur-halo{stroke:none;fill:var(--dsw-alias-bg-layer-1)}.lc-chart-dim .lc-duration{opacity:.35}.lc-bar-marker{z-index:2;color:var(--dsw-alias-state-warn-primary);font-size:11px;position:absolute;top:-16px;left:50%;transform:translate(-50%)}.lc-step-flag{z-index:2;background:color-mix(in srgb, var(--color-neutral-500) 45%, transparent);pointer-events:none;width:1px;position:absolute;top:-17px;bottom:0;right:-1px}.lc-step-flag-label{box-sizing:border-box;border:1px solid color-mix(in srgb, var(--color-neutral-500) 45%, transparent);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:3px;padding:1px 3px;font-size:9px;font-weight:600;line-height:1;position:absolute;top:0;right:0}.lc-turns{box-sizing:border-box;gap:2px;width:max-content;min-width:100%;margin-top:4px;padding:0 2px;display:flex;overflow:hidden}.lc-turn{box-sizing:border-box;text-align:center;color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;height:14px;transition:filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:3px;flex:none;font-size:10px;font-weight:600;line-height:14px}.lc-turn-on{filter:brightness(1.35);color:var(--dsw-alias-label-primary)}.lc-turn-label{display:inline-block}`,document.head.appendChild(e)}let Qs=`dsh-context/requestDetail.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Qs)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=Qs,e.textContent=`.lc-detail{border-top:1px solid var(--dsw-alias-border-l1);margin-top:12px;padding-top:12px}.lc-detail-head{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:6px 8px;margin-bottom:10px;display:flex}.lc-trend-lane .lc-detail-head{min-height:45px}.lc-detail-head b{color:var(--dsw-alias-label-primary);font-size:13px}.lc-detail-time{font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:auto;font-size:12px}.lc-detail-metrics{flex-wrap:wrap;flex:1 0 100%;gap:4px 6px;min-width:0;display:flex}.lc-detail-marker{color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent);border-radius:6px;padding:1px 7px;font-size:11px}.lc-detail-tag{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);border-radius:4px;padding:0 6px;font-size:11px}.lc-detail-metric{font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-secondary) 14%, transparent);border-radius:6px;padding:2px 8px;font-size:12px;font-weight:600}.lc-detail-metric-up{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 15%, transparent)}.lc-detail-metric-down{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 15%, transparent)}.lc-detail-rows{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:4px 24px;margin-top:10px;display:grid}.lc-brief{flex-direction:column;gap:2px;min-height:85px;margin:-4px 0 10px;display:flex}.lc-brief-row{box-sizing:border-box;min-width:0;min-height:27px;color:var(--dsw-alias-label-primary);text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:6px;align-items:center;gap:8px;margin-left:-6px;margin-right:-6px;padding:3px 6px;font-family:inherit;font-size:12px;line-height:1.5;display:flex}button.lc-brief-row-link{cursor:pointer}.lc-brief-tag{box-sizing:border-box;text-align:center;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);min-width:56px;color:var(--dsw-alias-label-secondary);border-radius:4px;flex:none;padding:0 6px;font-size:11px;position:relative}.lc-brief-tip{white-space:normal;text-align:left;max-width:240px;font-weight:400;line-height:1.5;bottom:calc(100% + 6px);left:0}.lc-brief-text{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.lc-brief-empty{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-tertiary);flex:1;overflow:hidden}.lc-brief-fact{box-sizing:border-box;text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);max-width:160px;color:var(--dsw-alias-label-secondary);border-radius:4px;flex:none;padding:0 6px;font-size:11px;overflow:hidden}.lc-brief-chip{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);min-width:0;max-width:260px;color:var(--dsw-alias-label-primary);transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:5px;align-items:center;gap:5px;padding:0 7px;font-size:12px;display:inline-flex;overflow:hidden}.lc-brief-chip-grow{flex:1;max-width:none}.lc-brief-chip-tag{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);max-width:120px;color:var(--dsw-alias-label-secondary);border-radius:4px;flex:none;padding:0 6px;font-size:11px;overflow:hidden}.lc-brief-chip-text{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.lc-brief-chip-link{cursor:pointer}.lc-brief-more{color:var(--dsw-alias-label-secondary);flex:none;font-size:11px}.lc-detail-row{transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:4px;align-items:center;gap:8px;margin:-1px -4px;padding:1px 4px;display:flex}.lc-detail-row i{transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-detail-row-on{background:var(--dsw-alias-interactive-bg-hover)}.lc-detail-row-on i{box-shadow:0 0 0 1px var(--dsw-alias-brand-primary)}.lc-detail-row-on .lc-detail-label{font-weight:600}.lc-detail-label{white-space:nowrap;min-width:70px;color:var(--dsw-alias-label-secondary)}.lc-bar-track{background:color-mix(in srgb, var(--color-neutral-500) 18%, transparent);border-radius:3px;flex:1;height:5px;display:block;position:relative;overflow:hidden}.lc-bar-fill{border-radius:3px;height:100%;display:block}.lc-bar-zero{border-left:1px solid color-mix(in srgb, var(--color-neutral-500) 45%, transparent);position:absolute;top:0;bottom:0;left:50%}.lc-bar-fill-up,.lc-bar-fill-down{height:100%;display:block;position:absolute;top:0}.lc-bar-fill-up{border-radius:0 3px 3px 0;left:50%}.lc-bar-fill-down{border-radius:3px 0 0 3px;right:50%}.lc-detail-num{text-align:right;font-variant-numeric:tabular-nums;width:52px}.lc-detail-num-up{color:var(--dsw-alias-state-success-primary)}.lc-detail-num-down{color:var(--dsw-alias-state-error-primary)}.lc-detail-pct{text-align:right;width:34px;color:var(--dsw-alias-label-secondary)}`,document.head.appendChild(e)}let $s=`dsh-context/events.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify($s)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=$s,e.textContent=`.lc-event{align-items:center;gap:8px;padding:3px 0;display:flex}.lc-event-icon{text-align:center;width:18px;color:var(--dsw-alias-state-warn-primary)}.lc-event-icon.lc-event-inject{color:var(--color-purple-500)}.lc-event-icon.lc-event-model{color:var(--dsw-alias-brand-primary)}.lc-event-icon.lc-event-mode{color:var(--dsw-alias-label-secondary)}.lc-kind{white-space:nowrap;border-radius:4px;flex:none;padding:1px 6px;font-size:10px;font-weight:600}.lc-kind-inject{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 15%, transparent);color:var(--dsw-alias-state-success-primary)}.lc-kind-compaction{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 15%, transparent);color:var(--dsw-alias-state-error-primary)}.lc-kind-prune{background:color-mix(in srgb, var(--color-violet-500) 15%, transparent);color:var(--color-violet-500)}.lc-kind-model{background:color-mix(in srgb, var(--dsw-alias-brand-primary) 15%, transparent);color:var(--dsw-alias-brand-primary)}.lc-kind-mode{background:color-mix(in srgb, var(--dsw-alias-label-secondary) 15%, transparent);color:var(--dsw-alias-label-secondary)}.lc-event-label{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.lc-event-at{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px}.lc-event-tokens{color:var(--dsw-alias-state-success-primary);white-space:nowrap;font-weight:600}.lc-event-tokens.lc-up{color:var(--dsw-alias-state-warn-primary)}.lc-event-time{color:var(--dsw-alias-label-secondary);font-size:12px}`,document.head.appendChild(e)}let ec=`dsh-context/fileCard.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(ec)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=ec,e.textContent=`.lc-fa-ctl,.lc-br-toolctl{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px;display:flex}.lc-fa-ctl{align-content:center;min-height:51px}@container lc-card (width<=380px){.lc-fa-ctl{min-height:70px}}.lc-fa-ctl .lc-gran{margin-left:0}.lc-fa-n{opacity:.75;margin-left:4px;font-weight:700}.lc-fa-search,.lc-br-tool-search,.lc-find-input{min-width:80px;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;outline:none;flex:1;padding:3px 8px;font-size:12px}.lc-fa-meta{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:6px;font-size:12px;display:flex}.lc-fa-meta .lc-fa-sort{flex:none}.lc-fa-meta-delta{position:relative}.lc-fa-meta-tip{white-space:normal;max-width:260px;line-height:1.5;top:calc(100% + 6px);left:0}.lc-fa-item{transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border:1px solid #0000;border-radius:8px}.lc-fa-item-on{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-border-l2)}.lc-fa-row{width:100%;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:7px;align-items:center;gap:7px;padding:6px 8px;font-size:12px;display:flex}.lc-fa-form{opacity:.85;flex:none;justify-content:center;align-items:center;width:20px;height:14px;font-size:11px;display:flex}.lc-fa-lang{border-radius:4px;justify-content:center;align-items:center;min-width:16px;height:13px;padding:0 2px;font-size:8px;font-weight:700;line-height:1;display:inline-flex}.lc-fa-row .lc-br-chev{margin-right:-2px}.lc-fa-path{word-break:break-all;min-width:0}.lc-fa-file{cursor:pointer}.lc-fa-path em{color:var(--dsw-alias-label-secondary);font-style:normal}.lc-fa-badge{font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;flex:none;align-items:center;gap:4px;padding:1px 7px;font-size:11px;font-weight:600;display:inline-flex}.lc-fa-badge i{background:currentColor;border-radius:50%;width:5px;height:5px;display:inline-block}.lc-fa-b-read{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent)}.lc-fa-b-write{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 14%, transparent)}.lc-fa-b-search{color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent)}.lc-fa-chip-read,.lc-fa-chip-read:hover{color:var(--dsw-alias-brand-primary)}.lc-fa-chip-write,.lc-fa-chip-write:hover{color:var(--dsw-alias-state-success-primary)}.lc-fa-chip-search,.lc-fa-chip-search:hover{color:var(--dsw-alias-state-warn-primary)}.lc-fa-chip-read.lc-gran-on,.lc-fa-chip-read.lc-gran-on:hover{background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent);color:var(--dsw-alias-brand-primary)}.lc-fa-chip-write.lc-gran-on,.lc-fa-chip-write.lc-gran-on:hover{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 14%, transparent);color:var(--dsw-alias-state-success-primary)}.lc-fa-chip-search.lc-gran-on,.lc-fa-chip-search.lc-gran-on:hover{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent);color:var(--dsw-alias-state-warn-primary)}.lc-fa-delta{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;gap:5px;font-size:11px;font-weight:600;display:inline-flex}.lc-fa-up{color:var(--dsw-alias-state-success-primary)}.lc-fa-down{color:var(--dsw-alias-state-error-primary)}.lc-fa-time{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.lc-fa-ops{border-left:2px solid var(--dsw-alias-border-l1);flex-direction:column;gap:1px;margin:0 8px 8px 15px;padding:2px 0 2px 10px;display:flex}.lc-fa-op{min-width:0;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:5px;align-items:center;gap:8px;padding:3px 6px;font-size:11px;display:flex}.lc-fa-op-link{cursor:pointer}.lc-fa-op-time{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;margin-left:auto}.lc-fa-op-tool{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);max-width:220px;color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:0 6px;font-size:11px;overflow:hidden}.lc-fa-op-detail{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary);flex:1;overflow:hidden}.lc-fa-read{color:var(--dsw-alias-brand-primary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;font-weight:600}`,document.head.appendChild(e)}let tc=`dsh-context/modal.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(tc)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=tc,e.textContent=`.lc-modal-backdrop{z-index:200;background:var(--dsw-alias-bg-mask-1,#00000073);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.lc-modal-card{box-sizing:border-box;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);width:min(720px,100% - 48px);max-height:min(82vh,760px);box-shadow:var(--dsw-shadow-lv3,0 12px 32px #0006);color:var(--dsw-alias-label-primary);border-radius:12px;padding:16px 18px 18px;font-size:13px;overflow-y:auto}.lc-modal-head{align-items:baseline;gap:8px;margin-bottom:12px;display:flex}.lc-modal-title{font-size:14px;font-weight:600}.lc-modal-close{color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:6px;margin-left:auto;padding:2px 6px;font-family:inherit;font-size:18px;line-height:1}.lc-gate-card{width:min(440px,100vw - 48px)}.lc-gate-body{color:var(--dsw-alias-label-secondary);line-height:1.7}.lc-gate-versions{gap:24px;margin-top:14px;display:flex}.lc-gate-version{flex-direction:column;gap:2px;display:flex}.lc-gate-version-label{color:var(--dsw-alias-label-secondary);font-size:11px}.lc-gate-version-value{font-weight:600;font-family:var(--dsw-font-family-mono,monospace);color:var(--dsw-alias-label-primary)}.lc-gate-or-newer{color:var(--dsw-alias-label-secondary);margin-left:6px;font-family:inherit;font-size:11px;font-weight:400}.lc-gate-actions{justify-content:flex-end;margin-top:16px;display:flex}.lc-gate-ok{cursor:pointer;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);transition:filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border:0;border-radius:6px;padding:6px 16px;font-family:inherit;font-size:12px}`,document.head.appendChild(e)}let nc=`dsh-context/browser.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(nc)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=nc,e.textContent=`.lc-br-dna-ctl{flex:none;margin-left:0}.lc-br-bar-dna .lc-stacked-seg{background-image:linear-gradient(to right, transparent calc(100% - min(.5px, 12.5%)), var(--dsw-alias-bg-layer-1) 0)}.lc-br-pick{font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;max-width:240px;padding:3px 6px;font-size:12px}.lc-br-meta{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:6px 16px;margin-bottom:8px;display:flex}.lc-br-meta b{color:var(--dsw-alias-label-primary)}.lc-br-meta .lc-est{margin-left:auto}.lc-br-note{color:var(--dsw-alias-label-secondary);margin-top:8px;font-size:12px}.lc-br-retry{color:var(--dsw-alias-brand-primary);font:inherit;cursor:pointer;text-underline-offset:2px;transition:filter var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;padding:0;font-size:12px;text-decoration:underline}.lc-br-cats{flex-direction:column;gap:4px;margin-top:10px;display:flex}.lc-br-cat{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:8px;overflow:hidden}.lc-br-cat-empty{opacity:.55}.lc-br-cat-row{width:100%;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;flex-wrap:nowrap;align-items:center;gap:8px;padding:7px 10px;display:flex}.lc-br-cat-on{background:var(--dsw-alias-interactive-bg-hover)}.lc-br-cat-on i{box-shadow:0 0 0 1px var(--dsw-alias-brand-primary)}.lc-br-cat-open{background:var(--dsw-alias-interactive-bg-hover)}.lc-br-cat-row i{width:8px;height:8px;transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:2px;flex:none;display:inline-block}.lc-br-cat-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-weight:600;overflow:hidden}.lc-br-cat-count{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:12px}.lc-br-count-grp{flex:1;align-items:center;gap:4px;min-width:0;display:inline-flex}.lc-br-chev{width:12px;height:14px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:flex}.lc-br-chev:before{content:"";width:5px;height:5px;transition:transform var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-bottom:1px solid;border-right:1px solid;transform:rotate(-45deg)}.lc-br-chev-on:before{transform:rotate(45deg)}.lc-br-tokens{color:var(--dsw-alias-label-secondary);flex:none;font-size:12px}.lc-br-delta,.lc-br-tdelta{white-space:nowrap;border-radius:4px;flex:none;padding:0 5px;font-size:11px;font-weight:600}.lc-br-delta-up,.lc-br-tdelta-up{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 15%, transparent)}.lc-br-delta-down,.lc-br-tdelta-down{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 15%, transparent)}.lc-br-tokens-grp{flex:none;align-items:center;gap:4px;min-width:0;display:inline-flex}.lc-br-pct{text-align:right;width:36px;color:var(--dsw-alias-label-secondary);flex:none;font-size:12px}.lc-br-body{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:2px;padding:4px 6px;display:flex}.lc-br-elem{border-radius:6px}.lc-br-elem-on{background:var(--dsw-alias-interactive-bg-active)}.lc-br-elem-row{width:100%;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;text-align:left;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:6px;align-items:center;gap:8px;padding:5px 6px;font-size:12px;display:flex}.lc-br-err-dot{background:var(--dsw-alias-state-error-primary);width:6px;height:6px;box-shadow:0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);border-radius:50%;flex:none}.lc-br-tag{min-width:0;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);text-overflow:ellipsis;white-space:nowrap;border-radius:4px;max-width:220px;padding:0 6px;font-size:11px;overflow:hidden}.lc-br-tags{align-items:center;gap:4px;min-width:0;display:inline-flex}.lc-br-tool-plugin{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent);border-color:#0000;border-radius:6px;font-size:12px}.lc-br-preview{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.lc-br-time{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px}.lc-br-time-pending{text-underline-offset:2px;text-decoration:underline dotted}.lc-br-hits{color:var(--dsw-alias-label-secondary);flex:none;font-size:11px}.lc-br-content{flex-direction:column;gap:6px;padding:2px 6px 8px 26px;display:flex}.lc-br-dim{color:var(--dsw-alias-label-secondary)}`,document.head.appendChild(e)}let rc=`dsh-context/detailSections.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(rc)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=rc,e.textContent=`.lc-ts-card{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;min-width:0;overflow:hidden}.lc-ts-card-head{color:var(--dsw-alias-label-secondary);border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:8px;padding:6px 10px;font-size:11px;font-weight:600;display:flex}.lc-ts-card-head-wrap{flex-wrap:wrap}.lc-ts-card-head b{color:var(--dsw-alias-label-primary)}.lc-ts-call-name{font-size:13px;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.lc-ts-card-count{margin-left:auto}.lc-ts-card-right{align-items:center;gap:8px;margin-left:auto;display:inline-flex}.lc-ts-card-meta{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px;font-weight:400}.lc-ts-call-state{white-space:nowrap;font-size:11px;font-weight:600;line-height:1;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);border-radius:999px;flex:none;align-items:center;gap:4px;padding:2px 7px;display:inline-flex}.lc-ts-call-state i{background:currentColor;border-radius:50%;flex:none;width:6px;height:6px}.lc-ts-call-ok{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent)}.lc-ts-call-err{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent)}.lc-ts-desc-body{color:var(--dsw-alias-label-primary);white-space:pre-wrap;word-break:break-word;scrollbar-width:thin;max-height:320px;margin:0;padding:8px 10px;font-size:12px;line-height:1.55;overflow-y:auto}.lc-ts-lines{counter-reset:lc-line}.lc-ts-line{padding-left:26px;display:block;position:relative}.lc-ts-line:before{content:counter(lc-line);counter-increment:lc-line;text-align:right;width:20px;color:var(--dsw-alias-label-tertiary);user-select:none;padding-right:6px;font-size:11px;position:absolute;left:0}.lc-ts-line:empty:after{content:"​"}.lc-ts-param-row{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:minmax(0,140px) minmax(0,90px) 56px minmax(0,1fr);align-items:baseline;gap:2px 10px;padding:6px 10px;font-size:12px;display:grid}.lc-ts-param-row:first-of-type{border-top:0}.lc-ts-param-name{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.lc-ts-param-type{color:var(--dsw-alias-label-secondary);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.lc-ts-param-req{color:var(--dsw-alias-state-warn-primary);font-size:11px;font-weight:600}.lc-ts-param-req-off{color:var(--dsw-alias-label-secondary);font-size:11px}.lc-ts-param-desc{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;grid-column:1/-1;line-height:1.5}.lc-ts-params-empty{color:var(--dsw-alias-label-secondary);padding:8px 10px;font-size:12px}.lc-ts-arg-row{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:minmax(0,96px) 1fr;align-items:start;column-gap:12px;padding:6px 10px;font-size:12px;display:grid}.lc-ts-arg-row:first-of-type{border-top:0}.lc-ts-arg-row .lc-ts-param-name{text-overflow:unset;white-space:normal;overflow-wrap:anywhere;overflow:visible}.lc-ts-arg-val{color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);white-space:pre-wrap;word-break:break-word;scrollbar-width:thin;max-height:200px;font-size:12px;line-height:1.55;overflow-y:auto}.lc-ts-json{flex-direction:column;gap:4px;display:flex}.lc-ts-json-toggle{color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;align-self:flex-start;padding:0;font-size:11px}.lc-rich-copy,.lc-find-btn{color:var(--dsw-alias-label-secondary);cursor:pointer;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:5px;align-items:center;padding:2px;display:inline-flex}.lc-rich-copy:hover,.lc-find-btn:hover{color:var(--dsw-alias-label-primary)}.lc-rich-copy-on,.lc-rich-copy-on:hover{color:var(--dsw-alias-state-success-primary)}.lc-find-btn:disabled{opacity:.4;cursor:default}.lc-find-btn:disabled:hover{color:var(--dsw-alias-label-secondary)}.lc-find-btn-on,.lc-find-btn-on:hover{color:var(--dsw-alias-label-primary)}.lc-find{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:6px;padding:6px 10px;display:flex}.lc-find-count{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px}.lc-find-mark{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 25%, transparent);color:inherit;border-radius:2px}.lc-find-mark-on{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 65%, transparent)}.lc-ts-desc-md{color:var(--dsw-alias-label-primary);word-break:break-word;overflow-wrap:anywhere;scrollbar-width:thin;min-width:0;max-height:320px;padding:4px 10px;font-size:12px;line-height:1.55;overflow:hidden auto}.lc-ts-desc-md>div{font-size:13px;line-height:1.55}.lc-ts-desc-md div :is(h1,h2,h3,h4,h5,h6){margin:10px 0 4px;font-size:13px;font-weight:600}.lc-ts-desc-md div p{white-space:pre-line;margin:6px 0}.lc-ts-desc-md div p br{display:none}.lc-ts-desc-md div pre{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;margin:6px 0}.lc-ts-desc-md div :not(pre)>code{box-decoration-break:clone;padding:1px 5px;line-height:1.3;font-size:1em!important}.lc-ts-desc-md div table code{font-size:inherit}`,document.head.appendChild(e)}let ic=`dsh-context/attachments.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(ic)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=ic,e.textContent=`.lc-att-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:8px 10px;display:grid}.lc-att-item{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:100%;min-width:0;font:inherit;text-align:left;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border-radius:8px;align-items:center;gap:8px;padding:6px;display:flex}.lc-att-thumb{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:6px;flex:none;justify-content:center;align-items:center;width:64px;height:64px;padding:0;display:flex;overflow:hidden}.lc-att-thumb img{object-fit:cover;width:100%;height:100%;display:block}.lc-att-ph,.lc-att-err{color:var(--dsw-alias-label-secondary);text-align:center;padding:2px;font-size:10px}.lc-att-meta{flex-direction:column;gap:2px;min-width:0;display:flex}.lc-att-name{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;word-break:break-word;font-size:12px;line-height:1.3}.lc-att-row{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:11px}.lc-att-row-label{min-width:3.2em;font-weight:400;display:inline-block}`,document.head.appendChild(e)}let ac=`dsh-context/agentGraph.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(ac)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=ac,e.textContent=`.lc-agents-chips{flex-wrap:wrap;gap:6px;margin-bottom:10px;display:flex}.lc-agents-chip{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;border-radius:999px;padding:2px 8px;font-size:11px}.lc-agents-chip-on{color:var(--dsw-alias-state-success-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 40%, transparent)}.lc-agents-stage{overscroll-behavior-x:contain;margin:0 -4px;padding:0 4px;overflow-x:auto}.lc-agents-canvas{margin:0 auto;position:relative}.lc-agents-links{pointer-events:none;position:absolute;inset:0}.lc-agents-link{stroke-opacity:.45;transition:stroke-opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-agents-link-live{stroke-opacity:.85}.lc-agents-flow{stroke-linecap:round;stroke-dasharray:2 7;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-agents-joint{opacity:.75;transition:opacity var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out)}.lc-agents-focus .lc-agents-link{stroke-opacity:.1}.lc-agents-focus .lc-agents-flow{opacity:.1}.lc-agents-focus .lc-agents-joint{opacity:.12}.lc-agents-focus .lc-agents-on .lc-agents-link{stroke-opacity:1}.lc-agents-focus .lc-agents-on .lc-agents-flow,.lc-agents-focus .lc-agents-on .lc-agents-joint{opacity:1}.lc-agent-card{box-sizing:border-box;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);height:104px;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), transform var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:10px;outline:none;flex-direction:column;padding:9px 10px;display:flex;position:absolute;overflow:hidden}.lc-agent-clickable{cursor:pointer}.lc-agent-card:hover,.lc-agent-card:focus-visible{border-color:var(--dsw-alias-label-tertiary,var(--dsw-alias-border-l2));box-shadow:0 2px 10px color-mix(in srgb, var(--color-neutral-500) 22%, transparent);transform:translateY(-2px)}.lc-agent-card:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,var(--color-blue-500));outline-offset:1px}.lc-agent-self{border-color:color-mix(in srgb, var(--dsw-alias-brand-primary,var(--color-blue-500)) 55%, var(--dsw-alias-border-l2))}.lc-agent-card-head{align-items:flex-start;gap:6px;display:flex}.lc-agent-state{margin-top:2px}.lc-agent-label{min-width:0;height:30px;color:var(--dsw-alias-label-primary);overflow-wrap:break-word;-webkit-line-clamp:2;-webkit-box-orient:vertical;flex:1;font-size:11.5px;line-height:1.3;display:-webkit-box;overflow:hidden}.lc-agent-metric{align-items:baseline;gap:6px;margin-top:5px;display:flex}.lc-agent-tokens{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:13px;font-weight:650}.lc-agent-pct{font-variant-numeric:tabular-nums;flex:none;font-size:11px;font-weight:600}.lc-agent-bar{background:color-mix(in srgb, var(--dsw-alias-label-secondary) 16%, transparent);border-radius:4px;height:7px;margin-top:8px;display:flex;overflow:hidden}.lc-agent-bar-seg{transform-origin:0;height:100%;display:block}.lc-agent-meta{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;align-items:baseline;gap:6px;margin-top:auto;padding-top:6px;font-size:10px;line-height:1.3;display:flex}.lc-agent-meta-text{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.lc-agents-solo{padding:4px 0 10px}.lc-agents-inspector{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:8px;margin-top:10px;padding:7px 10px;font-size:12px}.lc-agents-inspector-row{flex-wrap:wrap;align-items:baseline;gap:4px 8px;min-width:0;display:flex}.lc-agents-inspector-name{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}.lc-agents-badge{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 6px;font-size:10px}.lc-agents-badge-on{color:var(--dsw-alias-state-success-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 40%, transparent)}.lc-agents-inspector-stats{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.lc-agents-inspector-open{color:var(--dsw-alias-brand-primary,var(--color-blue-500));flex:none;margin-left:auto}.lc-agents-inspector-parts{border-top:1px dashed var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:4px 12px;margin-top:6px;padding-top:6px;font-size:11px;display:flex}.lc-agents-part{white-space:nowrap;align-items:center;gap:4px;display:inline-flex}.lc-agents-part i{border-radius:2px;width:7px;height:7px}.lc-agents-part em{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-variant-numeric:tabular-nums;font-style:normal}.lc-agents-legend{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:4px 14px;margin-top:8px;font-size:11px;display:flex}.lc-agents-legend-item{align-items:center;gap:5px;display:inline-flex}.lc-agents-legend-item i{border-radius:2px;width:8px;height:8px}.lc-agents-legend-free{background:color-mix(in srgb, var(--dsw-alias-label-secondary) 18%, transparent)}.lc-agents-legend-edge{border-top:2px dashed var(--dsw-alias-label-secondary);border-radius:0!important;width:14px!important;height:0!important}`,document.head.appendChild(e)}let oc=`dsh-context/overview.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(oc)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=oc,e.textContent=`.lc-ov-page{box-sizing:border-box;background:var(--dsw-alias-bg-base);width:100%;min-width:0;height:100%;min-height:0;color:var(--dsw-alias-label-primary);flex-direction:column;font-size:13px;display:flex;overflow:hidden;container:lc-ov/inline-size}.lc-ov-pagescroll{scrollbar-gutter:stable;flex:auto;min-height:0;overflow-y:auto}.lc-ov-pagecontent{padding:0 clamp(24px,4vw,48px) 48px}.lc-ov-pagehead{flex-wrap:wrap;align-items:center;gap:16px;margin-bottom:24px;padding-top:28px;display:flex}[data-platform=darwin] .lc-ov-pagehead{padding-top:calc(28px + var(--dsh-frame-top-clearance,0px))}.lc-ov-pagetitle{flex:0 auto;min-width:0;margin:0;font-size:20px;font-weight:500;line-height:28px}.lc-ov-settings{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);font:inherit;color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:999px;flex:none;align-items:center;gap:6px;padding:3px 12px;font-size:12px;line-height:18px;display:inline-flex}.lc-ov-headctl{flex-wrap:wrap;align-items:center;gap:8px;margin-left:auto;display:flex}.lc-ov-settings:hover{border-color:var(--dsw-alias-label-secondary);color:var(--dsw-alias-label-primary)}.lc-ov-balance{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);max-width:100%;color:inherit;border-radius:999px;flex:none;align-items:center;gap:6px;padding:2px 10px;font-size:12px;line-height:18px;text-decoration:none;display:inline-flex}.lc-ov-balance:hover .lc-ov-balance-value{text-decoration:underline}.lc-ov-balance-label{color:var(--dsw-alias-label-secondary);white-space:nowrap}.lc-ov-balance-value{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}.lc-hovertip{z-index:300;white-space:pre-line;max-width:min(320px,50vw);position:fixed}.lc-ov-first{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:10px;display:grid}.lc-ov-kpis{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.lc-ov-kpi{align-items:center;padding:8px}.lc-ov-kpi .lc-stat-value{font-size:20px}@container lc-ov (width<=932px){.lc-ov-first{grid-template-columns:minmax(0,1fr)}}@container lc-ov (width<=640px){.lc-ov-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}.lc-ov-usage{box-sizing:border-box;flex-direction:column;flex:auto;min-width:0;margin-bottom:0;display:flex}.lc-ov-usage-plot{flex:auto;grid-template-rows:minmax(56px,1fr) auto;grid-template-columns:42px minmax(0,1fr) 42px;gap:6px;min-height:0;display:grid}.lc-ov-usage-rail-l{grid-area:1/1}.lc-ov-usage-grid{grid-area:1/2;min-width:0;display:flex;position:relative}.lc-ov-usage-rail-r{grid-area:1/3}.lc-ov-usage-rail{width:42px;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:9px;line-height:1.2;position:relative}.lc-ov-usage-rail-l .lc-ov-usage-tick{right:0}.lc-ov-usage-rail-r .lc-ov-usage-tick{left:0}.lc-ov-usage-tick{white-space:nowrap;position:absolute;transform:translateY(-50%)}.lc-ov-usage-line{background:color-mix(in srgb, var(--dsw-alias-border-l2) 70%, transparent);height:1px;position:absolute;left:0;right:0}.lc-ov-usage-line-0{background:var(--dsw-alias-border-l2)}.lc-ov-usage-cols{flex:auto;align-items:stretch;gap:6px;min-width:0;display:flex;position:relative}.lc-ov-usage-col{flex-direction:column;flex:1 1 0;min-width:0;display:flex}.lc-ov-usage-bars{flex:auto;justify-content:center;align-items:flex-end;gap:3px;width:100%;display:flex}.lc-ov-usage-bar{border-radius:3px 3px 0 0;flex:none;width:10px}.lc-ov-usage-tokens{background:color-mix(in srgb, var(--color-blue-500) 72%, transparent)}.lc-ov-usage-cost{background:color-mix(in srgb, var(--color-green-500) 72%, transparent)}.lc-ov-usage-days{grid-area:2/2;gap:6px;display:flex}.lc-ov-usage-day{text-align:center;min-width:0;color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;flex:1 1 0;font-size:9px;line-height:1.2}@container lc-ov (width<=400px){.lc-ov-usage-day:nth-child(2n){visibility:hidden}}.lc-ov-usage-key{flex:none;justify-content:flex-end;align-items:center;gap:5px;padding-top:5px;display:flex}.lc-ov-usage-swatch{border-radius:2px;flex:none;width:10px;height:8px}.lc-ov-usage-key-label{color:var(--dsw-alias-label-secondary);font-size:9px}.lc-ov-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:10px;display:grid}.lc-ov-stats>.lc-card{box-sizing:border-box;min-width:0;margin-bottom:0}@container lc-ov (width<=700px){.lc-ov-stats{grid-template-columns:minmax(0,1fr)}}.lc-ov-body{grid-template-columns:minmax(0,3fr) minmax(0,7fr);align-items:start;gap:10px;display:grid}.lc-ov-left{flex-direction:column;gap:10px;min-width:0;display:flex}.lc-ov-right{min-width:0}@container lc-ov (width<=932px){.lc-ov-body{display:block}.lc-ov-left{margin-bottom:12px}}.lc-ov-left>.lc-card{box-sizing:border-box;min-width:0;margin-bottom:0}.lc-ov-heat-card{flex-direction:column;display:flex}.lc-heat-wrap{flex-direction:column;flex:1;display:flex}.lc-heat{flex:1;justify-content:center;align-items:center;gap:8px;display:flex}.lc-heat-wds,.lc-heat-col{padding-top:18px}.lc-heat-wds{flex-direction:column;gap:3px;display:flex}.lc-heat-wd{height:20px;color:var(--dsw-alias-label-secondary);text-align:center;white-space:nowrap;flex:none;justify-content:center;align-items:center;font-size:9px;display:flex}.lc-heat-cols{gap:3px;display:flex}.lc-heat-col{flex-direction:column;gap:3px;display:flex;position:relative}.lc-heat-mon{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:9px;line-height:18px;position:absolute;top:0;left:0}.lc-heat-cell{box-sizing:border-box;background:var(--dsw-alias-bg-layer-2);cursor:default;border:0;border-radius:20%;width:20px;height:20px;padding:0}button.lc-heat-cell{cursor:pointer}button.lc-heat-cell:hover{box-shadow:0 0 0 1.5px color-mix(in srgb, var(--color-blue-500) 70%, transparent)}.lc-heat-future{background:0 0}.lc-heat-0{background:color-mix(in srgb, var(--dsw-alias-label-secondary) 16%, transparent)}.lc-heat-1{background:color-mix(in srgb, var(--color-blue-500) 28%, transparent)}.lc-heat-2{background:color-mix(in srgb, var(--color-blue-500) 50%, transparent)}.lc-heat-3{background:color-mix(in srgb, var(--color-blue-500) 72%, transparent)}.lc-heat-4{background:color-mix(in srgb, var(--color-blue-500) 92%, transparent)}.lc-heat-on{box-shadow:0 0 0 1.5px var(--color-blue-500)}.lc-heat-legend{justify-content:flex-end;align-items:center;gap:2px;padding-top:6px;display:flex}.lc-heat-legend .lc-heat-cell{width:10px;height:10px}.lc-heat-key{color:var(--dsw-alias-label-secondary);margin:0 2px;font-size:9px}.lc-ov-skills{flex-direction:column;gap:2px;display:flex}.lc-ov-skills-sub{flex-wrap:wrap;align-items:center;gap:8px;margin:-4px 0 8px;display:flex}.lc-ov-skills-sub-n{margin-left:0}.lc-ov-skills-search{flex:0 170px;margin-left:auto}.lc-ov-skill{width:100%;min-width:0;font:inherit;color:inherit;text-align:left;cursor:pointer;transition:background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border:0;border-radius:6px;align-items:baseline;gap:7px;padding:2px 6px 4px;font-size:12px;line-height:1.7;display:flex;position:relative}.lc-ov-skill:hover{background:var(--dsw-alias-bg-layer-2)}.lc-ov-skill-unit{background:var(--dsw-alias-bg-layer-2);box-shadow:0 0 0 1.5px color-mix(in srgb, var(--color-blue-500) 45%, transparent);border-radius:8px}.lc-ov-skill-unit .lc-ov-skill-detail{background:0 0;margin-top:0;padding:4px 6px 8px}.lc-ov-skill-dot{border-radius:50%;flex:none;align-self:center;width:7px;height:7px}.lc-ov-skill-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-primary);flex:auto;font-size:11px;overflow:hidden}.lc-ov-skill-count{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);flex:none}.lc-ov-skill-last{text-align:right;min-width:56px;color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px}.lc-ov-skill-bar{opacity:.45;pointer-events:none;border-radius:1px;height:2px;position:absolute;bottom:1px;left:6px}.lc-ov-skill-more{color:var(--dsw-alias-label-secondary);padding-top:4px;font-size:11px}.lc-skilltip{z-index:300;white-space:normal;border-radius:10px;max-width:min(300px,60vw);padding:10px 12px;line-height:1.5;position:fixed}.lc-skilld-head{align-items:center;gap:7px;display:flex}.lc-skilld-name{overflow-wrap:anywhere;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-primary);flex:auto;font-size:12px;font-weight:600}.lc-skilld-chip{color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2);white-space:nowrap;border-radius:4px;flex:none;padding:0 5px;font-size:10px;line-height:1.5}.lc-skilld-desc{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:3;-webkit-box-orient:vertical;margin:6px 0 0;font-size:11.5px;line-height:1.55;display:-webkit-box;overflow:hidden}.lc-skilld-path{text-overflow:ellipsis;white-space:nowrap;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-tertiary);margin-top:6px;font-size:11px;overflow:hidden}.lc-skilld-foot{border-top:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:baseline;gap:2px 10px;margin-top:8px;padding-top:7px;font-size:11px;display:flex}.lc-skilld-foot>span:first-child{white-space:nowrap}.lc-skilld-hint{color:var(--color-blue-500);white-space:nowrap;flex:none;margin-left:auto}.lc-ov-skill-detail{background:var(--dsw-alias-bg-layer-2);border-radius:8px;margin:4px 0 2px;padding:8px 10px 9px}.lc-ov-skill-detail>:first-child{margin-top:0}.lc-skilld-grid{grid-template-columns:auto minmax(0,1fr);gap:2px 12px;margin-top:7px;font-size:11px;line-height:1.6;display:grid}.lc-skilld-k{color:var(--dsw-alias-label-tertiary);white-space:nowrap}.lc-skilld-v{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary);overflow:hidden}.lc-skilld-pathv{font:inherit;cursor:copy;text-align:left;background:0 0;border:0;align-items:center;gap:5px;padding:0;display:flex}.lc-skilld-pathv-text{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);overflow:hidden}.lc-skilld-pathv svg{color:var(--dsw-alias-label-tertiary);transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);flex:none}.lc-skilld-pathv:hover .lc-skilld-pathv-text,.lc-skilld-pathv:hover svg{color:var(--dsw-alias-label-primary)}.lc-ov-list-head{flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:10px;display:flex}.lc-ov-list-title{white-space:nowrap;font-weight:600}.lc-ov-list-count{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;background:var(--dsw-alias-bg-layer-2);border-radius:8px;padding:1px 7px;font-size:11px}.lc-ov-day-chip{border:1px solid color-mix(in srgb, var(--color-blue-500) 45%, transparent);color:var(--color-blue-500);background:color-mix(in srgb, var(--color-blue-500) 10%, transparent);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:999px;max-width:100%;padding:1px 10px;font-family:inherit;font-size:11px;line-height:1.4;overflow:hidden}.lc-ov-search{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);min-width:110px;font:inherit;color:var(--dsw-alias-label-primary);transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:6px;outline:none;flex:150px;padding:4px 10px;font-size:12px}.lc-ov-search:focus{border-color:var(--dsw-alias-label-secondary)}.lc-ov-search::placeholder{color:var(--dsw-alias-label-secondary)}.lc-ov-groups{flex-wrap:wrap;gap:6px;margin:-2px 0 10px;display:flex}.lc-ov-chip{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;max-width:220px;transition:color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border-radius:999px;align-items:baseline;gap:5px;padding:2px 10px;font-size:11px;line-height:1.5;display:inline-flex;overflow:hidden}.lc-ov-chip:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-secondary)}.lc-ov-chip-on,.lc-ov-chip-on:hover{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);border-color:#0000}.lc-ov-chip-n{font-variant-numeric:tabular-nums;opacity:.65;font-size:10px}.lc-ov-chip-on .lc-ov-chip-n{opacity:.85}.lc-ov-grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px;display:grid}.lc-ov-session{text-align:left;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;font:inherit;color:inherit;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), background-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:10px;flex-direction:column;gap:6px;padding:10px 12px;display:flex}.lc-ov-session:hover{border-color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2)}.lc-ov-session-current{border-color:color-mix(in srgb, var(--color-blue-500) 65%, transparent)}.lc-ov-session-head{align-items:flex-start;gap:6px;min-width:0;display:flex}.lc-ov-running{background:var(--color-green-500);border-radius:50%;flex:none;width:7px;height:7px}.lc-ov-session-title{-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;flex:auto;min-width:0;font-weight:600;display:-webkit-box;overflow:hidden}.lc-ov-current{color:var(--color-blue-500);border:1px solid color-mix(in srgb, var(--color-blue-500) 45%, transparent);border-radius:4px;flex:none;padding:0 4px;font-size:10px;line-height:1.5}.lc-ov-session-times{flex-direction:column;flex:none;align-items:flex-end;gap:1px;display:flex}.lc-ov-session-time{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:11px}.lc-ov-session-created{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:10px;line-height:1.4}.lc-ov-session-crumb{min-width:0;color:var(--dsw-alias-label-secondary);white-space:nowrap;align-items:center;gap:5px;font-size:11px;display:flex;overflow:hidden}.lc-ov-crumb-group{text-overflow:ellipsis;flex:none;max-width:55%;overflow:hidden}.lc-ov-crumb-sep{opacity:.55;flex:none}.lc-ov-crumb-project{text-overflow:ellipsis;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-secondary) 16%, transparent);border-radius:999px;flex:0 auto;padding:0 8px;font-size:10px;line-height:1.6;overflow:hidden}.lc-ov-session-body{align-items:center;gap:14px;min-width:0;display:flex}.lc-ov-mini-stats{flex-direction:column;flex:auto;gap:3px;min-width:0;display:flex}.lc-ov-mini-stat{justify-content:space-between;align-items:baseline;gap:10px;font-size:11px;display:flex}.lc-ov-mini-label{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none}.lc-ov-mini-value{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}.lc-ov-session-empty{color:var(--dsw-alias-label-secondary);padding:6px 0;font-size:11px;line-height:1.5}.lc-ov-session-preview{border-top:1px solid color-mix(in srgb, var(--dsw-alias-border-l2) 60%, transparent);align-items:baseline;gap:6px;min-width:0;margin-top:auto;padding-top:6px;display:flex}.lc-ov-session-preview-label{color:var(--dsw-alias-label-secondary);flex:none;font-size:10px}.lc-ov-session-preview-text{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary);flex:0 auto;font-size:11px;line-height:1.5;overflow:hidden}.lc-ov-pager{justify-content:center;align-items:center;gap:10px;margin-top:12px;display:flex}.lc-ov-pager-btn{border:1px solid var(--dsw-alias-border-l2);width:26px;height:22px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);background:0 0;border-radius:6px;flex:none;justify-content:center;align-items:center;line-height:1;display:flex}.lc-ov-pager-btn:hover:enabled{border-color:var(--dsw-alias-label-secondary)}.lc-ov-pager-btn:disabled{opacity:.4;cursor:default}.lc-ov-pager-n{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:11px}`,document.head.appendChild(e)}let sc=`dsh-context/dateRange.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(sc)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`dsh-context`,e.dataset.pluginCss=sc,e.textContent=`.lc-dp{flex:none;position:relative}.lc-dp-trigger{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);font:inherit;color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;transition:border-color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out), color var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease-in-out);border-radius:999px;align-items:center;gap:6px;padding:3px 12px;font-size:12px;line-height:18px;display:inline-flex}.lc-dp-trigger:hover{border-color:var(--dsw-alias-label-secondary);color:var(--dsw-alias-label-primary)}.lc-dp-trigger-on{border-color:color-mix(in srgb, var(--dsw-alias-brand-primary) 45%, transparent);color:var(--dsw-alias-brand-primary)}.lc-dp-half{text-align:center;font-variant-numeric:tabular-nums;flex:none}.lc-dp-half-empty{color:var(--dsw-alias-label-tertiary);font-variant-numeric:normal}.lc-dp-sep{color:var(--dsw-alias-label-tertiary);flex:none}.lc-dp-panel{z-index:300;pointer-events:auto;opacity:1;width:max-content;max-width:calc(100vw - 16px);padding:8px;position:fixed;top:0;left:0}.lc-dp-nav{align-items:center;gap:4px;margin-bottom:4px;display:flex}.lc-dp-month{text-align:center;white-space:nowrap;flex:auto;font-size:12px;font-weight:500;line-height:20px}.lc-dp-navbtn{width:22px;height:22px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:5px;flex:none;font-size:14px;line-height:1}.lc-dp-navbtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.lc-dp-navbtn:disabled{opacity:.35;cursor:not-allowed}.lc-dp-navbtn:disabled:hover{color:var(--dsw-alias-label-secondary);background:0 0}.lc-dp-wds,.lc-dp-week{display:flex}.lc-dp-wd{text-align:center;color:var(--dsw-alias-label-tertiary);flex:0 0 28px;font-size:10px;line-height:18px}.lc-dp-grid{outline:none;flex-direction:column;display:flex}.lc-dp-grid:focus-visible{outline:1px solid var(--dsw-alias-brand-primary);border-radius:6px}.lc-dp-cell{box-sizing:border-box;height:26px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;user-select:none;cursor:pointer;border-radius:5px;flex:0 0 28px;justify-content:center;align-items:center;font-size:11px;line-height:1;display:flex}.lc-dp-cell:hover{background:var(--dsw-alias-interactive-bg-hover)}.lc-dp-in{background:color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, transparent);border-radius:0}.lc-dp-in:hover{background:color-mix(in srgb, var(--dsw-alias-brand-primary) 24%, transparent)}.lc-dp-edge{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);border-radius:5px;font-weight:500}.lc-dp-edge:hover{background:var(--dsw-alias-button-primary-fill)}.lc-dp-cursor{box-shadow:inset 0 0 0 1px var(--dsw-alias-label-secondary)}.lc-dp-today{font-weight:600}.lc-dp-future{color:var(--dsw-alias-label-tertiary);opacity:.4;cursor:not-allowed}.lc-dp-future:hover{background:0 0}.lc-dp-blank{cursor:default}.lc-dp-blank:hover{background:0 0}.lc-dp-foot{border-top:1px solid var(--dsw-alias-border-l2);align-items:center;gap:8px;margin-top:6px;padding-top:6px;display:flex}.lc-dp-hint{min-width:0;color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;flex:auto;font-size:11px;line-height:18px;overflow:hidden}.lc-dp-clear{color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border:0;flex:none;font-size:11px;line-height:18px}.lc-dp-clear:hover{color:var(--dsw-alias-label-primary);text-decoration:underline}`,document.head.appendChild(e)}let cc=`dsh-context`;function lc(e){e.effect(()=>e.locale.register(cc,{zh:m,en:h}),`dsh-context: dictionaries`);let t=e.locale.bind(cc),n=Ws(t);Ve(e);let r=co(),i=zs(e,n,r);e.effect(()=>Us(r,{tab:()=>e.slots.inject(`conversation.view`,()=>e.slots.register({name:`conversation.view`,id:`context`,order:20,locale:cc,label:()=>t(`tab`)},e=>(0,u.createElement)(i,e))),sidebar:()=>Os(e,i,t,cc)}),`dsh-context: placement`);let a=Hs(e,n);e.slots.inject(`conversation.chat.assistant-actions`,()=>e.slots.register({name:`conversation.chat.assistant-actions`,id:`context-jump`,order:20,locale:cc},e=>(0,u.createElement)(a,e))),ee(e,n);let o=qn(e,n,r);e.slots.inject(`conversation.input.overlay`,()=>e.slots.register({name:`conversation.input.overlay`,id:`context-modal`,order:10,locale:cc,inject:(e=``)=>({hooks:{contextModal:O(e)}})},e=>(0,u.createElement)(o,e)));let s=eo(e,n);e.effect(()=>oo(e,r,e=>(0,u.createElement)(s,e),t,cc),`dsh-context: insight page`);let c=()=>({hooks:{contextSettings:r.store},set:(e,t)=>{r.set(e,t)}});e.inject([`configForms`],e=>{let t=e,i=t.configForms;if(i===void 0||typeof i.get!=`function`||typeof i.whileServed!=`function`)return;t.effect(()=>r.attach(i.get(cc)),`dsh-context: config forms`);let a=io(n);t.effect(()=>i.whileServed([cc],()=>t.slots.inject(`plugins.bundle.config`,()=>t.slots.register({name:`plugins.bundle.config`,key:cc,locale:cc,inject:c},e=>(0,u.createElement)(a,e)))),`dsh-context: plugins-page card`)})}return t.exports={name:`dsh-context`,inject:[`slots`,`locale`],apply:lc},t.exports}});
32
20
  //# sourceMappingURL=client.js.map