import{f as e,p as t}from"./lit-runtime-DA0-mbwP.js";import{o as n,r,t as i}from"./string-coerce-kcFITeCw.js";import{$ as a,B as o,P as s,V as c,_ as l,d as u,f as d,m as f,p,s as m,st as h,u as g}from"./index-x7xgmgRf.js";var _=[`off`,`minimal`,`low`,`medium`,`high`],v=[``,`off`,`on`,`full`],y=[``,`on`,`off`],b=[``,`off`,`on`,`stream`],x=[10,25,50,100];function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]??null:null}function C(e,t){return(!e.modelProvider||e.modelProvider===t?.modelProvider)&&(!e.model||e.model===t?.model)}function ee(e,t){let n=C(e,t),r=g(e.thinkingDefault??(n?t?.thinkingDefault:void 0)),i=e.thinkingLevels?.length?e.thinkingLevels:n&&t?.thinkingLevels?.length?t.thinkingLevels:(e.thinkingOptions?.length?e.thinkingOptions:n&&t?.thinkingOptions?.length?t.thinkingOptions:_).map(e=>({id:d(e),label:e}));return[{value:``,label:r},...i.map(e=>({value:d(e.id),label:u(e.id,e.label)}))]}function te(e,t){return!t||e.includes(t)?[...e]:[...e,t]}function w(e,t){return!t||e.some(e=>e.value===t)?[...e]:[...e,{value:t,label:u(t)}]}function ne(){return v.map(e=>({value:e,label:n(e===``?`sessionsView.inherit`:e===`off`?`sessionsView.offExplicit`:`sessionsView.${e}`)}))}function re(){return y.map(e=>({value:e,label:n(e===``?`sessionsView.inherit`:`sessionsView.${e}`)}))}function T(e){switch(e){case`running`:return n(`sessionsView.statusRunning`);case`done`:return n(`sessionsView.statusDone`);case`failed`:return n(`sessionsView.statusFailed`);case`killed`:return n(`sessionsView.statusKilled`);case`timeout`:return n(`sessionsView.statusTimeout`);default:return n(`sessionsView.statusUnknown`)}}function E(e){if(s(e))return{label:n(`sessionsView.statusLive`),tone:`live`};if(e.status===`running`&&e.hasActiveRun===!1)return{label:n(`sessionsView.statusIdle`),tone:`idle`};if(e.status){let t=e.status===`done`?`done`:`failed`;return{label:T(e.status),tone:t}}return e.hasActiveRun===!1?{label:n(`sessionsView.statusIdle`),tone:`idle`}:{label:n(`sessionsView.statusUnknown`),tone:`muted`}}function D(e){let r=E(e),i=`${n(`sessionsView.status`)}: ${r.label}`;return t`
    <span
      class="session-status-badge session-status-badge--${r.tone}"
      title=${i}
      aria-label=${i}
    >
      <span class="session-status-badge__dot" aria-hidden="true"></span>
      <span class="session-status-badge__label">${r.label}</span>
    </span>
  `}function ie(e){return e||null}function O(e,t,n){let r=i(t);return r?e.filter(e=>{let t=i(e.key),c=i(e.label),l=i(e.kind),u=i(e.displayName),d=i(a(e.agentRuntime)),p=i(e.status),m=e.goal?i(`${e.goal.objective} ${e.goal.status} ${f(e.goal)} ${e.goal.lastStatusNote??``}`):``,h=s(e)?`live running`:e.hasActiveRun===!1?`idle`:``;if(t.includes(r)||c.includes(r)||l.includes(r)||u.includes(r)||d.includes(r)||p.includes(r)||m.includes(r)||h.includes(r))return!0;let g=o(e.key);return(g?i(S(n,g.agentId)?.name):``).includes(r)}):e}function k(e,t,n){let r=n===`asc`?1:-1;return[...e].toSorted((e,n)=>{let i=0;switch(t){case`key`:i=(e.key??``).localeCompare(n.key??``);break;case`kind`:i=(e.kind??``).localeCompare(n.kind??``);break;case`updated`:i=(e.updatedAt??0)-(n.updatedAt??0);break;case`tokens`:i=(e.totalTokens??e.inputTokens??e.outputTokens??0)-(n.totalTokens??n.inputTokens??n.outputTokens??0);break}return i*r})}function A(e,t,n){let r=t*n;return e.slice(r,r+n)}function j(e){let t=Number(e.trim());return Number.isFinite(t)&&t>0}function M(e){return i(e.searchQuery).length>0||j(e.activeMinutes)||j(e.limit)||!e.includeGlobal||!e.includeUnknown||!e.showArchived}function N(e){switch(e){case`manual`:return n(`sessionsView.manual`);case`auto-threshold`:return n(`sessionsView.autoThreshold`);case`overflow-retry`:return n(`sessionsView.overflowRetry`);case`timeout-retry`:return n(`sessionsView.timeoutRetry`);default:return e}}function P(e){return n(e===1?`sessionsView.checkpoint`:`sessionsView.checkpoints`,{count:String(e)})}function F(e){return typeof e.tokensBefore==`number`&&typeof e.tokensAfter==`number`&&Number.isFinite(e.tokensBefore)&&Number.isFinite(e.tokensAfter)?n(`sessionsView.tokenRange`,{before:e.tokensBefore.toLocaleString(),after:e.tokensAfter.toLocaleString()}):typeof e.tokensBefore==`number`&&Number.isFinite(e.tokensBefore)?n(`sessionsView.tokensBefore`,{count:e.tokensBefore.toLocaleString()}):n(`sessionsView.tokenDeltaUnavailable`)}function I(e){if(typeof e!=`number`||!Number.isFinite(e)||e<0)return null;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;if(n<60)return r>0?`${n}m ${r}s`:`${n}m`;let i=Math.floor(n/60),a=n%60;return a>0?`${i}h ${a}m`:`${i}h`}function L(n){return n?t`
    <span
      class="session-goal-chip session-goal-chip--${n.status}"
      title=${p(n)}
      aria-label=${p(n)}
    >
      <span class="session-goal-chip__label">${f(n)}</span>
      <span class="session-goal-chip__objective">${n.objective}</span>
    </span>
  `:e}function R(e){let{row:t,updated:i,checkpointCount:a}=e,o=[{label:n(`sessionsView.key`),value:t.key},{label:n(`sessionsView.kind`),value:t.kind},{label:n(`sessionsView.updated`),value:i},{label:n(`sessionsView.tokens`),value:m(t)},{label:n(`sessionsView.compaction`),value:P(a)}],s=(e,t)=>{let n=r(t);n&&o.push({label:e,value:n})};return s(n(`sessionsView.status`),t.status),t.goal&&o.push({label:n(`sessionsView.goal`),value:p(t.goal)}),s(n(`sessionsView.goalNote`),t.goal?.lastStatusNote),s(n(`sessionsView.model`),t.model),s(n(`sessionsView.provider`),t.modelProvider),s(n(`sessionsView.runtime`),I(t.runtimeMs)),s(n(`sessionsView.surface`),t.surface),s(n(`sessionsView.subject`),t.subject),s(n(`sessionsView.room`),t.room),s(n(`sessionsView.space`),t.space),s(n(`sessionsView.sessionId`),t.sessionId),typeof t.hasActiveRun==`boolean`&&o.push({label:n(`sessionsView.activeRun`),value:t.hasActiveRun?n(`common.yes`):n(`common.no`)}),typeof t.archived==`boolean`&&o.push({label:n(`sessionsView.archived`),value:t.archived?n(`common.yes`):n(`common.no`)}),o}function z(e){return e instanceof Element&&!!e.closest(`a, button, input, label, select, textarea`)}function B(e){return t`
    <label class=${[`session-filter-check`,`session-filter-toggle`,e.extraClass??``,e.checked?`session-filter-check--active`:``].filter(Boolean).join(` `)} data-tooltip=${e.title}>
      <input
        name=${e.name}
        class="session-filter-check__input"
        type="checkbox"
        .checked=${e.checked}
        @change=${t=>e.onChange(t.target.checked)}
      />
      <span class="session-filter-check__mark" aria-hidden="true">${l.check}</span>
      <span class="session-filter-check__label">${e.label}</span>
    </label>
  `}function V(r){let i=r.result?.sessions??[],a=O(i,r.searchQuery,r.agentIdentityById),o=k(a,r.sortColumn,r.sortDir),s=o.length,c=Math.max(1,Math.ceil(s/r.pageSize)),u=Math.min(r.page,c-1),d=A(o,u,r.pageSize),f=i.length===0?M(r):a.length===0,p=n(`sessionsView.activeTooltip`,{count:r.activeMinutes.trim()}),m=n(`sessionsView.limitTooltip`),h=n(`sessionsView.globalTooltip`),g=n(`sessionsView.unknownTooltip`),_=n(`sessionsView.showArchivedTooltip`),v=!r.filtersCollapsed,y=n(`sessionsView.filters`),b=n(v?`sessionsView.hideFilters`:`sessionsView.showFilters`),S=(e,n,i=``)=>{let a=r.sortColumn===e,o=a&&r.sortDir===`asc`?`desc`:`asc`;return t`
      <th
        class=${i}
        data-sortable
        data-sort-dir=${a?r.sortDir:``}
        @click=${()=>r.onSortChange(e,a?o:`desc`)}
      >
        ${n}
        <span class="data-table-sort-icon">${l.arrowUpDown}</span>
      </th>
    `};return t`
    <section class="card">
      <div class="row" style="justify-content: space-between; margin-bottom: 12px;">
        <div>
          <div class="card-title">${n(`sessionsView.title`)}</div>
          <div class="card-sub">
            ${r.result?n(`sessionsView.store`,{path:r.result.path}):n(`sessionsView.subtitle`)}
          </div>
        </div>
        <button class="btn" ?disabled=${r.loading} @click=${r.onRefresh}>
          ${r.loading?n(`common.loading`):n(`common.refresh`)}
        </button>
      </div>

      <div class="sessions-filter-panel">
        <div class="sessions-filter-panel__header">
          <div class="sessions-filter-panel__title">${y}</div>
          <button
            class="sessions-filter-panel__toggle"
            type="button"
            aria-expanded=${String(v)}
            aria-controls="sessions-filter-bar"
            @click=${r.onToggleFiltersCollapsed}
          >
            ${v?l.chevronDown:l.chevronRight}
            <span>${b}</span>
          </button>
        </div>

        ${v?t`
              <div
                id="sessions-filter-bar"
                class="sessions-filter-bar"
                aria-label="Session filters"
              >
                <div class="session-filter-primary-row">
                  <label class="session-filter-field" data-tooltip=${p}>
                    <span class="session-filter-label">${n(`sessionsView.active`)}</span>
                    <input
                      class="session-filter-input session-filter-input--minutes"
                      placeholder=${n(`sessionsView.minutesPlaceholder`)}
                      .value=${r.activeMinutes}
                      ?disabled=${r.showArchived}
                      @input=${e=>r.onFiltersChange({activeMinutes:e.target.value,limit:r.limit,includeGlobal:r.includeGlobal,includeUnknown:r.includeUnknown,showArchived:r.showArchived})}
                    />
                  </label>
                  <label class="session-filter-field" data-tooltip=${m}>
                    <span class="session-filter-label">${n(`sessionsView.limit`)}</span>
                    <input
                      class="session-filter-input session-filter-input--limit"
                      .value=${r.limit}
                      @input=${e=>r.onFiltersChange({activeMinutes:r.activeMinutes,limit:e.target.value,includeGlobal:r.includeGlobal,includeUnknown:r.includeUnknown,showArchived:r.showArchived})}
                    />
                  </label>
                </div>
                <div
                  class="session-filter-toggle-group"
                  role="group"
                  aria-label=${n(`sessionsView.sourceFilters`)}
                >
                  ${B({name:`includeGlobal`,checked:r.includeGlobal,label:n(`sessionsView.global`),title:h,onChange:e=>r.onFiltersChange({activeMinutes:r.activeMinutes,limit:r.limit,includeGlobal:e,includeUnknown:r.includeUnknown,showArchived:r.showArchived})})}
                  ${B({name:`includeUnknown`,checked:r.includeUnknown,label:n(`sessionsView.unknown`),title:g,onChange:e=>r.onFiltersChange({activeMinutes:r.activeMinutes,limit:r.limit,includeGlobal:r.includeGlobal,includeUnknown:e,showArchived:r.showArchived})})}
                  ${B({name:`showArchived`,checked:r.showArchived,label:n(`sessionsView.showArchived`),title:_,extraClass:`session-archive-toggle`,onChange:e=>r.onFiltersChange({activeMinutes:r.activeMinutes,limit:r.limit,includeGlobal:r.includeGlobal,includeUnknown:r.includeUnknown,showArchived:e})})}
                </div>
              </div>
            `:e}
      </div>

      ${r.error?t`<div class="callout danger" style="margin-bottom: 12px;">${r.error}</div>`:e}

      <div class="data-table-wrapper">
        <div class="data-table-toolbar">
          <div class="data-table-search">
            <input
              type="text"
              placeholder=${n(`sessionsView.searchPlaceholder`)}
              .value=${r.searchQuery}
              @input=${e=>r.onSearchChange(e.target.value)}
            />
          </div>
        </div>

        ${r.selectedKeys.size>0?t`
              <div class="data-table-bulk-bar">
                <span
                  >${n(`sessionsView.selected`,{count:String(r.selectedKeys.size)})}</span
                >
                <button class="btn btn--sm" @click=${r.onDeselectAll}>
                  ${n(`common.unselect`)}
                </button>
                <button
                  class="btn btn--sm danger"
                  ?disabled=${r.loading}
                  @click=${r.onDeleteSelected}
                >
                  ${l.trash} ${n(`sessionsView.deleteSelected`)}
                </button>
              </div>
            `:e}

        <div class="data-table-container">
          <table class="data-table sessions-table">
            <thead>
              <tr>
                <th class="data-table-checkbox-col">
                  ${d.length>0?t`<input
                        type="checkbox"
                        .checked=${d.length>0&&d.every(e=>r.selectedKeys.has(e.key))}
                        .indeterminate=${d.some(e=>r.selectedKeys.has(e.key))&&!d.every(e=>r.selectedKeys.has(e.key))}
                        @change=${()=>{d.every(e=>r.selectedKeys.has(e.key))?r.onDeselectPage(d.map(e=>e.key)):r.onSelectPage(d.map(e=>e.key))}}
                        aria-label=${n(`sessionsView.selectAllOnPage`)}
                      />`:e}
                </th>
                ${S(`key`,n(`sessionsView.key`),`data-table-key-col`)}
                <th>${n(`sessionsView.label`)}</th>
                ${S(`kind`,n(`sessionsView.kind`))}
                <th class="session-status-col">${n(`sessionsView.status`)}</th>
                <th>${n(`agents.context.runtime`)}</th>
                ${S(`updated`,n(`sessionsView.updated`))}
                ${S(`tokens`,n(`sessionsView.tokens`))}
                <th class="session-compaction-col">${n(`sessionsView.compaction`)}</th>
                <th>${n(`sessionsView.thinking`)}</th>
                <th>${n(`sessionsView.fast`)}</th>
                <th>${n(`sessionsView.verbose`)}</th>
                <th>${n(`sessionsView.reasoning`)}</th>
                <th>${n(`sessionsView.actions`)}</th>
              </tr>
            </thead>
            <tbody>
              ${d.length===0?t`
                    <tr>
                      <td colspan="14" class="data-table-empty-cell">
                        ${f?t`
                              <div class="data-table-empty-state" role="status" aria-live="polite">
                                <div>${n(`sessionsView.noSessionsMatchFilters`)}</div>
                                <button class="btn btn--sm" @click=${r.onClearFilters}>
                                  ${n(`sessionsView.showAll`)}
                                </button>
                              </div>
                            `:n(`sessionsView.noSessions`)}
                      </td>
                    </tr>
                  `:d.flatMap(e=>H(e,r))}
            </tbody>
          </table>
        </div>

        ${s>0?t`
              <div class="data-table-pagination">
                <div class="data-table-pagination__info">
                  ${u*r.pageSize+1}-${Math.min((u+1)*r.pageSize,s)}
                  of ${s} row${s===1?``:`s`}
                </div>
                <div class="data-table-pagination__controls">
                  <select
                    style="height: 32px; padding: 0 8px; font-size: 13px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card);"
                    .value=${String(r.pageSize)}
                    @change=${e=>r.onPageSizeChange(Number(e.target.value))}
                  >
                    ${x.map(e=>t`<option value=${e}>${e} per page</option>`)}
                  </select>
                  <button ?disabled=${u<=0} @click=${()=>r.onPageChange(u-1)}>
                    Previous
                  </button>
                  <button
                    ?disabled=${u>=c-1}
                    @click=${()=>r.onPageChange(u+1)}
                  >
                    ${n(`common.next`)}
                  </button>
                </div>
              </div>
            `:e}
      </div>
    </section>
  `}function H(i,s){let u=i.updatedAt?c(i.updatedAt):n(`common.na`),f=i.thinkingLevel??``,p=f?d(f):``,g=w(ee(i,s.result?.defaults),p),_=i.fastMode===!0?`on`:i.fastMode===!1?`off`:``,v=w(re(),_),y=i.verboseLevel??``,x=w(ne(),y),C=i.reasoningLevel??``,T=te(b,C),E=i.latestCompactionCheckpoint,O=i.compactionCheckpointCount??0,k=Math.max(O,+!!E),A=O>0||!!E,j=s.expandedCheckpointKey===i.key,M=s.checkpointItemsByKey[i.key]??[],I=s.checkpointErrorByKey[i.key],B=`session-checkpoints-${encodeURIComponent(i.key)}`,V=P(k),H=R({row:i,updated:u,checkpointCount:k}),U=r(i.displayName)??null,ae=r(i.label)??``,W=!!(U&&U!==i.key&&U!==ae),G=o(i.key),K=G?S(s.agentIdentityById,G.agentId):null,q=r(K?.emoji)??``,J=r(K?.name)??``,Y=J&&G?`${q?`${q} `:``}${J} (${G.channel})`:null,oe=Y??i.key,X=i.kind!==`global`,Z=s.workboardSessionKeys?.has(i.key)===!0,se=s.workboardBusySessionKey===i.key,ce=X?`${h(`chat`,s.basePath)}?session=${encodeURIComponent(i.key)}`:null,Q=i.kind===`cron`?`data-table-badge--cron`:i.kind===`direct`?`data-table-badge--direct`:i.kind===`group`?`data-table-badge--group`:i.kind===`global`?`data-table-badge--global`:`data-table-badge--unknown`,le=[`session-data-row`,A?`session-data-row--expandable`:``,j?`session-data-row--expanded`:``].filter(Boolean).join(` `),$=()=>{A&&s.onToggleCheckpointDetails(i.key)};return[t`<tr
      class=${le}
      tabindex=${A?`0`:e}
      aria-expanded=${A?String(j):e}
      aria-controls=${A?B:e}
      @click=${e=>{!A||z(e.target)||$()}}
      @keydown=${e=>{!A||z(e.target)||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),$())}}
    >
      <td class="data-table-checkbox-col">
        <input
          type="checkbox"
          .checked=${s.selectedKeys.has(i.key)}
          @change=${()=>s.onToggleSelect(i.key)}
          aria-label=${n(`sessionsView.selectSession`)}
        />
      </td>
      <td class="data-table-key-col">
        <div
          class=${Y?`session-key-cell`:`mono session-key-cell`}
          title=${oe}
        >
          ${X?t`<a
                href=${ce}
                class="session-link"
                @click=${e=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||s.onNavigateToChat&&(e.preventDefault(),s.onNavigateToChat(i.key))}}
                >${Y??i.key}</a
              >`:Y??i.key}
          ${W?t`<span class="muted session-key-display-name">${U}</span>`:e}
        </div>
      </td>
      <td>
        <input
          .value=${i.label??``}
          ?disabled=${s.loading}
          placeholder=${n(`sessionsView.optionalPlaceholder`)}
          style="width: 100%; max-width: 140px; padding: 6px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);"
          @change=${e=>{let t=r(e.target.value)??null;s.onPatch(i.key,{label:t})}}
        />
      </td>
      <td>
        <span class="data-table-badge ${Q}">${i.kind}</span>
      </td>
      <td class="session-status-col">
        <div class="session-status-stack">
          ${D(i)} ${L(i.goal)}
        </div>
      </td>
      <td class="session-runtime-cell">
        <span class="mono">${a(i.agentRuntime)}</span>
      </td>
      <td>${u}</td>
      <td class="session-token-cell">${m(i)}</td>
      <td class="session-compaction-col">
        <div class="session-compaction-cell">
          ${A?t`
                <button
                  class="session-compaction-trigger"
                  type="button"
                  aria-expanded=${String(j)}
                  aria-controls=${B}
                  aria-label=${n(j?`sessionsView.hideSessionDetails`:`sessionsView.showSessionDetails`,{count:V})}
                  @click=${e=>{e.stopPropagation(),$()}}
                >
                  <span class="session-compaction-count">${V}</span>
                </button>
              `:t`<span class="muted session-compaction-count">${n(`common.none`)}</span>`}
        </div>
      </td>
      <td>
        <select
          ?disabled=${s.loading}
          style="padding: 6px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 90px;"
          @change=${e=>{let t=e.target.value;s.onPatch(i.key,{thinkingLevel:ie(t)})}}
        >
          ${g.map(e=>t`<option value=${e.value} ?selected=${p===e.value}>
                ${e.label}
              </option>`)}
        </select>
      </td>
      <td>
        <select
          ?disabled=${s.loading}
          style="padding: 6px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 90px;"
          @change=${e=>{let t=e.target.value;s.onPatch(i.key,{fastMode:t===``?null:t===`on`})}}
        >
          ${v.map(e=>t`<option value=${e.value} ?selected=${_===e.value}>
                ${e.label}
              </option>`)}
        </select>
      </td>
      <td>
        <select
          ?disabled=${s.loading}
          style="padding: 6px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 90px;"
          @change=${e=>{let t=e.target.value;s.onPatch(i.key,{verboseLevel:t||null})}}
        >
          ${x.map(e=>t`<option value=${e.value} ?selected=${y===e.value}>
                ${e.label}
              </option>`)}
        </select>
      </td>
      <td>
        <select
          ?disabled=${s.loading}
          style="padding: 6px 10px; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 90px;"
          @change=${e=>{let t=e.target.value;s.onPatch(i.key,{reasoningLevel:t||null})}}
        >
          ${T.map(e=>t`<option value=${e} ?selected=${C===e}>
                ${e||n(`sessionsView.inherit`)}
              </option>`)}
        </select>
      </td>
      <td>
        ${s.onAddToWorkboard&&X?t`
              <button
                class="icon-btn"
                title=${n(Z?`sessionsView.openWorkboardCard`:`sessionsView.addToWorkboard`)}
                ?disabled=${s.loading||se}
                @click=${e=>{e.stopPropagation(),s.onAddToWorkboard?.(i)}}
              >
                ${Z?l.check:l.plus}
              </button>
            `:e}
      </td>
    </tr>`,...j&&A?[t`<tr id=${B} class="session-checkpoint-details-row">
            <td colspan="14">
              <div class="session-details-panel">
                <div class="session-details-panel__hero">
                  <div>
                    <div class="session-details-panel__eyebrow">
                      ${n(`sessionsView.sessionDetails`)}
                    </div>
                    <div class="session-details-panel__title">${Y??i.key}</div>
                    ${W?t`
                          <div class="muted session-details-panel__subtitle">${U}</div>
                        `:e}
                  </div>
                  <div class="session-details-panel__badges">
                    ${D(i)} ${L(i.goal)}
                    <span class="data-table-badge ${Q}">${i.kind}</span>
                  </div>
                </div>

                <div class="session-details-grid">
                  ${H.map(e=>t`
                      <div class="session-detail-stat">
                        <div class="session-detail-stat__label">${e.label}</div>
                        <div class="session-detail-stat__value" title=${e.value}>
                          ${e.value}
                        </div>
                      </div>
                    `)}
                </div>

                <div class="session-details-section">
                  <div class="session-details-section__header">
                    <div>
                      <div class="session-details-panel__eyebrow">
                        ${n(`sessionsView.compactionHistory`)}
                      </div>
                      <div class="session-details-section__title">${V}</div>
                    </div>
                  </div>
                  ${s.checkpointLoadingKey===i.key?t`<div class="muted session-details-empty">
                        ${n(`sessionsView.loadingCheckpoints`)}
                      </div>`:I?t`<div class="callout danger">${I}</div>`:M.length===0?t`<div class="muted session-details-empty">
                            ${n(`sessionsView.noCheckpoints`)}
                          </div>`:t`
                            <div class="session-checkpoint-list">
                              ${M.map(e=>t`
                                  <div class="session-checkpoint-card">
                                    <div class="session-checkpoint-card__header">
                                      <strong>
                                        ${N(e.reason)} ·
                                        ${c(e.createdAt)}
                                      </strong>
                                      <span class="muted session-checkpoint-card__delta">
                                        ${F(e)}
                                      </span>
                                    </div>
                                    ${e.summary?t`<div class="session-checkpoint-card__summary">
                                          ${e.summary}
                                        </div>`:t`
                                          <div class="muted">${n(`sessionsView.noSummary`)}</div>
                                        `}
                                    <div class="session-checkpoint-card__actions">
                                      <button
                                        class="btn btn--sm"
                                        ?disabled=${s.checkpointBusyKey===e.checkpointId}
                                        @click=${()=>s.onBranchFromCheckpoint(i.key,e.checkpointId)}
                                      >
                                        ${n(`sessionsView.branchFromCheckpoint`)}
                                      </button>
                                      <button
                                        class="btn btn--sm"
                                        ?disabled=${s.checkpointBusyKey===e.checkpointId}
                                        @click=${()=>s.onRestoreCheckpoint(i.key,e.checkpointId)}
                                      >
                                        ${n(`sessionsView.restoreCheckpoint`)}
                                      </button>
                                    </div>
                                  </div>
                                `)}
                            </div>
                          `}
                </div>
              </div>
            </td>
          </tr>`]:[]]}export{V as renderSessions};
//# sourceMappingURL=sessions-Vdmd8Gqn.js.map