@michengai/dsh-archive-manager 1.1.19 → 1.1.21

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
@@ -7,20 +7,20 @@ window.__ModuleLoader__.load({
7
7
  globalThis.__dshArchiveReactDOMClient = require("react-dom/client");
8
8
  var module = { exports: {} };
9
9
  var exports = module.exports;
10
- "use strict";var Un=Object.defineProperty;var ei=Object.getOwnPropertyDescriptor;var ti=Object.getOwnPropertyNames;var ni=Object.prototype.hasOwnProperty;var e=(t,s)=>Un(t,"name",{value:s,configurable:!0});var ri=(t,s)=>{for(var o in s)Un(t,o,{get:s[o],enumerable:!0})},si=(t,s,o,b)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of ti(s))!ni.call(t,a)&&a!==o&&Un(t,a,{get:()=>s[a],enumerable:!(b=ei(s,a))||b.enumerable});return t};var ai=t=>si(Un({},"__esModule",{value:!0}),t);var Di={};ri(Di,{startArchiveClient:()=>ji});module.exports=ai(Di);function ne(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return t}e(ne,"record");function qe(t){return String(t&&typeof t=="object"&&"message"in t?t.message??t:t)}e(qe,"errorMessage");function Hn(t){return t&&typeof t=="object"&&"code"in t?t.code:void 0}e(Hn,"errorCode");var fs=Function("return globalThis.__dshArchiveReact")(),{Children:Bi,Component:Ui,Fragment:gs,Profiler:Hi,PureComponent:Wi,StrictMode:qi,Suspense:Vi,cloneElement:Gi,createContext:$i,createElement:vs,createRef:Ki,forwardRef:Yi,isValidElement:Zi,lazy:Ji,memo:Xi,startTransition:Qi,useCallback:eo,useContext:to,useDebugValue:no,useDeferredValue:ro,useEffect:bs,useId:so,useImperativeHandle:ao,useInsertionEffect:io,useLayoutEffect:oo,useMemo:lo,useReducer:co,useRef:uo,useState:Gt,useSyncExternalStore:ho,useTransition:po,version:mo}=fs,U=fs;function ws(t){return U.createElement("input",{className:"dsham_number",type:"number",min:t.min,max:t.max,value:t.value??"",disabled:t.disabled,"aria-label":t["aria-label"],onChange:e(s=>{let o=s.target.value;if(o===""){t.onChange(null);return}let b=Number(o);t.onChange(Number.isNaN(b)?null:b)},"onChange")})}e(ws,"NumberField");function oi(t=U.createElement){return t("svg",{className:"dsham_dateIcon",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},t("rect",{x:2,y:3,width:12,height:11,rx:2}),t("line",{x1:2,y1:6.5,x2:14,y2:6.5}),t("line",{x1:5.5,y1:1.5,x2:5.5,y2:3.5}),t("line",{x1:10.5,y1:1.5,x2:10.5,y2:3.5}))}e(oi,"CalendarIcon");function En(t,s,o){let b=String(s+1).padStart(2,"0"),a=String(o).padStart(2,"0");return`${t}-${b}-${a}`}e(En,"formatYmd");function on(t){let s=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return s?{year:Number(s[1]),monthIndex:Number(s[2])-1,day:Number(s[3])}:null}e(on,"parseYmd");function li(t,s){let o=new Date(t,s,1).getDay(),b=(o===0?7:o)-1,a=new Date(t,s+1,0).getDate(),l=new Date(t,s,0).getDate(),p=[];for(let g=0;g<42;g++){let y=t,D=s,x=0,v=!1;g<b?(x=l-b+g+1,D=s-1,D<0&&(D=11,y--),v=!0):g<b+a?x=g-b+1:(x=g-b-a+1,D=s+1,D>11&&(D=0,y++),v=!0),p.push({year:y,monthIndex:D,day:x,dateStr:En(y,D,x),isOutside:v})}return p}e(li,"buildMonthGrid");function di(t,s=new Date){if(t==="all")return{from:"",to:""};let o=En(s.getFullYear(),s.getMonth(),s.getDate());if(t==="today")return{from:o,to:o};let b=t==="7d"?6:t==="30d"?29:89,a=new Date(s.getTime()-b*864e5);return{from:En(a.getFullYear(),a.getMonth(),a.getDate()),to:o}}e(di,"getPresetRange");function ys(t,s,o,b){let a=s+b,l=new Date(t,a+1,0).getDate();return new Date(t,a,Math.min(o,l))}e(ys,"shiftMonthClamped");function Ss(t){let s=t.React||U;function o(_,fe){let Ve=_==="from"?fe:t.from,Kt=_==="to"?fe:t.to;if(Ve===""&&Kt===""){t.onClear();return}_==="from"?t.onFrom(fe):t.onTo(fe)}e(o,"change");let b=!!(t.from||t.to),a="";t.from&&t.to?a=`${t.from} \u2013 ${t.to}`:t.from?a=`${t.from} \u2013`:t.to?a=`\u2013 ${t.to}`:a=t.t?t.t("discovery.timeRange")||`${t.fromLabel} \u2013 ${t.toLabel}`:`${t.fromLabel} \u2013 ${t.toLabel}`;let p=(s.useRef??(_=>{let[fe]=s.useState({current:_});return fe}))(null),[g,y]=s.useState(!1),D=on(t.from||t.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[x,v]=s.useState(D.year),[C,M]=s.useState(D.monthIndex),[N,H]=s.useState(null),[B,q]=s.useState(null),[le,re]=s.useState(null);s.useEffect(()=>{if(!g)return;let _=e(Ve=>{p.current&&!p.current.contains(Ve.target)&&(y(!1),H(null))},"onPointerDown"),fe=e(Ve=>{Ve.key==="Escape"&&(Ve.preventDefault(),Ve.stopPropagation(),y(!1),H(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",_,!0),typeof window<"u"&&window.addEventListener("keydown",fe,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",_,!0),typeof window<"u"&&window.removeEventListener("keydown",fe,!0)}},[g]),s.useEffect(()=>{if(!g||!le||!p.current)return;p.current.querySelector(`[data-date="${le}"]`)?.focus()},[g,le]);let se=t.t?t.t("discovery.today")==="Today"||(t.t("locale.language")||"").startsWith("en"):!1,de=t.t?t.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(t.t("locale.language")||"").startsWith("ru"):!1,ae=se?"en-US":de?"ru-RU":"zh-CN",Be=se?["Mo","Tu","We","Th","Fr","Sa","Su"]:de?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function he(_){_.stopPropagation(),C<=0?(M(11),v(fe=>fe-1)):M(fe=>fe-1)}e(he,"prevMonth");function V(_){_.stopPropagation(),C>=11?(M(0),v(fe=>fe+1)):M(fe=>fe+1)}e(V,"nextMonth");function mt(_){N?(_>=N?(t.onFrom(N),t.onTo(_)):(t.onFrom(_),t.onTo(N)),H(null),y(!1)):(H(_),q(_))}e(mt,"handleDayClick");function ft(_){let fe=di(_);_==="all"?t.onClear():(t.onFrom(fe.from),t.onTo(fe.to)),H(null),y(!1)}e(ft,"applyPreset");function yt(_){let fe=En(_.getFullYear(),_.getMonth(),_.getDate());re(fe),N&&q(fe),(_.getFullYear()!==x||_.getMonth()!==C)&&(v(_.getFullYear()),M(_.getMonth()))}e(yt,"moveFocusToDate");function xt(_,fe){let Ve=on(_);Ve&&yt(new Date(Ve.year,Ve.monthIndex,Ve.day+fe))}e(xt,"moveFocus");let ze=t.from,It=t.to;N&&B&&(ze=N<=B?N:B,It=N<=B?B:N);let L=li(x,C),Ee=new Date,Mt=le||ze||En(Ee.getFullYear(),Ee.getMonth(),Ee.getDate()),Cr=L.map((_,fe)=>{let Ve=ze===_.dateStr,Kt=It===_.dateStr,cn=!!(ze&&It&&_.dateStr>ze&&_.dateStr<It),Rn=_.year===Ee.getFullYear()&&_.monthIndex===Ee.getMonth()&&_.day===Ee.getDate(),zt="dsham_dateDay";_.isOutside&&(zt+=" is-outside"),Rn&&(zt+=" is-today"),Ve&&(zt+=" is-start"),Kt&&(zt+=" is-end"),cn&&(zt+=" is-in-range");let Ot=!_.isOutside&&(_.dateStr===Mt||_.day===1&&!L.some(X=>!X.isOutside&&X.dateStr===Mt));return s.createElement("div",{key:fe,className:zt,role:"button",tabIndex:Ot?0:-1,"data-date":_.dateStr,"aria-label":_.dateStr,"aria-pressed":!!(Ve||Kt||cn),onClick:e(X=>{X.stopPropagation(),mt(_.dateStr)},"onClick"),onKeyDown:e(X=>{if(X.key==="Enter"||X.key===" ")X.preventDefault(),X.stopPropagation(),mt(_.dateStr);else if(X.key==="ArrowLeft")X.preventDefault(),X.stopPropagation(),xt(_.dateStr,-1);else if(X.key==="ArrowRight")X.preventDefault(),X.stopPropagation(),xt(_.dateStr,1);else if(X.key==="ArrowUp")X.preventDefault(),X.stopPropagation(),xt(_.dateStr,-7);else if(X.key==="ArrowDown")X.preventDefault(),X.stopPropagation(),xt(_.dateStr,7);else if(X.key==="Home"){X.preventDefault(),X.stopPropagation();let Le=on(_.dateStr);if(Le){let at=new Date(Le.year,Le.monthIndex,Le.day),un=(at.getDay()===0?7:at.getDay())-1;at.setDate(at.getDate()-un),yt(at)}}else if(X.key==="End"){X.preventDefault(),X.stopPropagation();let Le=on(_.dateStr);if(Le){let at=new Date(Le.year,Le.monthIndex,Le.day),un=(at.getDay()===0?7:at.getDay())-1;at.setDate(at.getDate()+(6-un)),yt(at)}}else if(X.key==="PageUp"){X.preventDefault(),X.stopPropagation();let Le=on(_.dateStr);Le&&yt(ys(Le.year,Le.monthIndex,Le.day,-1))}else if(X.key==="PageDown"){X.preventDefault(),X.stopPropagation();let Le=on(_.dateStr);Le&&yt(ys(Le.year,Le.monthIndex,Le.day,1))}},"onKeyDown"),onMouseEnter:e(()=>{N&&q(_.dateStr)},"onMouseEnter")},_.day)}),_n=`${x}\u5E74 ${C+1}\u6708`;try{_n=new Intl.DateTimeFormat(ae,{year:"numeric",month:"long"}).format(new Date(x,C,1))}catch{_n=se||de?`${x}-${String(C+1).padStart(2,"0")}`:`${x}\u5E74 ${C+1}\u6708`}return s.createElement("div",{ref:p,className:"dsham_dateRange",role:"group","aria-label":t.label},s.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.from,"aria-label":t.fromLabel,"aria-invalid":t.invalid||void 0,onChange:e(_=>o("from",_.target.value),"onChange")}),s.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.to,"aria-label":t.toLabel,"aria-invalid":t.invalid||void 0,onChange:e(_=>o("to",_.target.value),"onChange")}),s.createElement("div",{className:"dsham_dateTrigger"+(g?" is-open":""),role:"button",tabIndex:0,"aria-expanded":g,"aria-controls":g?"dsham-date-popover":void 0,onClick:e(()=>{g&&H(null),y(!g)},"onClick"),onKeyDown:e(_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g&&H(null),y(!g))},"onKeyDown")},oi(s.createElement),s.createElement("span",{className:"dsham_dateText"+(b?"":" placeholder")},a),b?s.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:e(_=>{_.stopPropagation(),t.onClear(),H(null)},"onClick"),children:"\xD7"}):null,s.createElement("span",{className:"dsham_dateChevron"},ks(s.createElement,g))),g&&s.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":t.label,onClick:e(_=>_.stopPropagation(),"onClick")},s.createElement("div",{className:"dsham_datePresets"},s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>ft("all"),"onClick")},t.t?t.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>ft("today"),"onClick")},t.t?t.t("discovery.today"):"\u4ECA\u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>ft("7d"),"onClick")},t.t?t.t("discovery.last7Days"):"\u8FD1 7 \u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>ft("30d"),"onClick")},t.t?t.t("discovery.last30Days"):"\u8FD1 30 \u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>ft("90d"),"onClick")},t.t?t.t("discovery.last90Days"):"\u8FD1 90 \u5929")),s.createElement("div",{className:"dsham_dateCalendar"},s.createElement("div",{className:"dsham_dateCalHeader"},s.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:he,"aria-label":"prev month"},"\u2039"),s.createElement("span",{className:"dsham_dateMonthTitle"},_n),s.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:V,"aria-label":"next month"},"\u203A")),s.createElement("div",{className:"dsham_dateGrid"},Be.map((_,fe)=>s.createElement("div",{key:fe,className:"dsham_dateWeekday"},_))),s.createElement("div",{className:"dsham_dateGrid"},Cr))))}e(Ss,"DateRange");function Wn(t){return U.createElement("div",{className:t.className},U.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":t.open,onClick:t.onToggle},ks(U.createElement,t.open),t.title),t.open?U.createElement("div",null,t.children):null)}e(Wn,"Disclosure");function ks(t,s){return t("svg",{className:"dsham_foldChevron"+(s?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},t("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}e(ks,"foldChevron");function hr(t){let s=U.useRef(null);return U.useEffect(()=>{s.current&&(s.current.indeterminate=!!t.indeterminate&&!t.checked)},[t.indeterminate,t.checked]),U.createElement("input",{ref:s,className:"dsham_checkbox",type:"checkbox",checked:t.checked,disabled:t.disabled,"aria-label":t.label,onChange:e(o=>t.onChange({target:{checked:o.target.checked}}),"onChange")})}e(hr,"SelectionCheckbox");var An=e(t=>{if(typeof t!="string"||!t.length||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return t},"id"),Cs=e((t,s=!1)=>{if(typeof t!="string"||t.length>200||s&&!t.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return t.trim()},"queryText"),xs={parse(t){let s=ne(t);if(!s||!Array.isArray(s.sessionIds)||!s.sessionIds.length||s.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(s.sessionIds.map(An))],query:Cs(s.query,!0)}}},ci={parse(t){let s=ne(t);if(!s)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:An(s.sessionId),query:Cs(s.query??"")}}},pr=e((t,s)=>{if(typeof t!="string"||t.length>s)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return t},"boundedString"),Es=e(t=>{if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return t},"sequence"),mr={parse(t){let s=ne(t);if(!s||!Array.isArray(s.items)||!Array.isArray(s.failures)||s.items.length>20||s.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:s.items.map(ne).map(o=>({sessionId:An(o.sessionId),seq:Es(o.seq),snippet:pr(o.snippet,400)})),failures:s.failures.map(ne).map(o=>({sessionId:An(o.sessionId),message:pr(o.message,500)}))}}},ui={parse(t){let s=ne(t);if(!s||!Array.isArray(s.messages)||s.messages.length>8||typeof s.hasEarlier!="boolean"||typeof s.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:An(s.sessionId),hasEarlier:s.hasEarlier,hasLater:s.hasLater,messages:s.messages.map(ne).map(o=>{if(typeof o.role!="string"||!["user","assistant"].includes(o.role)||typeof o.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:Es(o.seq),role:o.role,text:pr(o.text,2e3),truncated:o.truncated}})}}};async function fr(t,s=globalThis.navigator?.clipboard){if(typeof t!="string"||!t)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!s?.writeText)throw Object.assign(new Error("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762"),{code:"copy.unavailable"});try{await s.writeText(t)}catch{throw Object.assign(new Error("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5"),{code:"copy.denied"})}}e(fr,"copySessionText");function As(){let t=e((o,b)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${o}`,create:e(()=>b,"create"),schema:b}),"codec");return[["searchSessionContent",xs,mr],["searchArchivedContent",xs,mr],["previewArchivedSession",ci,ui]].map(([o,b,a])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${o}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:o,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:t(o+"Input",b)}],result:t(o+"Result",a),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(As,"discoveryInvocations");function Is(t,s){let o=s?.trim().toLowerCase();if(!o)return null;let b=t.toLowerCase().indexOf(o);if(b<0)return null;let a=0,l=0,p;for(let g of t){let y=l+g.toLowerCase().length;if(p===void 0&&y>b&&(p=a),a+=g.length,y>=b+o.length)return{start:p??a,end:a};l=y}return null}e(Is,"findTextRange");function qn(t,s=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return NaN;let[o,b,a]=t.split("-").map(Number),l=new Date(o,b-1,a);return l.getFullYear()!==o||l.getMonth()!==b-1||l.getDate()!==a?NaN:(s&&l.setDate(l.getDate()+1),l.getTime())}e(qn,"dayBoundary");function gr(t,s){return(!t||Number.isFinite(qn(t)))&&(!s||Number.isFinite(qn(s)))&&(!t||!s||t<=s)}e(gr,"validUpdatedRange");function Ts(t,s,o){if(!gr(s,o))return!1;if(!s&&!o)return!0;let b=typeof t=="number"?t:Date.parse(t??"");return Number.isFinite(b)&&(!s||b>=qn(s))&&(!o||b<qn(o,!0))}e(Ts,"matchesUpdatedRange");async function _s(t,s,o,{signal:b,onProgress:a}={}){let l=[],p=[],g=[...new Set(t)],y=e(()=>{if(b?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let D=0;D<g.length;D+=20){y();let x=mr.parse(await o({sessionIds:g.slice(D,D+20),query:s}));y(),l.push(...x.items),p.push(...x.failures),a?.({done:Math.min(D+20,g.length),total:g.length,items:[...l],failures:[...p]})}return y(),{items:l,failures:p}}e(_s,"searchArchiveBatches");function Rs(t,s={}){let o=t.createElement;function b({text:v,query:C=""}){let M=Is(v,C);return M?o(t.Fragment,null,v.slice(0,M.start),o("mark",null,v.slice(M.start,M.end)),v.slice(M.end)):v}e(b,"HighlightedText");function a(v,C,M,N){let H=JSON.stringify(v),B=JSON.stringify([H,C]),[q,le]=t.useState(0),[re,se]=t.useState({key:"",status:"idle",items:[],failures:[]});return t.useEffect(()=>{if(!M||!C.trim()||!N)return;let ae=new AbortController;se({key:B,status:"loading",items:[],failures:[],done:0,total:v.length});let Be=setTimeout(()=>{_s(JSON.parse(H),C,N,{signal:ae.signal,onProgress:e(he=>{ae.signal.aborted||se({key:B,status:"loading",...he})},"onProgress")}).then(he=>{ae.signal.aborted||se({key:B,status:"ready",done:v.length,total:v.length,...he})}).catch(he=>{ae.signal.aborted||se(V=>({...V,key:B,status:"error",error:qe(he)}))})},350);return()=>{ae.abort(),clearTimeout(Be)}},[H,C,M,N,q]),{...M&&C.trim()&&N?re.key===B?re:{key:B,status:"loading",items:[],failures:[],done:0,total:v.length}:{status:"idle",items:[],failures:[]},retry:e(()=>le(ae=>ae+1),"retry")}}e(a,"useArchiveSearch");function l(v,C){let[M,N]=t.useState(null),[H,B]=t.useState({status:"idle"}),[q,le]=t.useState(0),re=M,se=M&&C.includes(M.session.id);return t.useEffect(()=>{M&&!se&&N(null)},[M,se]),t.useEffect(()=>{if(!se||typeof window>"u")return;let de=e(ae=>{ae.key==="Escape"&&(ae.preventDefault(),ae.stopPropagation(),ae.stopImmediatePropagation(),N(null))},"onKeyDown");return window.addEventListener("keydown",de,!0),()=>window.removeEventListener("keydown",de,!0)},[se]),t.useEffect(()=>{if(!M||!se||!v)return;let de=!0;return B({key:re,status:"loading"}),Promise.resolve().then(()=>v({sessionId:M.session.id,query:M.query})).then(ae=>{de&&B({key:re,status:"ready",value:ae})}).catch(ae=>{de&&B({key:re,status:"error",error:qe(ae)})}),()=>{de=!1}},[re,se,v,q]),{target:se?M:null,...H.key===re?H:{status:"loading"},open:e((de,ae="")=>N({session:de,query:ae}),"open"),close:e(()=>N(null),"close"),retry:e(()=>le(de=>de+1),"retry")}}e(l,"useArchivePreview");function p({title:v,failures:C,separator:M}){let[N,H]=t.useState(!1),B=o("ul",null,C.map(q=>o("li",{key:q.sessionId},q.sessionId,M,q.message)));return o(Wn,{title:v,open:N,onToggle:e(()=>H(q=>!q),"onToggle")},B)}e(p,"FailureDetails");function g(v,C){let M=s.Button??(N=>o("button",{type:"button",disabled:N.disabled,onClick:N.onClick},N.children));return o(M,{variant:"outline",size:"sm",...C},v)}e(g,"textButton");function y({t:v,from:C,to:M,onFrom:N,onTo:H,invalid:B,onClear:q}){return o("div",{className:"dsham_dateFilter"},o(Ss,{React:t,from:C,to:M,invalid:B,label:v("discovery.date"),fromLabel:v("discovery.from"),toLabel:v("discovery.to"),onFrom:N,onTo:H,onClear:q,t:v}),B?o("p",{className:"dsham_dateAlert",role:"alert"},v("discovery.invalidDate")):null)}e(y,"DiscoveryFilters");function D({state:v,t:C}){return v.status==="idle"?null:o("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},o("p",null,C(v.status==="loading"?"discovery.searching":v.status==="error"?"discovery.searchError":"discovery.searched",{done:v.done??0,total:v.total??0})),v.status==="error"&&o("p",null,v.error),v.failures.length>0&&o(p,{title:C("discovery.failed",{n:v.failures.length}),failures:v.failures,separator:C("common.separator")}),(v.status==="error"||v.status==="ready"&&v.failures.length>0)&&g(C("discovery.retry"),{onClick:v.retry}))}e(D,"SearchStatus");function x({preview:v,t:C,MarkdownText:M}){let[N,H]=t.useState(!1);if(v.status==="loading")return o("p",{role:"status"},C("discovery.loading"));if(v.status==="error")return o("div",null,o("p",{role:"alert"},v.error),g(C("discovery.retry"),{onClick:v.retry}));let B=v.value;return B?o("div",{className:"dsham_previewMessages"},o("div",{className:"dsham_previewToolbar"},o("span",{title:C("discovery.previewHint")},C("discovery.readOnly")," \xB7 ",C("discovery.messageCount",{n:B.messages.length})),M&&o(s.SegmentedControl??"div",{id:"dsham-preview-mode",label:C("discovery.displayMode"),value:N?"raw":"formatted",options:[{value:"formatted",label:C("discovery.formatted")},{value:"raw",label:C("discovery.raw")}],onChange:e(q=>H(q==="raw"),"onChange")})),B.hasEarlier&&o("p",null,C("discovery.earlier")),!B.messages.length&&o("p",null,C("discovery.empty")),B.messages.map(q=>o("article",{key:q.seq,className:"dsham_previewMessage"},o("div",{className:"dsham_previewRole","data-role":q.role},o("span",{"aria-hidden":!0},C(q.role==="user"?"discovery.you":"discovery.ai")),o("strong",null,C("discovery."+q.role))),N||!M?o("pre",{className:"dsham_previewRaw"},o(b,{text:q.text,query:v.target?.query})):o(M,{text:q.text,streaming:!1,labels:{code:{copyLabel:C("discovery.copyCode"),copiedLabel:C("details.copied")},footnotes:C("discovery.footnotes")}}),q.truncated&&o("small",null,C("discovery.truncated")))),B.hasLater&&o("p",null,C("discovery.later"))):null}return e(x,"PreviewContent"),{HighlightedText:b,useArchiveSearch:a,useArchivePreview:l,DiscoveryFilters:y,SearchStatus:D,PreviewContent:x}}e(Rs,"createDiscoveryTools");var Ns=[".dsham_dateFilter{display:flex;align-items:center;gap:8px;min-width:0;position:relative}",".dsham_dateAlert{position:absolute;top:calc(100% + 4px);right:0;margin:0;width:max-content;max-width:240px;padding:4px 8px;background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-state-error-primary);border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.25);z-index:1100;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary);pointer-events:none}",".dsham_dateRange{position:relative;display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;box-sizing:border-box}",".dsham_dateTrigger{display:inline-flex;align-items:center;gap:6px;width:100%;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;cursor:pointer;box-sizing:border-box;transition:all .15s ease}",".dsham_dateTrigger:hover{border-color:var(--dsw-alias-border-l3)}",".dsham_dateTrigger.is-open{border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 1px var(--dsw-alias-state-business-primary)}",".dsham_dateIcon{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;color:var(--dsw-alias-label-primary)}",".dsham_dateText.placeholder{color:var(--dsw-alias-label-primary)}",".dsham_dateClearBtn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);border-radius:50%;cursor:pointer;font-size:13px;line-height:1}",".dsham_dateClearBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".dsham_dateChevron{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateInputSrOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}",".dsham_datePopover{position:absolute;top:calc(100% + 4px);right:0;left:auto;z-index:1000;display:flex;gap:10px;padding:10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md,10px);background:var(--dsw-alias-bg-layer-1);box-shadow:0 8px 24px rgba(0,0,0,0.12),0 2px 6px rgba(0,0,0,0.06);box-sizing:border-box}",".dsham_datePresets{width:84px;border-right:0.5px solid var(--dsw-alias-border-l2);padding-right:8px;display:flex;flex-direction:column;gap:3px;flex:none}",".dsham_datePresetBtn{border:0;background:transparent;padding:5px 6px;text-align:left;font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm,6px);cursor:pointer;transition:all .15s ease;white-space:nowrap}",".dsham_datePresetBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateCalendar{width:224px;display:flex;flex-direction:column;gap:6px;flex:none}",".dsham_dateCalHeader{display:flex;justify-content:space-between;align-items:center;padding:0 2px}",".dsham_dateMonthTitle{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}",".dsham_dateNavBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:4px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:14px;line-height:1}",".dsham_dateNavBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateGrid{display:grid;grid-template-columns:repeat(7,1fr);row-gap:2px}",".dsham_dateWeekday{font-size:11px;color:var(--dsw-alias-label-tertiary);text-align:center;padding:3px 0;font-weight:500}",".dsham_dateDay{position:relative;height:26px;display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:0}",".dsham_dateDay.is-outside{color:var(--dsw-alias-label-quaternary)}",".dsham_dateDay:not(.is-outside):hover{background:var(--dsw-alias-interactive-bg-hover);border-radius:4px}",".dsham_dateDay.is-start{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-left-radius:6px;border-bottom-left-radius:6px}",".dsham_dateDay.is-end{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-right-radius:6px;border-bottom-right-radius:6px}",".dsham_dateDay.is-start.is-end{border-radius:6px!important}",".dsham_dateDay.is-in-range{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-today::after{content:'';position:absolute;bottom:2px;width:3px;height:3px;border-radius:50%;background:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-start.is-today::after,.dsham_dateDay.is-end.is-today::after{background:#fff}",".dsham_discoveryStatus{font-size:12px;margin-bottom:12px;overflow-wrap:anywhere}",".dsham_settingsSnippet{display:block;width:100%;padding:0;margin:4px 0 0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}",".dsham_previewMessages{max-height:65vh;overflow:auto;overflow-wrap:anywhere;padding-right:8px}",".dsham_previewToolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_previewRole{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-size:13px}",".dsham_previewRole>span{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--dsw-alias-bg-layer-3);font-size:11px}",".dsham_previewRole[data-role=user]>span{color:var(--dsw-alias-state-business-primary)}",".dsham_previewRaw{white-space:pre-wrap;font:13px/1.8 ui-monospace,monospace;overflow-wrap:anywhere}",".dsham_previewMessage pre:not(.dsham_previewRaw){white-space:pre;overflow-x:auto;max-width:100%}",".dsham_previewMessage table{display:block;max-width:100%;overflow-x:auto}",".dsham_previewMessage img{max-width:100%}","@media(max-width:520px){.dsham_previewToolbar{align-items:flex-start;flex-wrap:wrap}}",".dsham_previewMessage{padding:18px 0;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_previewMessage p{font-size:14px;line-height:1.8}",".dsham_previewHint,.dsham_previewMessage small{color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_settings mark,.dsham_previewMessages mark{background:var(--dsw-alias-state-warn-tertiary);color:inherit;border-radius:2px}",".dsham_settingsSnippet:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}"].join(""),js={"common.separator":"\uFF1A","copy.empty":"\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9","copy.unavailable":"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762","copy.denied":"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5","discovery.you":"\u4F60","discovery.ai":"AI","discovery.readOnly":"\u53EA\u8BFB\u9884\u89C8","discovery.messageCount":"\u672C\u6B21\u663E\u793A {n} \u6761\u6D88\u606F","discovery.displayMode":"\u663E\u793A\u65B9\u5F0F","discovery.formatted":"\u6392\u7248","discovery.raw":"\u539F\u6587\u4E0E\u9AD8\u4EAE","discovery.copyCode":"\u590D\u5236\u4EE3\u7801","discovery.footnotes":"\u6CE8\u91CA","details.copyId":"\u590D\u5236\u4F1A\u8BDD ID","details.copied":"\u5DF2\u590D\u5236","discovery.date":"\u65E5\u671F","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","discovery.allTime":"\u5168\u90E8\u65F6\u95F4","discovery.today":"\u4ECA\u5929","discovery.last7Days":"\u8FD1 7 \u5929","discovery.last30Days":"\u8FD1 30 \u5929","discovery.last90Days":"\u8FD1 90 \u5929","discovery.customRange":"\u81EA\u5B9A\u4E49\u2026","discovery.dateActive":"\u65E5\u671F\xB7\u5DF2\u9009","discovery.clearDate":"\u6E05\u9664\u65E5\u671F","discovery.active":"\u5DF2\u542F\u7528","discovery.scope":"\u67E5\u627E\u8303\u56F4","discovery.titleOnly":"\u4EC5\u6807\u9898","discovery.titleAndContent":"\u6807\u9898\u4E0E\u6B63\u6587","discovery.from":"\u66F4\u65B0\u65F6\u95F4\u4ECE","discovery.to":"\u81F3","discovery.clear":"\u6E05\u9664\u6761\u4EF6","discovery.invalidDate":"\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u665A\u4E8E\u7ED3\u675F\u65E5\u671F\uFF0C\u8BF7\u68C0\u67E5\u65E5\u671F\u8303\u56F4\u3002","discovery.searching":"\u6B63\u5728\u68C0\u7D22\u6B63\u6587\uFF1A{done} / {total}","discovery.searched":"\u6B63\u6587\u68C0\u7D22\u5B8C\u6210\uFF1A{done} / {total}","discovery.searchError":"\u6B63\u6587\u68C0\u7D22\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\u3002","discovery.failed":"{n} \u6761\u4F1A\u8BDD\u8BFB\u53D6\u5931\u8D25","discovery.retry":"\u91CD\u8BD5","discovery.preview":"\u5FEB\u901F\u9884\u89C8","discovery.loading":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u2026","discovery.previewHint":"\u53EA\u8BFB\u9884\u89C8\u539F\u59CB\u5BF9\u8BDD\u6587\u672C\uFF0C\u4E0D\u6062\u590D\u4F1A\u8BDD\uFF1B\u4E0D\u542B\u5DE5\u5177\u8F93\u51FA\u3001\u9644\u4EF6\u3001\u63A8\u7406\u548C\u7CFB\u7EDF\u5185\u5BB9\u3002","discovery.earlier":"\u524D\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.later":"\u540E\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.empty":"\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u7528\u6237\u6216\u52A9\u624B\u6587\u672C\u3002","discovery.truncated":"\u672C\u6761\u4EC5\u663E\u793A\u90E8\u5206\u5185\u5BB9\u3002","discovery.user":"\u7528\u6237","discovery.assistant":"\u52A9\u624B","discovery.openFull":"\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD","discovery.searchPlaceholder":"\u641C\u7D22\u6807\u9898\u6216\u6B63\u6587"},Ds={"common.separator":": ","copy.empty":"Nothing to copy","copy.unavailable":"Clipboard unavailable. Open the page over HTTPS or localhost.","copy.denied":"Copy failed. Allow clipboard access and retry.","discovery.you":"You","discovery.ai":"AI","discovery.readOnly":"Read-only preview","discovery.messageCount":"Showing {n} messages","discovery.displayMode":"Display mode","discovery.formatted":"Formatted","discovery.raw":"Source and highlights","discovery.copyCode":"Copy code","discovery.footnotes":"Footnotes","details.copyId":"Copy session ID","details.copied":"Copied","discovery.date":"Date","discovery.timeRange":"Time range","discovery.allTime":"All time","discovery.today":"Today","discovery.last7Days":"Past 7 days","discovery.last30Days":"Past 30 days","discovery.last90Days":"Past 90 days","discovery.customRange":"Custom\u2026","discovery.dateActive":"Date \xB7 Set","discovery.clearDate":"Clear dates","discovery.active":"Active","discovery.scope":"Search in","discovery.titleOnly":"Titles","discovery.titleAndContent":"Titles and content","discovery.from":"Updated from","discovery.to":"To","discovery.clear":"Clear filters","discovery.invalidDate":"Check the date range: the start must not be after the end.","discovery.searching":"Searching content: {done} / {total}","discovery.searched":"Content search complete: {done} / {total}","discovery.searchError":"Content search is incomplete; results may be missing.","discovery.failed":"Could not read {n} conversations","discovery.retry":"Retry","discovery.preview":"Quick preview","discovery.loading":"Reading conversation\u2026","discovery.previewHint":"Read-only original conversation text; keeps the conversation archived. Excludes tools, attachments, reasoning and system content.","discovery.earlier":"More messages before this preview. Open the full conversation to read them.","discovery.later":"More messages after this preview. Open the full conversation to read them.","discovery.empty":"No user or assistant text to preview.","discovery.truncated":"Only part of this message is shown.","discovery.user":"User","discovery.assistant":"Assistant","discovery.openFull":"Open full conversation","discovery.searchPlaceholder":"Search titles or content"},Ms={"common.separator":": ","copy.empty":"\u041D\u0435\u0447\u0435\u0433\u043E \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","copy.unavailable":"\u0411\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u043E HTTPS \u0438\u043B\u0438 localhost.","copy.denied":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","discovery.you":"\u0412\u044B","discovery.ai":"\u0418\u0418","discovery.readOnly":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","discovery.messageCount":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439: {n}","discovery.displayMode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","discovery.formatted":"\u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.raw":"\u0418\u0441\u0445\u043E\u0434\u043D\u0438\u043A \u0438 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430","discovery.copyCode":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u0434","discovery.footnotes":"\u0421\u043D\u043E\u0441\u043A\u0438","details.copyId":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID \u0441\u0435\u0441\u0441\u0438\u0438","details.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.date":"\u0414\u0430\u0442\u0430","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","discovery.allTime":"\u0412\u0441\u0435 \u0432\u0440\u0435\u043C\u044F","discovery.today":"\u0421\u0435\u0433\u043E\u0434\u043D\u044F","discovery.last7Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 7 \u0434\u043D\u0435\u0439","discovery.last30Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 30 \u0434\u043D\u0435\u0439","discovery.last90Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 90 \u0434\u043D\u0435\u0439","discovery.customRange":"\u0421\u0432\u043E\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u2026","discovery.dateActive":"\u0414\u0430\u0442\u0430 \xB7 \u0412\u044B\u0431\u0440\u0430\u043D\u0430","discovery.clearDate":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u0430\u0442\u044B","discovery.active":"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E","discovery.scope":"\u0418\u0441\u043A\u0430\u0442\u044C \u0432","discovery.titleOnly":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F","discovery.titleAndContent":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F \u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435","discovery.from":"\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0441","discovery.to":"\u041F\u043E","discovery.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B","discovery.invalidDate":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u0430\u0442: \u043D\u0430\u0447\u0430\u043B\u043E \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u0437\u0436\u0435 \u043A\u043E\u043D\u0446\u0430.","discovery.searching":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443: {done} / {total}","discovery.searched":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D: {done} / {total}","discovery.searchError":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u0439; \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C\u0438.","discovery.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C {n} \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432","discovery.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C","discovery.preview":"\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440","discovery.loading":"\u0427\u0442\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430\u2026","discovery.previewHint":"\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u0435\u043D\u0438\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430; \u0441\u0435\u0441\u0441\u0438\u044F \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0411\u0435\u0437 \u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0439, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0433\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043E.","discovery.earlier":"\u041F\u0435\u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u043E\u043C \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.later":"\u041F\u043E\u0441\u043B\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.empty":"\u041D\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430.","discovery.truncated":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0430\u0441\u0442\u044C \u044D\u0442\u043E\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","discovery.user":"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C","discovery.assistant":"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442","discovery.openFull":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440","discovery.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C \u0438\u043B\u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443"};var zs=e(t=>{let s=ne(t);if(!s||typeof s.sessionId!="string"||!s.sessionId.length||s.sessionId.length>1024||typeof s.identity!="string"||!s.identity.length||s.identity.length>4096)throw new TypeError("invalid cache rebuild candidate");return{sessionId:s.sessionId,identity:s.identity}},"candidate"),hi={parse(t){let s=ne(t);if(!s||!Array.isArray(s.items)||!s.items.length||s.items.length>20)throw new TypeError("invalid cache rebuild batch (1\u201320 items required)");return{items:s.items.map(zs)}}},vr={parse(t){let s=ne(t);if(!s||!Array.isArray(s.items)||s.count!==s.items.length)throw new TypeError("invalid cache diagnosis");return{count:s.items.length,items:s.items.map(zs)}}},br={parse(t){let s=ne(t);for(let o of["rebuiltSessionIds","skippedSessionIds"])if(!Array.isArray(s?.[o])||s[o].some(b=>typeof b!="string"))throw new TypeError("invalid cache rebuild result");if(!Array.isArray(s.failures)||s.failures.some(o=>!o||typeof o.sessionId!="string"||typeof o.message!="string"))throw new TypeError("invalid cache rebuild failures");return s}};function Os(){let t=e((s,o)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${s}`,create:e(()=>o,"create"),schema:o}),"codec");return[{method:"diagnoseSessionCaches",parameters:[],result:t("CacheDiagnosis",vr)},{method:"rebuildSessionCaches",parameters:[{name:"input",wire:"input",source:"json",codec:t("CacheRebuildInput",hi)}],result:t("CacheRebuildResult",br)}].map(({method:s,...o})=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${s}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:s,invocation:{kind:"direct"},...o,sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Os,"cacheRebuildInvocations");function Ps(t,s={}){let{maxLoadRetries:o=3,retryDelayMs:b=200}=s,a={diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null},l=!0,p=0,g=[],y,D=new Set,x=e(C=>{if(l){a={...a,...C};for(let M of D)M()}},"update"),v=e(async(C=o)=>{if(!l)return;y!==void 0&&(clearTimeout(y),y=void 0);let M=++p;try{let N=vr.parse(await t.diagnose());l&&M===p&&x({diagnosis:N,error:null})}catch(N){if(C>0&&l&&M===p){y=setTimeout(()=>{y=void 0,l&&M===p&&v(C-1)},b);return}l&&M===p&&x({error:qe(N)})}},"load");return{snapshot:e(()=>a,"snapshot"),subscribe(C){return D.add(C),()=>{D.delete(C)}},load:v,async run(C=!1){if(!l||a.busy)return;++p,y!==void 0&&(clearTimeout(y),y=void 0);let M=C?[...g]:[...a.diagnosis.items],N={rebuiltSessionIds:[],skippedSessionIds:[],failures:[]};g=[],x({busy:!0,result:null,error:null,refreshError:null,progress:{done:0,total:M.length}});for(let[H,B]of M.entries()){if(!l)return;try{let q=br.parse(await t.rebuild({items:[B]}));if(!l)return;N.rebuiltSessionIds.push(...q.rebuiltSessionIds),N.skippedSessionIds.push(...q.skippedSessionIds),N.failures.push(...q.failures),q.failures.length&&g.push(B)}catch(q){if(!l)return;N.failures.push({sessionId:B.sessionId,message:qe(q)}),g.push(B)}x({progress:{done:H+1,total:M.length}})}x({result:N});try{await t.refresh()}catch(H){x({refreshError:qe(H)})}l&&(await v(),x({busy:!1,progress:null}))},dismiss(){l&&x({result:null,error:null,refreshError:null})},dispose(){l=!1,++p,y!==void 0&&(clearTimeout(y),y=void 0),D.clear()}}}e(Ps,"createCacheRebuildController");var $t=class extends Error{static{e(this,"ArchiveNavigationError")}code;constructor(s){super(s),this.name="ArchiveNavigationError",this.code=s}};function Ls(t,s){return t instanceof $t?s(`archives.${t.code}`):qe(t)}e(Ls,"formatArchiveNavigationError");function pi(t,s){if(typeof t?.retainInfo!="function")return;let o=t.retainInfo(s),b=o&&typeof o=="object"&&"getSnapshot"in o&&typeof o.getSnapshot=="function"?o.getSnapshot():o;if(!b||typeof b!="object"||!("retainedBy"in b))return;let a=b.retainedBy;if(!(!a||typeof a!="object"||!("mainView"in a)||typeof a.mainView!="number"))return{retainedBy:{mainView:a.mainView}}}e(pi,"retainInfoSnapshot");function mi(t){let s=t?.byId;if(s!==void 0){for(let o of Object.values(s))if(o&&(o.retainedBy?.mainView??0)>0)return o.id}}e(mi,"mainViewSessionId");function Dt(t){return mi(t)}e(Dt,"currentSessionId");function fi(t,s,o){return s===void 0||s===""?!1:(t?.byId?.[s]?.retainedBy?.mainView??0)>0||(pi(o,s)?.retainedBy?.mainView??0)>0}e(fi,"sessionIsCurrent");async function Fs(t,s,o,b=()=>!0){if(o){if(typeof t.prepare=="function"&&await t.prepare(s),!b())return;await t.restore(s)}b()&&await t.open(s)}e(Fs,"openArchivedConversation");function Bs(t,s,o,{onOpened:b=e(()=>{},"onOpened"),beginNavigation:a,warn:l=e((...p)=>console.warn(...p),"warn")}={}){let p,g=t?.clearArchivedCurrent,y=t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent"),D=e(C=>fi(s.list.getSnapshot(),C,s),"viewing"),x=e(function(...C){return p!==void 0&&D(p)&&o.list.getSnapshot().archivedSessionIds.includes(p)?!1:(p=void 0,g?.apply(this,C))},"wrapped"),v=e(()=>t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value===x,"ownsWrapper");if(t&&typeof g=="function")try{if(t.clearArchivedCurrent=x,!v())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(C){l("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",C)}return{open(C){p=C;try{if(typeof g=="function"&&!v()&&o.list.getSnapshot().archivedSessionIds.includes(C))throw l("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new $t("navigationUnavailable");if(a?.(),typeof t?.openSession!="function")throw l("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new $t("navigationUnavailable");if(t.openSession(C),!D(C))throw l("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof g=="function"}),new $t("sessionNotRetained");b()}catch(M){throw p=void 0,M}},dispose(){p=void 0,!(!t||Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value!==x)&&(y?Object.defineProperty(t,"clearArchivedCurrent",y):delete t.clearArchivedCurrent,g?.call(t))}}}e(Bs,"allowArchivedNavigation");var Xt=require("@deepseek-ai/dsh-client-ui-primitives");var Us={check:"\u68C0\u67E5\u66F4\u65B0",update:"\u66F4\u65B0",recheck:"\u91CD\u65B0\u68C0\u67E5",auto:"\u81EA\u52A8\u66F4\u65B0",updating:"\u6B63\u5728\u66F4\u65B0\u2026",copy:"\u590D\u5236\u547D\u4EE4",copied:"\u5DF2\u590D\u5236",copyFailed:"\u590D\u5236\u5931\u8D25",checking:"\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026",latest:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",found:"\u53D1\u73B0\u65B0\u7248\u672C",failed:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",current:"\u8FD0\u884C\u7248\u672C",latestLabel:"\u6700\u65B0\u7248\u672C",profile:"\u76EE\u6807 profile",unknown:"\u672A\u77E5",manual:"\u624B\u5DE5\u66F4\u65B0",manualHint:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u53EF\u5728\u5F53\u524D DSH \u7EC8\u7AEF\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u5B8C\u6210\u540E\u91CD\u542F DSH Web\u3002",manualHintDesktop:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u8BF7\u5148\u5B8C\u5168\u9000\u51FA DSH Desktop\uFF0C\u518D\u7528 Desktop \u81EA\u5E26\u7684 dsh \u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u3002\u666E\u901A dsh \u4F1A\u62D2\u7EDD desktop profile\u3002",intro:"\u4EC5\u68C0\u67E5\u5E76\u66F4\u65B0\u5F53\u524D\u63D2\u4EF6\uFF0C\u4E0D\u4F1A\u8054\u52A8\u5B89\u88C5\u5176\u4ED6\u63D2\u4EF6\u3002",restart:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u91CD\u542F DSH Web\u3002",restartDesktop:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 DSH Desktop\u3002",restarting:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u542F DSH Desktop\u2026",unavailable:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u4F7F\u7528\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4\u3002"},Hs={check:"Check for updates",update:"Update",recheck:"Check again",auto:"Update automatically",updating:"Updating\u2026",copy:"Copy command",copied:"Copied",copyFailed:"Copy failed",checking:"Checking for updates\u2026",latest:"You are up to date",found:"New version available",failed:"Could not check for updates. Try again later.",current:"Running version",latestLabel:"Latest version",profile:"Target profile",unknown:"Unknown",manual:"Manual update",manualHint:"If automatic update fails, run this command in the current DSH terminal, then restart DSH Web.",manualHintDesktop:"If automatic update fails, fully quit DSH Desktop, then run this command with Desktop's own dsh. A regular dsh rejects the desktop profile.",intro:"Only this plugin is checked and updated. Other plugins are not changed.",restart:"Update complete. Restart DSH Web.",restartDesktop:"Update complete. Fully quit and reopen DSH Desktop.",restarting:"Update complete. Restarting DSH Desktop\u2026",unavailable:"Automatic update is unavailable. Use the manual command."};function In(t){return t.toLowerCase().startsWith("zh")?Us:Hs}e(In,"pluginUpdateCopy");function gi(t,s,o,b){let a=In(t),l=s?.restartDesktop===!0||s?.profileName==="desktop",p=l?{...a,manualHint:a.manualHintDesktop}:a,g=o!=="idle",y=p.checking,D="";return o==="checking"?y=p.checking:o==="updating"?y=p.updating:b.type==="error"?(y=b.message||p.failed,D="error"):b.type==="restart"?(y=l?p.restartDesktop:p.restart,D="success"):b.type==="restarting"?(y=p.restarting,D="success"):s===void 0?y=p.checking:s.latestCheckFailed?(y=p.failed,D="error"):!s.canAutoUpdate&&s.updateAvailable?(y=p.unavailable,D="update"):s.updateAvailable?(y=`${p.found}: v${s.latestVersion??p.unknown}`,D="update"):(y=p.latest,D="success"),{copy:p,busy:g,message:y,kind:D,loading:o==="updating",updateLabel:o==="updating"?p.updating:p.auto,disabled:g||s?.canAutoUpdate!==!0||s.updateAvailable!==!0,currentVersion:s===void 0?p.unknown:`v${s.currentVersion}`,latestVersion:s?.latestVersion===void 0?p.unknown:`v${s.latestVersion}`,profileName:s?.profileName??p.unknown,profileRaw:s?.profileName??"",latestRaw:s?.latestVersion??"latest"}}e(gi,"describePluginUpdate");function Ws(t,s,o){let b="idle",a=s,l={type:"status"},p=0,g=new Set,y=e(()=>{for(let x of g)x()},"emit"),D=e(x=>{a=x,o?.(x)},"assign");return{get posts(){return p},subscribe(x){return g.add(x),()=>{g.delete(x)}},view(x){return gi(x,a,b,l)},async check(){if(b==="idle"){b="checking",l={type:"status"},y();try{D(await t("GET")),l={type:"status"}}catch(x){l={type:"error",message:x instanceof Error?x.message:""}}finally{b="idle",y()}}},async update(){if(b==="idle"){b="updating",l={type:"status"},p+=1,y();try{let x=await t("POST");D(x),l={type:x.autoReload===!0?"restarting":"restart"}}catch(x){l={type:"error",message:x instanceof Error?x.message:""}}finally{b="idle",y()}}}}}e(Ws,"createUpdateFlow");function qs(t,s,o){return`dsh plugin${t.trim()===""?"":` --profile ${t.trim()}`} add ${s}@${o} --registry=https://registry.npmjs.org/`}e(qs,"manualPluginUpdateCommand");function Vs(t,s){return t.key!=="Escape"?!1:(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),s(),!0)}e(Vs,"handlePluginUpdateEscape");function vi(){let t=globalThis.document;if(typeof t>"u"||t===null)return;let s=t.baseURI;if(!(typeof s!="string"||s===""))try{let o=new URL(s),b=o.pathname.lastIndexOf("/"),a=o.pathname.slice(b+1);return/\.(html?|php|aspx?|jsp)$/i.test(a)?o.pathname=o.pathname.slice(0,b+1):o.pathname.endsWith("/")||(o.pathname+="/"),o.href}catch{return}}e(vi,"pageBaseHref");function Tn(t){if(typeof t!="string"||t.charAt(0)!=="/"||t.charAt(1)==="/")return t;let s=vi();if(s===void 0)return t;try{return new URL(t.slice(1),s).href}catch{return t}}e(Tn,"resolveApiUrl");function Gs(t){let o=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(o===void 0)throw new Error("createRoot unavailable");return o(t)}e(Gs,"mountRoot");var bi="x-michengai-plugin-update",$s="michengai-plugin-update-ui",yr=`
10
+ "use strict";var Pn=Object.defineProperty;var zs=Object.getOwnPropertyDescriptor;var Ms=Object.getOwnPropertyNames;var Ps=Object.prototype.hasOwnProperty;var e=(t,r)=>Pn(t,"name",{value:r,configurable:!0});var Os=(t,r)=>{for(var i in r)Pn(t,i,{get:r[i],enumerable:!0})},Ls=(t,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Ms(r))!Ps.call(t,o)&&o!==i&&Pn(t,o,{get:()=>r[o],enumerable:!(a=zs(r,o))||a.enumerable});return t};var Fs=t=>Ls(Pn({},"__esModule",{value:!0}),t);var pi={};Os(pi,{startArchiveClient:()=>hi});module.exports=Fs(pi);function te(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return t}e(te,"record");function Ue(t){return String(t&&typeof t=="object"&&"message"in t?t.message??t:t)}e(Ue,"errorMessage");function On(t){return t&&typeof t=="object"&&"code"in t?t.code:void 0}e(On,"errorCode");var ea=Function("return globalThis.__dshArchiveReact")(),{Children:vi,Component:bi,Fragment:ta,Profiler:yi,PureComponent:wi,StrictMode:Si,Suspense:xi,cloneElement:ki,createContext:Ci,createElement:na,createRef:Ei,forwardRef:Ti,isValidElement:Ii,lazy:Ai,memo:_i,startTransition:Ri,useCallback:ji,useContext:Ni,useDebugValue:Di,useDeferredValue:zi,useEffect:ra,useId:Mi,useImperativeHandle:Pi,useInsertionEffect:Oi,useLayoutEffect:Li,useMemo:Fi,useReducer:Bi,useRef:Hi,useState:Wt,useSyncExternalStore:Ui,useTransition:Wi,version:qi}=ea,B=ea;function sa(t){return B.createElement("input",{className:"dsham_number",type:"number",min:t.min,max:t.max,value:t.value??"",disabled:t.disabled,"aria-label":t["aria-label"],onChange:e(r=>{let i=r.target.value;if(i===""){t.onChange(null);return}let a=Number(i);t.onChange(Number.isNaN(a)?null:a)},"onChange")})}e(sa,"NumberField");function Hs(t=B.createElement){return t("svg",{className:"dsham_dateIcon",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},t("rect",{x:2,y:3,width:12,height:11,rx:2}),t("line",{x1:2,y1:6.5,x2:14,y2:6.5}),t("line",{x1:5.5,y1:1.5,x2:5.5,y2:3.5}),t("line",{x1:10.5,y1:1.5,x2:10.5,y2:3.5}))}e(Hs,"CalendarIcon");function Sn(t,r,i){let a=String(r+1).padStart(2,"0"),o=String(i).padStart(2,"0");return`${t}-${a}-${o}`}e(Sn,"formatYmd");function an(t){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return r?{year:Number(r[1]),monthIndex:Number(r[2])-1,day:Number(r[3])}:null}e(an,"parseYmd");function Us(t,r){let i=new Date(t,r,1).getDay(),a=(i===0?7:i)-1,o=new Date(t,r+1,0).getDate(),g=new Date(t,r,0).getDate(),d=[];for(let k=0;k<42;k++){let b=t,I=r,S=0,f=!1;k<a?(S=g-a+k+1,I=r-1,I<0&&(I=11,b--),f=!0):k<a+o?S=k-a+1:(S=k-a-o+1,I=r+1,I>11&&(I=0,b++),f=!0),d.push({year:b,monthIndex:I,day:S,dateStr:Sn(b,I,S),isOutside:f})}return d}e(Us,"buildMonthGrid");function Ws(t,r=new Date){if(t==="all")return{from:"",to:""};let i=Sn(r.getFullYear(),r.getMonth(),r.getDate());if(t==="today")return{from:i,to:i};let a=t==="7d"?6:t==="30d"?29:89,o=new Date(r.getTime()-a*864e5);return{from:Sn(o.getFullYear(),o.getMonth(),o.getDate()),to:i}}e(Ws,"getPresetRange");function aa(t,r,i,a){let o=r+a,g=new Date(t,o+1,0).getDate();return new Date(t,o,Math.min(i,g))}e(aa,"shiftMonthClamped");function ia(t){let r=t.React||B;function i(A,se){let Ge=A==="from"?se:t.from,Vt=A==="to"?se:t.to;if(Ge===""&&Vt===""){t.onClear();return}A==="from"?t.onFrom(se):t.onTo(se)}e(i,"change");let a=!!(t.from||t.to),o="";t.from&&t.to?o=`${t.from} \u2013 ${t.to}`:t.from?o=`${t.from} \u2013`:t.to?o=`\u2013 ${t.to}`:o=t.t?t.t("discovery.timeRange")||`${t.fromLabel} \u2013 ${t.toLabel}`:`${t.fromLabel} \u2013 ${t.toLabel}`;let d=(r.useRef??(A=>{let[se]=r.useState({current:A});return se}))(null),[k,b]=r.useState(!1),I=an(t.from||t.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[S,f]=r.useState(I.year),[w,N]=r.useState(I.monthIndex),[_,H]=r.useState(null),[L,W]=r.useState(null),[le,ne]=r.useState(null);r.useEffect(()=>{if(!k)return;let A=e(Ge=>{d.current&&!d.current.contains(Ge.target)&&(b(!1),H(null))},"onPointerDown"),se=e(Ge=>{Ge.key==="Escape"&&(Ge.preventDefault(),Ge.stopPropagation(),b(!1),H(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",A,!0),typeof window<"u"&&window.addEventListener("keydown",se,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",A,!0),typeof window<"u"&&window.removeEventListener("keydown",se,!0)}},[k]),r.useEffect(()=>{if(!k||!le||!d.current)return;d.current.querySelector(`[data-date="${le}"]`)?.focus()},[k,le]);let re=t.t?t.t("discovery.today")==="Today"||(t.t("locale.language")||"").startsWith("en"):!1,ae=t.t?t.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(t.t("locale.language")||"").startsWith("ru"):!1,de=re?"en-US":ae?"ru-RU":"zh-CN",Oe=re?["Mo","Tu","We","Th","Fr","Sa","Su"]:ae?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function ue(A){A.stopPropagation(),w<=0?(N(11),f(se=>se-1)):N(se=>se-1)}e(ue,"prevMonth");function V(A){A.stopPropagation(),w>=11?(N(0),f(se=>se+1)):N(se=>se+1)}e(V,"nextMonth");function pt(A){_?(A>=_?(t.onFrom(_),t.onTo(A)):(t.onFrom(A),t.onTo(_)),H(null),b(!1)):(H(A),W(A))}e(pt,"handleDayClick");function mt(A){let se=Ws(A);A==="all"?t.onClear():(t.onFrom(se.from),t.onTo(se.to)),H(null),b(!1)}e(mt,"applyPreset");function St(A){let se=Sn(A.getFullYear(),A.getMonth(),A.getDate());ne(se),_&&W(se),(A.getFullYear()!==S||A.getMonth()!==w)&&(f(A.getFullYear()),N(A.getMonth()))}e(St,"moveFocusToDate");function Me(A,se){let Ge=an(A);Ge&&St(new Date(Ge.year,Ge.monthIndex,Ge.day+se))}e(Me,"moveFocus");let ft=t.from,et=t.to;_&&L&&(ft=_<=L?_:L,et=_<=L?L:_);let O=Us(S,w),Ce=new Date,Dt=le||ft||Sn(Ce.getFullYear(),Ce.getMonth(),Ce.getDate()),gr=O.map((A,se)=>{let Ge=ft===A.dateStr,Vt=et===A.dateStr,ln=!!(ft&&et&&A.dateStr>ft&&A.dateStr<et),Tn=A.year===Ce.getFullYear()&&A.monthIndex===Ce.getMonth()&&A.day===Ce.getDate(),dt="dsham_dateDay";A.isOutside&&(dt+=" is-outside"),Tn&&(dt+=" is-today"),Ge&&(dt+=" is-start"),Vt&&(dt+=" is-end"),ln&&(dt+=" is-in-range");let Zt=!A.isOutside&&(A.dateStr===Dt||A.day===1&&!O.some(Q=>!Q.isOutside&&Q.dateStr===Dt));return r.createElement("div",{key:se,className:dt,role:"button",tabIndex:Zt?0:-1,"data-date":A.dateStr,"aria-label":A.dateStr,"aria-pressed":!!(Ge||Vt||ln),onClick:e(Q=>{Q.stopPropagation(),pt(A.dateStr)},"onClick"),onKeyDown:e(Q=>{if(Q.key==="Enter"||Q.key===" ")Q.preventDefault(),Q.stopPropagation(),pt(A.dateStr);else if(Q.key==="ArrowLeft")Q.preventDefault(),Q.stopPropagation(),Me(A.dateStr,-1);else if(Q.key==="ArrowRight")Q.preventDefault(),Q.stopPropagation(),Me(A.dateStr,1);else if(Q.key==="ArrowUp")Q.preventDefault(),Q.stopPropagation(),Me(A.dateStr,-7);else if(Q.key==="ArrowDown")Q.preventDefault(),Q.stopPropagation(),Me(A.dateStr,7);else if(Q.key==="Home"){Q.preventDefault(),Q.stopPropagation();let Re=an(A.dateStr);if(Re){let gt=new Date(Re.year,Re.monthIndex,Re.day),In=(gt.getDay()===0?7:gt.getDay())-1;gt.setDate(gt.getDate()-In),St(gt)}}else if(Q.key==="End"){Q.preventDefault(),Q.stopPropagation();let Re=an(A.dateStr);if(Re){let gt=new Date(Re.year,Re.monthIndex,Re.day),In=(gt.getDay()===0?7:gt.getDay())-1;gt.setDate(gt.getDate()+(6-In)),St(gt)}}else if(Q.key==="PageUp"){Q.preventDefault(),Q.stopPropagation();let Re=an(A.dateStr);Re&&St(aa(Re.year,Re.monthIndex,Re.day,-1))}else if(Q.key==="PageDown"){Q.preventDefault(),Q.stopPropagation();let Re=an(A.dateStr);Re&&St(aa(Re.year,Re.monthIndex,Re.day,1))}},"onKeyDown"),onMouseEnter:e(()=>{_&&W(A.dateStr)},"onMouseEnter")},A.day)}),En=`${S}\u5E74 ${w+1}\u6708`;try{En=new Intl.DateTimeFormat(de,{year:"numeric",month:"long"}).format(new Date(S,w,1))}catch{En=re||ae?`${S}-${String(w+1).padStart(2,"0")}`:`${S}\u5E74 ${w+1}\u6708`}return r.createElement("div",{ref:d,className:"dsham_dateRange",role:"group","aria-label":t.label},r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.from,"aria-label":t.fromLabel,"aria-invalid":t.invalid||void 0,onChange:e(A=>i("from",A.target.value),"onChange")}),r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.to,"aria-label":t.toLabel,"aria-invalid":t.invalid||void 0,onChange:e(A=>i("to",A.target.value),"onChange")}),r.createElement("div",{className:"dsham_dateTrigger"+(k?" is-open":""),role:"button",tabIndex:0,"aria-expanded":k,"aria-controls":k?"dsham-date-popover":void 0,onClick:e(()=>{k&&H(null),b(!k)},"onClick"),onKeyDown:e(A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),k&&H(null),b(!k))},"onKeyDown")},Hs(r.createElement),r.createElement("span",{className:"dsham_dateText"+(a?"":" placeholder")},o),a?r.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:e(A=>{A.stopPropagation(),t.onClear(),H(null)},"onClick"),children:"\xD7"}):null,r.createElement("span",{className:"dsham_dateChevron"},oa(r.createElement,k))),k&&r.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":t.label,onClick:e(A=>A.stopPropagation(),"onClick")},r.createElement("div",{className:"dsham_datePresets"},r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>mt("all"),"onClick")},t.t?t.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>mt("today"),"onClick")},t.t?t.t("discovery.today"):"\u4ECA\u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>mt("7d"),"onClick")},t.t?t.t("discovery.last7Days"):"\u8FD1 7 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>mt("30d"),"onClick")},t.t?t.t("discovery.last30Days"):"\u8FD1 30 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>mt("90d"),"onClick")},t.t?t.t("discovery.last90Days"):"\u8FD1 90 \u5929")),r.createElement("div",{className:"dsham_dateCalendar"},r.createElement("div",{className:"dsham_dateCalHeader"},r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:ue,"aria-label":"prev month"},"\u2039"),r.createElement("span",{className:"dsham_dateMonthTitle"},En),r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:V,"aria-label":"next month"},"\u203A")),r.createElement("div",{className:"dsham_dateGrid"},Oe.map((A,se)=>r.createElement("div",{key:se,className:"dsham_dateWeekday"},A))),r.createElement("div",{className:"dsham_dateGrid"},gr))))}e(ia,"DateRange");function Ln(t){return B.createElement("div",{className:t.className},B.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":t.open,onClick:t.onToggle},oa(B.createElement,t.open),t.title),t.open?B.createElement("div",null,t.children):null)}e(Ln,"Disclosure");function oa(t,r){return t("svg",{className:"dsham_foldChevron"+(r?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},t("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}e(oa,"foldChevron");function ar(t){let r=B.useRef(null);return B.useEffect(()=>{r.current&&(r.current.indeterminate=!!t.indeterminate&&!t.checked)},[t.indeterminate,t.checked]),B.createElement("input",{ref:r,className:"dsham_checkbox",type:"checkbox",checked:t.checked,disabled:t.disabled,"aria-label":t.label,onChange:e(i=>t.onChange({target:{checked:i.target.checked}}),"onChange")})}e(ar,"SelectionCheckbox");var xn=e(t=>{if(typeof t!="string"||!t.length||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return t},"id"),da=e((t,r=!1)=>{if(typeof t!="string"||t.length>200||r&&!t.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return t.trim()},"queryText"),la={parse(t){let r=te(t);if(!r||!Array.isArray(r.sessionIds)||!r.sessionIds.length||r.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(r.sessionIds.map(xn))],query:da(r.query,!0)}}},qs={parse(t){let r=te(t);if(!r)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:xn(r.sessionId),query:da(r.query??"")}}},sr=e((t,r)=>{if(typeof t!="string"||t.length>r)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return t},"boundedString"),ca=e(t=>{if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return t},"sequence"),ir={parse(t){let r=te(t);if(!r||!Array.isArray(r.items)||!Array.isArray(r.failures)||r.items.length>20||r.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:r.items.map(te).map(i=>({sessionId:xn(i.sessionId),seq:ca(i.seq),snippet:sr(i.snippet,400)})),failures:r.failures.map(te).map(i=>({sessionId:xn(i.sessionId),message:sr(i.message,500)}))}}},Vs={parse(t){let r=te(t);if(!r||!Array.isArray(r.messages)||r.messages.length>8||typeof r.hasEarlier!="boolean"||typeof r.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:xn(r.sessionId),hasEarlier:r.hasEarlier,hasLater:r.hasLater,messages:r.messages.map(te).map(i=>{if(typeof i.role!="string"||!["user","assistant"].includes(i.role)||typeof i.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:ca(i.seq),role:i.role,text:sr(i.text,2e3),truncated:i.truncated}})}}};async function or(t,r=globalThis.navigator?.clipboard){if(typeof t!="string"||!t)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!r?.writeText)throw Object.assign(new Error("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762"),{code:"copy.unavailable"});try{await r.writeText(t)}catch{throw Object.assign(new Error("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5"),{code:"copy.denied"})}}e(or,"copySessionText");function ua(){let t=e((i,a)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${i}`,create:e(()=>a,"create"),schema:a}),"codec");return[["searchSessionContent",la,ir],["searchArchivedContent",la,ir],["previewArchivedSession",qs,Vs]].map(([i,a,o])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${i}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:i,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:t(i+"Input",a)}],result:t(i+"Result",o),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(ua,"discoveryInvocations");function ha(t,r){let i=r?.trim().toLowerCase();if(!i)return null;let a=t.toLowerCase().indexOf(i);if(a<0)return null;let o=0,g=0,d;for(let k of t){let b=g+k.toLowerCase().length;if(d===void 0&&b>a&&(d=o),o+=k.length,b>=a+i.length)return{start:d??o,end:o};g=b}return null}e(ha,"findTextRange");function Fn(t,r=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return NaN;let[i,a,o]=t.split("-").map(Number),g=new Date(i,a-1,o);return g.getFullYear()!==i||g.getMonth()!==a-1||g.getDate()!==o?NaN:(r&&g.setDate(g.getDate()+1),g.getTime())}e(Fn,"dayBoundary");function lr(t,r){return(!t||Number.isFinite(Fn(t)))&&(!r||Number.isFinite(Fn(r)))&&(!t||!r||t<=r)}e(lr,"validUpdatedRange");function pa(t,r,i){if(!lr(r,i))return!1;if(!r&&!i)return!0;let a=typeof t=="number"?t:Date.parse(t??"");return Number.isFinite(a)&&(!r||a>=Fn(r))&&(!i||a<Fn(i,!0))}e(pa,"matchesUpdatedRange");async function ma(t,r,i,{signal:a,onProgress:o}={}){let g=[],d=[],k=[...new Set(t)],b=e(()=>{if(a?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let I=0;I<k.length;I+=20){b();let S=ir.parse(await i({sessionIds:k.slice(I,I+20),query:r}));b(),g.push(...S.items),d.push(...S.failures),o?.({done:Math.min(I+20,k.length),total:k.length,items:[...g],failures:[...d]})}return b(),{items:g,failures:d}}e(ma,"searchArchiveBatches");function fa(t,r={}){let i=t.createElement;function a({text:f,query:w=""}){let N=ha(f,w);return N?i(t.Fragment,null,f.slice(0,N.start),i("mark",null,f.slice(N.start,N.end)),f.slice(N.end)):f}e(a,"HighlightedText");function o(f,w,N,_){let H=JSON.stringify(f),L=JSON.stringify([H,w]),[W,le]=t.useState(0),[ne,re]=t.useState({key:"",status:"idle",items:[],failures:[]});return t.useEffect(()=>{if(!N||!w.trim()||!_)return;let de=new AbortController;re({key:L,status:"loading",items:[],failures:[],done:0,total:f.length});let Oe=setTimeout(()=>{ma(JSON.parse(H),w,_,{signal:de.signal,onProgress:e(ue=>{de.signal.aborted||re({key:L,status:"loading",...ue})},"onProgress")}).then(ue=>{de.signal.aborted||re({key:L,status:"ready",done:f.length,total:f.length,...ue})}).catch(ue=>{de.signal.aborted||re(V=>({...V,key:L,status:"error",error:Ue(ue)}))})},350);return()=>{de.abort(),clearTimeout(Oe)}},[H,w,N,_,W]),{...N&&w.trim()&&_?ne.key===L?ne:{key:L,status:"loading",items:[],failures:[],done:0,total:f.length}:{status:"idle",items:[],failures:[]},retry:e(()=>le(de=>de+1),"retry")}}e(o,"useArchiveSearch");function g(f,w){let[N,_]=t.useState(null),[H,L]=t.useState({status:"idle"}),[W,le]=t.useState(0),ne=N,re=N&&w.includes(N.session.id);return t.useEffect(()=>{N&&!re&&_(null)},[N,re]),t.useEffect(()=>{if(!re||typeof window>"u")return;let ae=e(de=>{de.key==="Escape"&&(de.preventDefault(),de.stopPropagation(),de.stopImmediatePropagation(),_(null))},"onKeyDown");return window.addEventListener("keydown",ae,!0),()=>window.removeEventListener("keydown",ae,!0)},[re]),t.useEffect(()=>{if(!N||!re||!f)return;let ae=!0;return L({key:ne,status:"loading"}),Promise.resolve().then(()=>f({sessionId:N.session.id,query:N.query})).then(de=>{ae&&L({key:ne,status:"ready",value:de})}).catch(de=>{ae&&L({key:ne,status:"error",error:Ue(de)})}),()=>{ae=!1}},[ne,re,f,W]),{target:re?N:null,...H.key===ne?H:{status:"loading"},open:e((ae,de="")=>_({session:ae,query:de}),"open"),close:e(()=>_(null),"close"),retry:e(()=>le(ae=>ae+1),"retry")}}e(g,"useArchivePreview");function d({title:f,failures:w,separator:N}){let[_,H]=t.useState(!1),L=i("ul",null,w.map(W=>i("li",{key:W.sessionId},W.sessionId,N,W.message)));return i(Ln,{title:f,open:_,onToggle:e(()=>H(W=>!W),"onToggle")},L)}e(d,"FailureDetails");function k(f,w){let N=r.Button??(_=>i("button",{type:"button",disabled:_.disabled,onClick:_.onClick},_.children));return i(N,{variant:"outline",size:"sm",...w},f)}e(k,"textButton");function b({t:f,from:w,to:N,onFrom:_,onTo:H,invalid:L,onClear:W}){return i("div",{className:"dsham_dateFilter"},i(ia,{React:t,from:w,to:N,invalid:L,label:f("discovery.date"),fromLabel:f("discovery.from"),toLabel:f("discovery.to"),onFrom:_,onTo:H,onClear:W,t:f}),L?i("p",{className:"dsham_dateAlert",role:"alert"},f("discovery.invalidDate")):null)}e(b,"DiscoveryFilters");function I({state:f,t:w}){return f.status==="idle"?null:i("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},i("p",null,w(f.status==="loading"?"discovery.searching":f.status==="error"?"discovery.searchError":"discovery.searched",{done:f.done??0,total:f.total??0})),f.status==="error"&&i("p",null,f.error),f.failures.length>0&&i(d,{title:w("discovery.failed",{n:f.failures.length}),failures:f.failures,separator:w("common.separator")}),(f.status==="error"||f.status==="ready"&&f.failures.length>0)&&k(w("discovery.retry"),{onClick:f.retry}))}e(I,"SearchStatus");function S({preview:f,t:w,MarkdownText:N}){let[_,H]=t.useState(!1);if(f.status==="loading")return i("p",{role:"status"},w("discovery.loading"));if(f.status==="error")return i("div",null,i("p",{role:"alert"},f.error),k(w("discovery.retry"),{onClick:f.retry}));let L=f.value;return L?i("div",{className:"dsham_previewMessages"},i("div",{className:"dsham_previewToolbar"},i("span",{title:w("discovery.previewHint")},w("discovery.readOnly")," \xB7 ",w("discovery.messageCount",{n:L.messages.length})),N&&i(r.SegmentedControl??"div",{id:"dsham-preview-mode",label:w("discovery.displayMode"),value:_?"raw":"formatted",options:[{value:"formatted",label:w("discovery.formatted")},{value:"raw",label:w("discovery.raw")}],onChange:e(W=>H(W==="raw"),"onChange")})),L.hasEarlier&&i("p",null,w("discovery.earlier")),!L.messages.length&&i("p",null,w("discovery.empty")),L.messages.map(W=>i("article",{key:W.seq,className:"dsham_previewMessage"},i("div",{className:"dsham_previewRole","data-role":W.role},i("span",{"aria-hidden":!0},w(W.role==="user"?"discovery.you":"discovery.ai")),i("strong",null,w("discovery."+W.role))),_||!N?i("pre",{className:"dsham_previewRaw"},i(a,{text:W.text,query:f.target?.query})):i(N,{text:W.text,streaming:!1,labels:{code:{copyLabel:w("discovery.copyCode"),copiedLabel:w("details.copied")},footnotes:w("discovery.footnotes")}}),W.truncated&&i("small",null,w("discovery.truncated")))),L.hasLater&&i("p",null,w("discovery.later"))):null}return e(S,"PreviewContent"),{HighlightedText:a,useArchiveSearch:o,useArchivePreview:g,DiscoveryFilters:b,SearchStatus:I,PreviewContent:S}}e(fa,"createDiscoveryTools");var ga=[".dsham_dateFilter{display:flex;align-items:center;gap:8px;min-width:0;position:relative}",".dsham_dateAlert{position:absolute;top:calc(100% + 4px);right:0;margin:0;width:max-content;max-width:240px;padding:4px 8px;background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-state-error-primary);border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.25);z-index:1100;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary);pointer-events:none}",".dsham_dateRange{position:relative;display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;box-sizing:border-box}",".dsham_dateTrigger{display:inline-flex;align-items:center;gap:6px;width:100%;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;cursor:pointer;box-sizing:border-box;transition:all .15s ease}",".dsham_dateTrigger:hover{border-color:var(--dsw-alias-border-l3)}",".dsham_dateTrigger.is-open{border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 1px var(--dsw-alias-state-business-primary)}",".dsham_dateIcon{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;color:var(--dsw-alias-label-primary)}",".dsham_dateText.placeholder{color:var(--dsw-alias-label-primary)}",".dsham_dateClearBtn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);border-radius:50%;cursor:pointer;font-size:13px;line-height:1}",".dsham_dateClearBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".dsham_dateChevron{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateInputSrOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}",".dsham_datePopover{position:absolute;top:calc(100% + 4px);right:0;left:auto;z-index:1000;display:flex;gap:10px;padding:10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md,10px);background:var(--dsw-alias-bg-layer-1);box-shadow:0 8px 24px rgba(0,0,0,0.12),0 2px 6px rgba(0,0,0,0.06);box-sizing:border-box}",".dsham_datePresets{width:84px;border-right:0.5px solid var(--dsw-alias-border-l2);padding-right:8px;display:flex;flex-direction:column;gap:3px;flex:none}",".dsham_datePresetBtn{border:0;background:transparent;padding:5px 6px;text-align:left;font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm,6px);cursor:pointer;transition:all .15s ease;white-space:nowrap}",".dsham_datePresetBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateCalendar{width:224px;display:flex;flex-direction:column;gap:6px;flex:none}",".dsham_dateCalHeader{display:flex;justify-content:space-between;align-items:center;padding:0 2px}",".dsham_dateMonthTitle{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}",".dsham_dateNavBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:4px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:14px;line-height:1}",".dsham_dateNavBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateGrid{display:grid;grid-template-columns:repeat(7,1fr);row-gap:2px}",".dsham_dateWeekday{font-size:11px;color:var(--dsw-alias-label-tertiary);text-align:center;padding:3px 0;font-weight:500}",".dsham_dateDay{position:relative;height:26px;display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:0}",".dsham_dateDay.is-outside{color:var(--dsw-alias-label-quaternary)}",".dsham_dateDay:not(.is-outside):hover{background:var(--dsw-alias-interactive-bg-hover);border-radius:4px}",".dsham_dateDay.is-start{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-left-radius:6px;border-bottom-left-radius:6px}",".dsham_dateDay.is-end{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-right-radius:6px;border-bottom-right-radius:6px}",".dsham_dateDay.is-start.is-end{border-radius:6px!important}",".dsham_dateDay.is-in-range{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-today::after{content:'';position:absolute;bottom:2px;width:3px;height:3px;border-radius:50%;background:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-start.is-today::after,.dsham_dateDay.is-end.is-today::after{background:#fff}",".dsham_discoveryStatus{font-size:12px;margin-bottom:12px;overflow-wrap:anywhere}",".dsham_settingsSnippet{display:block;width:100%;padding:0;margin:4px 0 0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}",".dsham_previewMessages{max-height:65vh;overflow:auto;overflow-wrap:anywhere;padding-right:8px}",".dsham_previewToolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_previewRole{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-size:13px}",".dsham_previewRole>span{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--dsw-alias-bg-layer-3);font-size:11px}",".dsham_previewRole[data-role=user]>span{color:var(--dsw-alias-state-business-primary)}",".dsham_previewRaw{white-space:pre-wrap;font:13px/1.8 ui-monospace,monospace;overflow-wrap:anywhere}",".dsham_previewMessage pre:not(.dsham_previewRaw){white-space:pre;overflow-x:auto;max-width:100%}",".dsham_previewMessage table{display:block;max-width:100%;overflow-x:auto}",".dsham_previewMessage img{max-width:100%}","@media(max-width:520px){.dsham_previewToolbar{align-items:flex-start;flex-wrap:wrap}}",".dsham_previewMessage{padding:18px 0;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_previewMessage p{font-size:14px;line-height:1.8}",".dsham_previewHint,.dsham_previewMessage small{color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_settings mark,.dsham_previewMessages mark{background:var(--dsw-alias-state-warn-tertiary);color:inherit;border-radius:2px}",".dsham_settingsSnippet:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}"].join(""),va={"common.separator":"\uFF1A","copy.empty":"\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9","copy.unavailable":"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762","copy.denied":"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5","discovery.you":"\u4F60","discovery.ai":"AI","discovery.readOnly":"\u53EA\u8BFB\u9884\u89C8","discovery.messageCount":"\u672C\u6B21\u663E\u793A {n} \u6761\u6D88\u606F","discovery.displayMode":"\u663E\u793A\u65B9\u5F0F","discovery.formatted":"\u6392\u7248","discovery.raw":"\u539F\u6587\u4E0E\u9AD8\u4EAE","discovery.copyCode":"\u590D\u5236\u4EE3\u7801","discovery.footnotes":"\u6CE8\u91CA","details.copyId":"\u590D\u5236\u4F1A\u8BDD ID","details.copied":"\u5DF2\u590D\u5236","discovery.date":"\u65E5\u671F","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","discovery.allTime":"\u5168\u90E8\u65F6\u95F4","discovery.today":"\u4ECA\u5929","discovery.last7Days":"\u8FD1 7 \u5929","discovery.last30Days":"\u8FD1 30 \u5929","discovery.last90Days":"\u8FD1 90 \u5929","discovery.customRange":"\u81EA\u5B9A\u4E49\u2026","discovery.dateActive":"\u65E5\u671F\xB7\u5DF2\u9009","discovery.clearDate":"\u6E05\u9664\u65E5\u671F","discovery.active":"\u5DF2\u542F\u7528","discovery.scope":"\u67E5\u627E\u8303\u56F4","discovery.titleOnly":"\u4EC5\u6807\u9898","discovery.titleAndContent":"\u6807\u9898\u4E0E\u6B63\u6587","discovery.from":"\u66F4\u65B0\u65F6\u95F4\u4ECE","discovery.to":"\u81F3","discovery.clear":"\u6E05\u9664\u6761\u4EF6","discovery.invalidDate":"\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u665A\u4E8E\u7ED3\u675F\u65E5\u671F\uFF0C\u8BF7\u68C0\u67E5\u65E5\u671F\u8303\u56F4\u3002","discovery.searching":"\u6B63\u5728\u68C0\u7D22\u6B63\u6587\uFF1A{done} / {total}","discovery.searched":"\u6B63\u6587\u68C0\u7D22\u5B8C\u6210\uFF1A{done} / {total}","discovery.searchError":"\u6B63\u6587\u68C0\u7D22\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\u3002","discovery.failed":"{n} \u6761\u4F1A\u8BDD\u8BFB\u53D6\u5931\u8D25","discovery.retry":"\u91CD\u8BD5","discovery.preview":"\u5FEB\u901F\u9884\u89C8","discovery.loading":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u2026","discovery.previewHint":"\u53EA\u8BFB\u9884\u89C8\u539F\u59CB\u5BF9\u8BDD\u6587\u672C\uFF0C\u4E0D\u6062\u590D\u4F1A\u8BDD\uFF1B\u4E0D\u542B\u5DE5\u5177\u8F93\u51FA\u3001\u9644\u4EF6\u3001\u63A8\u7406\u548C\u7CFB\u7EDF\u5185\u5BB9\u3002","discovery.earlier":"\u524D\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.later":"\u540E\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.empty":"\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u7528\u6237\u6216\u52A9\u624B\u6587\u672C\u3002","discovery.truncated":"\u672C\u6761\u4EC5\u663E\u793A\u90E8\u5206\u5185\u5BB9\u3002","discovery.user":"\u7528\u6237","discovery.assistant":"\u52A9\u624B","discovery.openFull":"\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD","discovery.searchPlaceholder":"\u641C\u7D22\u6807\u9898\u6216\u6B63\u6587"},ba={"common.separator":": ","copy.empty":"Nothing to copy","copy.unavailable":"Clipboard unavailable. Open the page over HTTPS or localhost.","copy.denied":"Copy failed. Allow clipboard access and retry.","discovery.you":"You","discovery.ai":"AI","discovery.readOnly":"Read-only preview","discovery.messageCount":"Showing {n} messages","discovery.displayMode":"Display mode","discovery.formatted":"Formatted","discovery.raw":"Source and highlights","discovery.copyCode":"Copy code","discovery.footnotes":"Footnotes","details.copyId":"Copy session ID","details.copied":"Copied","discovery.date":"Date","discovery.timeRange":"Time range","discovery.allTime":"All time","discovery.today":"Today","discovery.last7Days":"Past 7 days","discovery.last30Days":"Past 30 days","discovery.last90Days":"Past 90 days","discovery.customRange":"Custom\u2026","discovery.dateActive":"Date \xB7 Set","discovery.clearDate":"Clear dates","discovery.active":"Active","discovery.scope":"Search in","discovery.titleOnly":"Titles","discovery.titleAndContent":"Titles and content","discovery.from":"Updated from","discovery.to":"To","discovery.clear":"Clear filters","discovery.invalidDate":"Check the date range: the start must not be after the end.","discovery.searching":"Searching content: {done} / {total}","discovery.searched":"Content search complete: {done} / {total}","discovery.searchError":"Content search is incomplete; results may be missing.","discovery.failed":"Could not read {n} conversations","discovery.retry":"Retry","discovery.preview":"Quick preview","discovery.loading":"Reading conversation\u2026","discovery.previewHint":"Read-only original conversation text; keeps the conversation archived. Excludes tools, attachments, reasoning and system content.","discovery.earlier":"More messages before this preview. Open the full conversation to read them.","discovery.later":"More messages after this preview. Open the full conversation to read them.","discovery.empty":"No user or assistant text to preview.","discovery.truncated":"Only part of this message is shown.","discovery.user":"User","discovery.assistant":"Assistant","discovery.openFull":"Open full conversation","discovery.searchPlaceholder":"Search titles or content"},ya={"common.separator":": ","copy.empty":"\u041D\u0435\u0447\u0435\u0433\u043E \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","copy.unavailable":"\u0411\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u043E HTTPS \u0438\u043B\u0438 localhost.","copy.denied":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","discovery.you":"\u0412\u044B","discovery.ai":"\u0418\u0418","discovery.readOnly":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","discovery.messageCount":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439: {n}","discovery.displayMode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","discovery.formatted":"\u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.raw":"\u0418\u0441\u0445\u043E\u0434\u043D\u0438\u043A \u0438 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430","discovery.copyCode":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u0434","discovery.footnotes":"\u0421\u043D\u043E\u0441\u043A\u0438","details.copyId":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID \u0441\u0435\u0441\u0441\u0438\u0438","details.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.date":"\u0414\u0430\u0442\u0430","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","discovery.allTime":"\u0412\u0441\u0435 \u0432\u0440\u0435\u043C\u044F","discovery.today":"\u0421\u0435\u0433\u043E\u0434\u043D\u044F","discovery.last7Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 7 \u0434\u043D\u0435\u0439","discovery.last30Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 30 \u0434\u043D\u0435\u0439","discovery.last90Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 90 \u0434\u043D\u0435\u0439","discovery.customRange":"\u0421\u0432\u043E\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u2026","discovery.dateActive":"\u0414\u0430\u0442\u0430 \xB7 \u0412\u044B\u0431\u0440\u0430\u043D\u0430","discovery.clearDate":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u0430\u0442\u044B","discovery.active":"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E","discovery.scope":"\u0418\u0441\u043A\u0430\u0442\u044C \u0432","discovery.titleOnly":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F","discovery.titleAndContent":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F \u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435","discovery.from":"\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0441","discovery.to":"\u041F\u043E","discovery.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B","discovery.invalidDate":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u0430\u0442: \u043D\u0430\u0447\u0430\u043B\u043E \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u0437\u0436\u0435 \u043A\u043E\u043D\u0446\u0430.","discovery.searching":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443: {done} / {total}","discovery.searched":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D: {done} / {total}","discovery.searchError":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u0439; \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C\u0438.","discovery.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C {n} \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432","discovery.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C","discovery.preview":"\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440","discovery.loading":"\u0427\u0442\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430\u2026","discovery.previewHint":"\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u0435\u043D\u0438\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430; \u0441\u0435\u0441\u0441\u0438\u044F \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0411\u0435\u0437 \u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0439, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0433\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043E.","discovery.earlier":"\u041F\u0435\u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u043E\u043C \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.later":"\u041F\u043E\u0441\u043B\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.empty":"\u041D\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430.","discovery.truncated":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0430\u0441\u0442\u044C \u044D\u0442\u043E\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","discovery.user":"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C","discovery.assistant":"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442","discovery.openFull":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440","discovery.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C \u0438\u043B\u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443"};var wa=e(t=>{let r=te(t);if(!r||typeof r.sessionId!="string"||!r.sessionId.length||r.sessionId.length>1024||typeof r.identity!="string"||!r.identity.length||r.identity.length>4096)throw new TypeError("invalid cache rebuild candidate");return{sessionId:r.sessionId,identity:r.identity}},"candidate"),$s={parse(t){let r=te(t);if(!r||!Array.isArray(r.items)||!r.items.length||r.items.length>20)throw new TypeError("invalid cache rebuild batch (1\u201320 items required)");return{items:r.items.map(wa)}}},dr={parse(t){let r=te(t);if(!r||!Array.isArray(r.items)||r.count!==r.items.length)throw new TypeError("invalid cache diagnosis");return{count:r.items.length,items:r.items.map(wa)}}},cr={parse(t){let r=te(t);for(let i of["rebuiltSessionIds","skippedSessionIds"])if(!Array.isArray(r?.[i])||r[i].some(a=>typeof a!="string"))throw new TypeError("invalid cache rebuild result");if(!Array.isArray(r.failures)||r.failures.some(i=>!i||typeof i.sessionId!="string"||typeof i.message!="string"))throw new TypeError("invalid cache rebuild failures");return r}};function Sa(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return[{method:"diagnoseSessionCaches",parameters:[],result:t("CacheDiagnosis",dr)},{method:"rebuildSessionCaches",parameters:[{name:"input",wire:"input",source:"json",codec:t("CacheRebuildInput",$s)}],result:t("CacheRebuildResult",cr)}].map(({method:r,...i})=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},...i,sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Sa,"cacheRebuildInvocations");function xa(t,r={}){let{maxLoadRetries:i=3,retryDelayMs:a=200}=r,o={diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null},g=!0,d=0,k=[],b,I=new Set,S=e(w=>{if(g){o={...o,...w};for(let N of I)N()}},"update"),f=e(async(w=i)=>{if(!g)return;b!==void 0&&(clearTimeout(b),b=void 0);let N=++d;try{let _=dr.parse(await t.diagnose());g&&N===d&&S({diagnosis:_,error:null})}catch(_){if(w>0&&g&&N===d){b=setTimeout(()=>{b=void 0,g&&N===d&&f(w-1)},a);return}g&&N===d&&S({error:Ue(_)})}},"load");return{snapshot:e(()=>o,"snapshot"),subscribe(w){return I.add(w),()=>{I.delete(w)}},load:f,async run(w=!1){if(!g||o.busy)return;++d,b!==void 0&&(clearTimeout(b),b=void 0);let N=w?[...k]:[...o.diagnosis.items],_={rebuiltSessionIds:[],skippedSessionIds:[],failures:[]};k=[],S({busy:!0,result:null,error:null,refreshError:null,progress:{done:0,total:N.length}});for(let[H,L]of N.entries()){if(!g)return;try{let W=cr.parse(await t.rebuild({items:[L]}));if(!g)return;_.rebuiltSessionIds.push(...W.rebuiltSessionIds),_.skippedSessionIds.push(...W.skippedSessionIds),_.failures.push(...W.failures),W.failures.length&&k.push(L)}catch(W){if(!g)return;_.failures.push({sessionId:L.sessionId,message:Ue(W)}),k.push(L)}S({progress:{done:H+1,total:N.length}})}S({result:_});try{await t.refresh()}catch(H){S({refreshError:Ue(H)})}g&&(await f(),S({busy:!1,progress:null}))},dismiss(){g&&S({result:null,error:null,refreshError:null})},dispose(){g=!1,++d,b!==void 0&&(clearTimeout(b),b=void 0),I.clear()}}}e(xa,"createCacheRebuildController");var qt=class extends Error{static{e(this,"ArchiveNavigationError")}code;constructor(r){super(r),this.name="ArchiveNavigationError",this.code=r}};function ka(t,r){return t instanceof qt?r(`archives.${t.code}`):Ue(t)}e(ka,"formatArchiveNavigationError");function Gs(t,r){if(typeof t?.retainInfo!="function")return;let i=t.retainInfo(r),a=i&&typeof i=="object"&&"getSnapshot"in i&&typeof i.getSnapshot=="function"?i.getSnapshot():i;if(!a||typeof a!="object"||!("retainedBy"in a))return;let o=a.retainedBy;if(!(!o||typeof o!="object"||!("mainView"in o)||typeof o.mainView!="number"))return{retainedBy:{mainView:o.mainView}}}e(Gs,"retainInfoSnapshot");function Ks(t){let r=t?.byId;if(r!==void 0){for(let i of Object.values(r))if(i&&(i.retainedBy?.mainView??0)>0)return i.id}}e(Ks,"mainViewSessionId");function Bn(t){return Ks(t)}e(Bn,"currentSessionId");function Ys(t,r,i){return r===void 0||r===""?!1:(t?.byId?.[r]?.retainedBy?.mainView??0)>0||(Gs(i,r)?.retainedBy?.mainView??0)>0}e(Ys,"sessionIsCurrent");async function Ca(t,r,i,a=()=>!0){if(i){if(typeof t.prepare=="function"&&await t.prepare(r),!a())return;await t.restore(r)}a()&&await t.open(r)}e(Ca,"openArchivedConversation");function Ea(t,r,i,{onOpened:a=e(()=>{},"onOpened"),beginNavigation:o,warn:g=e((...d)=>console.warn(...d),"warn")}={}){let d,k=t?.clearArchivedCurrent,b=t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent"),I=e(w=>Ys(r.list.getSnapshot(),w,r),"viewing"),S=e(function(...w){return d!==void 0&&I(d)&&i.list.getSnapshot().archivedSessionIds.includes(d)?!1:(d=void 0,k?.apply(this,w))},"wrapped"),f=e(()=>t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value===S,"ownsWrapper");if(t&&typeof k=="function")try{if(t.clearArchivedCurrent=S,!f())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(w){g("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",w)}return{open(w){d=w;try{if(typeof k=="function"&&!f()&&i.list.getSnapshot().archivedSessionIds.includes(w))throw g("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new qt("navigationUnavailable");if(o?.(),typeof t?.openSession!="function")throw g("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new qt("navigationUnavailable");if(t.openSession(w),!I(w))throw g("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof k=="function"}),new qt("sessionNotRetained");a()}catch(N){throw d=void 0,N}},dispose(){d=void 0,!(!t||Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value!==S)&&(b?Object.defineProperty(t,"clearArchivedCurrent",b):delete t.clearArchivedCurrent,k?.call(t))}}}e(Ea,"allowArchivedNavigation");var Yt=require("@deepseek-ai/dsh-client-ui-primitives");var Ta={check:"\u68C0\u67E5\u66F4\u65B0",update:"\u66F4\u65B0",recheck:"\u91CD\u65B0\u68C0\u67E5",auto:"\u81EA\u52A8\u66F4\u65B0",updating:"\u6B63\u5728\u66F4\u65B0\u2026",copy:"\u590D\u5236\u547D\u4EE4",copied:"\u5DF2\u590D\u5236",copyFailed:"\u590D\u5236\u5931\u8D25",checking:"\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026",latest:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",found:"\u53D1\u73B0\u65B0\u7248\u672C",failed:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",current:"\u8FD0\u884C\u7248\u672C",latestLabel:"\u6700\u65B0\u7248\u672C",profile:"\u76EE\u6807 profile",unknown:"\u672A\u77E5",manual:"\u624B\u5DE5\u66F4\u65B0",manualHint:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u53EF\u5728\u5F53\u524D DSH \u7EC8\u7AEF\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u5B8C\u6210\u540E\u91CD\u542F DSH Web\u3002",manualHintDesktop:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u8BF7\u5148\u5B8C\u5168\u9000\u51FA DSH Desktop\uFF0C\u518D\u7528 Desktop \u81EA\u5E26\u7684 dsh \u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u3002\u666E\u901A dsh \u4F1A\u62D2\u7EDD desktop profile\u3002",intro:"\u4EC5\u68C0\u67E5\u5E76\u66F4\u65B0\u5F53\u524D\u63D2\u4EF6\uFF0C\u4E0D\u4F1A\u8054\u52A8\u5B89\u88C5\u5176\u4ED6\u63D2\u4EF6\u3002",restart:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u91CD\u542F DSH Web\u3002",restartDesktop:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 DSH Desktop\u3002",restarting:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u542F DSH Desktop\u2026",unavailable:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u4F7F\u7528\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4\u3002"},Ia={check:"Check for updates",update:"Update",recheck:"Check again",auto:"Update automatically",updating:"Updating\u2026",copy:"Copy command",copied:"Copied",copyFailed:"Copy failed",checking:"Checking for updates\u2026",latest:"You are up to date",found:"New version available",failed:"Could not check for updates. Try again later.",current:"Running version",latestLabel:"Latest version",profile:"Target profile",unknown:"Unknown",manual:"Manual update",manualHint:"If automatic update fails, run this command in the current DSH terminal, then restart DSH Web.",manualHintDesktop:"If automatic update fails, fully quit DSH Desktop, then run this command with Desktop's own dsh. A regular dsh rejects the desktop profile.",intro:"Only this plugin is checked and updated. Other plugins are not changed.",restart:"Update complete. Restart DSH Web.",restartDesktop:"Update complete. Fully quit and reopen DSH Desktop.",restarting:"Update complete. Restarting DSH Desktop\u2026",unavailable:"Automatic update is unavailable. Use the manual command."};function kn(t){return t.toLowerCase().startsWith("zh")?Ta:Ia}e(kn,"pluginUpdateCopy");function Zs(t,r,i,a){let o=kn(t),g=r?.restartDesktop===!0||r?.profileName==="desktop",d=g?{...o,manualHint:o.manualHintDesktop}:o,k=i!=="idle",b=d.checking,I="";return i==="checking"?b=d.checking:i==="updating"?b=d.updating:a.type==="error"?(b=a.message||d.failed,I="error"):a.type==="restart"?(b=g?d.restartDesktop:d.restart,I="success"):a.type==="restarting"?(b=d.restarting,I="success"):r===void 0?b=d.checking:r.latestCheckFailed?(b=d.failed,I="error"):!r.canAutoUpdate&&r.updateAvailable?(b=d.unavailable,I="update"):r.updateAvailable?(b=`${d.found}: v${r.latestVersion??d.unknown}`,I="update"):(b=d.latest,I="success"),{copy:d,busy:k,message:b,kind:I,loading:i==="updating",updateLabel:i==="updating"?d.updating:d.auto,disabled:k||r?.canAutoUpdate!==!0||r.updateAvailable!==!0,currentVersion:r===void 0?d.unknown:`v${r.currentVersion}`,latestVersion:r?.latestVersion===void 0?d.unknown:`v${r.latestVersion}`,profileName:r?.profileName??d.unknown,profileRaw:r?.profileName??"",latestRaw:r?.latestVersion??"latest"}}e(Zs,"describePluginUpdate");function Aa(t,r,i){let a="idle",o=r,g={type:"status"},d=0,k=new Set,b=e(()=>{for(let S of k)S()},"emit"),I=e(S=>{o=S,i?.(S)},"assign");return{get posts(){return d},subscribe(S){return k.add(S),()=>{k.delete(S)}},view(S){return Zs(S,o,a,g)},async check(){if(a==="idle"){a="checking",g={type:"status"},b();try{I(await t("GET")),g={type:"status"}}catch(S){g={type:"error",message:S instanceof Error?S.message:""}}finally{a="idle",b()}}},async update(){if(a==="idle"){a="updating",g={type:"status"},d+=1,b();try{let S=await t("POST");I(S),g={type:S.autoReload===!0?"restarting":"restart"}}catch(S){g={type:"error",message:S instanceof Error?S.message:""}}finally{a="idle",b()}}}}}e(Aa,"createUpdateFlow");function _a(t,r,i){return`dsh plugin${t.trim()===""?"":` --profile ${t.trim()}`} add ${r}@${i} --registry=https://registry.npmjs.org/`}e(_a,"manualPluginUpdateCommand");function Ra(t,r){return t.key!=="Escape"?!1:(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r(),!0)}e(Ra,"handlePluginUpdateEscape");function Js(){let t=globalThis.document;if(typeof t>"u"||t===null)return;let r=t.baseURI;if(!(typeof r!="string"||r===""))try{let i=new URL(r),a=i.pathname.lastIndexOf("/"),o=i.pathname.slice(a+1);return/\.(html?|php|aspx?|jsp)$/i.test(o)?i.pathname=i.pathname.slice(0,a+1):i.pathname.endsWith("/")||(i.pathname+="/"),i.href}catch{return}}e(Js,"pageBaseHref");function Cn(t){if(typeof t!="string"||t.charAt(0)!=="/"||t.charAt(1)==="/")return t;let r=Js();if(r===void 0)return t;try{return new URL(t.slice(1),r).href}catch{return t}}e(Cn,"resolveApiUrl");function ja(t){let i=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(i===void 0)throw new Error("createRoot unavailable");return i(t)}e(ja,"mountRoot");var Xs="x-michengai-plugin-update",Na="michengai-plugin-update-ui",ur=`
11
11
  .mpi-version{margin-left:8px;color:var(--dsw-alias-label-tertiary,#a0a0a0);font-family:inherit;font-size:12px;font-weight:500;line-height:18px;letter-spacing:0;white-space:nowrap;vertical-align:baseline}.mpi-check-host{display:inline-flex;align-items:center}.mpi-icon{display:inline-flex;flex:0 0 auto;width:16px;height:16px;align-items:center;justify-content:center;pointer-events:none}.mpi-icon svg{display:block;width:16px;height:16px}
12
12
  .mpi-intro{margin:0 0 16px;color:var(--dsw-alias-label-secondary,#b9b9b9);font-size:13px;line-height:20px}.mpi-meta{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 18px;margin:0 0 16px;font-size:12px;line-height:18px}.mpi-meta dt{color:var(--dsw-alias-label-secondary,#b9b9b9)}.mpi-meta dd{margin:0}.mpi-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.mpi-latest{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px}.mpi-status{font-size:13px;font-weight:600;line-height:18px}.mpi-status[data-kind=error]{color:var(--dsw-alias-state-error-primary,#ef7272)}.mpi-status[data-kind=success]{color:var(--dsw-alias-state-success-primary,#51b976)}.mpi-status[data-kind=update]{color:#e8b15a !important}.mpi-manual{border-top:1px solid var(--dsw-alias-border-l2,#494949);padding-top:16px}.mpi-manual h3{margin:0 0 6px;font-size:14px;line-height:20px}.mpi-manual p{margin:0 0 10px;color:var(--dsw-alias-label-secondary,#b9b9b9);font-size:12px;line-height:18px}.mpi-command{display:flex;align-items:flex-start;gap:8px;border:1px solid var(--dsw-alias-border-l2,#494949);border-radius:7px;padding:10px;background:var(--dsw-alias-bg-layer-3,var(--dsw-specific-menu-item-hover,#353638))}.mpi-command code{min-width:0;flex:1;overflow:visible;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:18px;white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:560px){.mpi-meta{grid-template-columns:1fr;gap:2px}.mpi-meta dd{margin-bottom:6px}}
13
13
  .dssm-update-progress{height:4px;border-radius:2px;background:var(--dsw-alias-border-l1,#3a3a3a);overflow:hidden;margin:12px 0;position:relative}.dssm-update-progress-bar{height:100%;width:40%;background:var(--dsw-alias-button-primary-fill,#4176e6);border-radius:2px;animation:dssm-progress-slide 1.4s ease-in-out infinite}@keyframes dssm-progress-slide{0%{transform:translateX(-100%)}100%{transform:translateX(300%)}}@media (prefers-reduced-motion:reduce){.dssm-update-progress-bar{animation:none;width:100%;opacity:.6}}
14
- `;function yi(){let t=document.getElementById($s);if(t!==null){t.textContent!==yr&&(t.textContent=yr);return}let s=document.createElement("style");s.id=$s,s.textContent=yr,(document.head??document.documentElement).append(s)}e(yi,"ensureStyle");function wi(t){if(t===null||typeof t!="object")return!1;let s=t;return typeof s.packageName=="string"&&typeof s.currentVersion=="string"&&typeof s.updateAvailable=="boolean"&&typeof s.profileName=="string"&&typeof s.canAutoUpdate=="boolean"&&typeof s.latestCheckFailed=="boolean"&&(s.latestVersion===void 0||typeof s.latestVersion=="string")}e(wi,"validPayload");async function Ks(t,s,o){let b=o===void 0?{}:{signal:o},a=await fetch(t,s==="GET"?{cache:"no-store",...b}:{method:"POST",headers:{"content-type":"application/json",[bi]:"1"},body:"{}",...b}),l=await a.json();if(!a.ok||!wi(l))throw new Error(l&&typeof l=="object"&&"error"in l&&typeof l.error=="string"?l.error:In(document.documentElement.lang).failed);return l}e(Ks,"requestStatus");function Si(t){let s=U.useRef(null);return U.useLayoutEffect(()=>{s.current?.replaceChildren(t.node)},[t.node]),U.createElement("span",{ref:s,className:"mpi-icon","aria-hidden":!0})}e(Si,"HostIcon");function ki(t){let s=U.useRef(null),[,o]=U.useState(0),[b,a]=U.useState("idle");U.useEffect(()=>t.flow.subscribe(()=>o(x=>x+1)),[t.flow]),U.useEffect(()=>{let x=document.documentElement,v=new MutationObserver(()=>o(C=>C+1));return v.observe(x,{attributes:!0,attributeFilter:["lang"]}),()=>v.disconnect()},[]),U.useEffect(()=>{t.flow.check()},[t.flow]),U.useEffect(()=>{function x(v){Vs(v,t.onClose)}return e(x,"onKey"),document.addEventListener("keydown",x,!0),()=>document.removeEventListener("keydown",x,!0)},[t.onClose]);let l=document.documentElement.lang,p=t.flow.view(l),g=l.toLowerCase().startsWith("zh")?t.zhName:l.toLowerCase().startsWith("ru")?t.ruName:t.enName,y=qs(p.profileRaw,t.packageName,p.latestRaw),D=b==="copied"?p.copy.copied:b==="failed"?p.copy.copyFailed:p.copy.copy;return U.createElement(Xt.Modal,{open:!0,className:"mpi-dialog",title:`${g} ${p.copy.update}`,closeLabel:"Close",onClose:t.onClose,footer:[U.createElement(Xt.Button,{key:"check",variant:"outline",disabled:p.busy,onClick:e(()=>{t.flow.check()},"onClick")},p.copy.recheck),U.createElement(Xt.Button,{key:"update",variant:"primary",disabled:p.disabled,onClick:e(()=>{t.flow.update()},"onClick")},p.updateLabel)]},U.createElement("div",{ref:s},U.createElement("p",{className:"mpi-intro"},p.copy.intro),U.createElement("dl",{className:"mpi-meta"},U.createElement("dt",null,p.copy.current),U.createElement("dd",null,U.createElement("span",{className:"mpi-mono"},p.currentVersion)),U.createElement("dt",null,p.copy.latestLabel),U.createElement("dd",{className:"mpi-latest"},U.createElement("span",{className:"mpi-mono"},p.latestVersion),U.createElement("span",{className:"mpi-status",role:"status","data-kind":p.kind,...p.kind==="update"?{style:{color:"#e8b15a"}}:{}},p.message)),U.createElement("dt",null,p.copy.profile),U.createElement("dd",null,U.createElement("span",{className:"mpi-mono"},p.profileName))),p.busy?U.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},U.createElement("div",{className:"dssm-update-progress-bar"})):null,U.createElement("section",{className:"mpi-manual"},U.createElement("h3",null,p.copy.manual),U.createElement("p",null,p.copy.manualHint),U.createElement("div",{className:"mpi-command"},U.createElement("code",null,y),U.createElement(Xt.Button,{variant:"outline",size:"sm",disabled:p.busy,onClick:e(()=>{let x=navigator.clipboard?.writeText(y);if(x===void 0){a("failed");return}x.then(()=>{a("copied"),window.setTimeout(()=>a("idle"),1400)}).catch(()=>a("failed"))},"onClick")},D)))))}e(ki,"UpdateDialog");function Ys(t){if(typeof document>"u"||document.body===null)return()=>{};let s=Tn(t.endpoint);yi();let o=new AbortController,b,a,l,p,g,y,D;function x(){l?.unmount(),l=void 0,a=void 0,p=void 0}e(x,"unmountCheck");function v(){if(l===void 0)return;p===void 0&&(p=t.createIcon("refresh"));let re=p;l.render(U.createElement(Xt.Button,{variant:"outline",size:"sm",onClick:M,icon:U.createElement(Si,{node:re})},U.createElement("span",{"data-mpi-label":""},In(document.documentElement.lang).check)))}e(v,"renderCheck");function C(){y?.unmount(),y=void 0,g?.remove(),g=void 0}e(C,"closeDialog");function M(){C();let re=document.createElement("div");re.className="mpi-dialog-root",document.body.append(re),g=re,y=Gs(re),y.render(U.createElement(ki,{flow:Ws(se=>Ks(s,se,o.signal),b,se=>{b=se,N()}),packageName:t.packageName,zhName:t.zhName,enName:t.enName,ruName:t.ruName,onClose:C}))}e(M,"openDialog");function N(){let re=document.querySelector(t.titleRowSelector);if(re===null)return;let se=re.querySelector("h1,h2"),de=re.querySelector(t.linksSelector);if(t.isEnabled&&!t.isEnabled()){if(g!==void 0&&C(),de!==null){let he=de.querySelector(`[data-mpi-check="${t.packageName}"]`);he!==null&&(x(),he.remove())}if(se!==null){let he=se.querySelector(`.mpi-version[data-package="${t.packageName}"]`);he!==null&&he.remove()}return}if(se!==null&&b!==void 0){let he=se.querySelector(`.mpi-version[data-package="${t.packageName}"]`);he===null&&(he=document.createElement("span"),he.className="mpi-version",he.dataset.package=t.packageName,se.append(he));let V=`v${b.currentVersion}`;he.textContent!==V&&(he.textContent=V)}if(a!==void 0&&!a.isConnected&&x(),de===null)return;let ae=de.querySelector(`[data-mpi-check="${t.packageName}"]`);if(ae!==null){let he=ae.querySelector("[data-mpi-label]");(he===null||he.textContent!==In(document.documentElement.lang).check)&&v();return}let Be=document.createElement("span");Be.dataset.mpiCheck=t.packageName,Be.className="mpi-check-host",de.append(Be),a=Be,l=Gs(Be),v()}e(N,"applyControls");let H=new MutationObserver(()=>{D===void 0&&(D=window.requestAnimationFrame(()=>{D=void 0,N()}))});H.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]});let B,q=e(async()=>B||(B=(async()=>{try{return b=await Ks(s,"GET",o.signal),N(),b}finally{B=void 0}})(),B),"load"),le=e(()=>{N(),(!t.isEnabled||t.isEnabled())&&q().catch(()=>{})},"onToggle");return typeof window<"u"&&window.addEventListener("dsham-update-toggle",le),N(),q().catch(()=>{}),()=>{o.abort(),H.disconnect(),C(),x(),typeof window<"u"&&window.removeEventListener("dsham-update-toggle",le),D!==void 0&&window.cancelAnimationFrame(D),document.querySelectorAll(`[data-mpi-check="${t.packageName}"],.mpi-version[data-package="${t.packageName}"]`).forEach(re=>re.remove())}}e(Ys,"observePluginUpdate");var ln=require("@deepseek-ai/dsh-client-ui-primitives");var Ke=vs,xi="@michengai/dsh-archive-manager",wr="archived-sessions",Ci=4,Zs="dsham-sidebar-entry-style",Ei=`
14
+ `;function Qs(){let t=document.getElementById(Na);if(t!==null){t.textContent!==ur&&(t.textContent=ur);return}let r=document.createElement("style");r.id=Na,r.textContent=ur,(document.head??document.documentElement).append(r)}e(Qs,"ensureStyle");function ei(t){if(t===null||typeof t!="object")return!1;let r=t;return typeof r.packageName=="string"&&typeof r.currentVersion=="string"&&typeof r.updateAvailable=="boolean"&&typeof r.profileName=="string"&&typeof r.canAutoUpdate=="boolean"&&typeof r.latestCheckFailed=="boolean"&&(r.latestVersion===void 0||typeof r.latestVersion=="string")}e(ei,"validPayload");async function Da(t,r,i){let a=i===void 0?{}:{signal:i},o=await fetch(t,r==="GET"?{cache:"no-store",...a}:{method:"POST",headers:{"content-type":"application/json",[Xs]:"1"},body:"{}",...a}),g=await o.json();if(!o.ok||!ei(g))throw new Error(g&&typeof g=="object"&&"error"in g&&typeof g.error=="string"?g.error:kn(document.documentElement.lang).failed);return g}e(Da,"requestStatus");function ti(t){let r=B.useRef(null);return B.useLayoutEffect(()=>{r.current?.replaceChildren(t.node)},[t.node]),B.createElement("span",{ref:r,className:"mpi-icon","aria-hidden":!0})}e(ti,"HostIcon");function ni(t){let r=B.useRef(null),[,i]=B.useState(0),[a,o]=B.useState("idle");B.useEffect(()=>t.flow.subscribe(()=>i(S=>S+1)),[t.flow]),B.useEffect(()=>{let S=document.documentElement,f=new MutationObserver(()=>i(w=>w+1));return f.observe(S,{attributes:!0,attributeFilter:["lang"]}),()=>f.disconnect()},[]),B.useEffect(()=>{t.flow.check()},[t.flow]),B.useEffect(()=>{function S(f){Ra(f,t.onClose)}return e(S,"onKey"),document.addEventListener("keydown",S,!0),()=>document.removeEventListener("keydown",S,!0)},[t.onClose]);let g=document.documentElement.lang,d=t.flow.view(g),k=g.toLowerCase().startsWith("zh")?t.zhName:g.toLowerCase().startsWith("ru")?t.ruName:t.enName,b=_a(d.profileRaw,t.packageName,d.latestRaw),I=a==="copied"?d.copy.copied:a==="failed"?d.copy.copyFailed:d.copy.copy;return B.createElement(Yt.Modal,{open:!0,className:"mpi-dialog",title:`${k} ${d.copy.update}`,closeLabel:"Close",onClose:t.onClose,footer:[B.createElement(Yt.Button,{key:"check",variant:"outline",disabled:d.busy,onClick:e(()=>{t.flow.check()},"onClick")},d.copy.recheck),B.createElement(Yt.Button,{key:"update",variant:"primary",disabled:d.disabled,onClick:e(()=>{t.flow.update()},"onClick")},d.updateLabel)]},B.createElement("div",{ref:r},B.createElement("p",{className:"mpi-intro"},d.copy.intro),B.createElement("dl",{className:"mpi-meta"},B.createElement("dt",null,d.copy.current),B.createElement("dd",null,B.createElement("span",{className:"mpi-mono"},d.currentVersion)),B.createElement("dt",null,d.copy.latestLabel),B.createElement("dd",{className:"mpi-latest"},B.createElement("span",{className:"mpi-mono"},d.latestVersion),B.createElement("span",{className:"mpi-status",role:"status","data-kind":d.kind,...d.kind==="update"?{style:{color:"#e8b15a"}}:{}},d.message)),B.createElement("dt",null,d.copy.profile),B.createElement("dd",null,B.createElement("span",{className:"mpi-mono"},d.profileName))),d.busy?B.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},B.createElement("div",{className:"dssm-update-progress-bar"})):null,B.createElement("section",{className:"mpi-manual"},B.createElement("h3",null,d.copy.manual),B.createElement("p",null,d.copy.manualHint),B.createElement("div",{className:"mpi-command"},B.createElement("code",null,b),B.createElement(Yt.Button,{variant:"outline",size:"sm",disabled:d.busy,onClick:e(()=>{let S=navigator.clipboard?.writeText(b);if(S===void 0){o("failed");return}S.then(()=>{o("copied"),window.setTimeout(()=>o("idle"),1400)}).catch(()=>o("failed"))},"onClick")},I)))))}e(ni,"UpdateDialog");function za(t){if(typeof document>"u"||document.body===null)return()=>{};let r=Cn(t.endpoint);Qs();let i=new AbortController,a,o,g,d,k,b,I;function S(){g?.unmount(),g=void 0,o=void 0,d=void 0}e(S,"unmountCheck");function f(){if(g===void 0)return;d===void 0&&(d=t.createIcon("refresh"));let ne=d;g.render(B.createElement(Yt.Button,{variant:"outline",size:"sm",onClick:N,icon:B.createElement(ti,{node:ne})},B.createElement("span",{"data-mpi-label":""},kn(document.documentElement.lang).check)))}e(f,"renderCheck");function w(){b?.unmount(),b=void 0,k?.remove(),k=void 0}e(w,"closeDialog");function N(){w();let ne=document.createElement("div");ne.className="mpi-dialog-root",document.body.append(ne),k=ne,b=ja(ne),b.render(B.createElement(ni,{flow:Aa(re=>Da(r,re,i.signal),a,re=>{a=re,_()}),packageName:t.packageName,zhName:t.zhName,enName:t.enName,ruName:t.ruName,onClose:w}))}e(N,"openDialog");function _(){let ne=document.querySelector(t.titleRowSelector);if(ne===null)return;let re=ne.querySelector("h1,h2"),ae=ne.querySelector(t.linksSelector);if(t.isEnabled&&!t.isEnabled()){if(k!==void 0&&w(),ae!==null){let ue=ae.querySelector(`[data-mpi-check="${t.packageName}"]`);ue!==null&&(S(),ue.remove())}if(re!==null){let ue=re.querySelector(`.mpi-version[data-package="${t.packageName}"]`);ue!==null&&ue.remove()}return}if(re!==null&&a!==void 0){let ue=re.querySelector(`.mpi-version[data-package="${t.packageName}"]`);ue===null&&(ue=document.createElement("span"),ue.className="mpi-version",ue.dataset.package=t.packageName,re.append(ue));let V=`v${a.currentVersion}`;ue.textContent!==V&&(ue.textContent=V)}if(o!==void 0&&!o.isConnected&&S(),ae===null)return;let de=ae.querySelector(`[data-mpi-check="${t.packageName}"]`);if(de!==null){let ue=de.querySelector("[data-mpi-label]");(ue===null||ue.textContent!==kn(document.documentElement.lang).check)&&f();return}let Oe=document.createElement("span");Oe.dataset.mpiCheck=t.packageName,Oe.className="mpi-check-host",ae.append(Oe),o=Oe,g=ja(Oe),f()}e(_,"applyControls");let H=new MutationObserver(()=>{I===void 0&&(I=window.requestAnimationFrame(()=>{I=void 0,_()}))});H.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]});let L,W=e(async()=>L||(L=(async()=>{try{return a=await Da(r,"GET",i.signal),_(),a}finally{L=void 0}})(),L),"load"),le=e(()=>{_(),(!t.isEnabled||t.isEnabled())&&W().catch(()=>{})},"onToggle");return typeof window<"u"&&window.addEventListener("dsham-update-toggle",le),_(),W().catch(()=>{}),()=>{i.abort(),H.disconnect(),w(),S(),typeof window<"u"&&window.removeEventListener("dsham-update-toggle",le),I!==void 0&&window.cancelAnimationFrame(I),document.querySelectorAll(`[data-mpi-check="${t.packageName}"],.mpi-version[data-package="${t.packageName}"]`).forEach(ne=>ne.remove())}}e(za,"observePluginUpdate");var sn=require("@deepseek-ai/dsh-client-ui-primitives");var Ve=na,ri="@michengai/dsh-archive-manager",hr="archived-sessions",ai=4,Ma="dsham-sidebar-entry-style",si=`
15
15
  .dsham_mainPanel{box-sizing:border-box;height:100%;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;padding:28px clamp(24px,4vw,48px) 48px}
16
16
  .dsham_mainPanel>*{width:100%;max-width:960px}
17
17
  .dsham_bundle_row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:0.5px solid var(--dsw-alias-border-l2)}
18
18
  .dsham_bundle_label_box{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;text-align:left}
19
19
  .dsham_bundle_title{font-size:13px;font-weight:500;line-height:20px;color:var(--dsw-alias-label-primary)}
20
20
  .dsham_bundle_desc{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
21
- `;function Js(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(Zs)!==null||typeof document.createElement!="function")return;let t=document.createElement("style");t.id=Zs,t.textContent=Ei,(document.head??document.documentElement)?.appendChild?.(t)}e(Js,"ensureSidebarEntryStyle");function Ai(t){let s=t&&typeof t.size=="number"?t.size:16;return Ke(ln.IconArchiveOutlineMedium,{size:s})}e(Ai,"ArchiveSidebarIcon");function Ii(t){Js();let{t:s,enabled:o,onToggle:b,disabled:a,onlineUpdateEnabled:l=!0,onToggleOnlineUpdate:p,onlineUpdateDisabled:g,onlineUpdateLocked:y=!1,sidebarFavoriteStarEnabled:D=!0,onToggleSidebarFavoriteStar:x,sidebarFavoriteStarDisabled:v}=t,C=[Ke("div",{key:"sidebar-entry",className:"dsham_bundle_row"},Ke("div",{className:"dsham_bundle_label_box"},Ke("span",{className:"dsham_bundle_title"},s("sidebar.entry.title")),Ke("span",{className:"dsham_bundle_desc"},s("sidebar.entry.desc"))),Ke(ln.Switch,{checked:o,onChange:b,label:s("sidebar.entry.toggle"),disabled:a}))];if(typeof p=="function"){let M=y?`${s("update.entry.desc")} (${s("update.entry.locked")})`:s("update.entry.desc");C.push(Ke("div",{key:"online-update",className:"dsham_bundle_row"},Ke("div",{className:"dsham_bundle_label_box"},Ke("span",{className:"dsham_bundle_title"},s("update.entry.title")),Ke("span",{className:"dsham_bundle_desc"},M)),Ke(ln.Switch,{checked:l,onChange:p,label:s("update.entry.toggle"),disabled:g||y,title:y?s("update.entry.locked"):void 0})))}return typeof x=="function"&&C.push(Ke("div",{key:"sidebar-favorite-star",className:"dsham_bundle_row"},Ke("div",{className:"dsham_bundle_label_box"},Ke("span",{className:"dsham_bundle_title"},s("sidebar.favoriteStar.title")),Ke("span",{className:"dsham_bundle_desc"},s("sidebar.favoriteStar.desc"))),Ke(ln.Switch,{checked:D,onChange:x,label:s("sidebar.favoriteStar.toggle"),disabled:v}))),Ke(gs,null,C)}e(Ii,"ArchiveBundleConfigCard");function Ti(t){let[s,o]=Gt(t.getEnabled),[b,a]=Gt(t.getOnlineUpdateEnabled?t.getOnlineUpdateEnabled:()=>!0),[l,p]=Gt(t.getOnlineUpdateLocked?t.getOnlineUpdateLocked:()=>!1),[g,y]=Gt(t.getSidebarFavoriteStarEnabled?t.getSidebarFavoriteStarEnabled:()=>!0),[D,x]=Gt(!1),[v,C]=Gt(!1),[M,N]=Gt(!1);bs(()=>{let le=e(()=>{o(t.getEnabled()),t.getOnlineUpdateEnabled&&a(t.getOnlineUpdateEnabled()),t.getOnlineUpdateLocked&&p(t.getOnlineUpdateLocked()),t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())},"syncState");return le(),t.subscribe(le)},[t]);let H=e(le=>{x(!0),o(le),t.setSidebar(le).catch(()=>{o(t.getEnabled())}).finally(()=>{x(!1)})},"onToggleSidebar"),B=t.setOnlineUpdate?le=>{t.getOnlineUpdateLocked?.()||(C(!0),a(le),t.setOnlineUpdate(le).catch(()=>{t.getOnlineUpdateEnabled&&a(t.getOnlineUpdateEnabled())}).finally(()=>{C(!1)}))}:void 0,q=t.setSidebarFavoriteStar?le=>{N(!0),y(le),t.setSidebarFavoriteStar(le).catch(()=>{t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())}).finally(()=>{N(!1)})}:void 0;return Ke(Ii,{t:t.t,enabled:s,disabled:D,onToggle:H,onlineUpdateEnabled:b,onlineUpdateDisabled:v||l,onlineUpdateLocked:l,onToggleOnlineUpdate:B,sidebarFavoriteStarEnabled:g,sidebarFavoriteStarDisabled:M,onToggleSidebarFavoriteStar:q})}e(Ti,"ArchiveBundleConfigCardWrapper");function Sr(t,s){if(Js(),!t.locale)return{isEnabled:e(()=>!1,"isEnabled"),isSupported:e(()=>!1,"isSupported"),setEnabled:e(async()=>!1,"setEnabled"),isOnlineUpdateEnabled:e(()=>!0,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>!1,"isOnlineUpdateLocked"),setOnlineUpdate:e(async()=>!1,"setOnlineUpdate"),isSidebarFavoriteStarEnabled:e(()=>!0,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:e(async()=>!1,"setSidebarFavoriteStar"),destroy:e(()=>{},"destroy")};let{callApi:o,renderPanel:b,ns:a}=s,l=!1,p=!1,g=!1,y=null,D=null,x=0,v=!1,C,M=new Set,N=e(()=>{if(!v)for(let L of M)try{L()}catch{}},"notify"),H=e(()=>{if(v||!g||!l||y)return;let L=t.slots.register({name:"main",key:wr,locale:a,inject:e(()=>{let Ee=typeof s.injectProps=="function"?s.injectProps():{};return Object.assign({t:t.locale?.bind?t.locale.bind(a):void 0},Ee)},"inject")},Ee=>Ke("div",{className:"dsham_mainPanel"},b(Ee)));y=typeof L=="function"?L:()=>{}},"mountMain"),B=e(()=>{if(y){try{y()}catch{}y=null}},"unmountMain"),q=e(()=>{if(v||!p||!l||D)return;let L=t.slots.register({name:"sidebar.panellist",id:wr,order:Ci,label:e(()=>t.locale.bind(a)("archives.title"),"label"),locale:a},Ee=>Ai(Ee&&typeof Ee=="object"&&"size"in Ee?Ee:void 0));D=typeof L=="function"?L:()=>{}},"mountRow"),le=e(()=>{if(D){try{D()}catch{}D=null}},"unmountRow"),re=e(()=>{if(!v)if(l)H(),q();else{if(C?.panelInfo&&typeof C.selectPanel=="function")try{C.panelInfo.getSnapshot().activePanelId===wr&&C.selectPanel(null)}catch{}le(),B()}},"sync"),se=e(async L=>{if(v)return l;let Ee=++x;l=L,re(),N();try{return await o("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:L})}),L}catch(Mt){throw Ee===x&&(l=!L,re(),N()),Mt}},"setEnabled"),de=!0,ae=!1,Be=0,he=e(async L=>{if(v||ae)return de;let Ee=++Be;if(de=L,N(),typeof s.onOnlineUpdateChange=="function")try{s.onOnlineUpdateChange(L)}catch{}try{if(await o("/online-update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:L})}),Ee===Be&&typeof s.onOnlineUpdateChange=="function")try{s.onOnlineUpdateChange(L)}catch{}return L}catch(Mt){if(Ee===Be&&(de=!L,N(),typeof s.onOnlineUpdateChange=="function"))try{s.onOnlineUpdateChange(!L)}catch{}throw Mt}},"setOnlineUpdate"),V=!0,mt=0,ft=e(async L=>{if(v)return V;let Ee=++mt;if(V=L,N(),typeof s.onSidebarFavoriteStarChange=="function")try{s.onSidebarFavoriteStarChange(L)}catch{}try{return await o("/sidebar-favorite-star",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:L})}),L}catch(Mt){if(Ee===mt&&(V=!L,N(),typeof s.onSidebarFavoriteStarChange=="function"))try{s.onSidebarFavoriteStarChange(!L)}catch{}throw Mt}},"setSidebarFavoriteStar"),yt=x;o("/sidebar-entry").then(L=>{!v&&x===yt&&L&&typeof L.enabled=="boolean"&&(l=L.enabled,re(),N())}).catch(()=>{});let xt=Be;o("/online-update").then(L=>{if(!v&&Be===xt&&L&&typeof L.enabled=="boolean"&&(de=L.enabled,L.locked===!0&&(ae=!0),N(),typeof s.onOnlineUpdateChange=="function"))try{s.onOnlineUpdateChange(de)}catch{}}).catch(()=>{});let ze=mt;o("/sidebar-favorite-star").then(L=>{if(!v&&mt===ze&&L&&typeof L.enabled=="boolean"&&(V=L.enabled,N(),typeof s.onSidebarFavoriteStarChange=="function"))try{s.onSidebarFavoriteStarChange(V)}catch{}}).catch(()=>{});let It=t;return typeof It.inject=="function"&&It.inject(["layout"],L=>{!v&&L.layout&&(C=L.layout)}),t.slots.inject("main",()=>{if(!v)return g=!0,H(),()=>{g=!1,B()}}),t.slots.inject("sidebar.panellist",()=>{if(!v)return p=!0,q(),()=>{p=!1,le()}}),t.slots.inject("plugins.bundle.config",()=>{if(!v)return t.slots.register({name:"plugins.bundle.config",key:xi,locale:a},L=>L&&L.view==="summary"?null:Ke(Ti,{t:t.locale.bind(a),getEnabled:e(()=>l,"getEnabled"),setSidebar:se,getOnlineUpdateEnabled:e(()=>de,"getOnlineUpdateEnabled"),setOnlineUpdate:he,getOnlineUpdateLocked:e(()=>ae,"getOnlineUpdateLocked"),getSidebarFavoriteStarEnabled:e(()=>V,"getSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:ft,subscribe:e(Ee=>(M.add(Ee),()=>{M.delete(Ee)}),"subscribe")}))}),{isEnabled:e(()=>l,"isEnabled"),isSupported:e(()=>p,"isSupported"),setEnabled:se,isOnlineUpdateEnabled:e(()=>de,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>ae,"isOnlineUpdateLocked"),setOnlineUpdate:he,isSidebarFavoriteStarEnabled:e(()=>V,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:ft,destroy:e(()=>{v||(v=!0,x++,Be++,mt++,C=void 0,M.clear(),le(),B())},"destroy")}}e(Sr,"setupSidebarEntry");function kr(t){if(typeof t!="string"||t.length===0||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u957F\u5EA6\u987B\u4E3A 1\uFF5E1024 \u4E2A\u5B57\u7B26");return t}e(kr,"checkedId");var _i={parse(t){let s=ne(t);if(!s||typeof s!="object"||typeof s.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:kr(s.sessionId),favorite:s.favorite}}},Ri={parse(t){let s=ne(t);if(!s||!Array.isArray(s.favoriteSessionIds)||s.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(s.favoriteSessionIds.map(kr))]}},safeParse(t){try{return{success:!0,data:this.parse(t)}}catch(s){return{success:!1,error:s}}}};function Xs(){let t=e((s,o)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${s}`,create:e(()=>o,"create"),schema:o}),"codec");return["favoriteSessions","setSessionFavorite"].map(s=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${s}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:s,invocation:{kind:"direct"},parameters:s==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:t("FavoriteInput",_i)}],result:t("FavoriteState",Ri),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Xs,"favoriteInvocations");function xr(t,{days:s,now:o=Date.now(),favorites:b=new Set,currentId:a,pending:l=new Map}){if(!t||!Number.isInteger(s)||s<1||s>36500||b.has(t.id)||t.id===a||(t.retainedBy?.mainView??0)>0||t.running||(t.runningSubagentCount??0)>0||t.pendingInteraction!=null||l.has(t.id))return!1;let p=typeof t.updatedAt=="number"?t.updatedAt:Date.parse(t.updatedAt??"");return Number.isFinite(p)&&p<=o-s*864e5}e(xr,"idleArchiveCandidate");async function Vn(t,s,{onProgress:o,refresh:b}={}){let a=[...new Set(t.map(kr))],l={requested:a,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},p=e(()=>o?.({total:a.length,done:l.succeeded.length+l.skipped.length+l.failures.length,succeeded:l.succeeded.length,skipped:l.skipped.length,failed:l.failures.length}),"report");p();for(let g of a){try{(await s(g)?l.succeeded:l.skipped).push(g)}catch(y){l.failures.push({sessionId:g,message:y instanceof Error?y.message:String(y)}),l.remaining.push(g)}p()}try{await b?.()}catch(g){l.refreshError=g instanceof Error?g.message:String(g)}return l}e(Vn,"runSessionBatch");function Qs({workspaces:t,sessions:s,archive:o,restore:b,deleteOne:a,getFavorites:l,refresh:p,currentSessionId:g}){return async(y,D,x={})=>{if(!["archive","restore","undo","delete"].includes(y))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return Vn(D,async v=>{let M=t.getSnapshot().archivedSessionIds.includes(v);if(y==="archive"){if(M||!s.getSnapshot().byId[v])return!1;if(x.idleDays!==void 0){let le=new Set((await l()).favoriteSessionIds),re=s.getSnapshot();if(!xr(re.byId[v],{days:x.idleDays,favorites:le,currentId:g(re),pending:x.getPending?.()??x.pending}))return!1}return await o(v),t.getSnapshot().archivedSessionIds.includes(v)}return M?y==="delete"?(await a(v),!0):!((await b(v))?.archivedSessionIds??t.getSnapshot().archivedSessionIds).includes(v):!1},{onProgress:x.onProgress,refresh:p})}}e(Qs,"createSessionOrganizer");function Ni(t){return!t||t<=0?"0 B":t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/(1024*1024)).toFixed(1)+" MB"}e(Ni,"formatBytes");function ea(t,s){let o=t.createElement;function b(l,p){return o(s??(y=>o("button",{type:"button",disabled:y.disabled,onClick:y.onClick},y.children)),{variant:"outline",size:"sm",...p},l)}e(b,"textButton");function a({title:l,failures:p,separator:g}){let[y,D]=t.useState(!1),x=o("ul",null,p.map(v=>o("li",{key:v.sessionId},v.sessionId,g,v.message)));return o(Wn,{title:l,open:y,onToggle:e(()=>D(v=>!v),"onToggle")},x)}return e(a,"FailureDetails"),e(function({t:p,archived:g,busy:y,ready:D,days:x,onDays:v,count:C,onPreview:M,progress:N,result:H,onRetry:B,undoCount:q,onUndo:le,onReload:re,orphanCount:se=0,orphanSizeBytes:de=0,orphanCleaning:ae=!1,onCleanOrphans:Be,cacheCount:he=0,cacheRepair:V,onRebuildCaches:mt,onRetryCaches:ft,onReloadCaches:yt,onDismissCaches:xt}){return o(t.Fragment,null,o("style",null,".dsham_organizer,.dsham_batchFeedback{display:grid;gap:12px;margin:0 0 16px;padding:14px 16px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.dsham_organizerControls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.dsham_organizer label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary)}.dsham_number{width:88px;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.dsham_number:hover{border-color:var(--dsw-alias-border-l3)}.dsham_number:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}.dsham_disclosure{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}.dsham_foldChevron{transition:transform 150ms ease}.dsham_foldChevron.is-open{transform:rotate(180deg)}.dsham_organizer p,.dsham_batchFeedback p{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsham_batchFeedback progress{width:100%}.dsham_batchFeedback details{font-size:12px;overflow-wrap:anywhere}.dsham_archivePreview{max-height:260px;overflow:auto;display:grid;gap:8px;padding:8px 0}.dsham_archivePreview label{display:flex;gap:8px;align-items:center;overflow-wrap:anywhere}"),(!g||!D)&&o("div",{className:"dsham_organizer"},o("div",{className:"dsham_organizerControls"},!D&&b(p("organizer.reloadFavorites"),{disabled:y,onClick:re}),!g&&o(t.Fragment,null,o("label",null,p("organizer.idleDays"),o(ws,{min:1,max:36500,value:x===""?null:Number(x),disabled:y,"aria-label":p("organizer.idleDays"),onChange:e(ze=>v(ze==null?"":String(ze)),"onChange")})),b(p("organizer.preview",{n:C}),{disabled:y||!D||C===0,onClick:M}))),!g&&o("p",null,p("organizer.rules"))),se>0&&o("div",{className:"dsham_organizer"},o("div",{className:"dsham_organizerControls"},o("strong",null,p("organizer.orphanTitle",{n:se})),Be&&b(p(ae?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:y||ae,onClick:Be})),o("p",null,p("organizer.orphanDesc",{size:Ni(de)}))),he>0&&o("div",{className:"dsham_organizer"},o("div",{className:"dsham_organizerControls"},o("strong",null,p("organizer.cacheTitle",{n:he})),mt&&b(p(V?.busy?"organizer.cacheRebuilding":"organizer.cacheRebuild"),{disabled:y||V?.busy,onClick:mt})),o("p",null,p("organizer.cacheDesc"))),V&&(V.result||V.progress||V.error||V.refreshError)&&o("section",{className:"dsham_batchFeedback","aria-label":p("organizer.cacheRebuild")},V.progress&&o("div",{role:"status"},o("progress",{value:V.progress.done,max:Math.max(1,V.progress.total)}),p("organizer.progressCount",V.progress)),V.result&&o("div",{role:"status"},o("p",null,p("organizer.result",{succeeded:V.result.rebuiltSessionIds.length,skipped:V.result.skippedSessionIds.length,failed:V.result.failures.length})),V.result.failures.length>0&&o(a,{title:p("organizer.failureDetails"),failures:V.result.failures,separator:p("common.separator")}),V.result.failures.length>0&&ft&&b(p("organizer.cacheRetry",{n:V.result.failures.length}),{disabled:y||V.busy,onClick:ft})),V.error&&o("p",{role:"alert"},p("organizer.cacheError",{detail:V.error})),V.refreshError&&o("p",{role:"alert"},p("organizer.refreshError",{detail:V.refreshError})),o("div",{className:"dsham_organizerControls"},yt&&b(p("organizer.cacheCheck"),{disabled:y||V.busy,onClick:yt}),xt&&b(p("organizer.dismiss"),{disabled:y||V.busy,onClick:xt}))),(N||H||q>0)&&o("section",{className:"dsham_batchFeedback","aria-label":p("organizer.feedback")},N&&o("div",{role:"status","aria-live":"polite"},o("progress",{value:N.done,max:Math.max(1,N.total),"aria-label":p("organizer.progress")}),p("organizer.progressCount",{done:N.done,total:N.total})),H&&o("div",{role:"status"},o("strong",null,p(`organizer.${H.kind??"archive"}Result`)),o("p",null,p("organizer.result",{succeeded:H.succeeded.length,skipped:H.skipped.length,failed:H.failures.length})),H.failures.length>0&&o(a,{title:p("organizer.failureDetails"),failures:H.failures,separator:p("common.separator")}),H.refreshError&&o("p",{role:"alert"},p("organizer.refreshError",{detail:H.refreshError})),H.remaining.length>0&&b(p("organizer.retry",{n:H.remaining.length}),{disabled:y,onClick:B})),q>0&&o("div",{className:"dsham_organizerControls"},b(p("organizer.undo",{n:q}),{disabled:y,onClick:le}),o("p",null,p("organizer.undoHint")))))},"OrganizerPanel")}e(ea,"createOrganizerPanel");var ta={"organizer.cacheTitle":"\u53D1\u73B0 {n} \u4E2A\u4F1A\u8BDD\u7F3A\u5C11\u53EF\u7528\u5217\u8868\u7F13\u5B58","organizer.cacheDesc":"\u68C0\u67E5\u5DE5\u4F5C\u533A\u3001\u672A\u5206\u7EC4\u53CA\u5F52\u6863\u666E\u901A\u4F1A\u8BDD\u7684\u5934\u90E8\u4E0E\u5B98\u65B9\u7F13\u5B58\u3002\u70B9\u51FB\u540E\u9010\u6761\u53EA\u8BFB\u65E5\u5FD7\u5E76\u91CD\u5EFA\u5B98\u65B9\u5217\u8868\u7F13\u5B58\uFF1B\u8DF3\u8FC7\u6D3B\u52A8\u4F1A\u8BDD\uFF0C\u4E0D\u6253\u5F00\u4F1A\u8BDD\u3001\u4E0D\u8C03\u7528\u6A21\u578B\uFF0C\u4E5F\u4E0D\u6539\u53D8\u5F52\u6863\u6216\u5B9A\u65F6\u4EFB\u52A1\u3002\u8D85\u65F6\u8868\u793A\u4FDD\u5B58\u672A\u786E\u8BA4\uFF0C\u53EF\u91CD\u8BD5\u3002","organizer.cacheRebuild":"\u91CD\u5EFA\u5217\u8868\u7F13\u5B58","organizer.cacheRebuilding":"\u91CD\u5EFA\u4E2D\u2026","organizer.cacheRetry":"\u91CD\u8BD5\u5931\u8D25 {n} \u6761","organizer.cacheCheck":"\u5237\u65B0\u5217\u8868\u5E76\u91CD\u65B0\u68C0\u6D4B","organizer.cacheError":"\u7F13\u5B58\u68C0\u6D4B\u5931\u8D25\uFF1A{detail}","organizer.dismiss":"\u5B8C\u6210","organizer.feedback":"\u64CD\u4F5C\u53CD\u9988","organizer.allSessions":"\u5168\u90E8\u4F1A\u8BDD","organizer.favoriteFilter":"\u6536\u85CF\u7B5B\u9009","organizer.archiveResult":"\u5F52\u6863\u7ED3\u679C","organizer.restoreResult":"\u6062\u590D\u7ED3\u679C","organizer.deleteResult":"\u5220\u9664\u7ED3\u679C","organizer.undoResult":"\u64A4\u56DE\u7ED3\u679C","organizer.favorite":"\u6536\u85CF","organizer.unfavorite":"\u53D6\u6D88\u6536\u85CF","organizer.favoritesOnly":"\u53EA\u770B\u6536\u85CF","organizer.reloadFavorites":"\u91CD\u65B0\u52A0\u8F7D\u6536\u85CF","organizer.idleDays":"\u95F2\u7F6E\u5929\u6570","organizer.preview":"\u9884\u89C8\u95F2\u7F6E\u5F52\u6863\uFF08{n}\uFF09","organizer.rules":"\u6309\u6700\u540E\u6D3B\u52A8\u65F6\u95F4\u7B5B\u9009\uFF0C\u9075\u5FAA\u5F53\u524D\u5217\u8868\u7B5B\u9009\u6761\u4EF6\uFF1B\u6392\u9664\u6536\u85CF\u3001\u5F53\u524D\u6253\u5F00\u3001\u6B63\u5728\u6267\u884C\u53CA\u7B49\u5F85\u4EA4\u4E92\u7684\u4F1A\u8BDD\u3002","organizer.progress":"\u6279\u91CF\u64CD\u4F5C\u8FDB\u5EA6","organizer.progressCount":"\u5DF2\u5904\u7406 {done} / {total}","organizer.result":"\u6210\u529F {succeeded} \xB7 \u8DF3\u8FC7 {skipped} \xB7 \u5931\u8D25 {failed}","organizer.failureDetails":"\u67E5\u770B\u5931\u8D25\u8BE6\u60C5","organizer.refreshError":"\u64CD\u4F5C\u7ED3\u679C\u5DF2\u4FDD\u7559\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\uFF1A{detail}","organizer.retry":"\u91CD\u8BD5\u5269\u4F59 {n} \u6761","organizer.undo":"\u64A4\u56DE\u672C\u6B21\u5F52\u6863\uFF08{n}\uFF09","organizer.undoHint":"\u4EC5\u4FDD\u7559\u672C\u6B21\u6253\u5F00\u7BA1\u7406\u9875\u671F\u95F4\u6700\u8FD1\u4E00\u6279\u5F52\u6863\uFF1B\u5173\u95ED\u9875\u9762\u6216\u5237\u65B0\u540E\u6E05\u9664\u3002\u64A4\u56DE\u4E0D\u4F1A\u6062\u590D\u5DF2\u5220\u9664\u7684\u4F1A\u8BDD\u3002","organizer.idleConfirm":"\u8BF7\u68C0\u67E5\u4EE5\u4E0B\u5019\u9009\uFF0C\u53EF\u53D6\u6D88\u52FE\u9009\uFF1B\u6267\u884C\u524D\u518D\u6B21\u6392\u9664\u6536\u85CF\u53CA\u6D3B\u8DC3\u4F1A\u8BDD\u3002","organizer.manualConfirm":"\u4EC5\u5F52\u6863\u4EE5\u4E0B\u52FE\u9009\u4F1A\u8BDD\uFF1B\u53EF\u9010\u6761\u53D6\u6D88\u3002\u5F52\u6863\u540E\u53EF\u64A4\u56DE\u672C\u6279\u64CD\u4F5C\u3002","organizer.orphanTitle":"\u53D1\u73B0 {n} \u4E2A\u65E0\u4E3B\u5B64\u513F\u5B50\u4EE3\u7406","organizer.orphanDesc":"\u6BCD\u4F1A\u8BDD\u5DF2\u88AB\u5916\u90E8\u5220\u9664\uFF0C\u8FD9\u4E9B\u5B50\u4EE3\u7406\u5728\u65E5\u5E38\u804A\u5929\u5217\u8868\u4E2D\u4E0D\u53EF\u89C1\uFF0C\u5171\u5360\u7528\u7EA6 {size} \u78C1\u76D8\u7A7A\u95F4\u3002\u6E05\u7406\u4E0D\u53EF\u64A4\u9500\u3002","organizer.cleanOrphans":"\u6E05\u7406\u5168\u90E8\u5B64\u513F","organizer.cleaning":"\u6E05\u7406\u4E2D\u2026","organizer.orphanCleanSuccess":"\u5DF2\u6210\u529F\u6E05\u7406 {n} \u4E2A\u65E0\u4E3B\u5B50\u4EE3\u7406\u4F1A\u8BDD\u3002"},na={"organizer.cacheTitle":"Found {n} sessions without usable list caches","organizer.cacheDesc":"Checks headers and official caches for workspace, ungrouped, and archived ordinary sessions. On click, reads logs one at a time and rebuilds official caches. Skips active sessions; never opens sessions, calls models or changes archives or schedules. Timeout means persistence is unconfirmed and can be retried.","organizer.cacheRebuild":"Rebuild list caches","organizer.cacheRebuilding":"Rebuilding\u2026","organizer.cacheRetry":"Retry {n} failed","organizer.cacheCheck":"Refresh lists and check again","organizer.cacheError":"Cache check failed: {detail}","organizer.dismiss":"Done","organizer.feedback":"Operation feedback","organizer.allSessions":"All sessions","organizer.favoriteFilter":"Favorites filter","organizer.archiveResult":"Archive results","organizer.restoreResult":"Restore results","organizer.deleteResult":"Delete results","organizer.undoResult":"Undo results","organizer.favorite":"Favorite","organizer.unfavorite":"Unfavorite","organizer.favoritesOnly":"Favorites only","organizer.reloadFavorites":"Reload favorites","organizer.idleDays":"Idle days","organizer.preview":"Preview idle archives ({n})","organizer.rules":"Uses last activity, the current list filters. Excludes favorites, open, running and waiting sessions.","organizer.progress":"Batch progress","organizer.progressCount":"Processed {done} / {total}","organizer.result":"Succeeded {succeeded} \xB7 Skipped {skipped} \xB7 Failed {failed}","organizer.failureDetails":"Failure details","organizer.refreshError":"Results retained, but refresh failed: {detail}","organizer.retry":"Retry remaining {n}","organizer.undo":"Undo this archive batch ({n})","organizer.undoHint":"Only the latest archive batch while this page is open is retained. Closing or refreshing clears undo. Deleted sessions cannot be restored.","organizer.idleConfirm":"Review and deselect candidates. Favorites and active sessions are checked again before archiving.","organizer.manualConfirm":"Only checked sessions below will be archived. You can undo this batch afterward.","organizer.orphanTitle":"Found {n} orphan subagents","organizer.orphanDesc":"Parent sessions were deleted externally. These subagents are hidden from normal chat lists and occupy ~{size} disk space. Removal cannot be undone.","organizer.cleanOrphans":"Clean up all orphans","organizer.cleaning":"Cleaning up\u2026","organizer.orphanCleanSuccess":"Successfully cleaned up {n} orphan subagent sessions."},ra={"organizer.cacheTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u0441\u0435\u0441\u0441\u0438\u0439 \u0431\u0435\u0437 \u043F\u0440\u0438\u0433\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430 \u0441\u043F\u0438\u0441\u043A\u0430","organizer.cacheDesc":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0438 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u043A\u0435\u0448 \u0441\u0435\u0441\u0441\u0438\u0439 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043E\u0431\u043B\u0430\u0441\u0442\u0435\u0439, \u0431\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B \u0438 \u0430\u0440\u0445\u0438\u0432\u0430. \u041F\u043E \u043D\u0430\u0436\u0430\u0442\u0438\u044E \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u043F\u043E \u043E\u0434\u043D\u043E\u043C\u0443 \u0434\u043B\u044F \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430. \u0410\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u043F\u0443\u0441\u043A\u0430\u044E\u0442\u0441\u044F; \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u043C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u0430\u0440\u0445\u0438\u0432\u044B \u0438 \u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u044F \u043D\u0435 \u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F. \u0422\u0430\u0439\u043C-\u0430\u0443\u0442 \u043E\u0437\u043D\u0430\u0447\u0430\u0435\u0442 \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u043E\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435; \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u043F\u043E\u0432\u0442\u043E\u0440.","organizer.cacheRebuild":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043A\u0435\u0448 \u0441\u043F\u0438\u0441\u043A\u043E\u0432","organizer.cacheRebuilding":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u2026","organizer.cacheRetry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C {n} \u043E\u0448\u0438\u0431\u043E\u043A","organizer.cacheCheck":"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u0438 \u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C","organizer.cacheError":"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0435\u0448\u0430: {detail}","organizer.dismiss":"\u0413\u043E\u0442\u043E\u0432\u043E","organizer.feedback":"\u041E\u0442\u0437\u044B\u0432 \u043E\u0431 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.allSessions":"\u0412\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","organizer.favoriteFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.archiveResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438","organizer.restoreResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F","organizer.deleteResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F","organizer.undoResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043E\u0442\u043C\u0435\u043D\u044B","organizer.favorite":"\u0412 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.unfavorite":"\u0423\u0431\u0440\u0430\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.favoritesOnly":"\u0422\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.reloadFavorites":"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.idleDays":"\u0414\u043D\u0438 \u043F\u0440\u043E\u0441\u0442\u043E\u044F","organizer.preview":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 \u043F\u0440\u043E\u0441\u0442\u043E\u044F ({n})","organizer.rules":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C \u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0441\u043F\u0438\u0441\u043A\u0430. \u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435, \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u043D\u044B\u0435 \u0438 \u043E\u0436\u0438\u0434\u0430\u044E\u0449\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438.","organizer.progress":"\u0425\u043E\u0434 \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.progressCount":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {done} / {total}","organizer.result":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E {succeeded} \xB7 \u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E {skipped} \xB7 \u041E\u0448\u0438\u0431\u043E\u043A {failed}","organizer.failureDetails":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u043E\u0448\u0438\u0431\u043E\u043A","organizer.refreshError":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C: {detail}","organizer.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043E\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044F {n}","organizer.undo":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u044D\u0442\u0443 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044E ({n})","organizer.undoHint":"\u0421\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F, \u043F\u043E\u043A\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0430 \u044D\u0442\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430. \u0417\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u0438\u043B\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u0442 \u043E\u0442\u043C\u0435\u043D\u0443. \u0423\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u043B\u044C\u0437\u044F.","organizer.idleConfirm":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043A\u0430\u043D\u0434\u0438\u0434\u0430\u0442\u043E\u0432, \u043C\u043E\u0436\u043D\u043E \u0441\u043D\u044F\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443. \u041F\u0435\u0440\u0435\u0434 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0438 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E.","organizer.manualConfirm":"\u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435 \u043D\u0438\u0436\u0435 \u0441\u0435\u0441\u0441\u0438\u0438. \u042D\u0442\u0443 \u043F\u0430\u043A\u0435\u0442\u043D\u0443\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044E \u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0437\u0436\u0435.","organizer.orphanTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432","organizer.orphanDesc":"\u0420\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437\u0432\u043D\u0435. \u041F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u044B \u0441\u043A\u0440\u044B\u0442\u044B \u0438\u0437 \u043E\u0431\u044B\u0447\u043D\u044B\u0445 \u0441\u043F\u0438\u0441\u043A\u043E\u0432 \u0447\u0430\u0442\u043E\u0432 \u0438 \u0437\u0430\u043D\u0438\u043C\u0430\u044E\u0442 ~{size} \u0434\u0438\u0441\u043A\u043E\u0432\u043E\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430. \u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","organizer.cleanOrphans":"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435\u0445 \u0441\u0438\u0440\u043E\u0442","organizer.cleaning":"\u041E\u0447\u0438\u0441\u0442\u043A\u0430\u2026","organizer.orphanCleanSuccess":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432."};var dn=Function("return globalThis.__dshArchiveReactDOM")(),sa=Function("return globalThis.__dshArchiveReactDOMClient")(),aa=dn.createPortal,tl=dn.flushSync,nl=sa?.createRoot,rl=sa?.hydrateRoot,sl=dn.findDOMNode,al=dn.unmountComponentAtNode,il=dn.unstable_batchedUpdates,ol=dn.version;function ji(t){var s={exports:{}},o=s.exports;Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});let b=t("@deepseek-ai/dsh-client-store"),a=t("react/jsx-runtime"),l=t("react"),p=t("react-dom"),g=t("@deepseek-ai/dsh-client-ui-primitives");function y({open:n,onClose:r,title:i,description:d,footer:m,children:u,className:S,width:k,portalToBody:A=!1,closeLabel:P,t:I}){let R=l.useRef(null),F=l.useCallback(()=>R.current?.closest(".dsham_settings")??document.body,[]),[h,ge]=l.useState(null);l.useEffect(()=>{if(!n){ge(null);return}ge(A?typeof document<"u"?document.body:null:F())},[n,F,A]),l.useEffect(()=>{if(!n)return;let ot=e(Xe=>{Xe.key==="Escape"&&(Xe.preventDefault(),Xe.stopPropagation(),"stopImmediatePropagation"in Xe&&typeof Xe.stopImmediatePropagation=="function"&&Xe.stopImmediatePropagation(),r())},"onKey");return window.addEventListener("keydown",ot,!0),()=>window.removeEventListener("keydown",ot,!0)},[n,r]);let _e=P||I("common.close"),ce=(0,a.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,a.jsx)("div",{className:"dsham_modalMask",onClick:r}),(0,a.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof i=="string"?i:void 0,className:ua("dsham_modalDialog",S),style:{width:k??560},children:[(0,a.jsxs)("div",{className:"dsham_modalHeader",children:[(0,a.jsx)("h2",{title:typeof i=="string"?i:void 0,children:i}),(0,a.jsx)("button",{type:"button",className:"dsham_modalClose",onClick:r,"aria-label":_e,title:_e,children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),d!=null&&(0,a.jsx)("p",{children:d}),u!=null&&(0,a.jsx)("div",{className:"dsham_modalBody",children:u}),m!=null&&(0,a.jsx)("div",{className:"dsham_modalFooter",children:m})]})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(D,{refObject:R,getContainer:F}),n&&h?aa(ce,h):null]})}e(y,"SettingsModal");function D({refObject:n,getContainer:r}){return(0,a.jsx)("span",{hidden:!0,ref:n,"data-get-container":r})}e(D,"SettingsModalAnchor");function x({variant:n="outline",icon:r,children:i,className:d,disabled:m,title:u,onClick:S,"aria-label":k,"aria-pressed":A,"aria-expanded":P,"aria-haspopup":I}){return(0,a.jsx)(g.Button,{variant:n,size:"sm",className:d,disabled:m,title:u,onClick:S,"aria-label":k,"aria-pressed":A,"aria-expanded":P,"aria-haspopup":I,icon:r,children:i})}e(x,"settingsButton");function v({variant:n="outline",danger:r=!1,disabled:i,onClick:d,children:m}){return(0,a.jsx)(g.Button,{variant:r?"outline":n,className:r?"dsham_btnDanger":void 0,disabled:i,onClick:d,children:m})}e(v,"modalFooterButton");function C(n,r){let i={className:n?"dsham_archiveTabsLocked":void 0,children:r};return n&&(i.inert=""),i}e(C,"tabsShell");let M=ea(l,g.Button),{HighlightedText:N,useArchiveSearch:H,useArchivePreview:B,DiscoveryFilters:q,SearchStatus:le,PreviewContent:re}=Rs(l,{Button:g.Button,SegmentedControl:g.SegmentedControl}),se={refresh:["M13.5 5.5V2.5m0 0h-3m3 0-2.1 2.1A5.5 5.5 0 1 0 13.2 12"],download:["M8 2v8m0 0 3-3m-3 3-3-3M3 13v2h10v-2"],copy:["M5 5h8v8H5z","M3 3h8"],close:["m4 4 8 8M12 4 4 12"]};function de(n){let r=document.createElement("span"),i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("viewBox","0 0 16 16"),i.setAttribute("width","16"),i.setAttribute("height","16"),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.5"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("aria-hidden","true");for(let d of se[n]){let m=document.createElementNS("http://www.w3.org/2000/svg","path");m.setAttribute("d",d),i.append(m)}return r.append(i),r}e(de,"createPluginUpdateIcon");let ae={parse(n){if(typeof n!="string"||n.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(n)}`);return n}},Be={parse(n){let r=ne(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("result must be an object");let i=r.archivedSessionIds;if(!Array.isArray(i)||i.some(d=>typeof d!="string"))throw new TypeError("archivedSessionIds must be a string array");return r}},he={parse(n){let r=ne(n);if(typeof r!="object"||r===null||Array.isArray(r)||r.deleted!==!0)throw new TypeError("deleted must be true");return r}},V={parse(n){let r=ne(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("target must be an object");if(r.scope==="all"||r.scope==="ungrouped"||r.scope==="workspace"&&typeof r.workspaceId=="string"&&r.workspaceId.length>0||r.scope==="sessions"&&Array.isArray(r.sessionIds)&&r.sessionIds.length>0&&r.sessionIds.every(i=>typeof i=="string"&&i.length>0))return r;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},mt={parse(n){let r=ne(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("result must be an object");for(let i of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(r[i])||r[i].some(d=>typeof d!="string"))throw new TypeError(`${i} must be a string array`);if(!Array.isArray(r.failures)||r.failures.some(i=>typeof i!="object"||i===null||typeof i.sessionId!="string"||typeof i.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return r}},ft={parse(n){let r=ne(n);if(typeof r!="object"||r===null||Array.isArray(r)||!Array.isArray(r.items))throw new TypeError("result.items must be an array");if(r.items.some(i=>typeof i!="object"||i===null||typeof i.sessionId!="string"||typeof i.createdAt!="number"||!Number.isFinite(i.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");return r}},yt={parse(n){let r=ne(n);if(!r||typeof r.sessionId!="string"||!r.sessionId||typeof r.targetWorkspaceId!="string"||!r.targetWorkspaceId)throw new TypeError("sessionId and targetWorkspaceId must be non-empty strings");return{sessionId:r.sessionId,targetWorkspaceId:r.targetWorkspaceId}}},xt={parse(n){let r=ne(n);if(!r||r.ok!==!0)throw new TypeError("session move result must be ok: true");return r}};function ze(n,r){return{mode:"strict",typeSymbol:n,create:e(()=>r,"create"),schema:r}}e(ze,"strictCodec");let It={package:"@michengai/dsh-archive-manager",descriptors:[...Xs(),...As(),...Os(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:ze("@deepseek-ai/dsh-session/types#SessionId",ae)}],result:ze("@michengai/dsh-archive-manager/types#ArchivedSessionIds",Be),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:ze("@deepseek-ai/dsh-session/types#SessionId",ae)}],result:ze("@michengai/dsh-archive-manager/types#Deleted",he),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteArchivedSessions",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteArchivedSessions",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",codec:ze("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",V)}],result:ze("@michengai/dsh-archive-manager/types#DeletedBatch",mt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/archivedSessionMetadata",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"archivedSessionMetadata",invocation:{kind:"direct"},parameters:[],result:ze("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",ft),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/diagnoseOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"diagnoseOrphanSubagents",invocation:{kind:"direct"},parameters:[],result:ze("@michengai/dsh-archive-manager/types#OrphanSubagentDiagnosis",{parse(n){let r=ne(n);if(!r||typeof r.count!="number"||!Array.isArray(r.items)||typeof r.totalSizeBytes!="number")throw new TypeError("invalid orphan subagent diagnosis");return r}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/cleanOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"cleanOrphanSubagents",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",acceptsUndefined:!0,codec:ze("@michengai/dsh-archive-manager/types#CleanOrphanTarget",{parse(n){if(n==null)return{};let r=ne(n);if(!r)throw new TypeError("target must be an object");if(r.sessionIds!==void 0&&(!Array.isArray(r.sessionIds)||r.sessionIds.some(i=>typeof i!="string")))throw new TypeError("sessionIds must be an array of strings");return r}})}],result:ze("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let r=ne(n);if(!r||!Array.isArray(r.cleanedSessionIds)||!Array.isArray(r.skippedSessionIds)||!Array.isArray(r.failures))throw new TypeError("invalid orphan subagent clean result");return r}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/moveSessionToWorkspace",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"moveSessionToWorkspace",invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:ze("@michengai/dsh-archive-manager/types#SessionMoveInput",yt)}],result:ze("@michengai/dsh-archive-manager/types#SessionMoveResult",xt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]};function L(n,r){if(typeof document>"u"||document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")!==null)return;let i=document.createElement("style");i.dataset.plugin="@michengai/dsh-archive-manager",i.dataset.pluginCss=n,i.textContent=r,document.head.appendChild(i)}e(L,"ensurePluginStyle");function Ee(n){if(typeof document>"u")return;document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")?.remove()}e(Ee,"removePluginStyle"),L("dsh-archive-manager/DangerButton.css",".dsham_btnDanger:not(:disabled){color:var(--dsw-alias-state-error-primary,#ef7272);border-color:var(--dsw-alias-state-error-primary,#ef7272)}"),L("dsh-archive-manager/IconAction.css",".dsham_iconAction{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:22px!important;min-width:22px!important;height:22px!important;padding:0!important;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px)!important;background:transparent;color:var(--dsw-alias-label-secondary)}.dsham_iconAction:not(:disabled):hover{color:var(--dsw-alias-link,#4176e6)!important;border-color:var(--dsw-alias-link,#4176e6)!important}.dsham_iconAction.dsham_iconDanger{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction.dsham_iconDanger:not(:disabled):hover{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction svg{width:16px!important;height:16px!important;flex:none!important}"),L("dsh-archive-manager/Modal.css",".dsham_modalRoot{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.dsham_modalMask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1,rgb(0 0 0 / 45%));backdrop-filter:var(--dsw-mask-blur,blur(16px));-webkit-backdrop-filter:var(--dsw-mask-blur,blur(16px))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;box-sizing:border-box;max-width:calc(100vw - 48px);max-height:min(85vh,760px);padding:22px 24px 20px;overflow:hidden;border:1px solid var(--dsw-alias-border-l1,rgba(128,128,128,.2));border-radius:var(--dsw-radius-panel,28px);background-color:var(--dsw-alias-surface-overlay,var(--dsw-alias-bg-base,Canvas));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-surface-overlay,Canvas));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}.dsham_modalHeader h2,.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.dsham_modalClose{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:28px;height:28px;padding:0;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;flex:none;transition:background-color .15s ease,color .15s ease}.dsham_modalClose:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.dsham_modalClose svg{display:block;width:14px;height:14px}.dsham_modalDialog>p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.dsham_modalBody{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}.dsham_modalFooter{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:8px}.dsham_modalWide{width:min(900px,calc(100vw - 48px))!important;max-height:min(88vh,820px)!important}.dsham_modalWide .dsham_modalBody{overflow:hidden}.dsham_modalWide .dsham_previewMessages{max-height:none;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}"),L("dsh-archive-manager/SidebarPopover.css",".dsham_sidebarCardRoot{position:fixed;inset:0;z-index:1200;pointer-events:none}.dsham_sidebarCardBackdrop{position:fixed;inset:0;pointer-events:auto;background:transparent}.dsham_sidebarCard{position:fixed;pointer-events:auto;box-sizing:border-box;width:290px;max-height:calc(100vh - 32px);overflow-y:auto;padding:16px 18px 14px;border-radius:var(--dsw-radius-lg,14px);background:var(--dsw-menu-surface-fill);backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:none;box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:8px}.dsham_sidebarCardTitle{margin:0;font-size:14px;font-weight:600;line-height:20px;color:var(--dsw-alias-label-primary)}.dsham_sidebarCardDesc{margin:0;font-size:13px;line-height:18px;color:var(--dsw-alias-label-secondary)}.dsham_sidebarCardError{margin-top:2px;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef7272);white-space:pre-line}.dsham_sidebarCardFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.dsham_sidebarCardBtn{border:none;background:transparent;padding:5px 12px;border-radius:var(--dsw-radius-sm,6px);font:inherit;font-size:13px;font-weight:500;line-height:18px;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.dsham_sidebarCardBtnCancel{color:var(--dsw-alias-label-primary)}.dsham_sidebarCardBtnCancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.dsham_sidebarCardBtnDanger{color:var(--dsw-alias-state-error-primary,#ef7272)}.dsham_sidebarCardBtnDanger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger,#f25a5a26)}.dsham_sidebarCardBtn:disabled{opacity:.4;cursor:default}"),L("dsh-archive-manager/MoveSubmenu.css",".dsham_moveSessionWrap{position:relative}.dsham_moveSubmenu{position:fixed;z-index:99999;min-width:160px;max-width:260px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.25) transparent;background:var(--dsw-menu-surface-fill,var(--dsw-alias-surface-overlay,#1e1e22));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,0.12));border-radius:var(--dsw-radius-md,8px);box-shadow:var(--dsw-elevation-prominent,0 6px 20px rgba(0,0,0,0.45));padding:4px;display:flex;flex-direction:column;gap:2px}.dsham_moveSubmenu::-webkit-scrollbar{width:6px}.dsham_moveSubmenu::-webkit-scrollbar-track{background:transparent}.dsham_moveSubmenu::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.2);border-radius:3px}.dsham_moveSubmenu::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.35)}.dsham_moveSubmenuBtn{display:flex;align-items:center;width:100%;padding:6px 10px;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-primary,#ededed);font:inherit;font-size:13px;line-height:20px;text-align:left;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background-color .12s ease}.dsham_moveSubmenuBtn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,0.08))}.dsham_moveSubmenuBtn:focus-visible:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,0.08));outline:none}");let Ve="M8 1.75l1.934 3.918 4.324.628-3.129 3.05.738 4.306L8 11.618l-3.867 2.034.738-4.306-3.129-3.05 4.324-.628L8 1.75z";function Kt(n){return n?'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="'+Ve+'"/></svg>':'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round" aria-hidden="true"><path d="'+Ve+'"/></svg>'}e(Kt,"starSvg");function cn(n){return!!n?.querySelector("[data-state]")}e(cn,"resolveRowHasStatus");let Rn="[data-row-key^='session:']{position:relative}.dsham_starSlot{display:none;position:absolute;left:calc(8px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(8px + var(--dsh-workspace-indent,0px));top:50%;transform:translateY(-50%);align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:20px;z-index:1;pointer-events:none}[data-row-key^='session:']:hover .dsham_starSlot,.dsham_starSlot[data-favorited='true']{display:inline-flex;pointer-events:auto}[data-row-key^='session:']:hover>span:first-child:not(:has([data-state])),[data-row-key^='session:'][data-dsham-favorited='true']:not([data-dsham-has-status='true'])>span:first-child:not(:has([data-state])){opacity:0}[data-row-key^='session:'][data-dsham-has-status='true']>span:first-child,[data-row-key^='session:']>span:first-child:has([data-state]){opacity:1}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_starSlot,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_starSlot{width:10px;height:10px;top:auto;bottom:3px;left:calc(15px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(15px + var(--dsh-workspace-indent,0px));transform:none}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar{width:10px;height:10px}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar svg,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar svg{width:10px;height:10px;filter:drop-shadow(0 0 1px rgba(0,0,0,0.85))}.dsham_rowStar{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);cursor:pointer;flex:none;border-radius:var(--dsw-radius-xs,4px)}.dsham_starSlot[data-favorited='true'] .dsham_rowStar{color:#e8b931}.dsham_rowStar svg{display:block;width:16px;height:16px;flex:none}";L("dsh-archive-manager/RowFavorite.css",Rn);let zt="dsh-archive-manager:workspace-favorites-only",Ot="data-dsham-favorites-hidden",X="data-dsham-favorites-only",Le="dsham_rowStar",at="dsham_starSlot",un=["\u4EC5\u663E\u793A\u5DF2\u5F52\u6863","Archived only","\u0422\u043E\u043B\u044C\u043A\u043E \u0430\u0440\u0445\u0438\u0432\u043D\u044B\u0435"];L("dsh-archive-manager/FavoritesFilter.css",`[data-dsham-favorites-hidden='true']{display:none!important}button[data-dsham-favorites-only='true'][data-active='true']::after{content:"\\2713";margin-left:auto;padding-left:12px;font-size:12px;line-height:1;color:var(--dsw-alias-state-business-primary,#3b82f6)}`);function ia(){try{return window.localStorage.getItem(zt)==="1"}catch{return!1}}e(ia,"readWorkspaceFavoritesOnly");function oa(n){try{window.localStorage.setItem(zt,n?"1":"0")}catch{}}e(oa,"writeWorkspaceFavoritesOnly");function Er(n,r){let i=e(u=>r.favorites.has(u)||r.sessions?.[u]?.blank===!0,"visibleSession"),d=new Map,m=null;for(let u of n){if(u.startsWith("workspace:")){m=u,d.set(u,!1);continue}u.startsWith("session:")&&m!==null&&i(u.slice(8))&&d.set(m,!0)}return n.map(u=>u.startsWith("session:")?i(u.slice(8)):u.startsWith("workspace:")?d.get(u)===!0||r.groupHasFavorite?.(u.slice(10))===!0:!u.startsWith("overflow:"))}e(Er,"favoritesOnlyVisibility");function Ar(n,r){let i=new Map,d=new Set;for(let u of r){let S=!1;for(let k of u.sessionIds)d.add(k),n.has(k)&&(S=!0);i.set(u.workspaceId,S)}let m=!1;for(let u of n)if(!d.has(u)){m=!0;break}return u=>u===""||u==="ungrouped"?m:i.get(u)===!0}e(Ar,"favoriteGroupPredicate");function Ir(n,r,i,d){let m={dispose:e(()=>{},"dispose"),setFavoriteStarEnabled:e(W=>{},"setFavoriteStarEnabled"),isFavoriteStarEnabled:e(()=>!0,"isFavoriteStarEnabled")};if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return m;let u=ia(),S=typeof d=="function"?d():!0,k=!1,A=!1,P=e(()=>{S?L("dsh-archive-manager/RowFavorite.css",Rn):Ee("dsh-archive-manager/RowFavorite.css")},"updateStarStyle");P();let I=e(W=>{let De=W;typeof De?.detail?.enabled=="boolean"?S=De.detail.enabled:typeof d=="function"&&(S=d()),P(),Ye()},"onStarToggle");typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("dsham-favorite-star-toggle",I);let R=0,F=200,h=null,ge=new Set,_e=e(W=>{if(!S){for(let J of W)Array.from(J.children).find(Ue=>Ue.classList.contains(at))?.remove(),J.removeAttribute("data-dsham-favorited"),J.removeAttribute("data-dsham-has-status");return}let De=r.getSnapshot();for(let J of W){let K=J.getAttribute("data-row-key")??"";if(!K.startsWith("session:"))continue;let Ue=K.slice(8),rt=Array.from(J.children).find(Qe=>Qe.tagName==="SPAN"&&Array.from(Qe.classList).some(Tt=>Tt==="slot"||Tt.endsWith("_slot")))??null;if(rt===null){J.removeAttribute("data-dsham-has-status");continue}let O=Array.from(J.children).find(Qe=>Qe.classList.contains(at))??null;if(!De.ready){O?.remove(),J.removeAttribute("data-dsham-favorited"),J.removeAttribute("data-dsham-has-status");continue}O!==null&&(O.parentElement!==J||O.nextElementSibling!==null)&&J.appendChild(O),O===null&&(O=document.createElement("span"),O.className=at,J.appendChild(O)),O.dataset.sessionId=Ue,cn(rt)?J.setAttribute("data-dsham-has-status","true"):J.removeAttribute("data-dsham-has-status");let Ae=O.querySelector("."+Le);Ae===null&&(Ae=document.createElement("button"),Ae.type="button",Ae.className=Le,Ae.addEventListener("click",Qe=>{Qe.preventDefault(),Qe.stopPropagation(),r.toggle(O?.dataset.sessionId??"")}),O.appendChild(Ae));let Ze=De.ids.has(Ue);if(Ze?J.setAttribute("data-dsham-favorited","true"):J.removeAttribute("data-dsham-favorited"),O.dataset.favorited===String(Ze))continue;let dt=i()(Ze?"organizer.unfavorite":"organizer.favorite");O.dataset.favorited=String(Ze),Ae.setAttribute("aria-pressed",String(Ze)),Ae.setAttribute("aria-label",dt),Ae.title=dt,Ae.innerHTML=Kt(Ze)}},"ensureRowStars"),ce=e(W=>{let De=r.getSnapshot();if(!u||!De.ready){for(let O of W)O.hasAttribute(Ot)&&O.removeAttribute(Ot);R=0,h=null,ge.clear();return}let J=W.map(O=>O.getAttribute("data-row-key")??""),K=Ar(De.ids,n.workspaces.list?.getSnapshot?.()?.items??[]),Ue=Er(J,{favorites:De.ids,sessions:n.sessions.list?.getSnapshot?.()?.byId,groupHasFavorite:K});h!==null&&(W.length<=h.rows&&ge.add(h.key),h=null);let rt=!1;if(R<F)for(let O=0;O<W.length;O+=1){let Re=W[O],Ae=J[O];if(!Ae.startsWith("overflow:")||Re.getAttribute("aria-expanded")!=="false")continue;let Ze=Ae.slice(9);if(!(ge.has(Ze)||!K(Ze))){try{Re.click(),R+=1,h={key:Ze,rows:W.length},rt=!0}catch(dt){console.warn("archive-manager: favorites-only expand failed",dt)}break}}for(let O=0;O<W.length;O+=1){let Re=W[O];Ue[O]?Re.hasAttribute(Ot)&&Re.removeAttribute(Ot):Re.setAttribute(Ot,"true")}rt&&Ye()},"applyVisibility"),ot=e(W=>{let De=W.parentElement;if(De===null)return null;let J=De.cloneNode(!0),K=J.querySelector('button[role="menuitem"]');if(K===null)return null;let Ue=Array.from(K.querySelectorAll("span")),rt=Ue[0]??null,O=Ue[Ue.length-1]??null;rt!==null&&(rt.innerHTML=Kt(!1)),O!==null&&(O.textContent=i()("organizer.favoritesOnly"));for(let Re of Array.from(K.querySelectorAll("svg")))Re.closest("span")===null&&Re.remove();return K.setAttribute(X,"true"),K.setAttribute("role","menuitemcheckbox"),K.dataset.active=String(u),K.setAttribute("aria-checked",String(u)),K.setAttribute("aria-label",i()("organizer.favoritesOnly")),K.onclick=Re=>{Re.preventDefault(),Re.stopPropagation(),ee(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0}))},J},"buildMenuRow"),Xe=e(()=>{if(!k){for(let W of Array.from(document.querySelectorAll("button["+X+"]")))W.dataset.active=String(u),W.setAttribute("aria-checked",String(u));for(let W of Array.from(document.querySelectorAll('[role="menu"]'))){let De=Array.from(W.querySelectorAll('button[role="menuitem"]')).find(Ue=>un.some(rt=>(Ue.textContent??"").includes(rt)));if(De===void 0||W.querySelector("["+X+"]")!==null)continue;let J=De.parentElement;if(J===null)continue;let K=ot(De);K!==null&&J.parentElement?.insertBefore(K,J.nextSibling)}}},"injectMenuRows"),Ye=e(()=>{if(A||k)return;A=!0;let W=e(()=>{if(A=!1,k)return;let De=Array.from(document.querySelectorAll("[data-row-key]"));Xe(),_e(De),ce(De),r.getSnapshot().ready||en()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(W):setTimeout(W,16)},"schedulePass"),ee=e(()=>{u=!u,nt=20,R=0,h=null,ge.clear(),oa(u),Ye()},"toggle"),pe=null,nt=20,en=e(()=>{pe!==null||k||nt<=0||(nt-=1,pe=setTimeout(()=>{pe=null,r.ensure(),Ye()},600))},"scheduleRetry"),wt=new MutationObserver(W=>{On(W,'[data-row-key], [role="menu"]')&&Ye()});wt.observe(document.body,{childList:!0,subtree:!0}),r.ensure().catch(()=>{});let Ct=[r.subscribe(()=>Ye()),typeof n.sessions.list?.subscribe=="function"?n.sessions.list.subscribe(()=>Ye()):null,typeof n.workspaces.list?.subscribe=="function"?n.workspaces.list.subscribe(()=>Ye()):null].filter(W=>typeof W=="function");return Ye(),{dispose(){k=!0,typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("dsham-favorite-star-toggle",I),wt.disconnect();for(let W of Ct)W();for(let W of Array.from(document.querySelectorAll("["+Ot+"]")))W.removeAttribute(Ot);for(let W of Array.from(document.querySelectorAll("["+X+"]")))W.parentElement?.remove();for(let W of Array.from(document.querySelectorAll("."+at)))W.remove();for(let W of Array.from(document.querySelectorAll("[data-dsham-favorited]")))W.removeAttribute("data-dsham-favorited");for(let W of Array.from(document.querySelectorAll("[data-dsham-has-status]")))W.removeAttribute("data-dsham-has-status");pe!==null&&(clearTimeout(pe),pe=null)},setFavoriteStarEnabled(W){S=W,P(),Ye()},isFavoriteStarEnabled:e(()=>S,"isFavoriteStarEnabled")}}e(Ir,"setupWorkspaceFavoritesOnly");function Tr(){let n,r={ready:!1,ids:new Set,pending:new Set},i,d=0,m=new Set,u=e(k=>{r=k;for(let A of m)try{A()}catch(P){console.warn("archive-manager: favorite listener failed",P)}},"publish"),S=e((k,A)=>{let P=new Set(k);for(let h of r.pending)h!==A&&(r.ids.has(h)?P.add(h):P.delete(h));let I=new Set(r.pending);A!==void 0?I.delete(A):r.pending.size===0&&I.clear();let R=r.ids.size===P.size&&[...P].every(h=>r.ids.has(h)),F=r.pending.size===I.size&&[...I].every(h=>r.pending.has(h));R&&F&&r.ready||u({ready:!0,ids:P,pending:I})},"adopt");return{bind(k){n=k},subscribe(k){return m.add(k),()=>{m.delete(k)}},getSnapshot:e(()=>r,"getSnapshot"),adopt:e(k=>S(k),"adopt"),ensure(){return n===void 0||r.ready?Promise.resolve():i!==void 0?i:Date.now()<d?Promise.resolve():(i=n.favoriteSessions().then(k=>{S(k.favoriteSessionIds)}).catch(k=>{console.warn("archive-manager: load favorites failed, will retry",k),d=Date.now()+600}).finally(()=>{i=void 0}),i)},async toggle(k){if(n===void 0||!r.ready||r.pending.has(k))return;let A=r.ids.has(k),P=!A,I=new Set(r.ids);P?I.add(k):I.delete(k);let R=new Set(r.pending);R.add(k),u({ready:!0,ids:I,pending:R});try{let F=await n.setSessionFavorite({sessionId:k,favorite:P});if(!Array.isArray(F?.favoriteSessionIds))throw new TypeError("favorite response is missing favoriteSessionIds");S(F.favoriteSessionIds,k)}catch(F){console.warn("archive-manager: sidebar favorite toggle failed",F);let h=new Set(r.ids);A?h.add(k):h.delete(k);let ge=new Set(r.pending);ge.delete(k),u({ready:!0,ids:h,pending:ge})}}}}e(Tr,"createFavoriteRowStore");function Nn(n){let r=new Map;for(let i of Object.values(n)){if(i.origin!=="subagent")continue;let d=new Set,m=i;for(;m?.origin==="subagent"&&m.parentId!==void 0&&!d.has(m.id);){d.add(m.id);let u=r.get(m.parentId);u===void 0?r.set(m.parentId,{count:1,runningCount:i.running?1:0}):(u.count+=1,i.running&&(u.runningCount+=1)),m=n[m.parentId]}}return r}e(Nn,"indexSubagentDescendants");let zi="__flat_session_order__",jn="dsh.archive-manager.workspace.view.v1",_r="dsh.workspace.view.v5";function Rr(n){let r=n??globalThis.localStorage;if(r==null||typeof r.getItem!="function"||typeof r.setItem!="function")return!1;try{if(r.getItem(jn)!=null)return!1;let i=r.getItem(_r);return i==null?!1:(r.setItem(jn,i),!0)}catch{return!1}}e(Rr,"migrateWorkspaceViewPersist");function la(){return Rr(),(0,b.defineStore)({init:e(()=>({groupBy:"workspace",orderBy:"updated",showArchived:!1,groupExpansion:{},sessionOrderByAccount:{},sessionUpdatedAtByAccount:{}}),"init"),persist:jn,actions:{setGroupBy:e((n,r)=>{n.groupBy=r},"setGroupBy"),setOrderBy:e((n,r)=>{n.orderBy=r},"setOrderBy"),setShowArchived:e((n,r)=>{n.showArchived=r===!0},"setShowArchived"),setGroupExpanded:e((n,r,i)=>{n.groupExpansion[r]=i},"setGroupExpanded"),retainAccountKeys:e((n,r)=>{let i=new Set(r);n.groupExpansion=Object.fromEntries(Object.entries(n.groupExpansion).filter(([d])=>i.has(d))),n.sessionOrderByAccount=Object.fromEntries(Object.entries(n.sessionOrderByAccount).filter(([d])=>i.has(d))),n.sessionUpdatedAtByAccount=Object.fromEntries(Object.entries(n.sessionUpdatedAtByAccount).filter(([d])=>i.has(d)))},"retainAccountKeys"),syncSessionOrderAccount:e((n,r,i,d)=>{n.sessionOrderByAccount[r]=i,n.sessionUpdatedAtByAccount[r]=d},"syncSessionOrderAccount"),setSessionOrder:e((n,r,i)=>{n.sessionOrderByAccount[r]=i},"setSessionOrder")}})}e(la,"createWorkspaceViewStore");function da(){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,a.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z"})})}e(da,"GithubMark16");function ca(){let n=g.IconEditOutlineRegular;return(0,a.jsx)(n,{size:16})}e(ca,"FeedbackIcon");function Gn({archiveSessions:n,archiveSession:r,sessionStore:i,workspaceStore:d,unarchiveSession:m,deleteSession:u,unarchiveSessions:S,deleteArchivedSessions:k,archivedSessionMetadata:A,openConversation:P,focusSessionWorkspace:I,viewState:R,close:F,t:h,diagnoseOrphanSubagents:ge,cleanOrphanSubagents:_e,diagnoseSessionCaches:ce,rebuildSessionCaches:ot,refreshCacheLists:Xe,searchSessionContent:Ye,searchArchivedContent:ee,previewArchivedSession:pe,favoriteSessions:nt,setSessionFavorite:en,favoriteSync:wt,organizeBatch:Ct,useSessionPendingInteraction:W,useSessionStatus:De}){let J=(0,l.useSyncExternalStore)(i.subscribe,i.getSnapshot),K=(0,l.useSyncExternalStore)(d.subscribe,d.getSnapshot),[Ue,rt]=(0,l.useState)("archived"),O=Ue==="archived",[Re,Ae]=(0,l.useState)(null),[Ze,dt]=(0,l.useState)(null),[Qe,Tt]=(0,l.useState)(null),Lt=e((c,E=null)=>{G(null),$e(null),xe(!1),dt(E),Ae(c)},"requestArchive"),Yt=e(()=>{Z||(Ae(null),dt(null),G(null))},"closeArchive"),Et=(0,l.useRef)(!1),[Ne,Ut]=(0,l.useState)(null),mn=(0,l.useRef)(!1),[Z,Ge]=(0,l.useState)(!1),[St,G]=(0,l.useState)(null),[Ln,$e]=(0,l.useState)(null),tn=e(c=>{G(null),$e(null),Ut(c)},"requestDelete"),[_t,fn]=(0,l.useState)(R?.query??""),[pt,Ht]=(0,l.useState)(R?.project??"all"),[Rt,gn]=(0,l.useState)(R?.sortBy??"updated"),[vn,bn]=(0,l.useState)({}),[Wt,yn]=(0,l.useState)(()=>new Set),Nt=(0,l.useRef)(new Set),[gt,vt]=(0,l.useState)([]),[f,w]=(0,l.useState)([]),[T,$]=(0,l.useState)(!1),[Ie,ue]=(0,l.useState)(!1),Me=(0,l.useRef)(!1),[je,ve]=(0,l.useState)(!1),[He,et]=l.useState("content"),[ct,bt]=l.useState(""),[te,ie]=l.useState(""),[z,oe]=(0,l.useState)(()=>new Set),[Te,ke]=(0,l.useState)("30"),[tt,xe]=(0,l.useState)(!1),[be,ye]=(0,l.useState)(null),[Ce,Q]=(0,l.useState)(null),[Oe,kt]=(0,l.useState)([]),Pe=(0,l.useRef)(!1),st=(0,l.useRef)(null),me=wa(W??va,De??ba,typeof De=="function"),Ft=(0,l.useRef)(me.pending);Ft.current=me.pending;let ut=(0,l.useMemo)(()=>new Set(f),[f]),nn=e(async()=>{if(nt)try{let c=await nt();w(c.favoriteSessionIds),$(!0),wt?.adopt(c.favoriteSessionIds)}catch(c){$(!1),G(qe(c))}},"loadFavorites");(0,l.useEffect)(()=>{let c=!0;return nt&&nt().then(E=>{c&&(w(E.favoriteSessionIds),$(!0),wt?.adopt(E.favoriteSessionIds))}).catch(E=>{c&&G(qe(E))}),()=>{c=!1}},[nt]),(0,l.useEffect)(()=>{if(wt)return wt.subscribe(()=>{let c=wt.getSnapshot();c.ready&&(w([...c.ids]),$(!0))})},[wt]);let wn=e(async c=>{if(!(Me.current||Z||!T)){Me.current=!0,ue(!0),G(null);try{let E=await en({sessionId:c,favorite:!ut.has(c)});w(E.favoriteSessionIds),wt?.adopt(E.favoriteSessionIds)}catch(E){G(qe(E))}finally{Me.current=!1,ue(!1)}}},"toggleFavorite"),We=e(async(c,E,{idle:Y=!1,retry:we=!1}={})=>{if(!(Pe.current||Me.current||Nt.current.size>0||!Ct)){Pe.current=!0,Ge(!0),G(null),$e(null),Q(null),c==="archive"&&!we&&kt([]);try{let j=await Ct(c,E,{idleDays:Y?Number(Te):void 0,getPending:e(()=>Ft.current,"getPending"),onProgress:e(Se=>{ye(Se),c==="archive"&&Se.total>0&&Se.done>=Se.total&&(Ae(null),dt(null),xe(!1))},"onProgress")});return Q({...j,kind:c,tab:Ue}),st.current=j.remaining.length?{kind:c,ids:j.remaining,idle:Y}:null,c==="archive"&&kt(Se=>[...new Set([...Se,...j.succeeded])]),(c==="undo"||c==="restore"||c==="delete")&&kt(Se=>Se.filter(ht=>!j.succeeded.includes(ht)&&!j.skipped.includes(ht))),vt(Se=>Se.filter(ht=>!j.succeeded.includes(ht)&&!j.skipped.includes(ht))),c==="delete"&&w(Se=>Se.filter(ht=>!j.succeeded.includes(ht))),j}catch(j){G(qe(j))}finally{Pe.current=!1,Ge(!1),ye(null)}}},"executeBatch"),[lt,rn]=(0,l.useState)(null),[sn,Sn]=(0,l.useState)({diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null}),Fe=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!ce||!ot||!Xe)return;let c=Ps({diagnose:ce,rebuild:ot,refresh:Xe});Fe.current=c;let E=c.subscribe(()=>{Sn(c.snapshot())});return c.load(),()=>{E(),c.dispose(),Fe.current=null}},[ce,ot,Xe]),(0,l.useEffect)(()=>{Fe.current?.snapshot().busy||Fe.current?.load()},[K.archivedSessionIds]);let Zt=e(async(c=!1)=>{if(!(Z||Pe.current||!Fe.current||Fe.current.snapshot().busy)){Pe.current=!0,Ge(!0);try{await Fe.current.run(c)}finally{Pe.current=!1,jt.current&&Ge(!1)}}},"runCacheRebuild"),[an,qt]=(0,l.useState)(!1),Jt=e(()=>{typeof ge=="function"&&ge().then(rn).catch(c=>{console.warn("archive-manager: diagnose orphan subagents failed",c)})},"loadOrphans");(0,l.useEffect)(()=>{Jt()},[K.archivedSessionIds]);let Ua=e(async()=>{if(!(an||typeof _e!="function")){qt(!0),G(null),$e(null);try{let c=await _e({});(c.cleanedSessionIds.length>0||c.skippedSessionIds.length>0)&&Jt(),c.failures.length>0?($e(null),G(Mn(c.failures,h))):c.cleanedSessionIds.length>0&&(G(null),$e(h("organizer.orphanCleanSuccess",{n:c.cleanedSessionIds.length})))}catch(c){G(qe(c))}finally{qt(!1)}}},"cleanOrphans"),jt=(0,l.useRef)(!0),ir=(0,l.useRef)(!1);(0,l.useEffect)(()=>(jt.current=!0,()=>{jt.current=!1}),[]);let Fn=e(async(c,E=!1)=>{if(Z||ir.current)return;ir.current=!0,Ge(!0),G(null);let Y=!1;try{await Fs({prepare:E?async we=>{await I?.(we)}:void 0,restore:e(async we=>{await m(we),Y=!0},"restore"),open:e(async we=>{await P(we),jt.current&&F?.()},"open")},c.id,E,()=>jt.current)}catch(we){if(!jt.current)return;if(Y){rt("unarchived");let j=Vt.find(Se=>Se.sessions.some(ht=>ht.id===c.id));j!==void 0&&Ht(j.key)}G(Ls(we,h))}finally{ir.current=!1,jt.current&&Ge(!1)}},"viewConversation");(0,l.useEffect)(()=>{R&&Object.assign(R,{query:_t,project:pt,sortBy:Rt})},[_t,pt,Rt,R]);let Bn=(0,l.useMemo)(()=>O?K.archivedSessionIds:es(J.byId,K.archivedSessionIds),[O,J.byId,K.archivedSessionIds]),Vt=(0,l.useMemo)(()=>ts(J.byId,K.items,Bn,h("group.ungrouped")),[J.byId,K,Bn,h]),Ha=e(c=>{Z||Nt.current.size>0||(At.close(),rt(c),vt([]),Ae(null),dt(null),G(null),$e(null),Ht("all"),fn(""),c!=="archived"&&Rt==="archived"&&gn("updated"))},"switchTab"),os=e(async(c,E=!1)=>{if(!(Et.current||Z||!c?.length)){if(Ct){Et.current=!0;try{let Y=await We("archive",c,{idle:E}),we=Y?.failures.map(j=>zr(j.sessionId,j.message)).find(j=>j!==void 0);if(we!==void 0&&typeof r=="function"){let j=J.byId[we.sessionId];Tt({sessionId:we.sessionId,title:j===void 0?we.sessionId:it(j,h),kinds:we.kinds.join(", ")}),Ae(null),dt(null),G(null);return}Y&&(Ae(null),dt(null),xe(!1))}finally{Et.current=!1}return}Et.current=!0,Ge(!0),G(null),$e(null);try{let Y=await n(c);Ae(null),dt(null),Y.archivedSessionIdsAdded.length>0&&$e(h("archives.archiveSuccess",{n:Y.archivedSessionIdsAdded.length})),Y.failures&&Y.failures.length>0?G(Mn(Y.failures,h)):(vt([]),rt("archived"),Ht("all"),fn(""))}catch(Y){let we=Mr(Y);if(we!==void 0&&typeof r=="function"){let j=J.byId[we.sessionId];Tt({sessionId:we.sessionId,title:j===void 0?we.sessionId:it(j,h),kinds:we.kinds.join(", ")}),Ae(null),dt(null),G(null)}else{let j=zn(Y);G(j===void 0?h("archives.archiveBatchFailed",{detail:Y instanceof Error?Y.message:String(Y)}):h("archives.archiveActive",{kinds:j.join(", ")}))}}finally{Et.current=!1,Ge(!1)}}},"performArchive"),Wa=e(()=>os(Re,tt),"confirmArchive"),qa=e(async c=>{G(null),$e(null);try{await fr(c.id),jt.current&&$e(h("details.copied"))}catch(E){jt.current&&G(typeof Hn(E)=="string"&&String(Hn(E)).startsWith("copy.")?h(String(Hn(E))):qe(E))}},"copyId"),or=(0,l.useMemo)(()=>ns(Vt,Rt,vn,h,O?K.archivedSessionIds:void 0),[Vt,Rt,vn,h,O,K.archivedSessionIds]);(0,l.useEffect)(()=>{if(Z)return;let c=!1;return A().then(E=>{c||bn(Object.fromEntries(E.items.map(Y=>[Y.sessionId,Y.createdAt])))}).catch(()=>{c||bn({})}),()=>{c=!0}},[A,K.archivedSessionIds,Z]),(0,l.useEffect)(()=>{pt!=="all"&&!Vt.some(c=>c.key===pt)&&Ht("all")},[Vt,pt]);let ls=!gr(ct,te),ds=or.filter(c=>pt==="all"||pt===c.key).map(c=>({...c,sessions:c.sessions.filter(E=>(!je||ut.has(E.id))&&Ts(E.updatedAt,ct,te))})).filter(c=>c.sessions.length),lr=He==="content"&&!ls,kn=H(ds.flatMap(c=>c.sessions.map(E=>E.id)),_t,lr,Ye??ee),dr=new Map(kn.items.map(c=>[c.sessionId,c])),At=B(pe,O?K.archivedSessionIds:[]),cs=_t.trim().toLocaleLowerCase(),xn=ds.map(c=>({...c,sessions:c.sessions.filter(E=>!cs||it(E,h).toLocaleLowerCase().includes(cs)||dr.has(E.id))})).filter(c=>c.sessions.length),us=T?xn.flatMap(c=>c.sessions).filter(c=>xr(c,{days:Number(Te),favorites:ut,currentId:Dt(J),pending:me.pending})).map(c=>c.id):[],Cn=(0,l.useMemo)(()=>Jr(xn),[xn]),cr=(0,l.useMemo)(()=>new Set(gt),[gt]),Va=(0,l.useMemo)(()=>{let c=new Set(K.archivedSessionIds);return Oe.reduce((E,Y)=>E+(c.has(Y)?1:0),0)},[Oe,K.archivedSessionIds]),ur=Cn.filter(c=>cr.has(c)).length,Ga=Cn.length>0&&ur===Cn.length;(0,l.useEffect)(()=>{vt(c=>Xr(c,Bn))},[Bn]);let $a=e((c,E)=>{vt(Y=>rr(Y,[c],E))},"toggleSessionSelection"),Ka=e(c=>{vt(E=>rr(E,Cn,c))},"toggleVisibleSelection"),Ya=e(c=>{Z||Nt.current.has(c)||(Nt.current.add(c),yn(new Set(Nt.current)),G(null),$e(null),m(c).catch(E=>{G(jr(E,h))}).finally(()=>{Nt.current.delete(c),yn(new Set(Nt.current))}))},"onUnarchive"),hs=e(async c=>{if(!Z){if(Ct){let E=pn(K.archivedSessionIds,K.items,c),Y=await We("restore",E);return Y&&{unarchivedSessionIds:Y.succeeded}}Ge(!0),G(null),$e(null);try{let E=await S(c);return E.unarchivedSessionIds.length>0&&$e(h("archives.restoreSuccess",{n:E.unarchivedSessionIds.length})),E.failures&&E.failures.length>0&&G(Mn(E.failures,h,jr)),E}catch(E){G(h("archives.restoreBatchFailed",{detail:E instanceof Error?E.message:String(E)}))}finally{Ge(!1)}}},"onBatchUnarchive"),Za=e(async()=>{if(gt.length===0)return;let c=await hs({scope:"sessions",sessionIds:gt});if(c!==void 0){let E=new Set(c.unarchivedSessionIds);vt(Y=>Y.filter(we=>!E.has(we)))}},"onSelectedUnarchive"),ps=e(()=>{Z||Ut(null)},"closeDelete");(0,l.useEffect)(()=>{if(Ne===null)return;let c=e(E=>{E.key==="Escape"&&(E.preventDefault(),E.stopPropagation(),"stopImmediatePropagation"in E&&typeof E.stopImmediatePropagation=="function"&&E.stopImmediatePropagation(),Z||Ut(null))},"onKeyDown");return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[Ne,Z]);let Ja=e(async()=>{if(Z||mn.current||Ne===null)return;if(Ne.kind!=="batch"){mn.current=!0,Ge(!0),G(null),$e(null);try{await u(Ne.session.id),Ut(null)}catch(E){G(Kn(E,h))}finally{mn.current=!1,Ge(!1)}return}if(Pe.current||Me.current||Nt.current.size>0)return;let{target:c}=Ne;if(c.scope==="sessions"&&pn(K.archivedSessionIds,K.items,c).length===0){Ut(null);return}Pe.current=!0,Ge(!0),G(null),$e(null),Q(null),ye(null);try{let E=await k(c),Y=Qr(E,h);Y.kind==="error"?G(Y.message):$e(Y.message);let we=new Set([...E.deletedSessionIds,...E.skippedSessionIds]);kt(Se=>Se.filter(ht=>!we.has(ht))),vt(Se=>Se.filter(ht=>!we.has(ht))),w(Se=>Se.filter(ht=>!we.has(ht)));let j=E.failures.map(Se=>Se.sessionId);st.current=j.length>0?{kind:"delete",ids:j,idle:!1}:null,Q({requested:E.requestedSessionIds,succeeded:E.deletedSessionIds,skipped:E.skippedSessionIds,failures:E.failures,remaining:j,refreshError:"refreshError"in E&&typeof E.refreshError=="string"?E.refreshError:null,kind:"delete",tab:Ue}),Ut(null)}catch(E){G(Kn(E,h))}finally{Pe.current=!1,Ge(!1)}},"confirmDelete"),Bt=Ne?.kind==="batch"?Ne.target.scope:null,Xa=Bt==="ungrouped"?h("archives.deleteUngroupedTitle"):Bt==="workspace"?h("archives.deleteProjectTitle",{name:Ne?.kind==="batch"?Ne.title:""}):h(Bt==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),ms=Ne===null?void 0:Bt==="ungrouped"?h("archives.deleteUngroupedDesc",{n:Ne.kind==="batch"?Ne.count:0}):Bt==="workspace"?h("archives.deleteProjectDesc",{name:Ne?.kind==="batch"?Ne.title:"",n:Ne.kind==="batch"?Ne.count:0}):Bt==="sessions"?h("archives.deleteSelectedDesc",{n:Ne.kind==="batch"?Ne.count:0}):h("deleteSession.desc",{name:it(Ne.kind==="session"?Ne.session:{},h)}),Qa=h(Bt==="ungrouped"?"archives.deleteUngroupedConfirm":Bt==="workspace"?"archives.deleteProjectConfirm":Bt==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,a.jsxs)("section",{className:"dsham_settings","aria-label":h("archives.title"),children:[(0,a.jsx)("style",{children:Ea+Ta+_a+Ra+Na}),(0,a.jsxs)("div",{className:"dsham_settingsHeader",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"dsham_settingsTitleRow",children:[(0,a.jsx)("h2",{children:h("archives.title")}),(0,a.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,a.jsx)(g.Button,{variant:"outline",size:"sm","aria-label":h("archives.viewProject"),icon:(0,a.jsx)(da,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:h("archives.viewProject")}),(0,a.jsx)(g.Button,{variant:"outline",size:"sm","aria-label":h("archives.feedback"),icon:(0,a.jsx)(ca,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:h("archives.feedback")})]})]}),(0,a.jsx)("p",{className:"dsham_settingsIntro",children:h("archives.description")})]}),l.createElement("div",C(Z||Wt.size>0,(0,a.jsx)(g.SegmentedTabs,{className:"dsham_archiveTabs",label:h("archives.title"),value:Ue==="unarchived"?"unarchived":"archived",onChange:e(c=>Ha(c==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:(0,a.jsxs)("span",{className:"dsham_tabLabel",children:[(0,a.jsx)(g.IconArchiveOutlineMedium,{size:14}),(0,a.jsx)("span",{children:h("archives.tab.archived")})]}),id:"dsham-tab-archived",panelId:"dsham-archive-panel"},{value:"unarchived",label:(0,a.jsxs)("span",{className:"dsham_tabLabel",children:[(0,a.jsx)(g.IconFolderCloseMedium,{size:14}),(0,a.jsx)("span",{children:h("archives.tab.unarchived")})]}),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,a.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":h(Ue==="unarchived"?"archives.tab.unarchived":"archives.tab.archived"),children:[(0,a.jsx)("div",{className:"dsham_settingsToolbar",children:(0,a.jsxs)("div",{className:"dsham_settingsSearch",children:[(0,a.jsx)(nr,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:je?"favorites":"all",options:[{value:"all",label:h("organizer.allSessions")},{value:"favorites",label:h("organizer.favoritesOnly")}],onChange:e(c=>typeof ve=="function"&&ve(c==="favorites"),"onChange"),"aria-label":h("organizer.favoriteFilter")}),(0,a.jsx)(nr,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:He,options:[{value:"title",label:h("discovery.titleOnly")},{value:"content",label:h("discovery.titleAndContent")}],onChange:e(c=>typeof et=="function"&&et(c),"onChange"),"aria-label":h("discovery.scope")}),(0,a.jsx)(g.Input,{id:"dsham-search-input",className:"dsham_searchField",type:"search",icon:(0,a.jsx)(g.IconSearchOutlineMedium,{size:16,"aria-hidden":!0}),autoComplete:"off",spellCheck:!1,maxLength:200,value:_t,onChange:e(c=>fn(c.target.value),"onChange"),placeholder:h(lr?"discovery.searchPlaceholder":O?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":h(lr?"discovery.searchPlaceholder":O?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,a.jsx)(ja,{id:"dsham-sort-filter",t:h,disabled:Z,favoritesOnly:je,setFavoritesOnly:ve,favoriteBusy:Z||Ie||!T,sortBy:!O&&Rt==="archived"?"updated":Rt,setSortBy:gn,options:[...O?[{value:"archived",label:h("archives.sortArchived")}]:[],{value:"updated",label:h("archives.sortUpdated")},{value:"created",label:h("archives.sortCreated")},{value:"alphabetical",label:h("archives.sortAlphabetical")}]}),(0,a.jsx)(nr,{id:"dsham-project-filter",className:"dsham_projectFilter",value:pt,title:pt==="all"?h("archives.allProjects"):or.find(c=>c.key===pt)?.title??pt,options:[{value:"all",label:h("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:h("archives.allProjects")},...or.map(c=>({value:c.key,label:c.title,title:c.title}))],onChange:Ht,"aria-label":h("archives.projectFilter")}),l.createElement(q,{t:h,from:ct,to:te,onFrom:bt,onTo:ie,invalid:ls,onClear:e(()=>{bt(""),ie("")},"onClear")})]})}),l.createElement("style",null,Ns),l.createElement(le,{state:kn,t:h}),Ct&&(0,a.jsx)(M,{t:h,archived:O,busy:Z||Ie||Wt.size>0,ready:T,days:Te,onDays:ke,count:us.length,onPreview:e(()=>{Lt(us),xe(!0)},"onPreview"),progress:be,result:Ce?.tab===Ue?Ce:null,onRetry:e(()=>{let c=st.current;c&&(c.kind==="delete"?tn({kind:"batch",target:{scope:"sessions",sessionIds:c.ids},count:c.ids.length}):We(c.kind,c.ids,{idle:c.idle,retry:!0}))},"onRetry"),undoCount:Va,onUndo:e(()=>We("undo",Oe,{retry:!0}),"onUndo"),onReload:nn,orphanCount:lt?.count??0,cacheCount:sn.diagnosis.count,cacheRepair:sn,onRebuildCaches:e(()=>Zt(),"onRebuildCaches"),onRetryCaches:e(()=>Zt(!0),"onRetryCaches"),onReloadCaches:e(async()=>{try{await Xe?.(),await Fe.current?.load(),(Fe.current?.snapshot().diagnosis.count??0)===0&&Fe.current?.dismiss()}catch(c){jt.current&&G(qe(c))}},"onReloadCaches"),onDismissCaches:e(()=>Fe.current?.dismiss(),"onDismissCaches"),orphanSizeBytes:lt?.totalSizeBytes??0,orphanCleaning:an,onCleanOrphans:Ua}),Vt.length>0&&(0,a.jsx)(Kr,{selectedCount:gt.length,hiddenCount:gt.length-ur,allVisibleSelected:Ga,selectedVisibleCount:ur,visibleCount:Cn.length,busy:Z,t:h,onToggle:Ka,onClear:e(()=>vt([]),"onClear"),onArchive:O?void 0:()=>Lt([...gt]),onRestore:Za,onDelete:e(()=>tn({kind:"batch",target:{scope:"sessions",sessionIds:gt},count:gt.length}),"onDelete")}),Vt.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:h(O?"archives.empty":"archives.emptyUnarchived")}):xn.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:kn.status==="loading"||kn.status==="error"||kn.failures.length?null:h("archives.emptyFiltered")}):xn.map(c=>{let E=za(c.key),Y=Vt.find(j=>j.key===c.key)?.sessions.map(j=>j.id)??[],we=O?pn(K.archivedSessionIds,K.items,E).length:Y.length;return(0,a.jsxs)("section",{className:"dsham_settingsGroup",children:[(0,a.jsxs)("div",{className:"dsham_settingsGroupHeading",children:[(0,a.jsx)("h3",{className:"dsham_settingsGroupTitle",children:(0,a.jsxs)("button",{type:"button",className:"dsham_groupToggle","aria-expanded":!z.has(c.key),"aria-controls":"dsham-group-"+encodeURIComponent(c.key),onClick:e(()=>oe(j=>{let Se=new Set(j);return Se.has(c.key)?Se.delete(c.key):Se.add(c.key),Se}),"onClick"),children:[(0,a.jsx)(z.has(c.key)?g.IconChevronRightOutlineMedium:g.IconChevronDownOutlineMedium,{}),(0,a.jsx)(g.IconFolderOpenOutlineMedium,{}),(0,a.jsx)("span",{children:c.title})]})}),(0,a.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,a.jsx)("span",{className:"dsham_settingsCount",children:h("archives.sessionCount",{n:c.sessions.length})}),(0,a.jsx)(Ma,{group:c,busy:Z,onArchive:O?void 0:()=>Lt(Y,c),onRestore:e(()=>hs(E),"onRestore"),onDelete:e(()=>tn({kind:"batch",target:E,title:c.title,count:we}),"onDelete"),t:h})]})]}),(0,a.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(c.key),hidden:z.has(c.key)||void 0,children:!z.has(c.key)&&c.sessions.map(j=>(0,a.jsxs)("div",{className:"dsham_settingsRow","data-selected":cr.has(j.id),children:[(0,a.jsx)(Yr,{checked:cr.has(j.id),disabled:Z,label:h("archives.selectSession",{name:it(j,h)}),onChange:e(Se=>$a(j.id,Se.target.checked),"onChange")}),(0,a.jsxs)("div",{className:"dsham_settingsContent",children:[(0,a.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:it(j,h),"aria-label":h("archives.openSession")+h("common.separator")+it(j,h),disabled:Z||Wt.has(j.id),onClick:e(()=>Fn(j),"onClick"),children:it(j,h)}),(0,a.jsx)("div",{className:"dsham_settingsMeta",children:[Ca(j.updatedAt,h)]}),dr.has(j.id)&&l.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:Z,title:h(O?"discovery.preview":"archives.openSession"),onClick:e(()=>O?At.open(j,_t):Fn(j),"onClick")},l.createElement(N,{text:dr.get(j.id)?.snippet??"",query:_t}))]}),(0,a.jsxs)("div",{className:"dsham_settingsActions",children:[typeof en=="function"&&x({variant:"outline",className:"dsham_iconAction"+(ut.has(j.id)?" dsham_favoriteOn":""),title:h(ut.has(j.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":ut.has(j.id),"aria-label":h(ut.has(j.id)?"organizer.unfavorite":"organizer.favorite")+h("common.separator")+it(j,h),disabled:Z||Ie||!T,onClick:e(()=>wn(j.id),"onClick"),children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:ut.has(j.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,a.jsx)("path",{d:Ve})})}),x({variant:"outline",className:"dsham_iconAction",title:h(O?"archives.restore":"archives.archiveSelected"),"aria-label":h(O?"archives.restore":"archives.archiveSelected"),disabled:Z||Wt.has(j.id),onClick:e(()=>O?Ya(j.id):os([j.id]),"onClick"),icon:(0,a.jsx)(O?g.IconRefreshOutlineMedium:g.IconArchiveOutlineMedium,{size:16})}),O&&(0,a.jsx)(Da,{busy:Z||Wt.has(j.id),t:h,title:it(j,h),onCopyId:e(()=>qa(j),"onCopyId"),onPreview:typeof pe=="function"?()=>At.open(j,_t):void 0,onRestoreOpen:e(()=>Fn(j,!0),"onRestoreOpen"),onDelete:e(()=>tn({kind:"session",session:j}),"onDelete")})]})]},j.id))})]},c.key)}),l.createElement(y,{width:900,className:"dsham_modalWide",portalToBody:!0,t:h,open:At.target!==null,onClose:At.close,title:At.target?it(At.target.session,h):h("discovery.preview"),footer:v({variant:"primary",disabled:Z,onClick:e(()=>{if(At.target){let c=At.target.session;return At.close(),Fn(c)}},"onClick"),children:h("discovery.openFull")}),children:l.createElement(re,{preview:At,t:h,MarkdownText:g.MarkdownText})}),Re===null&&St!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:St}),Ln!==null&&(0,a.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:Ln}),(0,a.jsx)(y,{t:h,open:Re!==null,onClose:Yt,title:h("archives.archiveTitle",{n:Re?.length??0}),description:Ze===null?h("archives.archiveSelectedDesc"):h(Ze.key===Pn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:Ze.title,n:Re?.length??0}),footer:(0,a.jsxs)(a.Fragment,{children:[v({disabled:Z,onClick:Yt,children:h("cancel")}),v({variant:"primary",disabled:Z||!Re?.length,onClick:Wa,children:h("archives.archiveSelected")})]}),children:(0,a.jsxs)(a.Fragment,{children:[Ct&&(0,a.jsx)("p",{children:h(tt?"organizer.idleConfirm":"organizer.manualConfirm")}),Ct&&(0,a.jsx)("div",{className:"dsham_archivePreview",children:(Re??[]).map(c=>(0,a.jsxs)("label",{children:[(0,a.jsx)(hr,{checked:!0,disabled:Z,label:it(J.byId[c]??{id:c},h),onChange:e(()=>Ae(E=>(E??[]).filter(Y=>Y!==c)),"onChange")}),it(J.byId[c]??{id:c},h)]},c))}),be&&(0,a.jsxs)("div",{role:"status",children:[(0,a.jsx)("progress",{value:be.done,max:Math.max(1,be.total)}),h("organizer.progressCount",{done:be.done,total:be.total})]}),St!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:St})]})}),(0,a.jsx)(y,{t:h,open:Qe!==null,onClose:e(()=>{Z||(Tt(null),G(null))},"onClose"),title:h("archiveActive.title"),...Qe===null?{}:{description:h("archiveActive.desc",{name:Qe.title,kinds:Qe.kinds})},footer:(0,a.jsxs)(a.Fragment,{children:[v({disabled:Z,onClick:e(()=>{Z||(Tt(null),G(null))},"onClick"),children:h("cancel")}),v({danger:!0,disabled:Z,onClick:e(async()=>{if(!(Et.current||Z||Qe===null||typeof r!="function")){Et.current=!0,Ge(!0),G(null);try{await r(Qe.sessionId,{stopActivity:!0}),vt(c=>c.filter(E=>Qe===null||E!==Qe.sessionId)),rt("archived"),$e(h("archives.archiveSuccess",{n:1})),Tt(null)}catch(c){G(c instanceof Error?c.message:String(c))}finally{Et.current=!1,Ge(!1)}}},"onClick"),children:h("archiveActive.confirm")})]}),children:St!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:St})}),(0,a.jsx)(y,{t:h,open:Ne!==null,onClose:ps,title:Xa,...ms===void 0?{}:{description:ms},footer:(0,a.jsxs)(a.Fragment,{children:[v({disabled:Z,onClick:ps,children:h("cancel")}),v({danger:!0,disabled:Z,onClick:Ja,children:Qa})]}),children:(0,a.jsxs)(a.Fragment,{children:[Z&&(0,a.jsxs)("div",{role:"status",children:[Ne?.kind==="batch"?h("archives.deleteBatchPending"):h("deleteSession.pending"),be&&(0,a.jsx)("progress",{value:be.done,max:Math.max(1,be.total),"aria-label":h("organizer.progress")}),be&&h("organizer.progressCount",{done:be.done,total:be.total})]}),St!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:St})]})})]})]})}e(Gn,"ArchivedSessionsSection");function Nr(n){var r,i,d="";if(typeof n=="string"||typeof n=="number")d+=n;else if(typeof n=="object")if(Array.isArray(n)){var m=n.length;for(r=0;r<m;r++)n[r]&&(i=Nr(n[r]))&&(d&&(d+=" "),d+=i)}else for(i in n)n[i]&&(d&&(d+=" "),d+=i);return d}e(Nr,"r");function ua(...n){for(var r,i,d=0,m="",u=arguments.length;d<u;d++)(r=arguments[d])&&(i=Nr(r))&&(m&&(m+=" "),m+=i);return m}e(ua,"clsx");let $n="Ungrouped";function ha(n,r=$n){if(n===void 0||n==="")return r;let i=n.replace(/[/\\]+$/,"").split(/[/\\]/).pop();return i!==void 0&&i!==""?i:n}e(ha,"workspaceLabel");function hn(n,r){return r.updatedAt!==n.updatedAt?r.updatedAt-n.updatedAt:n.id<r.id?-1:1}e(hn,"byRecency");function Qt(n,r,i,d){return n.origin!=="subagent"&&(!i.has(n.id)||d===!0)&&(!n.blank||n.id===r)}e(Qt,"sessionVisible");function Dn(n){let r=n instanceof Error?n.message:String(n);return r.includes("UNKNOWN_SESSION")||r.includes("no such session")}e(Dn,"isUnknownSessionError");function Kn(n,r){if(Dn(n))return r("deleteSession.unknown");let i=n instanceof Error?n.message:String(n);return r("deleteSession.failed",{detail:i})}e(Kn,"formatDeleteError");function jr(n,r){if(Dn(n))return r("archives.unarchiveUnknown");let i=n instanceof Error?n.message:String(n);return r("archives.unarchiveFailed",{detail:i})}e(jr,"formatUnarchiveError");function Mn(n,r,i=Dr){return n.map(d=>d.sessionId+r("common.separator")+i(new Error(d.message),r)).join(`
22
- `)}e(Mn,"formatBatchFailures");function Dr(n,r){if(Dn(n))return r("archives.archiveUnknown");let i=n instanceof Error?n.message:String(n);return r("archives.archiveFailed",{detail:i})}e(Dr,"formatArchiveError");function zn(n){if(n===null||typeof n!="object")return;let r=ne(n),i=r.rpcError!==null&&typeof r.rpcError=="object"?ne(r.rpcError):void 0,d=r.name==="WorkspaceActiveSessionError"?r.activity:void 0,m=i?.details,u=r.name==="WorkspaceArchiveError"&&i?.code==="workspace/session-active"&&m!==null&&typeof m=="object"?ne(m).activity:void 0,S=Array.isArray(d)?d:Array.isArray(u)?u:void 0;if(S===void 0)return;let k=S.flatMap(A=>{if(A===null||typeof A!="object")return[];let P=ne(A).kind;return typeof P=="string"&&P.length>0?[P]:[]});return k.length>0?k:void 0}e(zn,"activeSessionActivity");function Mr(n){let r=zn(n);if(r===void 0||n===null||typeof n!="object")return;let i=ne(n),d=i.rpcError!==null&&typeof i.rpcError=="object"?ne(i.rpcError).details:void 0,m=d!==null&&typeof d=="object"?ne(d).sessionId:void 0,u=typeof i.sessionId=="string"?i.sessionId:typeof m=="string"?m:void 0;return u===void 0?void 0:{sessionId:u,kinds:r}}e(Mr,"activeSessionRefusal");function zr(n,r){let i=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(r);if(i===null)return;let d=i[1].split(", ").filter(m=>m.length>0);return d.length>0?{sessionId:n,kinds:d}:void 0}e(zr,"activeArchiveFromMessage");function pa(n,r){let i=n instanceof Error?n.message:String(n);return r("archives.forkFailed",{detail:i})}e(pa,"formatForkError");function Yn(n){return n.blank?"New Session":n.displayTitle}e(Yn,"sessionTitle");function Or(n,r,i,d,m,u,S){let k=[...u];return S==="recency"&&k.sort(hn),{key:n,workspaceId:r,cwd:i,createdAt:d,label:m,sessions:k}}e(Or,"buildGroup");function ma(n,r){let i=new Map(n.map(u=>[u.id,u])),d=new Set,m=[];for(let u of r){let S=i.get(u);S===void 0||d.has(u)||(m.push(S),d.add(u))}for(let u of[...n].sort(hn))d.has(u.id)||m.push(u);return m}e(ma,"orderedUngrouped");function Pr(n,r,i,d,m){let u=[],S=new Set;for(let A of r){let P=[];for(let I of A.sessionIds){let R=n.byId[I];R!==void 0&&(S.add(I),Qt(R,Dt(n),i,m)&&P.push(R))}u.push(Or(A.workspaceId,A.workspaceId,A.path,Date.parse(A.createdAt),A.title,P,"account"))}let k=n.ids.map(A=>n.byId[A]).filter(A=>A!==void 0&&!S.has(A.id)&&Qt(A,Dt(n),i,m));return k.length>0&&u.push(Or("",void 0,void 0,void 0,$n,d===void 0?k:ma(k,d),d===void 0?"recency":"account")),u}e(Pr,"groupByWorkspace");function Zn(n,r,i){if(!n||i.has(n))return!1;let d=r?.[n];return!(d===void 0||d.origin==="subagent"||d.blank)}e(Zn,"isWorkspaceTaskCandidate");function Lr(n){let r=n?.closest("[data-row-key]")??null;if(r===null)return null;let i=r.getAttribute("data-row-key")??"";if(!i.startsWith("workspace:"))return null;let d=i.slice(10);if(!d)return null;let m=r.querySelector(".title")??r.querySelector("[class*='title']");return{workspaceId:d,title:m?.textContent?.trim()||d}}e(Lr,"workspaceMenuTriggerFrom");function Jn(n){let r=n.querySelector('[class*="rowActions"]');if(!r)return null;let i=Array.from(r.querySelectorAll("button"));if(i.length===0)return null;let d=e(u=>!!((u.getAttribute("class")??"").includes("dsham_rowStar")||typeof u.closest=="function"&&u.closest(".dsham_starSlot")),"isStarButton");return i.find(u=>{if(d(u))return!1;if(u.getAttribute("aria-haspopup")==="menu")return!0;let S=(u.getAttribute("aria-label")??u.getAttribute("title")??"").toLowerCase();return/new|create|新建|add|\+|созда/.test(S)?!1:/action|操作|действи|more|更多|选项|options|menu/.test(S)})??null}e(Jn,"findRowMenuButton");function Fr(n,r){if(Jn(r)===n)return!0;let d=(n.getAttribute("aria-label")??n.getAttribute("title")??"").toLowerCase();return/action|操作|действи|more|更多/.test(d)}e(Fr,"isRowMenuButton");function Br(){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let n=e(r=>{let i=r.target;if(!i||i.closest("input, textarea, [contenteditable='true']"))return;let d=i.closest('[data-row-key^="workspace:"], [data-row-key^="session:"]');if(!d)return;let m=i.closest("button");if(m&&!Fr(m,d))return;let u=Jn(d);u&&(r.preventDefault(),r.stopPropagation(),u.click())},"onContextMenu");return document.addEventListener("contextmenu",n,!0),()=>{document.removeEventListener("contextmenu",n,!0)}}e(Br,"setupSidebarRowContextMenu");function Xn(n,r=!0){let i=(n.textContent??"").toLowerCase();return i.includes("\u5220\u9664\u5DE5\u4F5C\u533A")||i.includes("delete workspace")||i.includes("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435")?!0:r&&/(?:^|[_\s-])danger(?:$|[_\s-])/i.test(n.className)}e(Xn,"isWorkspaceDeleteMenuItem");function fa(n){switch(n){case"approval":case"plan-review":case"question":return n;default:return}}e(fa,"visiblePendingKind");function Ur(n,r){let i=r.get(n.id),d=i===void 0?n.pendingInteraction:i.kind;return fa(d)}e(Ur,"pendingInteractionForSession");let Qn=new Map,er=new Set,ga=new Map;function va(n){return n(Qn)}e(va,"useEmptySessionPendingInteraction");function ba(n){return n(ga)}e(ba,"useEmptySessionStatus");function Hr(n){return n instanceof Map||n==null?{pending:n??Qn,completed:er}:{pending:n.pending??Qn,completed:n.completed??er}}e(Hr,"pendingFacts");function ya(n){let r=new Map,i=new Set;if(n instanceof Map)for(let[d,m]of n)m?.pendingInteraction!==void 0&&r.set(d,m.pendingInteraction),m?.completionUnread===!0&&i.add(d);return{pending:r,completed:i}}e(ya,"factsFromSessionStatus");function wa(n,r,i){let d=n(u=>u),m=r(u=>u);return i?ya(m):{pending:d,completed:er}}e(wa,"useSessionUiFacts");function Wr(n,r,i,d){let m=Hr(d),u=Ur(n,m.pending);return{id:n.id,title:Yn(n),blank:n.blank,running:n.running,runningSubagentCount:r.get(n.id)?.runningCount??0,completed:n.completed===!0||m.completed.has(n.id),updatedAt:n.updatedAt,archived:i.has(n.id),...u===void 0?{}:{pendingInteraction:u}}}e(Wr,"sessionNode");function Sa(n,r,i,d,m){let u=new Set(i),S=new Set(m.expandedGroups),k=Nn(n.byId),A=Dt(n),P=A===void 0?void 0:r.find(R=>R.sessionIds.includes(A))?.workspaceId??"",I=[];for(let R of Pr(n,r,u,m.ungroupedOrder,m.showArchived)){let F=S.has(R.key);I.push({key:R.key,workspaceId:R.workspaceId,cwd:R.cwd,createdAt:R.createdAt,label:R.label,sessionCount:R.sessions.length,expanded:F,containsCurrent:R.key===P,sessions:F?R.sessions.map(h=>Wr(h,k,u,d)):[]})}return I}e(Sa,"deriveGroups");function ka(n,r,i,d){let m=new Set(r),u=Nn(n.byId),S=[];for(let k of n.ids){let A=n.byId[k];A===void 0||!Qt(A,Dt(n),m,d)||S.push(A)}return S.sort(hn),S.map(k=>Wr(k,u,m,i))}e(ka,"deriveFlat");function xa(n,r,i,d,m,u,S,k,A=$n){let P=i.trim().toLowerCase();if(P==="")return{items:[],hasMore:!1};let I=new Set(d),R=Nn(n.byId),F=new Map;for(let ee of r)for(let pe of ee.sessionIds)F.has(pe)||F.set(pe,ee.title);let h=e(ee=>F.get(ee.id)??ha(ee.cwd,A),"labelOf"),ge=new Map;for(let ee of u.items)ge.has(ee.sessionId)||ge.set(ee.sessionId,ee);let _e=[];for(let ee of n.ids){let pe=n.byId[ee];pe===void 0||pe.blank||!Qt(pe,Dt(n),I,k)||(Yn(pe).toLowerCase().includes(P)||h(pe).toLowerCase().includes(P))&&_e.push(pe)}_e.sort(hn);let ce=[],ot=new Set,Xe=e(ee=>{ot.has(ee.id)||(ot.add(ee.id),ce.push(ee))},"include");for(let ee of _e)Xe(ee);for(let ee of u.items){let pe=n.byId[ee.sessionId];pe!==void 0&&!pe.blank&&Qt(pe,Dt(n),I,k)&&Xe(pe)}let Ye=Hr(m);return{items:ce.slice(0,S).map(ee=>{let pe=ge.get(ee.id),nt=Ur(ee,Ye.pending);return{id:ee.id,title:Yn(ee),workspace:h(ee),running:ee.running,runningSubagentCount:R.get(ee.id)?.runningCount??0,archived:I.has(ee.id),...nt===void 0?{}:{pendingInteraction:nt},completed:ee.completed===!0||Ye.completed.has(ee.id),...pe===void 0?{}:{snippet:pe.snippet}}}),hasMore:u.hasMore||ce.length>S}}e(xa,"deriveSearchResults");function Oi(n,r){let u=Math.max(0,r-n);return u<6e4?{unit:"now",n:0}:u<36e5?{unit:"minutes",n:Math.floor(u/6e4)}:u<864e5?{unit:"hours",n:Math.floor(u/36e5)}:u<30*864e5?{unit:"days",n:Math.floor(u/864e5)}:u<365*864e5?{unit:"months",n:Math.floor(u/(30*864e5))}:{unit:"years",n:Math.floor(u/(365*864e5))}}e(Oi,"relativeTime");let qr={listeners:new Set,request(n){for(let r of this.listeners)r(n)},subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}};function it(n,r){return n.blank?r("session.new"):n.title??n.displayTitle??""}e(it,"displayTitle");function Ca(n,r){let i=new Date(n),d=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`;return r("archives.timestamp",{date:r("date.ymd",{y:i.getFullYear(),m:i.getMonth()+1,d:i.getDate()}),time:d})}e(Ca,"archiveTimeLabel");let Ea=[".dsham_archiveTabsLocked{opacity:.5}",".dsham_archiveTabs{display:grid!important;box-sizing:border-box!important;height:32px!important;min-height:32px!important;max-height:32px!important;padding:2px!important;border:0!important;border-radius:var(--dsw-radius-sm,8px)!important;box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l2)!important;background:var(--dsw-alias-bg-layer-1)!important}",'.dsham_archiveTabs>span[aria-hidden="true"],.dsham_archiveTabs>[class*="indicator"]{inset:2px auto 2px 2px!important;width:calc((100% - 4px)/2)!important;border-radius:6px!important;border:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12))!important;background:var(--dsw-alias-bg-layer-3,rgba(255,255,255,.08))!important;box-shadow:none!important}',".dsham_archiveTabs [role=tab]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;height:28px!important;padding:0 12px!important;border-radius:6px!important;font-size:13px!important;line-height:20px!important;color:var(--dsw-alias-label-secondary)!important;text-align:center!important;box-sizing:border-box!important;transition:color 150ms ease!important}",".dsham_archiveTabs [role=tab]:hover{color:var(--dsw-alias-label-primary)!important}",'.dsham_archiveTabs [role=tab][aria-selected="true"]{color:var(--dsw-alias-label-primary)!important;font-weight:600!important}',".dsham_tabLabel{display:inline-flex;align-items:center;justify-content:center;gap:6px}",".dsham_tabLabel svg{flex:none;display:block}"].join(""),Pt="data-dsham-nav-icon",Aa='[role="dialog"] nav button',tr=[`[${Pt}] > svg { display: none !important; }`,`[${Pt}]::before {`," content: '';"," flex: none;"," width: 16px;"," height: 16px;"," background-color: currentColor;",' -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;',' mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;'," -webkit-mask-repeat: no-repeat;"," mask-repeat: no-repeat;"," -webkit-mask-position: center;"," mask-position: center;"," -webkit-mask-size: 16px 16px;"," mask-size: 16px 16px;","}"].join(`
23
- `);function Ia(n,r){let i=String(r??"").trim();return i.length>0&&String(n??"").trim()===i}e(Ia,"isOwnSettingsNavRow");function On(n,r){for(let i of n){if(i.type==="characterData"){let m=i.target.parentElement;if(m!==null&&m.closest(r)!==null)return!0;continue}let d=i.target;if(d&&d.nodeType===1&&(typeof d.matches=="function"&&d.matches(r)||typeof d.closest=="function"&&d.closest(r)!==null))return!0;if(i.addedNodes)for(let m of i.addedNodes){if(m.nodeType!==1)continue;let u=m;if(typeof u.matches=="function"&&u.matches(r)||typeof u.querySelector=="function"&&u.querySelector(r)!==null||typeof u.closest=="function"&&u.closest(r)!==null)return!0}if(i.removedNodes)for(let m of i.removedNodes){if(m.nodeType!==1)continue;let u=m;if(typeof u.matches=="function"&&u.matches(r)||typeof u.querySelector=="function"&&u.querySelector(r)!==null||typeof u.closest=="function"&&u.closest(r)!==null)return!0}}return!1}e(On,"mutationTouches");function Vr(n,r){return Ia(n.textContent,r)?n.getAttribute(Pt)===""?!1:(n.setAttribute(Pt,""),!0):n.hasAttribute(Pt)?(n.removeAttribute(Pt),!0):!1}e(Vr,"applySettingsNavIcon");function Gr(n){return n.hasAttribute(Pt)?(n.removeAttribute(Pt),!0):!1}e(Gr,"restoreSettingsNavIcon");function $r(n){typeof document>"u"||typeof MutationObserver>"u"||n.effect(()=>{let r="dsham-nav-icon-style",i=document.getElementById(r);i===null?(i=document.createElement("style"),i.id=r,i.textContent=tr,(document.head??document.documentElement).append(i)):i.textContent!==tr&&(i.textContent=tr);let d=!1,m=!1,u=e(()=>{if(m=!1,d)return;let A=n.locale.bind(Je)("archived.badge");for(let P of document.querySelectorAll(Aa))Vr(P,A)},"sync"),S=e(()=>{m||d||(m=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(u):setTimeout(u,16))},"schedule");u();let k=new MutationObserver(A=>{On(A,'[role="dialog"] nav')&&S()});return k.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{d=!0,k.disconnect();for(let A of document.querySelectorAll(`[${Pt}]`))Gr(A);i?.remove()}},"archive-manager: settings nav icon")}e($r,"installSettingsNavIcon");let Ta=[".dsham_settings{container-type:inline-size;min-width:0;box-sizing:border-box;width:100%;padding:0 0 32px;color:var(--dsw-alias-label-primary)}",".dsham_settingsHeader{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:16px}",".dsham_settings h2{margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;white-space:nowrap}",".dsham_settingsIntro{margin:12px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px}",".dsham_settingsToolbar{display:flex;align-items:center;gap:8px;margin-bottom:16px;width:100%;min-width:0}",".dsham_settingsSearch{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}","@container(max-width:520px){.dsham_settingsSearch{flex-wrap:wrap}}",".dsham_settingsSearch .dsham_searchField{flex:1 1 0;min-width:120px;width:auto;box-sizing:border-box}",".dsham_viewSortContainer{flex:0 0 auto;position:relative;box-sizing:border-box}",".dsham_viewSortBtn{height:32px!important;padding:0 8px!important;font-size:13px!important;box-sizing:border-box}",".dsham_viewSortBtn.has-filter{border-color:var(--dsw-alias-state-business-primary)!important;color:var(--dsw-alias-state-business-primary)!important}",".dsham_settingsFilter{display:inline-flex;position:relative}",".dsham_settingsSearch .dsham_projectFilter{flex:0 0 auto;max-width:120px;min-width:0;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter > span{display:inline-block;max-width:100%;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter .dsham_menuSelectBtn{display:inline-flex!important;width:100%;max-width:120px;padding:0 8px;box-sizing:border-box;overflow:hidden}",".dsham_settingsSearch .dsham_projectFilter .dsham_selectLabel{flex:1 1 auto;min-width:0;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}",".dsham_settingsSearch .dsham_dateFilter{flex:0 0 125px;width:125px;min-width:125px;position:relative;box-sizing:border-box}",".dsham_dateRange{width:100%;box-sizing:border-box}",".dsham_dateTrigger{height:32px!important;padding:0 8px!important;gap:5px!important;border:0.5px solid var(--dsw-alias-border-l2)!important;border-radius:var(--dsw-radius-sm,8px)!important;background:var(--dsw-alias-bg-layer-1)!important;box-sizing:border-box}",".dsham_dateTrigger .dsham_dateText{font-size:12px!important;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".dsham_srOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;opacity:0;pointer-events:none}",".dsham_menuSelectBtn{display:inline-flex!important;align-items:center;justify-content:space-between;gap:6px;width:auto!important;max-width:100%;min-width:0!important;height:32px!important;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-sizing:border-box;font:inherit;font-size:13px;cursor:pointer}",".dsham_selectLabel{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:normal;text-align:left}",".dsham_settingsGroup{margin:0 0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill));overflow:hidden;transition:border-color 150ms ease}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:0 10px;margin:0;user-select:none}",".dsham_settingsGroupTitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}",".dsham_settingsGroupTitle svg{flex:none;color:var(--dsw-alias-label-secondary)}",".dsham_settingsCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px}",".dsham_settingsList{display:grid;overflow:hidden;border:0;border-top:1px solid var(--dsw-alias-border-l2);border-radius:0;background:transparent}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:4px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsTitle{overflow:hidden;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:16px;text-overflow:ellipsis;white-space:nowrap}",".dsham_settingsMeta{margin-top:1px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:13px}",".dsham_settingsActions{display:flex;align-items:center;gap:4px;flex:none}",".dsham_settingsEmpty{padding:28px 8px;color:var(--dsw-alias-label-secondary);text-align:center}",".dsham_settingsError{margin-top:10px;color:var(--dsw-alias-state-error-primary);font-size:12px;white-space:pre-line}","@container(max-width:520px){.dsham_settingsHeader{margin-bottom:16px}.dsham_settingsGroup{margin-bottom:10px}.dsham_settingsRow{padding:4px 8px}.dsham_settingsActions{gap:2px}}"].join(""),_a=".dsham_settingsTitleLink{display:block;max-width:100%;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;line-height:16px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.dsham_settingsTitleLink:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}.dsham_settingsTitleLink:disabled{cursor:default;opacity:.6}.dsham_groupToggle{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;padding:4px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsham_groupToggle span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsham_settingsRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsRow[data-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsTitleLink:focus-visible,.dsham_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#3b82f6);outline-offset:2px}@container(max-width:400px){.dsham_settingsRow{gap:6px;padding:4px 6px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:10px}}.dsham_settingsGroupMeta{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap}.dsham_settingsStatus{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:12px}.dsham_checkbox{flex:none;box-sizing:border-box;width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);cursor:pointer}.dsham_checkbox:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.dsham_checkbox:disabled{opacity:.5;cursor:default}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",Ra=".dsham_settingsTitleRow{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}.dsham_settingsLinks{display:flex;align-items:center;gap:8px;flex-wrap:wrap}@media(max-width:720px){.dsham_settingsTitleRow{flex-wrap:wrap}}",Na=".dsham_settingsSelection{margin:-8px 0 16px;padding:4px 0 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsham_settingsSelectionMain{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;min-height:36px}.dsham_settingsSelectionSummary{display:flex;flex-wrap:wrap;align-items:center;gap:12px;min-width:0;max-width:100%}.dsham_settingsSelectionToggle{display:inline-flex;flex:none;white-space:nowrap;align-items:center;gap:12px;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;cursor:pointer}.dsham_settingsSelectionActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:100%;margin-left:auto}.dsham_settingsSelectionScope{margin:8px 0 0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow-wrap:anywhere}";function nr({id:n,className:r,value:i,options:d,onChange:m,disabled:u=!1,"aria-label":S,title:k,tabIndex:A,"aria-hidden":P}){let[I,R]=l.useState(!1),F=l.useMemo(()=>d.map(_e=>({id:_e.value,label:_e.label})),[d]),h=d.find(_e=>_e.value===i),ge=h?.label??S;return(0,a.jsx)("div",{id:n,tabIndex:A,"aria-hidden":P,className:r===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${r}`,children:(0,a.jsx)(g.Menu,{open:I,onClose:e(()=>R(!1),"onClose"),onSelect:e(_e=>{u||m(_e),R(!1)},"onSelect"),selectedId:i,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,a.jsxs)(g.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":S,"aria-expanded":I,disabled:u,tabIndex:A,"aria-hidden":P,title:k??h?.title??h?.label??S,className:"dsham_menuSelectBtn"+(I?" is-open":""),onClick:e(()=>{u||R(_e=>!_e)},"onClick"),children:[(0,a.jsx)("span",{className:"dsham_selectLabel",children:ge}),(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:4,transition:"transform 150ms ease",transform:I?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:F})})}e(nr,"ArchiveProjectSelect");function ja({id:n,t:r,disabled:i=!1,favoritesOnly:d,setFavoritesOnly:m,favoriteBusy:u=!1,sortBy:S,setSortBy:k,options:A}){let[P,I]=l.useState(!1),R=l.useMemo(()=>{let ce=[];typeof m=="function"&&(ce.push({type:"label",id:"lbl_view_filter",text:r("organizer.favoriteFilter")||"\u7B5B\u9009\u4F1A\u8BDD"}),ce.push({id:"filter:all",label:r("organizer.allSessions")||"\u5168\u90E8\u4F1A\u8BDD"}),ce.push({id:"filter:favorites",label:r("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF"}),ce.push({type:"separator",id:"sep_view_filter"})),ce.push({type:"label",id:"lbl_view_sort",text:r("archives.sortLabel")||"\u6392\u5E8F\u65B9\u5F0F"});for(let ot of A)ce.push({id:`sort:${ot.value}`,label:ot.label});return ce},[r,m,A]),F=e(ce=>{ce.startsWith("filter:")?typeof m=="function"&&!u&&m(ce==="filter:favorites"):ce.startsWith("sort:")&&k(ce.slice(5)),I(!1)},"onSelect"),h=A.find(ce=>ce.value===S),ge=d?r("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":r("organizer.allChats")||"\u5168\u90E8\u804A\u5929",_e=`${ge} \xB7 ${h?.label??S}`;return(0,a.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,a.jsx)(g.Menu,{open:P,onClose:e(()=>I(!1),"onClose"),onSelect:F,selectedIds:[d?"filter:favorites":"filter:all",`sort:${S}`],align:"end",portal:!0,dense:!0,listClassName:"dsham_viewSortDropdown",anchor:(0,a.jsxs)(g.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":r("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":P,disabled:i,title:_e,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(P?" is-open":"")+(d?" has-filter":""),onClick:e(()=>{i||I(ce=>!ce)},"onClick"),children:[(0,a.jsxs)("svg",{viewBox:"0 0 16 16",width:13,height:13,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"none",marginRight:4},children:[(0,a.jsx)("line",{x1:2.5,y1:4.5,x2:13.5,y2:4.5}),(0,a.jsx)("circle",{cx:5,cy:4.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"}),(0,a.jsx)("line",{x1:2.5,y1:11.5,x2:13.5,y2:11.5}),(0,a.jsx)("circle",{cx:11,cy:11.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"})]}),(0,a.jsx)("span",{className:"dsham_selectLabel",children:ge}),(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:11,height:11,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:3,transition:"transform 150ms ease",transform:P?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:R})]})}e(ja,"ArchiveViewSortMenu");function Kr({selectedCount:n,hiddenCount:r,allVisibleSelected:i,selectedVisibleCount:d,visibleCount:m,busy:u,t:S,onToggle:k,onClear:A,onRestore:P,onDelete:I,onArchive:R}){let F=n>0;return(0,a.jsxs)("div",{className:"dsham_settingsSelection",children:[(0,a.jsxs)("div",{className:"dsham_settingsSelectionMain",children:[(0,a.jsxs)("div",{className:"dsham_settingsSelectionSummary",children:[(0,a.jsxs)("label",{className:"dsham_settingsSelectionToggle",title:S("archives.selectAllFiltered"),children:[(0,a.jsx)(Yr,{checked:i,indeterminate:d>0&&!i,disabled:u||m===0,label:S("archives.selectAllFiltered"),onChange:e(h=>k(h.target.checked),"onChange")}),(0,a.jsx)("span",{"aria-live":"polite",children:F?S("archives.selectedCount",{n}):S("archives.selectAllFiltered")})]}),F&&x({disabled:u,"aria-label":S("archives.clearSelection"),onClick:A,children:S("archives.clearSelectionShort")})]}),F&&(0,a.jsxs)("div",{className:"dsham_settingsSelectionActions",children:R?[x({disabled:u,onClick:R,children:S("archives.archiveSelected")})]:[x({disabled:u,"aria-label":S("archives.restoreSelected"),onClick:P,children:S("archives.restore")}),x({disabled:u,className:"dsham_btnDanger","aria-label":S("archives.deleteSelected"),onClick:I,children:S("archives.deleteSelectionShort")})]})]}),r>0&&(0,a.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:S("archives.selectionHiddenHint",{hidden:r})})]})}e(Kr,"ArchiveSelectionToolbar");function Yr({checked:n,indeterminate:r=!1,disabled:i=!1,label:d,onChange:m}){return(0,a.jsx)(hr,{checked:n,indeterminate:r,disabled:i,label:d,onChange:m})}e(Yr,"ArchiveSelectionCheckbox");function Zr(){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:[3.5,8,12.5].map(n=>(0,a.jsx)("circle",{cx:n,cy:8,r:1.15,fill:"none",stroke:"currentColor",strokeWidth:1.5},n))})}e(Zr,"moreIcon");function Da({busy:n,title:r,t:i,onPreview:d,onRestoreOpen:m,onDelete:u,onCopyId:S}){let[k,A]=(0,l.useState)(!1),P=e(R=>{if(!n){if(A(!1),R==="copyId")return S?.();if(R==="preview")return d?.();if(R==="restoreOpen")return m?.();R==="delete"&&u?.()}},"choose"),I=[...d?[{id:"preview",label:i("discovery.preview"),icon:(0,a.jsx)(g.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...m?[{id:"restoreOpen",label:i("archives.restoreOpen"),icon:(0,a.jsx)(g.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...S?[{id:"copyId",label:i("details.copyId"),icon:(0,a.jsx)(g.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...u?[{id:"delete",label:i("menu.deleteSession"),icon:(0,a.jsx)(g.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,a.jsx)(g.Menu,{open:!n&&k,align:"end",portal:!0,dense:!0,items:I,onSelect:P,onClose:e(()=>A(!1),"onClose"),anchor:x({variant:"outline",className:"dsham_iconAction",disabled:n,title:i("archives.moreActions"),"aria-label":i("archives.moreActions")+i("common.separator")+r,"aria-haspopup":"menu","aria-expanded":k&&!n,icon:Zr(),onClick:e(()=>{n||A(R=>!R)},"onClick")})})}e(Da,"ArchivedSessionMenu");function Ma({group:n,busy:r,onArchive:i,onRestore:d,onDelete:m,t:u}){let S=n.key===Pn,k=i?[{id:"archive",label:u(S?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,a.jsx)(g.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:u(S?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,a.jsx)(g.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:u(S?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,a.jsx)(g.IconTrashOutlineMedium,{size:16}),danger:!0}],[A,P]=(0,l.useState)(!1),I=u(S?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),R=e(F=>{r||(F==="archive"?i?.():F==="restore"?d?.():F==="delete"&&m?.())},"choose");return(0,a.jsx)(g.Menu,{open:!r&&A,align:"end",portal:!0,dense:!0,items:k,onSelect:e(F=>{P(!1),R(F)},"onSelect"),onClose:e(()=>P(!1),"onClose"),anchor:x({variant:"outline",className:"dsham_iconAction",disabled:r,"aria-label":I,"aria-haspopup":"menu","aria-expanded":A&&!r,icon:Zr(),onClick:e(()=>{r||P(F=>!F)},"onClick")})})}e(Ma,"ArchivedGroupActions");let Pn="__ungrouped__";function za(n){return n===Pn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}e(za,"archivedBatchTargetForGroup");function pn(n,r,i){let d=[...new Set(n??[])];if(i.scope==="all")return d;if(i.scope==="sessions"){let u=new Set(i.sessionIds??[]);return d.filter(S=>u.has(S))}if(i.scope==="workspace"){let u=new Set(r.find(S=>S.workspaceId===i.workspaceId)?.sessionIds??[]);return d.filter(S=>u.has(S))}let m=new Set(r.flatMap(u=>u.sessionIds));return d.filter(u=>!m.has(u))}e(pn,"deriveArchivedBatchIds");function Jr(n){return[...new Set(n.flatMap(r=>r.sessions.map(i=>i.id)))]}e(Jr,"archivedSessionIdsInGroups");function Xr(n,r){let i=new Set(r);return[...new Set(n)].filter(d=>i.has(d))}e(Xr,"pruneArchivedSelection");function rr(n,r,i){let d=new Set(n);for(let m of r)i?d.add(m):d.delete(m);return[...d]}e(rr,"toggleArchivedSelection");function Qr(n,r){let i=n.deletedSessionIds.length,d=n.skippedSessionIds.length;return n.failures.length>0?{kind:"error",message:r("archives.deletePartial",{deleted:i,skipped:d,failed:n.failures.length,detail:n.failures[0].message})}:d>0&&i>0?{kind:"notice",message:r("archives.deleteSuccessWithSkipped",{deleted:i,skipped:d})}:d>0?{kind:"notice",message:r("archives.deleteSkipped",{n:d})}:{kind:"notice",message:r("archives.deleteSuccess",{n:i})}}e(Qr,"archivedDeleteFeedback");function es(n,r){let i=new Set(r);return Object.values(n).filter(d=>d.origin!=="subagent"&&!d.blank&&!i.has(d.id)).map(d=>d.id)}e(es,"unarchivedSessionIds");function ts(n,r,i,d){let m=r.map(k=>({key:k.workspaceId,title:k.title,ids:new Set(k.sessionIds),sessions:[]})),u=[];for(let k of i){let A=n[k];if(A===void 0||A.origin==="subagent")continue;let P=m.find(I=>I.ids?.has(k));(P===void 0?u:P.sessions).push(A)}let S=m.filter(k=>k.sessions.length>0);return u.length>0&&S.push({key:Pn,title:d,sessions:u}),S}e(ts,"deriveArchivedGroups");function ns(n,r,i,d,m=[]){let u=e((I,R)=>String(I).localeCompare(String(R),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),S=new Map;if(Array.isArray(m))for(let I=0;I<m.length;I++)S.set(m[I],I);let k=e(I=>{let R=r==="created"?i[I.id]:I.updatedAt;return typeof R=="number"&&Number.isFinite(R)?R:Number.NEGATIVE_INFINITY},"timestampOf"),A=e((I,R)=>{if(r==="archived"){let F=S.get(I.id)??-1,ge=(S.get(R.id)??-1)-F;if(ge!==0)return ge}if(r!=="alphabetical"){let F=k(R)-k(I);if(Number.isFinite(F)&&F!==0)return F}return u(it(I,d),it(R,d))||u(I.id,R.id)},"compareSessions");return n.map(I=>({...I,sessions:[...I.sessions].sort(A)})).sort((I,R)=>{if(r==="archived"){let F=I.sessions[0]?.id,h=R.sessions[0]?.id,ge=F!==void 0?S.get(F)??-1:-1,ce=(h!==void 0?S.get(h)??-1:-1)-ge;if(ce!==0)return ce}if(r!=="alphabetical"){let F=k(R.sessions[0])-k(I.sessions[0]);if(Number.isFinite(F)&&F!==0)return F}return u(I.title,R.title)||u(I.key,R.key)})}e(ns,"sortArchivedGroups");let rs={...ta,...js,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","common.close":"\u5173\u95ED","sidebar.entry.title":"\u4FA7\u8FB9\u680F\u5165\u53E3","sidebar.entry.desc":"\u5728\u5DE6\u4FA7\u4E3B\u5BFC\u822A\u680F\u663E\u793A\u5F52\u6863\u7BA1\u7406\u5668\u3002\u8BBE\u7F6E\u91CC\u7684\u5165\u53E3\u4E0D\u53D8\u3002","sidebar.entry.toggle":"\u5207\u6362\u4FA7\u8FB9\u680F\u5165\u53E3","sidebar.favoriteStar.title":"\u4FA7\u680F\u6536\u85CF\u661F\u6807","sidebar.favoriteStar.desc":"\u5728\u4F1A\u8BDD\u5217\u8868\u884C\u524D\u663E\u793A\u6536\u85CF\u661F\u6807\u3002\u5173\u95ED\u540E\u4E0D\u663E\u793A\u56FE\u6807\uFF0C\u4ECD\u53EF\u901A\u8FC7\u83DC\u5355\u6536\u85CF\u548C\u7B5B\u9009\u3002","sidebar.favoriteStar.toggle":"\u5207\u6362\u4FA7\u680F\u6536\u85CF\u661F\u6807","update.entry.title":"\u5728\u7EBF\u66F4\u65B0","update.entry.desc":"\u5141\u8BB8\u68C0\u67E5\u5E76\u5728\u7EBF\u5B89\u88C5\u5F52\u6863\u7BA1\u7406\u5668\u7684\u65B0\u7248\u672C\u3002\u5173\u95ED\u540E\u9690\u85CF\u66F4\u65B0\u5165\u53E3\u3002","update.entry.toggle":"\u5207\u6362\u5728\u7EBF\u66F4\u65B0","update.entry.locked":"\u5728\u7EBF\u66F4\u65B0\u5DF2\u88AB\u5BBF\u4E3B\u914D\u7F6E\u9501\u5B9A\u7981\u7528","archives.archiveProject":"\u5F52\u6863\u8BE5\u9879\u76EE\u7684\u5168\u90E8\u804A\u5929","archives.archiveUngrouped":"\u5F52\u6863\u5168\u90E8\u672A\u5206\u7EC4\u804A\u5929","archives.archiveProjectDesc":"\u5C06\u201C{name}\u201D\u4E2D\u5168\u90E8 {n} \u6761\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.archiveUngroupedDesc":"\u5C06\u5168\u90E8 {n} \u6761\u672A\u5206\u7EC4\u7684\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.tab.archived":"\u5DF2\u5F52\u6863","archives.tab.unarchived":"\u672A\u5F52\u6863","archives.searchUnarchived":"\u641C\u7D22\u672A\u5F52\u6863\u804A\u5929","archives.emptyUnarchived":"\u6682\u65E0\u672A\u5F52\u6863\u4F1A\u8BDD\u3002","archives.archiveSelected":"\u5F52\u6863","archives.openSession":"\u6253\u5F00","archives.moreActions":"\u66F4\u591A\u64CD\u4F5C","archives.archiveSelectedDesc":"\u5C06\u9009\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\uFF0C\u5305\u542B\u5F53\u524D\u7B5B\u9009\u9690\u85CF\u7684\u5DF2\u9009\u9879\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u67E5\u770B\u548C\u6062\u590D\u3002","archives.archiveSuccess":"\u5DF2\u5F52\u6863 {n} \u6761\u4F1A\u8BDD\u3002","archives.archiveBatchFailed":"\u6279\u91CF\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.navigationUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u65E0\u6CD5\u4FDD\u6301\u5F52\u6863\u5BF9\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u201C\u6062\u590D\u5E76\u6253\u5F00\u201D\u3002","archives.sessionNotRetained":"\u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u6216\u6062\u590D\u540E\u518D\u8BD5\u3002","archives.restoreOpen":"\u6062\u590D\u6253\u5F00","archives.selectedCount":"\u5DF2\u9009 {n} \u6761","archives.selectionHiddenHint":"\u542B\u5F53\u524D\u672A\u663E\u793A\u7684 {hidden} \u6761\uFF0C\u4E5F\u5C06\u53C2\u4E0E\u64CD\u4F5C","archives.clearSelectionShort":"\u6E05\u7A7A","archives.restore":"\u6062\u590D","archives.archiveTitle":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archives.deleteSelectionShort":"\u5220\u9664","archives.clearSelection":"\u6E05\u7A7A\u9009\u62E9","group.ungrouped":"\u672A\u5206\u7EC4","session.new":"\u65B0\u4F1A\u8BDD","section.workspaces":"\u5DE5\u4F5C\u533A","section.sessions":"\u4F1A\u8BDD","viewOptions.label":"\u89C6\u56FE\u9009\u9879","groupBy.label":"\u5206\u7EC4\u65B9\u5F0F","groupBy.workspace":"\u6309\u5DE5\u4F5C\u533A","groupBy.flat":"\u5355\u5217\u8868","orderBy.label":"\u6392\u5E8F\u65B9\u5F0F","orderBy.manual":"\u624B\u52A8\u6392\u5E8F","orderBy.updated":"\u6700\u8FD1\u66F4\u65B0","sessions.expand":"\u5C55\u5F00\u5176\u4F59 {n} \u4E2A\u4F1A\u8BDD","sessions.collapse":"\u6536\u8D77","empty.none":"\u6682\u65E0\u4F1A\u8BDD","workspace.add":"\u6DFB\u52A0\u5DE5\u4F5C\u533A","search.sessions.aria":"\u641C\u7D22\u4F1A\u8BDD","search.placeholder":"\u641C\u7D22\u4F1A\u8BDD\u2026","search.clear":"\u6E05\u9664\u641C\u7D22","search.results.aria":"\u641C\u7D22\u7ED3\u679C","search.pending":"\u6B63\u5728\u641C\u7D22\u4F1A\u8BDD\u5386\u53F2\u2026","search.unavailable":"\u5185\u5BB9\u641C\u7D22\u6682\u4E0D\u53EF\u7528\uFF0C\u4EC5\u663E\u793A\u540D\u79F0\u5339\u914D\u3002","search.noMatches":"\u65E0\u5339\u914D\u4F1A\u8BDD","search.hasMore":"\u4EC5\u663E\u793A\u524D {n} \u6761\u7ED3\u679C\uFF0C\u8BF7\u7F29\u5C0F\u641C\u7D22\u8303\u56F4\u3002","menu.addWorkspace":"\u6DFB\u52A0\u5DE5\u4F5C\u533A\u2026","menu.unarchive":"\u53D6\u6D88\u5F52\u6863","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archived.notOpenable":"\u5DF2\u5F52\u6863\uFF0C\u53D6\u6D88\u5F52\u6863\u540E\u53EF\u7EE7\u7EED\u5BF9\u8BDD","archives.title":"\u5F52\u6863\u4F1A\u8BDD","archives.description":"\u7BA1\u7406\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u6216\u9009\u62E9\u672A\u5F52\u6863\u4F1A\u8BDD\u8FDB\u884C\u6279\u91CF\u5F52\u6863\u3002","archives.viewProject":"GitHub","archives.feedback":"\u95EE\u9898\u53CD\u9988","archives.empty":"\u6682\u65E0\u5DF2\u5F52\u6863\u4F1A\u8BDD","archives.emptyFiltered":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u804A\u5929","archives.searchPlaceholder":"\u641C\u7D22\u5DF2\u5F52\u6863\u804A\u5929","archives.sortBy":"\u6392\u5E8F\u65B9\u5F0F","archives.sortLabel":"\u6392\u5E8F\u65B9\u5F0F","archives.viewOptions":"\u89C6\u56FE\u9009\u9879","archives.sortArchived":"\u6700\u8FD1\u5F52\u6863","archives.sortUpdated":"\u66F4\u65B0\u65F6\u95F4","archives.sortCreated":"\u521B\u5EFA\u65F6\u95F4","archives.sortAlphabetical":"\u6309\u5B57\u6BCD\u987A\u5E8F","archives.projectFilter":"\u6309\u9879\u76EE\u7B5B\u9009","archives.allProjects":"\u6240\u6709\u9879\u76EE","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","organizer.allChats":"\u5168\u90E8\u804A\u5929","archives.sessionCount":"{n} \u4E2A\u804A\u5929","archives.selectAllFiltered":"\u5168\u9009\u5F53\u524D\u7B5B\u9009\u7ED3\u679C","archives.selectSession":"\u9009\u62E9\u4F1A\u8BDD\u201C{name}\u201D","archives.restoreSelected":"\u6062\u590D\u6240\u9009","archives.deleteSelected":"\u5220\u9664\u6240\u9009","archives.timestamp":"{date}\uFF0C{time}","archives.restoreProject":"\u6062\u590D\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.restoreUngrouped":"\u5168\u90E8\u6062\u590D","archives.deleteProject":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngrouped":"\u5168\u90E8\u5220\u9664","archives.projectActions":"\u9879\u76EE\u201C{name}\u201D\u7684\u5F52\u6863\u64CD\u4F5C","archives.ungroupedActions":"\u672A\u5206\u7EC4\u804A\u5929\u7684\u5F52\u6863\u64CD\u4F5C","archives.restoreSuccess":"\u5DF2\u6062\u590D {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.restoreBatchFailed":"\u6279\u91CF\u6062\u590D\u5931\u8D25\uFF1A{detail}","archives.deleteSelectedTitle":"\u5220\u9664\u6240\u9009\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteSelectedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u6240\u9009\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteSelectedConfirm":"\u5220\u9664\u6240\u9009\u804A\u5929","archives.deleteProjectTitle":"\u5220\u9664\u201C{name}\u201D\u4E2D\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteProjectDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{name}\u201D\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u9879\u76EE\u76EE\u5F55\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteProjectConfirm":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngroupedTitle":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteUngroupedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u672A\u5206\u7EC4\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u9879\u76EE\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteUngroupedConfirm":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5168\u90E8\u804A\u5929","archives.deleteBatchPending":"\u6B63\u5728\u5220\u9664\u5DF2\u5F52\u6863\u804A\u5929\u2026","archives.deleteSuccess":"\u5DF2\u5220\u9664 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.deleteSuccessWithSkipped":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\uFF1B\u53E6\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deleteSkipped":"\u5DF2\u6E05\u7406 {n} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deletePartial":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u804A\u5929\uFF0C\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\uFF1B{failed} \u4E2A\u5220\u9664\u5931\u8D25\uFF1A{detail}","archives.unarchiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u53D6\u6D88\u5F52\u6863\u3002","archives.unarchiveFailed":"\u53D6\u6D88\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5F52\u6863\u3002","archives.archiveFailed":"\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveActive":"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF08{kinds}\uFF09\u3002","archiveActive.title":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.desc":"\u201C{name}\u201D\u4ECD\u6709\u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\uFF1A{kinds}\u3002\u5F52\u6863\u524D\u4F1A\u505C\u6B62\u8FD9\u4E9B\u5DE5\u4F5C\u3002","archiveActive.confirm":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.pending":"\u6B63\u5728\u505C\u6B62\u5E76\u5F52\u6863\u2026","archives.forkFailed":"\u5206\u53C9\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","deleteSession.title":"\u5220\u9664\u4F1A\u8BDD","deleteSession.confirmTitle":"\u5220\u9664\u4F1A\u8BDD\uFF1F","deleteSession.desc":"\u5C06\u6C38\u4E45\u5220\u9664\u4F1A\u8BDD\u201C{name}\u201D\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u5168\u90E8\u8BB0\u5F55\uFF08\u5BF9\u8BDD\u5185\u5BB9\u3001\u7EDF\u8BA1\u3001\u7F13\u5B58\uFF09\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","deleteSession.pending":"\u6B63\u5728\u5220\u9664\u4F1A\u8BDD\u2026","deleteSession.unknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5220\u9664\u3002","deleteSession.failed":"\u5220\u9664\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","picker.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u533A\u2026","conflict.named":"\u5DF2\u5B58\u5728\u540D\u4E3A\u201C{name}\u201D\u7684\u5DE5\u4F5C\u533A\u3002","folderError.title":"\u65E0\u6CD5\u6253\u5F00\u6587\u4EF6\u5939","folderError.retry":"\u91CD\u65B0\u9009\u62E9",rename:"\u91CD\u547D\u540D","rename.workspace.title":"\u91CD\u547D\u540D\u5DE5\u4F5C\u533A","rename.session.title":"\u91CD\u547D\u540D\u4F1A\u8BDD","field.workspaceName":"\u5DE5\u4F5C\u533A\u540D\u79F0","field.sessionName":"\u4F1A\u8BDD\u540D\u79F0","delete.workspace":"\u5220\u9664\u5DE5\u4F5C\u533A","delete.desc":"\u5C06\u628A\u201C{name}\u201D\u4ECE\u5DE5\u4F5C\u533A\u5217\u8868\u4E2D\u79FB\u9664\u3002\u6587\u4EF6\u5939\u4E0E\u4F1A\u8BDD\u8BB0\u5F55\u4F1A\u4FDD\u7559\uFF0C\u5176\u4F1A\u8BDD\u5C06\u663E\u793A\u5728\u201C\u672A\u5206\u7EC4\u201D\u4E0B\u3002","delete.pending":"\u6B63\u5728\u5220\u9664\u5DE5\u4F5C\u533A\u2026","menu.fork":"\u5206\u53C9\u4F1A\u8BDD","menu.archiveSession":"\u5F52\u6863\u4F1A\u8BDD","menu.archiveWorkspace":"\u5F52\u6863\u4F1A\u8BDD","menu.copyWorkspacePath":"\u590D\u5236\u76EE\u5F55","menu.openInExplorer":"\u6253\u5F00\u76EE\u5F55","menu.moveSession":"\u79FB\u52A8\u5230\u5DE5\u4F5C\u533A","moveSession.title":"\u79FB\u52A8\u4F1A\u8BDD\u5230\u5DE5\u4F5C\u533A","moveSession.desc":"\u5C06\u201C{name}\u201D\u79FB\u52A8\u5230\u76EE\u6807\u5DE5\u4F5C\u533A\uFF0C\u540E\u7EED\u5BF9\u8BDD\u5C06\u5728\u76EE\u6807\u5DE5\u4F5C\u533A\u73AF\u5883\u4E2D\u6267\u884C\u3002","moveSession.warning":"\u63D0\u793A\uFF1A\u79FB\u52A8\u540E\u8BE5\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u76EE\u5F55\u5C06\u53D8\u66F4\u4E3A\u76EE\u6807\u9879\u76EE\u76EE\u5F55\u3002","moveSession.currentWorkspace":"\u5F53\u524D\u5DE5\u4F5C\u533A\uFF1A{name}","moveSession.selectLabel":"\u9009\u62E9\u76EE\u6807\u5DE5\u4F5C\u533A","moveSession.noOtherWorkspaces":"\u6682\u65E0\u53EF\u79FB\u52A8\u7684\u5176\u4ED6\u5DE5\u4F5C\u533A","moveSession.confirm":"\u79FB\u52A8","moveSession.pending":"\u6B63\u5728\u79FB\u52A8\u4F1A\u8BDD\u2026","moveSession.success":"\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C{name}\u201D","archiveWorkspace.title":"\u5F52\u6863 {n} \u4E2A\u4F1A\u8BDD\uFF1F","archiveWorkspace.desc":"\u8FD9\u4F1A\u5C06\u201C{name}\u201D\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\u3002\u4E4B\u540E\u53EF\u4EE5\u5728\u201C\u8BBE\u7F6E \u2192 \u5F52\u6863\u4F1A\u8BDD\u201D\u4E2D\u627E\u5230\u5B83\u4EEC\u3002","archiveWorkspace.confirm":"\u5168\u90E8\u5F52\u6863","archiveWorkspace.pending":"\u6B63\u5728\u5F52\u6863\u4F1A\u8BDD\u2026","actions.workspace.aria":"\u5DE5\u4F5C\u533A\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.session.aria":"\u4F1A\u8BDD\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.newSession.aria":"\u5728\u201C{name}\u201D\u4E2D\u65B0\u5EFA\u4F1A\u8BDD","status.running":"\u8FDB\u884C\u4E2D","status.subagentsRunning.one":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.subagentsRunning.other":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.idle":"\u7A7A\u95F2","status.waitingApproval":"\u7B49\u5F85\u5BA1\u6279","status.planReview":"\u8BA1\u5212\u5F85\u5BA1","status.waitingAnswer":"\u7B49\u5F85\u56DE\u7B54","status.completed":"\u5DF2\u5B8C\u6210","hover.created":"\u521B\u5EFA\u4E8E {time}","hover.copied":"\u5DF2\u590D\u5236","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5","time.now":"\u521A\u521A","time.minutes":"{n}\u5206\u949F","time.hours":"{n}\u5C0F\u65F6","time.days":"{n}\u5929","time.months":"{n}\u4E2A\u6708","time.years":"{n}\u5E74","time.ago":"{t}\u524D"},ss={...na,...Ds,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","common.close":"Close","sidebar.entry.title":"Sidebar entry","sidebar.entry.desc":"Show Archived Sessions in the left sidebar. The Settings entry stays either way.","sidebar.entry.toggle":"Toggle sidebar entry","sidebar.favoriteStar.title":"Sidebar favorite star","sidebar.favoriteStar.desc":"Show favorite star on session rows in the sidebar. When disabled, the star is hidden while menu actions and filters stay available.","sidebar.favoriteStar.toggle":"Toggle sidebar favorite star","update.entry.title":"Online updates","update.entry.desc":"Allow checking and installing new versions online. Hides the update entry when disabled.","update.entry.toggle":"Toggle online updates","update.entry.locked":"Online updates are disabled by the host configuration.","archives.moreActions":"More actions","archives.archiveProject":"Archive all chats in this project","archives.archiveUngrouped":"Archive all ungrouped chats","archives.archiveProjectDesc":"Archive all {n} unarchived sessions in \u201C{name}\u201D, regardless of the current search filter. You can restore them in Archived.","archives.archiveUngroupedDesc":"Archive all {n} ungrouped, unarchived sessions, regardless of the current search filter. You can restore them in Archived.","archives.tab.archived":"Archived","archives.tab.unarchived":"Unarchived","archives.searchUnarchived":"Search unarchived chats","archives.emptyUnarchived":"No unarchived sessions.","archives.archiveSelected":"Archive","archives.openSession":"Open session","archives.archiveSelectedDesc":"Archive the selected sessions, including selections hidden by the current filter. You can view and restore them in Archived.","archives.archiveSuccess":"Archived {n} sessions.","archives.archiveBatchFailed":"Batch archive failed: {detail}","archives.navigationUnavailable":"This host cannot keep the conversation archived while opening it. Use \u201CRestore and open\u201D instead.","archives.sessionNotRetained":"The host did not keep the requested conversation open. Try again, or restore it before opening.","archives.restoreOpen":"Restore and open","archives.selectedCount":"{n} selected","archives.selectionHiddenHint":"Includes {hidden} hidden by the current filter; actions apply to them too.","archives.clearSelectionShort":"Clear","archives.restore":"Restore","archives.archiveTitle":"Archive {n} chats?","archives.deleteSelectionShort":"Delete","archives.clearSelection":"Clear selection","group.ungrouped":"Ungrouped","session.new":"New Session","section.workspaces":"Workspaces","section.sessions":"Sessions","viewOptions.label":"View options","groupBy.label":"Group by","groupBy.workspace":"Workspace","groupBy.flat":"In one list","orderBy.label":"Order by","orderBy.manual":"Manual","orderBy.updated":"Last updated","sessions.expand":"Show {n} more sessions","sessions.collapse":"Show less","empty.none":"No sessions yet","workspace.add":"Add workspace","search.sessions.aria":"Search sessions","search.placeholder":"Search sessions...","search.clear":"Clear search","search.results.aria":"Search results","search.pending":"Searching session history\u2026","search.unavailable":"Content search is temporarily unavailable. Showing name matches.","search.noMatches":"No matching sessions","search.hasMore":"Showing the first {n} results. Narrow your search.","menu.addWorkspace":"Add workspace\u2026","menu.unarchive":"Unarchive","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archived.notOpenable":"This session is archived. Unarchive it to continue the conversation.","archives.title":"Archived sessions","archives.description":"Manage archived sessions or select unarchived sessions to archive in bulk.","archives.viewProject":"GitHub","archives.feedback":"Issues","archives.empty":"No archived sessions.","archives.emptyFiltered":"No chats match your filters.","archives.searchPlaceholder":"Search archived chats","archives.sortBy":"Sort archived chats","archives.sortLabel":"Sort order","archives.viewOptions":"View options","archives.sortArchived":"Recently archived","archives.sortUpdated":"Last updated","archives.sortCreated":"Created","archives.sortAlphabetical":"Alphabetical","archives.projectFilter":"Filter by project","archives.allProjects":"All projects","discovery.timeRange":"Date range","organizer.allChats":"All chats","archives.sessionCount":"{n} chats","archives.selectAllFiltered":"Select all results","archives.selectSession":"Select chat {name}","archives.restoreSelected":"Restore selected","archives.deleteSelected":"Delete selected","archives.timestamp":"{date}, {time}","archives.restoreProject":"Restore all chats in this project","archives.restoreUngrouped":"Restore all","archives.deleteProject":"Delete all chats in this project","archives.deleteUngrouped":"Delete all","archives.projectActions":"Archive actions for project {name}","archives.ungroupedActions":"Archive actions for ungrouped chats","archives.restoreSuccess":"Restored {n} archived chats.","archives.restoreBatchFailed":"Could not restore the archived chats: {detail}","archives.deleteSelectedTitle":"Delete selected archived chats","archives.deleteSelectedDesc":"This permanently deletes the selected {n} archived chats, their child agents (including any that are still running), and their records. Other chats are not affected. This cannot be undone.","archives.deleteSelectedConfirm":"Delete selected chats","archives.deleteProjectTitle":"Delete archived chats in {name}","archives.deleteProjectDesc":"This permanently deletes the {n} archived chats in {name}, their child agents, and their records. The project directory and unarchived chats are not affected. This cannot be undone.","archives.deleteProjectConfirm":"Delete all project chats","archives.deleteUngroupedTitle":"Delete ungrouped archived chats","archives.deleteUngroupedDesc":"This permanently deletes the {n} ungrouped archived chats, their child agents, and their records. Other projects and unarchived chats are not affected. This cannot be undone.","archives.deleteUngroupedConfirm":"Delete all ungrouped chats","archives.deleteBatchPending":"Deleting archived chats\u2026","archives.deleteSuccess":"Deleted {n} archived chats.","archives.deleteSuccessWithSkipped":"Deleted {deleted} archived chats and cleared {skipped} stale archive entries for sessions that no longer exist.","archives.deleteSkipped":"Cleared {n} stale archive entries for sessions that no longer exist.","archives.deletePartial":"Deleted {deleted} chats and cleared {skipped} stale archive entries; {failed} could not be deleted: {detail}","archives.unarchiveUnknown":"This session no longer exists, so it cannot be unarchived.","archives.unarchiveFailed":"Could not unarchive the session: {detail}","archives.archiveUnknown":"This session no longer exists, so it cannot be archived.","archives.archiveFailed":"Could not archive the session: {detail}","archives.archiveActive":"This conversation is still running ({kinds}).","archiveActive.title":"Stop and archive","archiveActive.desc":"\u201C{name}\u201D still has work in progress: {kinds}. Archiving stops that work first.","archiveActive.confirm":"Stop and archive","archiveActive.pending":"Stopping and archiving\u2026","archives.forkFailed":"Could not fork the session: {detail}","deleteSession.title":"Delete session","deleteSession.confirmTitle":"Delete session?","deleteSession.desc":"This permanently deletes session \u201C{name}\u201D, its child agents (including any that are still running), and all of its records (conversation, stats, cache). This cannot be undone.","deleteSession.pending":"Deleting session\u2026","deleteSession.unknown":"This session no longer exists or was already deleted.","deleteSession.failed":"Could not delete the session: {detail}","picker.loading":"Loading workspaces\u2026","conflict.named":"A workspace named \u201C{name}\u201D already exists.","folderError.title":"Couldn\u2019t open folder","folderError.retry":"Choose again",rename:"Rename","rename.workspace.title":"Rename workspace","rename.session.title":"Rename session","field.workspaceName":"Workspace name","field.sessionName":"Session name","delete.workspace":"Delete workspace","delete.desc":"This removes \u201C{name}\u201D from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.","delete.pending":"Deleting workspace\u2026","menu.fork":"Fork session","menu.archiveSession":"Archive session","menu.archiveWorkspace":"Archive sessions","menu.copyWorkspacePath":"Copy folder path","menu.openInExplorer":"Open folder","menu.moveSession":"Move to workspace","moveSession.title":"Move session to workspace","moveSession.desc":"Move \u201C{name}\u201D to target workspace. Subsequent turns will execute within the destination context.","moveSession.warning":"Note: The session working directory will change to the destination project path.","moveSession.currentWorkspace":"Current workspace: {name}","moveSession.selectLabel":"Select destination workspace","moveSession.noOtherWorkspaces":"No other workspaces available","moveSession.confirm":"Move","moveSession.pending":"Moving session\u2026","moveSession.success":"Session successfully moved to \u201C{name}\u201D","archiveWorkspace.title":"Archive {n} conversations?","archiveWorkspace.desc":"This archives all conversations in \u201C{name}\u201D. You can find them later in Archived sessions.","archiveWorkspace.confirm":"Archive all","archiveWorkspace.pending":"Archiving conversations\u2026","actions.workspace.aria":"Workspace actions for {name}","actions.session.aria":"Session actions for {name}","actions.newSession.aria":"New session in {name}","status.running":"Running","status.subagentsRunning.one":"{n} subagent running","status.subagentsRunning.other":"{n} subagents running","status.idle":"Idle","status.waitingApproval":"Waiting for approval","status.planReview":"Plan awaiting review","status.waitingAnswer":"Waiting for answer","status.completed":"Completed","hover.created":"Created {time}","hover.copied":"Copied","date.ymd":"{y}-{m}-{d}","time.now":"now","time.minutes":"{n}min","time.hours":"{n}h","time.days":"{n}d","time.months":"{n}mo","time.years":"{n}y","time.ago":"{t} ago"},Oa={...ra,...Ms,"locale.language":"ru","service.unavailable":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","common.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","sidebar.entry.title":"\u041F\u0443\u043D\u043A\u0442 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.entry.desc":"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0430\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439 \u043D\u0430 \u043B\u0435\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0443\u043D\u043A\u0442 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F.","sidebar.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.favoriteStar.title":"\u0417\u0432\u0435\u0437\u0434\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.favoriteStar.desc":"\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0443 \u0441\u0442\u0440\u043E\u043A \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438 \u0437\u043D\u0430\u0447\u043E\u043A \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F, \u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043C\u0435\u043D\u044E \u0438 \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u043C\u0438.","sidebar.favoriteStar.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","update.entry.title":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.desc":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439 \u043E\u043D\u043B\u0430\u0439\u043D. \u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u043F\u0443\u043D\u043A\u0442 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438.","update.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.locked":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0445\u043E\u0441\u0442\u0430.","archives.moreActions":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E","archives.archiveProject":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.archiveUngrouped":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.archiveProjectDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \xAB{name}\xBB, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveUngroupedDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.tab.archived":"\u0410\u0440\u0445\u0438\u0432","archives.tab.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.searchUnarchived":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.emptyUnarchived":"\u041D\u0435\u0442 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.archiveSelected":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.openSession":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archives.archiveSelectedDesc":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0441\u043A\u0440\u044B\u0442\u044B\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveSuccess":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441\u0435\u0441\u0441\u0438\u0439: {n}.","archives.archiveBatchFailed":"\u041F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {detail}","archives.navigationUnavailable":"\u042D\u0442\u043E\u0442 \u0445\u043E\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438. \u0412\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \xAB\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\xBB.","archives.sessionNotRetained":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0438\u043B\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C.","archives.restoreOpen":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C","archives.selectedCount":"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}","archives.selectionHiddenHint":"\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 {hidden}, \u0441\u043A\u0440\u044B\u0442\u044B\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u0438 \u043A \u043D\u0438\u043C.","archives.clearSelectionShort":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C","archives.restore":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C","archives.archiveTitle":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archives.deleteSelectionShort":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","archives.clearSelection":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440","group.ungrouped":"\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B","session.new":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F","section.workspaces":"\u0420\u0430\u0431\u043E\u0447\u0438\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","section.sessions":"\u0421\u0435\u0441\u0441\u0438\u0438","viewOptions.label":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430","groupBy.label":"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E","groupBy.workspace":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","groupBy.flat":"\u0412 \u043E\u0434\u043D\u043E\u043C \u0441\u043F\u0438\u0441\u043A\u0435","orderBy.label":"\u041F\u043E\u0440\u044F\u0434\u043E\u043A","orderBy.manual":"\u0412\u0440\u0443\u0447\u043D\u0443\u044E","orderBy.updated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","sessions.expand":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 {n} \u0441\u0435\u0441\u0441\u0438\u0439","sessions.collapse":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u043D\u044C\u0448\u0435","empty.none":"\u041F\u043E\u043A\u0430 \u043D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439","workspace.add":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","search.sessions.aria":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439","search.placeholder":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439...","search.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u043E\u0438\u0441\u043A","search.results.aria":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043F\u043E\u0438\u0441\u043A\u0430","search.pending":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0438\u0441\u0442\u043E\u0440\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0439\u2026","search.unavailable":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0441\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u044F \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C.","search.noMatches":"\u041D\u0435\u0442 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439","search.hasMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u044B \u043F\u0435\u0440\u0432\u044B\u0435 {n} \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432. \u0421\u0443\u0437\u044C\u0442\u0435 \u043F\u043E\u0438\u0441\u043A.","menu.addWorkspace":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E\u2026","menu.unarchive":"\u0412\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430","menu.deleteSession":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archived.badge":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archived.notOpenable":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0412\u0435\u0440\u043D\u0438\u0442\u0435 \u0435\u0451 \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440.","archives.title":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.description":"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0438\u043B\u0438 \u0432\u044B\u0431\u043E\u0440 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438.","archives.viewProject":"GitHub","archives.feedback":"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u044B","archives.empty":"\u041D\u0435\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.emptyFiltered":"\u041D\u0438 \u043E\u0434\u0438\u043D \u0447\u0430\u0442 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0448\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u043C.","archives.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.sortBy":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.sortLabel":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430","archives.viewOptions":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0432\u0438\u0434\u0430","archives.sortArchived":"\u041D\u0435\u0434\u0430\u0432\u043D\u043E \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.sortUpdated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","archives.sortCreated":"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F","archives.sortAlphabetical":"\u041F\u043E \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u0443","archives.projectFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0443","archives.allProjects":"\u0412\u0441\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","organizer.allChats":"\u0412\u0441\u0435 \u0447\u0430\u0442\u044B","archives.sessionCount":"{n} \u0447\u0430\u0442\u043E\u0432","archives.selectAllFiltered":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B","archives.selectSession":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0447\u0430\u0442 {name}","archives.restoreSelected":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.deleteSelected":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.timestamp":"{date}, {time}","archives.restoreProject":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.restoreUngrouped":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435","archives.deleteProject":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngrouped":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435","archives.projectActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0435\u043A\u0442\u0430 {name}","archives.ungroupedActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.restoreSuccess":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.restoreBatchFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B: {detail}","archives.deleteSelectedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteSelectedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteSelectedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteProjectTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u0432 {name}","archives.deleteProjectDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0432 {name}, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteProjectConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngroupedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteUngroupedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteUngroupedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteBatchPending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432\u2026","archives.deleteSuccess":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.deleteSuccessWithSkipped":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deleteSkipped":"\u041E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deletePartial":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430; {failed} \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C: {detail}","archives.unarchiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430.","archives.unarchiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430: {detail}","archives.archiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C.","archives.archiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","archives.archiveActive":"\u042D\u0442\u043E\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F ({kinds}).","archiveActive.title":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.desc":"\u0412 \xAB{name}\xBB \u0435\u0449\u0451 \u0438\u0434\u0451\u0442 \u0440\u0430\u0431\u043E\u0442\u0430: {kinds}. \u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442 \u0435\u0451.","archiveActive.confirm":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.pending":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 \u0438 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F\u2026","archives.forkFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438: {detail}","deleteSession.title":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","deleteSession.confirmTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E?","deleteSession.desc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044E \xAB{name}\xBB, \u0435\u0451 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0432\u0441\u0435 \u0435\u0451 \u0437\u0430\u043F\u0438\u0441\u0438 (\u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0443, \u043A\u044D\u0448). \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","deleteSession.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","deleteSession.unknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u0443\u0436\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0430.","deleteSession.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","picker.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u2026","conflict.named":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E \u0441 \u0438\u043C\u0435\u043D\u0435\u043C \xAB{name}\xBB \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","folderError.title":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","folderError.retry":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430",rename:"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C","rename.workspace.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","rename.session.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","field.workspaceName":"\u0418\u043C\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","field.sessionName":"\u0418\u043C\u044F \u0441\u0435\u0441\u0441\u0438\u0438","delete.workspace":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","delete.desc":"\u042D\u0442\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \xAB{name}\xBB \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432. \u041F\u0430\u043F\u043A\u0430 \u0438 \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0441\u0435\u0441\u0441\u0438\u0439 \u043E\u0441\u0442\u0430\u043D\u0443\u0442\u0441\u044F. \u0415\u0433\u043E \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B\xBB.","delete.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430\u2026","menu.fork":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438","menu.archiveSession":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","menu.archiveWorkspace":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u0438","menu.copyWorkspacePath":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0443\u0442\u044C \u043A \u043F\u0430\u043F\u043A\u0435","menu.openInExplorer":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","menu.moveSession":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0432 \u043F\u0440\u043E\u0435\u043A\u0442","moveSession.title":"\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","moveSession.desc":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \xAB{name}\xBB \u0432 \u0446\u0435\u043B\u0435\u0432\u043E\u0435 \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E. \u0414\u0430\u043B\u044C\u043D\u0435\u0439\u0448\u0438\u0435 \u0440\u0435\u043F\u043B\u0438\u043A\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0442\u044C\u0441\u044F \u0432 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435 \u0446\u0435\u043B\u0435\u0432\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430.","moveSession.warning":"\u041F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u0435: \u0440\u0430\u0431\u043E\u0447\u0438\u0439 \u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043C\u0435\u043D\u0435\u043D \u043D\u0430 \u043F\u0443\u0442\u044C \u0446\u0435\u043B\u0435\u0432\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430.","moveSession.currentWorkspace":"\u0422\u0435\u043A\u0443\u0449\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442: {name}","moveSession.selectLabel":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0435\u043A\u0442","moveSession.noOtherWorkspaces":"\u041D\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u0432","moveSession.confirm":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C","moveSession.pending":"\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","moveSession.success":"\u0421\u0435\u0441\u0441\u0438\u044F \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0430 \u0432 \xAB{name}\xBB","archiveWorkspace.title":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0441\u0435\u0441\u0441\u0438\u0439?","archiveWorkspace.desc":"\u042D\u0442\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432 \xAB{name}\xBB. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u043F\u043E\u0437\u0436\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archiveWorkspace.confirm":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435","archiveWorkspace.pending":"\u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0439\u2026","actions.workspace.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430 \u0434\u043B\u044F {name}","actions.session.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0438 \u0434\u043B\u044F {name}","actions.newSession.aria":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F \u0432 {name}","status.running":"\u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F","status.subagentsRunning.one":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442","status.subagentsRunning.other":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442","status.idle":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435","status.waitingApproval":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F","status.planReview":"\u041F\u043B\u0430\u043D \u043E\u0436\u0438\u0434\u0430\u0435\u0442 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438","status.waitingAnswer":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043E\u0442\u0432\u0435\u0442\u0430","status.completed":"\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","hover.created":"\u0421\u043E\u0437\u0434\u0430\u043D\u043E {time}","hover.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","date.ymd":"{y}-{m}-{d}","time.now":"\u0441\u0435\u0439\u0447\u0430\u0441","time.minutes":"{n}\u043C\u0438\u043D","time.hours":"{n}\u0447","time.days":"{n}\u0434","time.months":"{n}\u043C\u0435\u0441","time.years":"{n}\u0433","time.ago":"{t} \u043D\u0430\u0437\u0430\u0434"},Je="archive-manager-workspace",Pa=["slots","sessions","workspaces","locale","remote","typert"];function sr(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}e(sr,"bindObservable");function as(n){return async r=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(r)}}e(as,"createUnarchiveSession");async function ar(n,r,i){let d=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),m=await Vn(r,async S=>{try{await n.archiveSession(S)}catch(k){throw k!==null&&typeof k=="object"&&zn(k)!==void 0&&typeof ne(k).sessionId!="string"&&Object.assign(k,{sessionId:S}),k}return!0},{refresh:i}),u=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:u,archivedSessionIdsAdded:u.filter(S=>!d.has(S)),failures:m.failures}}e(ar,"archiveSessionsViaOfficial");async function is(n,r,i,d){let m=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),u=typeof d=="function"?d:A=>n.unarchiveSession?.(A),S=await Vn(r,async A=>(await u(A),!0),{refresh:i}),k=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:k,unarchivedSessionIds:[...m].filter(A=>!k.includes(A)),failures:S.failures}}e(is,"unarchiveSessionsViaOfficial");async function La(n){Fa(n);let r=n.get("remote"),i=e(()=>{},"disposeRemote");return r!==void 0&&(i=await r.$mount(It)),async()=>{await i()}}e(La,"apply");function Fa(n){n.effect(()=>n.locale.register(Je,{zh:rs,en:ss,ru:Oa}),"dsh-archive-manager: dictionaries");let r=e(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),i={},d,m=e(f=>(d=Bs(f,n.sessions,n.workspaces,{onOpened:e(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:e(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>d?.dispose()),"attachArchiveNavigation");n.effect(()=>m(r()),"archive-manager: explicit archived navigation");let u=e(f=>{if(d===void 0)throw new $t("navigationUnavailable");return qr.request(f),d.open(f)},"openConversation"),S=e(async f=>{n.get("layout")?.beginNavigation?.(),qr.request(f)},"focusSessionWorkspace"),k=e(async(f,w)=>{let T=await n.sessions.search(f,w);if(!T.ok)throw new Error(T.error.message);return T.value},"searchSessions"),A=e(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await ge(),null}catch(f){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",f),f instanceof Error?f.message:String(f)}},"refreshSessionList"),P=as(n.workspaces),I=e(async(f,...w)=>{let T=n.get("remote.workspaceRegistry");if(!T||typeof T[f]!="function")throw new Error(n.locale.bind(Je)("service.unavailable"));let Ie=await T[f].apply(T,w);if(!Ie.ok)throw new Error(Ie.error.message);return Ie.value},"registryCall"),R=e(()=>I("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),F=e(()=>I("diagnoseSessionCaches"),"diagnoseSessionCaches"),h=e(f=>I("rebuildSessionCaches",f),"rebuildSessionCaches"),ge=e(async()=>{if(typeof n.sessions.refresh!="function")throw new Error("Official session list refresh is unavailable");let f=await n.sessions.refresh(),w=n.sessions,T=w.manager;if(T?.listState==="error"&&T.listError)throw new Error(qe(T.listError));if(w.listState==="error"&&w.listError)throw new Error(qe(w.listError));let $=w.list?.getSnapshot?.();if($?.state==="error"&&$.error)throw new Error(qe($.error));if(f&&typeof f=="object"&&"ok"in f&&f.ok===!1)throw new Error(qe(f.error??"Session list refresh failed"))},"refreshCacheLists"),_e=e((f={})=>I("cleanOrphanSubagents",f??{}),"cleanOrphanSubagents"),ce=e(f=>I("searchArchivedContent",f),"searchArchivedContent"),ot=e(f=>I("searchSessionContent",f),"searchSessionContent"),Xe=e(f=>I("previewArchivedSession",f),"previewArchivedSession"),Ye=e(()=>I("favoriteSessions"),"favoriteSessions"),ee=e(f=>I("setSessionFavorite",f),"setSessionFavorite"),pe=Tr();pe.bind({favoriteSessions:Ye,setSessionFavorite:ee});let nt,en=Ir(n,pe,()=>n.locale.bind(Je),()=>nt?.isSidebarFavoriteStarEnabled()??!0);n.effect(()=>()=>en.dispose(),"archive-manager: favorites only filter");let wt=Qs({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:e(f=>n.workspaces.archiveSession(f),"archive"),restore:e(async f=>{await P(f)},"restore"),deleteOne:e(async f=>{let w=n.get("remote.workspaceRegistry");if(!w)throw new Error(n.locale.bind(Je)("service.unavailable"));let T=await w.deleteSession(f);if(!T.ok)throw new Error(T.error.message)},"deleteOne"),getFavorites:Ye,refresh:e(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:Dt}),Ct=e(async f=>{await P(f),await A()},"unarchiveSession"),W=e(async f=>{let w=n.get("remote.workspaceRegistry");if(w===void 0)throw new Error("archive-manager remote service is unavailable");let T=await w.deleteSession(f);if(!T.ok)throw new Error(T.error.message);await A()},"deleteSession"),De=e(async(f,w)=>{let T=n.get("remote.workspaceRegistry");if(T===void 0)throw new Error("archive-manager remote service is unavailable");let $=await T.moveSessionToWorkspace({sessionId:f,targetWorkspaceId:w});if(!$.ok)throw new Error($.error?.message||"move failed");return await A(),$.value},"moveSession"),J=e(async f=>ar(n.workspaces,f,A),"archiveSessions"),K=e(async f=>{let w=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},T=pn(w.archivedSessionIds,w.items,f);return is(n.workspaces,T,A,P)},"unarchiveSessions"),Ue=e(async f=>{let w=n.get("remote.workspaceRegistry");if(w===void 0)throw new Error("archive-manager remote service is unavailable");let T=await w.deleteArchivedSessions(f);if(!T.ok)throw new Error(T.error.message);let $=await A();return{...T.value,refreshError:$}},"deleteArchivedSessions"),rt=e(async()=>{let f=n.get("remote.workspaceRegistry");if(f===void 0)throw new Error("archive-manager remote service is unavailable");let w=await f.archivedSessionMetadata();if(!w.ok)throw new Error(w.error.message);return w.value},"archivedSessionMetadata"),O="sidebar.workspaces.session.menu.item",Re=null,Ae=new Set,Ze=e(f=>{Re=f;for(let w of Ae)w()},"publishDeleteTarget");function dt(){return l.useSyncExternalStore(f=>(Ae.add(f),()=>{Ae.delete(f)}),()=>Re,()=>Re)}e(dt,"useDeleteRequest");function Qe({sessionId:f,displayTitle:w,useMenuOpenState:T,t:$}){let[,Ie]=T(),ue=g.MenuItemButton,Me=(0,a.jsx)(g.IconTrashOutlineRegular,{size:14}),je=e(()=>{Ie(!1),Ze({sessionId:f,title:w})},"onSelect");return typeof ue=="function"?(0,a.jsx)(ue,{danger:!0,icon:Me,onSelect:je,children:$("menu.deleteSession")}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:je,children:$("menu.deleteSession")})}e(Qe,"DeleteSessionMenuItem");function Tt({sessionId:f,favoriteRow:w,useMenuOpenState:T,t:$}){let[,Ie]=T(),ue=(0,l.useSyncExternalStore)(w.subscribe,w.getSnapshot),Me=ue.ready&&ue.ids.has(f),je=e(()=>{Ie(!1),w.toggle(f)},"onSelect"),ve=g.MenuItemButton,He=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:Me?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:Ve})}),et=$(Me?"organizer.unfavorite":"organizer.favorite");return typeof ve=="function"?(0,a.jsx)(ve,{icon:He,onSelect:je,children:et}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:je,children:et})}e(Tt,"FavoriteMenuItem");let Lt=null,Yt=new Set;function Et(f,w="success"){Lt={text:f,tone:w,seq:Date.now()};for(let T of Yt)T()}e(Et,"showToast");function Ne(){let f=l.useSyncExternalStore(T=>(Yt.add(T),()=>{Yt.delete(T)}),()=>Lt,()=>Lt);if(!f)return null;let w=g.Toast;return typeof w=="function"?(0,a.jsx)(w,{key:f.seq,text:f.text,tone:f.tone,holdMs:3e3,onDone:e(()=>{if(Lt?.seq===f.seq){Lt=null;for(let T of Yt)T()}},"onDone")}):(0,a.jsx)("div",{key:f.seq,style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:99999,padding:"8px 16px",borderRadius:8,background:f.tone==="danger"?"#7f1d1d":"#14532d",color:"#fff",fontSize:13,boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:f.text})}e(Ne,"GlobalToastOverlay");function Ut({sessionId:f,displayTitle:w,useMenuOpenState:T,t:$}){let[,Ie]=T(),[ue,Me]=l.useState(!1),[je,ve]=l.useState(null),[He,et]=l.useState(!1),ct=l.useRef(null),bt=l.useRef(null),te=n.workspaces.list?.getSnapshot?.()?.items??[],ie=g.MenuItemButton,z=e(()=>{if(bt.current&&clearTimeout(bt.current),ct.current){let ye=ct.current.getBoundingClientRect(),Ce=typeof window<"u"?window.innerWidth:1024,Q=typeof window<"u"?window.innerHeight:768,Oe=220,kt=Math.max(140,Q-20),Pe=Math.min(360,kt),st=ye.right+2;st+Oe>Ce-10&&(st=Math.max(10,ye.left-Oe-4));let me=ye.top-4;me+Pe>Q-10&&(me=Math.max(10,Q-Pe-10)),me<10&&(me=10),ve({top:me,left:st,maxHeight:Pe})}Me(!0)},"handleMouseEnter"),oe=e(()=>{bt.current=setTimeout(()=>{Me(!1)},180)},"handleMouseLeave"),Te=e(async(ye,Ce)=>{if(!He){et(!0),Me(!1),Ie(!1);try{await De(f,ye),Et($("moveSession.success",{name:Ce})||`\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C${Ce}\u201D`,"success")}catch(Q){let Oe=Q instanceof Error?Q.message:String(Q);console.warn("archive-manager: move session failed",Q),Et(Oe,"danger")}finally{et(!1)}}},"handleSelectWorkspace"),ke=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,a.jsx)("path",{d:"M2 3.5C2 2.67157 2.67157 2 3.5 2H6.5L8 4H12.5C13.3284 4 14 4.67157 14 5.5V12.5C14 13.3284 13.3284 14 12.5 14H3.5C2.67157 14 2 13.3284 2 12.5V3.5Z"}),(0,a.jsx)("path",{d:"M8 7.5L10.5 10L8 12.5"}),(0,a.jsx)("path",{d:"M5.5 10H10.5"})]}),tt=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{marginLeft:"auto",opacity:.65},children:(0,a.jsx)("path",{d:"M6 3.5L10.5 8L6 12.5"})}),xe=(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:8},children:[(0,a.jsx)("span",{children:$("menu.moveSession")}),tt]}),be=typeof ie=="function"?(0,a.jsx)(ie,{icon:ke,onSelect:e(()=>z(),"onSelect"),children:xe}):(0,a.jsxs)("button",{type:"button",role:"menuitem",onClick:e(()=>z(),"onClick"),style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 8px",background:"transparent",border:"none",cursor:"pointer",color:"inherit",textAlign:"left"},children:[ke,xe]});return(0,a.jsxs)("div",{ref:ct,className:"dsham_moveSessionWrap",onMouseEnter:z,onMouseLeave:oe,children:[be,ue&&je&&typeof document<"u"&&typeof p?.createPortal=="function"&&(0,p.createPortal)((0,a.jsxs)("div",{className:"dsham_moveSubmenu",role:"menu",onPointerDown:e(ye=>{ye.stopPropagation()},"onPointerDown"),onMouseDown:e(ye=>{ye.stopPropagation()},"onMouseDown"),onMouseEnter:z,onMouseLeave:oe,style:{top:je.top,left:je.left,maxHeight:je.maxHeight},children:[(0,a.jsx)("div",{style:{position:"absolute",top:0,bottom:0,left:-6,width:8},"aria-hidden":!0}),te.length===0?(0,a.jsx)("div",{style:{padding:"8px 10px",fontSize:"12px",color:"var(--dsw-alias-label-tertiary, #888)"},children:$("moveSession.noOtherWorkspaces")}):te.map(ye=>{let Ce=ye.title||ye.path||ye.workspaceId;return(0,a.jsx)("button",{type:"button",role:"menuitem",className:"dsham_moveSubmenuBtn",disabled:He,onPointerDown:e(Q=>{Q.preventDefault(),Q.stopPropagation(),Te(ye.workspaceId,Ce)},"onPointerDown"),onClick:e(Q=>{Q.preventDefault(),Q.stopPropagation(),Te(ye.workspaceId,Ce)},"onClick"),children:(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1},children:Ce})},ye.workspaceId)})]}),document.body)]})}e(Ut,"MoveSessionMenuItem");function mn(f){try{let w=document.querySelector(`[data-row-key="session:${CSS.escape(f)}"]`);return w?(w.hasAttribute("tabindex")||(w.setAttribute("tabindex","-1"),w.addEventListener("blur",()=>w.removeAttribute("tabindex"),{once:!0})),typeof g.focusWithoutRing=="function"?g.focusWithoutRing(w):w.focus(),!0):!1}catch{return!1}}e(mn,"focusSessionRow");function Z({t:f}){let w=dt(),[T,$]=(0,l.useState)(!1),[Ie,ue]=(0,l.useState)(null),[Me,je]=(0,l.useState)(null),ve=(0,l.useRef)(null),He=(0,l.useRef)(null),et=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(w===null||typeof document>"u"){je(null);return}let te=null,ie=e(()=>{if(te&&te.isConnected)return te;try{te=document.querySelector(`[data-row-key="session:${CSS.escape(w.sessionId)}"]`)}catch{te=null}return te},"getTargetRow"),z=e(()=>{let Te=ve.current,ke=Te?.offsetWidth||290,tt=Te?.offsetHeight||160,xe=8,be=ie();if(!be){let Oe=window.innerWidth,kt=window.innerHeight,Pe=Math.max(16,(kt-tt)/2),st=Math.max(16,(Oe-ke)/2);je(me=>me!==null&&me.top===Pe&&me.left===st?me:{top:Pe,left:st});return}let ye=be.getBoundingClientRect(),Ce=ye.top-4;Ce+tt>window.innerHeight-16&&(Ce=window.innerHeight-16-tt),Ce<16&&(Ce=16);let Q=ye.right+xe;Q+ke>window.innerWidth-16&&(Q=ye.left-ke-xe),Q<16&&(Q=16),je(Oe=>Oe!==null&&Oe.top===Ce&&Oe.left===Q?Oe:{top:Ce,left:Q})},"updatePosition");z(),window.addEventListener("scroll",z,!0),window.addEventListener("resize",z);let oe=null;return typeof ResizeObserver<"u"&&ve.current&&(oe=new ResizeObserver(z),oe.observe(ve.current)),()=>{oe?.disconnect(),window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[w]),(0,l.useEffect)(()=>{if(w===null)return;He.current&&!He.current.disabled?He.current.focus():ve.current?.focus();let te=w.sessionId;return()=>{if(!mn(te)){let z=document.querySelector('[role="treeitem"][aria-selected="true"]');z&&(z.hasAttribute("tabindex")||(z.setAttribute("tabindex","-1"),z.addEventListener("blur",()=>z.removeAttribute("tabindex"),{once:!0})),typeof g.focusWithoutRing=="function"?g.focusWithoutRing(z):z.focus())}}},[w]),(0,l.useEffect)(()=>{w!==null&&T&&ve.current?.focus()},[w,T]),(0,l.useEffect)(()=>{if(w===null)return;let te=e(ie=>{if(ie.key==="Escape"){ie.preventDefault(),ie.stopPropagation(),"stopImmediatePropagation"in ie&&typeof ie.stopImmediatePropagation=="function"&&ie.stopImmediatePropagation(),T||(ue(null),Ze(null));return}if(ie.key==="Tab"){if(ie.preventDefault(),T){ve.current?.focus();return}let z=He.current,oe=et.current;if(!z||!oe)return;ie.shiftKey?document.activeElement===z?oe.focus():z.focus():document.activeElement===oe?z.focus():oe.focus()}},"onKey");return window.addEventListener("keydown",te,!0),()=>window.removeEventListener("keydown",te,!0)},[w,T]),w===null)return null;let ct=e(()=>{T||(ue(null),Ze(null))},"close"),bt=e(()=>{$(!0),ue(null),W(w.sessionId).then(()=>{$(!1),Ze(null)}).catch(te=>{$(!1),ue(Kn(te,f))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:ct}),(0,a.jsxs)("div",{ref:ve,role:"dialog","aria-modal":!0,"aria-label":f("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:Me?{top:Me.top,left:Me.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:f("deleteSession.confirmTitle")}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:f("deleteSession.desc",{name:w.title})}),T&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:f("deleteSession.pending")}),Ie!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Ie}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:He,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:T,onClick:ct,children:f("cancel")}),(0,a.jsx)("button",{ref:et,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:T,onClick:bt,children:f("deleteSession.title")})]})]})]})}e(Z,"DeleteSessionOverlay");let Ge=null,St=new Set,G=e(f=>{Ge=f;for(let w of St)w()},"publishArchiveWsTarget");function Ln(){return l.useSyncExternalStore(f=>(St.add(f),()=>{St.delete(f)}),()=>Ge,()=>Ge)}e(Ln,"useArchiveWsRequest");function $e(f){try{let w=document.querySelector(`[data-row-key="workspace:${CSS.escape(f)}"]`);return w?(w.hasAttribute("tabindex")||(w.setAttribute("tabindex","-1"),w.addEventListener("blur",()=>w.removeAttribute("tabindex"),{once:!0})),typeof g.focusWithoutRing=="function"?g.focusWithoutRing(w):w.focus(),!0):!1}catch{return!1}}e($e,"focusWorkspaceRow");function tn({t:f}){let w=Ln(),[T,$]=(0,l.useState)(!1),[Ie,ue]=(0,l.useState)(null),[Me,je]=(0,l.useState)(null),ve=(0,l.useRef)(null),He=(0,l.useRef)(null),et=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(w===null||typeof document>"u"){je(null);return}let te=null,ie=e(()=>{if(te&&te.isConnected)return te;try{te=document.querySelector(`[data-row-key="workspace:${CSS.escape(w.workspaceId)}"]`)}catch{te=null}return te},"getTargetRow"),z=e(()=>{let Te=ve.current,ke=Te?.offsetWidth||290,tt=Te?.offsetHeight||160,xe=8,be=ie();if(!be){let Oe=window.innerWidth,kt=window.innerHeight,Pe=Math.max(16,(kt-tt)/2),st=Math.max(16,(Oe-ke)/2);je(me=>me!==null&&me.top===Pe&&me.left===st?me:{top:Pe,left:st});return}let ye=be.getBoundingClientRect(),Ce=ye.top-4;Ce+tt>window.innerHeight-16&&(Ce=window.innerHeight-16-tt),Ce<16&&(Ce=16);let Q=ye.right+xe;Q+ke>window.innerWidth-16&&(Q=ye.left-ke-xe),Q<16&&(Q=16),je(Oe=>Oe!==null&&Oe.top===Ce&&Oe.left===Q?Oe:{top:Ce,left:Q})},"updatePosition");z(),window.addEventListener("scroll",z,!0),window.addEventListener("resize",z);let oe=null;return typeof ResizeObserver<"u"&&ve.current&&(oe=new ResizeObserver(z),oe.observe(ve.current)),()=>{oe?.disconnect(),window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[w]),(0,l.useEffect)(()=>{if(w===null)return;He.current&&!He.current.disabled?He.current.focus():ve.current?.focus();let te=w.workspaceId;return()=>{$e(te)}},[w]),(0,l.useEffect)(()=>{w!==null&&T&&ve.current?.focus()},[w,T]),(0,l.useEffect)(()=>{if(w===null)return;let te=e(ie=>{if(ie.key==="Escape"){ie.preventDefault(),ie.stopPropagation(),"stopImmediatePropagation"in ie&&typeof ie.stopImmediatePropagation=="function"&&ie.stopImmediatePropagation(),T||(ue(null),G(null));return}if(ie.key==="Tab"){if(ie.preventDefault(),T){ve.current?.focus();return}let z=He.current,oe=et.current;if(!z||!oe)return;ie.shiftKey?document.activeElement===z?oe.focus():z.focus():document.activeElement===oe?z.focus():oe.focus()}},"onKey");return window.addEventListener("keydown",te,!0),()=>window.removeEventListener("keydown",te,!0)},[w,T]),w===null)return null;let ct=e(()=>{T||(ue(null),G(null))},"close"),bt=e(()=>{$(!0),ue(null);let ie=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ke=>ke.workspaceId===w.workspaceId),z=n.sessions.list?.getSnapshot?.()?.byId??{},oe=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),Te=(ie?.sessionIds??[]).filter(ke=>Zn(ke,z,oe));ar(n.workspaces,Te,A).then(ke=>{if($(!1),ke.failures.length>0){ue(Mn(ke.failures,f));return}G(null)}).catch(ke=>{$(!1),ue(Dr(ke,f))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:ct}),(0,a.jsxs)("div",{ref:ve,role:"dialog","aria-modal":!0,"aria-label":f("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:Me?{top:Me.top,left:Me.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:f("archiveWorkspace.title",{n:w.count})}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:f("archiveWorkspace.desc",{name:w.title})}),T&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:f("archiveWorkspace.pending")}),Ie!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Ie}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:He,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:T,onClick:ct,children:f("cancel")}),(0,a.jsx)("button",{ref:et,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:T,onClick:bt,children:f("archiveWorkspace.confirm")})]})]})]})}e(tn,"ArchiveWorkspaceOverlay");function _t(f){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let w=null,T=!1,$=new Map,Ie=!1,ue=e(z=>{let Te=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(xe=>xe.workspaceId===z);if(Te===void 0)return[];let ke=n.sessions.list?.getSnapshot?.()?.byId??{},tt=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return Te.sessionIds.filter(xe=>Zn(xe,ke,tt))},"workspaceCandidateIds"),Me=e(()=>{if(Ie=!1,!T)for(let[z,oe]of $){if(!z.isConnected){$.delete(z);continue}let Te=ue(oe.workspaceId).length===0;z.disabled=Te,z.style.opacity=Te?"0.5":"",z.style.cursor=Te?"not-allowed":""}},"revalidateItems"),je=e(()=>{if($.size===0||Ie||T)return;Ie=!0;let z=e(()=>Me(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(z):setTimeout(z,16)},"scheduleRevalidate"),ve=e(z=>{w=Lr(z.target)},"rememberWorkspace");document.addEventListener("pointerdown",ve,!0),document.addEventListener("click",ve,!0);let He=e(()=>{if(T)return;for(let[oe]of $)oe.isConnected||$.delete(oe);let z=document.querySelectorAll('[role="menu"]');for(let oe of z){if(oe.querySelector('[data-dsham-archive-workspace="true"]'))continue;let Te=Array.from(oe.querySelectorAll('button[role="menuitem"]'));if(Te.length===0)continue;let ke=Te.find(We=>Xn(We,!1))??Te.find(We=>Xn(We,!0));if(!ke)continue;let tt=Te.find(We=>We!==ke)??ke,xe=ke.parentElement;if(!xe)continue;let be=w;if(!be)continue;let Ce=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(We=>We.workspaceId===be.workspaceId),Q=Ce?.path??Ce?.cwd,kt=ue(be.workspaceId).length,Pe=document.createElement("div");Pe.className=xe.className;let st=tt.className.split(/\s+/).filter(We=>!/(?:^|[_-])danger(?:$|[_-])/i.test(We)).join(" "),me=document.createElement("button");me.type="button",me.setAttribute("role","menuitem"),me.dataset.dshamArchiveWorkspace="true",me.className=st;let Ft=tt.querySelector("span"),ut=tt.querySelectorAll("span")[1],nn=document.createElement("span");nn.setAttribute("aria-hidden","true"),Ft?.className&&(nn.className=Ft.className),nn.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"/><path d="M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"/><path d="M6.5 9.5H9.5"/></svg>';let wn=document.createElement("span");if(ut?.className&&(wn.className=ut.className),wn.textContent=f("menu.archiveWorkspace"),me.append(nn,wn),Pe.append(me),kt===0&&(me.disabled=!0,me.style.opacity="0.5",me.style.cursor="not-allowed"),me.addEventListener("click",We=>{We.preventDefault(),We.stopPropagation();let lt=ue(be.workspaceId).length;lt!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),G({workspaceId:be.workspaceId,title:be.title,count:lt}))}),Q){let We=document.createElement("div");We.className=xe.className;let lt=document.createElement("button");lt.type="button",lt.setAttribute("role","menuitem"),lt.dataset.dshamCopyWorkspacePath="true",lt.className=st,lt.disabled=!1,lt.style.opacity="",lt.style.cursor="";let rn=document.createElement("span");rn.setAttribute("aria-hidden","true"),Ft?.className&&(rn.className=Ft.className),rn.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 3.5V2.5C10.5 1.94772 10.0523 1.5 9.5 1.5H3.5C2.94772 1.5 2.5 1.94772 2.5 2.5V8.5C2.5 9.05228 2.94772 9.5 3.5 9.5H4.5"/></svg>';let sn=document.createElement("span");ut?.className&&(sn.className=ut.className),sn.textContent=f("menu.copyWorkspacePath"),lt.append(rn,sn),We.append(lt),lt.addEventListener("click",qt=>{qt.preventDefault(),qt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),fr(Q).catch(()=>{})});let Sn=document.createElement("div");Sn.className=xe.className;let Fe=document.createElement("button");Fe.type="button",Fe.setAttribute("role","menuitem"),Fe.dataset.dshamOpenExplorer="true",Fe.className=st,Fe.disabled=!1,Fe.style.opacity="",Fe.style.cursor="";let Zt=document.createElement("span");Zt.setAttribute("aria-hidden","true"),Ft?.className&&(Zt.className=Ft.className),Zt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"/><path d="M10 8.5L12 10.5L10 12.5"/><path d="M6.5 10.5H12"/></svg>';let an=document.createElement("span");ut?.className&&(an.className=ut.className),an.textContent=f("menu.openInExplorer"),Fe.append(Zt,an),Sn.append(Fe),Fe.addEventListener("click",qt=>{qt.preventDefault(),qt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),(async()=>{try{let Jt=await fetch(Tn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:Q})}).catch(()=>null);if(Jt&&Jt.ok)return}catch{}try{await vt("/open-in-explorer",{method:"POST",body:JSON.stringify({path:Q,workspaceId:be.workspaceId})})}catch(Jt){console.warn("archive-manager: open in explorer failed",Jt)}})()}),xe.parentNode?.insertBefore(We,xe),xe.parentNode?.insertBefore(Sn,xe)}xe.parentNode?.insertBefore(Pe,xe),$.set(me,{workspaceId:be.workspaceId})}},"checkAndInject"),et=!1,ct=e(()=>{if(et||T)return;et=!0;let z=e(()=>{et=!1,!T&&He()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(z):setTimeout(z,16)},"scheduleInject"),bt=new MutationObserver(z=>{On(z,'[role="menu"]')&&ct()});bt.observe(document.body,{childList:!0,subtree:!0});let te=n.sessions.list?.subscribe?.(je),ie=n.workspaces.list?.subscribe?.(je);return()=>{T=!0,document.removeEventListener("pointerdown",ve,!0),document.removeEventListener("click",ve,!0),bt.disconnect(),te?.(),ie?.(),$.clear();for(let z of document.querySelectorAll('[data-dsham-archive-workspace="true"], [data-dsham-copy-workspace-path="true"], [data-dsham-open-explorer="true"]'))z.parentElement?.remove()}}e(_t,"setupWorkspaceMenuInjector");function fn(){return typeof n.slots.entries!="function"?!1:n.slots.entries("sidebar.workspaces").some(f=>f.children?.[O]!==void 0)}e(fn,"hostSidebarDeclaresSessionMenu");let pt,Ht,Rt,gn,vn,bn,Wt,yn=e(()=>{let f=fn()?"menu":"waiting";f!==pt&&(pt=f,f==="menu"&&(Ht??=n.slots.inject(O,()=>n.slots.register({name:O,id:"archive-manager.delete-session",order:500,locale:Je,inject:e(()=>({}),"inject")},Qe)),Rt??=n.slots.inject(O,()=>n.slots.register({name:O,id:"archive-manager.favorite",order:50,locale:Je,inject:e(()=>({favoriteRow:pe}),"inject")},Tt)),gn??=n.slots.inject(O,()=>n.slots.register({name:O,id:"archive-manager.move-session",order:480,locale:Je,inject:e(()=>({}),"inject")},Ut)),vn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:Je,inject:e(()=>({t:n.locale.bind(Je)}),"inject")},Z)),bn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.archive-workspace",locale:Je,inject:e(()=>({t:n.locale.bind(Je)}),"inject")},tn)),Wt??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.toast",locale:Je,inject:e(()=>({}),"inject")},Ne))))},"reconcileSidebar");yn(),n.effect(()=>_t(n.locale.bind(Je)),"archive-manager: workspace menu injector"),n.effect(()=>Br(),"archive-manager: sidebar row contextmenu trigger"),$r(n);let Nt=typeof n.on=="function"?n.on("slots/changed",f=>{if(f==="sidebar.workspaces")try{yn()}catch(w){console.warn("archive-manager: sidebar mode switch failed",w)}}):void 0;n.effect(()=>()=>{Nt?.(),Ht?.(),Rt?.(),gn?.(),vn?.(),bn?.(),Wt?.()},"archive-manager: sidebar mode");let gt=e(()=>({archiveSessions:J,archiveSession:e((f,w)=>n.workspaces.archiveSession(f,w),"archiveSession"),sessionStore:sr(n.sessions.list),workspaceStore:sr(n.workspaces.list),unarchiveSession:Ct,deleteSession:W,unarchiveSessions:K,deleteArchivedSessions:Ue,archivedSessionMetadata:rt,openConversation:u,focusSessionWorkspace:S,viewState:i,favoriteSessions:Ye,setSessionFavorite:ee,favoriteSync:pe,organizeBatch:wt,diagnoseOrphanSubagents:R,cleanOrphanSubagents:_e,diagnoseSessionCaches:F,rebuildSessionCaches:h,refreshCacheLists:ge,searchSessionContent:ot,searchArchivedContent:ce,previewArchivedSession:Xe,t:n.locale.bind(Je)}),"buildArchivedSectionProps"),vt=e(async(f,w)=>{let T=Tn(`/api/michengai/dsh-archive-manager${f}`),$=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},w?.headers),Ie=await fetch(T,Object.assign({},w,{headers:$})),ue=await Ie.json();if(!Ie.ok||!ue||ue.ok===!1)throw new Error((ue&&typeof ue=="object"&&typeof ue.error=="string"?ue.error:void 0)||`HTTP ${Ie.status}`);return ue},"callSettingsApi");nt=Sr(n,{callApi:vt,renderPanel:e(f=>(0,a.jsx)(Gn,Object.assign({},gt(),f)),"renderPanel"),injectProps:gt,ns:Je,onOnlineUpdateChange:e(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange"),onSidebarFavoriteStarChange:e(f=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-favorite-star-toggle",{detail:{enabled:f}}))},"onSidebarFavoriteStarChange")}),n.effect(()=>()=>nt?.destroy(),"archive-manager: sidebar entry"),n.effect(()=>Ys({endpoint:"/api/michengai/dsh-archive-manager/update",packageName:"@michengai/dsh-archive-manager",titleRowSelector:".dsham_settingsTitleRow",linksSelector:".dsham_settingsLinks",zhName:"\u5F52\u6863\u4F1A\u8BDD",enName:"Archived sessions",ruName:"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439",createIcon:de,isEnabled:e(()=>nt.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>{try{return n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(Je)("archived.badge"),"label"),icon:"archive",locale:Je,inject:gt},Gn)}catch(f){return console.warn("archive-manager: register settings.section failed:",f),()=>{}}})}e(Fa,"applyWorkspaceBrowser");async function Ba(n,r,i,d){try{await r(n)}catch(m){i(pa(m,d))}}return e(Ba,"forkWithFeedback"),o.__test={forkWithFeedback:Ba,favoritesOnlyVisibility:Er,favoriteGroupPredicate:Ar,createFavoriteRowStore:Tr,unarchivedSessionIds:es,ArchiveSelectionToolbar:Kr,ArchivedSessionsSection:Gn,zh:rs,en:ss,displayTitle:it,sessionVisible:Qt,indexSubagentDescendants:Nn,isUnknownSessionError:Dn,deriveGroups:Sa,deriveFlat:ka,deriveSearchResults:xa,deriveArchivedGroups:ts,sortArchivedGroups:ns,deriveArchivedBatchIds:pn,archivedSessionIdsInGroups:Jr,pruneArchivedSelection:Xr,toggleArchivedSelection:rr,archivedDeleteFeedback:Qr,isWorkspaceTaskCandidate:Zn,isWorkspaceDeleteMenuItem:Xn,workspaceMenuTriggerFrom:Lr,findRowMenuButton:Jn,isRowMenuButton:Fr,setupSidebarRowContextMenu:Br,applySettingsNavIcon:Vr,restoreSettingsNavIcon:Gr,installSettingsNavIcon:$r,mutationTouches:On,resolveRowHasStatus:cn,activeSessionActivity:zn,activeSessionRefusal:Mr,activeArchiveFromMessage:zr,archiveSessionsViaOfficial:ar,unarchiveSessionsViaOfficial:is,createUnarchiveSession:as,createWorkspaceViewStore:la,migrateWorkspaceViewPersist:Rr,WORKSPACE_VIEW_PERSIST_KEY:jn,LEGACY_WORKSPACE_VIEW_PERSIST_KEY:_r,bindObservable:sr,groupByWorkspace:Pr,byRecency:hn,ARCHIVE_MANAGER_REMOTE:It,currentSessionId:Dt,setupSidebarEntry:Sr,setupWorkspaceFavoritesOnly:Ir},o.apply=La,o.inject=Pa,s.exports}e(ji,"startArchiveClient");
21
+ `;function Pa(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(Ma)!==null||typeof document.createElement!="function")return;let t=document.createElement("style");t.id=Ma,t.textContent=si,(document.head??document.documentElement)?.appendChild?.(t)}e(Pa,"ensureSidebarEntryStyle");function ii(t){let r=t&&typeof t.size=="number"?t.size:16;return Ve(sn.IconArchiveOutlineMedium,{size:r})}e(ii,"ArchiveSidebarIcon");function oi(t){Pa();let{t:r,enabled:i,onToggle:a,disabled:o,onlineUpdateEnabled:g=!0,onToggleOnlineUpdate:d,onlineUpdateDisabled:k,onlineUpdateLocked:b=!1,sidebarFavoriteStarEnabled:I=!0,onToggleSidebarFavoriteStar:S,sidebarFavoriteStarDisabled:f}=t,w=[Ve("div",{key:"sidebar-entry",className:"dsham_bundle_row"},Ve("div",{className:"dsham_bundle_label_box"},Ve("span",{className:"dsham_bundle_title"},r("sidebar.entry.title")),Ve("span",{className:"dsham_bundle_desc"},r("sidebar.entry.desc"))),Ve(sn.Switch,{checked:i,onChange:a,label:r("sidebar.entry.toggle"),disabled:o}))];if(typeof d=="function"){let N=b?`${r("update.entry.desc")} (${r("update.entry.locked")})`:r("update.entry.desc");w.push(Ve("div",{key:"online-update",className:"dsham_bundle_row"},Ve("div",{className:"dsham_bundle_label_box"},Ve("span",{className:"dsham_bundle_title"},r("update.entry.title")),Ve("span",{className:"dsham_bundle_desc"},N)),Ve(sn.Switch,{checked:g,onChange:d,label:r("update.entry.toggle"),disabled:k||b,title:b?r("update.entry.locked"):void 0})))}return typeof S=="function"&&w.push(Ve("div",{key:"sidebar-favorite-star",className:"dsham_bundle_row"},Ve("div",{className:"dsham_bundle_label_box"},Ve("span",{className:"dsham_bundle_title"},r("sidebar.favoriteStar.title")),Ve("span",{className:"dsham_bundle_desc"},r("sidebar.favoriteStar.desc"))),Ve(sn.Switch,{checked:I,onChange:S,label:r("sidebar.favoriteStar.toggle"),disabled:f}))),Ve(ta,null,w)}e(oi,"ArchiveBundleConfigCard");function li(t){let[r,i]=Wt(t.getEnabled),[a,o]=Wt(t.getOnlineUpdateEnabled?t.getOnlineUpdateEnabled:()=>!0),[g,d]=Wt(t.getOnlineUpdateLocked?t.getOnlineUpdateLocked:()=>!1),[k,b]=Wt(t.getSidebarFavoriteStarEnabled?t.getSidebarFavoriteStarEnabled:()=>!0),[I,S]=Wt(!1),[f,w]=Wt(!1),[N,_]=Wt(!1);ra(()=>{let le=e(()=>{i(t.getEnabled()),t.getOnlineUpdateEnabled&&o(t.getOnlineUpdateEnabled()),t.getOnlineUpdateLocked&&d(t.getOnlineUpdateLocked()),t.getSidebarFavoriteStarEnabled&&b(t.getSidebarFavoriteStarEnabled())},"syncState");return le(),t.subscribe(le)},[t]);let H=e(le=>{S(!0),i(le),t.setSidebar(le).catch(()=>{i(t.getEnabled())}).finally(()=>{S(!1)})},"onToggleSidebar"),L=t.setOnlineUpdate?le=>{t.getOnlineUpdateLocked?.()||(w(!0),o(le),t.setOnlineUpdate(le).catch(()=>{t.getOnlineUpdateEnabled&&o(t.getOnlineUpdateEnabled())}).finally(()=>{w(!1)}))}:void 0,W=t.setSidebarFavoriteStar?le=>{_(!0),b(le),t.setSidebarFavoriteStar(le).catch(()=>{t.getSidebarFavoriteStarEnabled&&b(t.getSidebarFavoriteStarEnabled())}).finally(()=>{_(!1)})}:void 0;return Ve(oi,{t:t.t,enabled:r,disabled:I,onToggle:H,onlineUpdateEnabled:a,onlineUpdateDisabled:f||g,onlineUpdateLocked:g,onToggleOnlineUpdate:L,sidebarFavoriteStarEnabled:k,sidebarFavoriteStarDisabled:N,onToggleSidebarFavoriteStar:W})}e(li,"ArchiveBundleConfigCardWrapper");function pr(t,r){if(Pa(),!t.locale)return{isEnabled:e(()=>!1,"isEnabled"),isSupported:e(()=>!1,"isSupported"),setEnabled:e(async()=>!1,"setEnabled"),isOnlineUpdateEnabled:e(()=>!0,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>!1,"isOnlineUpdateLocked"),setOnlineUpdate:e(async()=>!1,"setOnlineUpdate"),isSidebarFavoriteStarEnabled:e(()=>!0,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:e(async()=>!1,"setSidebarFavoriteStar"),destroy:e(()=>{},"destroy")};let{callApi:i,renderPanel:a,ns:o}=r,g=!1,d=!1,k=!1,b=null,I=null,S=0,f=!1,w,N=new Set,_=e(()=>{if(!f)for(let O of N)try{O()}catch{}},"notify"),H=e(()=>{if(f||!k||!g||b)return;let O=t.slots.register({name:"main",key:hr,locale:o,inject:e(()=>{let Ce=typeof r.injectProps=="function"?r.injectProps():{};return Object.assign({t:t.locale?.bind?t.locale.bind(o):void 0},Ce)},"inject")},Ce=>Ve("div",{className:"dsham_mainPanel"},a(Ce)));b=typeof O=="function"?O:()=>{}},"mountMain"),L=e(()=>{if(b){try{b()}catch{}b=null}},"unmountMain"),W=e(()=>{if(f||!d||!g||I)return;let O=t.slots.register({name:"sidebar.panellist",id:hr,order:ai,label:e(()=>t.locale.bind(o)("archives.title"),"label"),locale:o},Ce=>ii(Ce&&typeof Ce=="object"&&"size"in Ce?Ce:void 0));I=typeof O=="function"?O:()=>{}},"mountRow"),le=e(()=>{if(I){try{I()}catch{}I=null}},"unmountRow"),ne=e(()=>{if(!f)if(g)H(),W();else{if(w?.panelInfo&&typeof w.selectPanel=="function")try{w.panelInfo.getSnapshot().activePanelId===hr&&w.selectPanel(null)}catch{}le(),L()}},"sync"),re=e(async O=>{if(f)return g;let Ce=++S;g=O,ne(),_();try{return await i("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:O})}),O}catch(Dt){throw Ce===S&&(g=!O,ne(),_()),Dt}},"setEnabled"),ae=!0,de=!1,Oe=0,ue=e(async O=>{if(f||de)return ae;let Ce=++Oe;if(ae=O,_(),typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(O)}catch{}try{if(await i("/online-update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:O})}),Ce===Oe&&typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(O)}catch{}return O}catch(Dt){if(Ce===Oe&&(ae=!O,_(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(!O)}catch{}throw Dt}},"setOnlineUpdate"),V=!0,pt=0,mt=e(async O=>{if(f)return V;let Ce=++pt;if(V=O,_(),typeof r.onSidebarFavoriteStarChange=="function")try{r.onSidebarFavoriteStarChange(O)}catch{}try{return await i("/sidebar-favorite-star",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:O})}),O}catch(Dt){if(Ce===pt&&(V=!O,_(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(!O)}catch{}throw Dt}},"setSidebarFavoriteStar"),St=S;i("/sidebar-entry").then(O=>{!f&&S===St&&O&&typeof O.enabled=="boolean"&&(g=O.enabled,ne(),_())}).catch(()=>{});let Me=Oe;i("/online-update").then(O=>{if(!f&&Oe===Me&&O&&typeof O.enabled=="boolean"&&(ae=O.enabled,O.locked===!0&&(de=!0),_(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(ae)}catch{}}).catch(()=>{});let ft=pt;i("/sidebar-favorite-star").then(O=>{if(!f&&pt===ft&&O&&typeof O.enabled=="boolean"&&(V=O.enabled,_(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(V)}catch{}}).catch(()=>{});let et=t;return typeof et.inject=="function"&&et.inject(["layout"],O=>{!f&&O.layout&&(w=O.layout)}),t.slots.inject("main",()=>{if(!f)return k=!0,H(),()=>{k=!1,L()}}),t.slots.inject("sidebar.panellist",()=>{if(!f)return d=!0,W(),()=>{d=!1,le()}}),t.slots.inject("plugins.bundle.config",()=>{if(!f)return t.slots.register({name:"plugins.bundle.config",key:ri,locale:o},O=>O&&O.view==="summary"?null:Ve(li,{t:t.locale.bind(o),getEnabled:e(()=>g,"getEnabled"),setSidebar:re,getOnlineUpdateEnabled:e(()=>ae,"getOnlineUpdateEnabled"),setOnlineUpdate:ue,getOnlineUpdateLocked:e(()=>de,"getOnlineUpdateLocked"),getSidebarFavoriteStarEnabled:e(()=>V,"getSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:mt,subscribe:e(Ce=>(N.add(Ce),()=>{N.delete(Ce)}),"subscribe")}))}),{isEnabled:e(()=>g,"isEnabled"),isSupported:e(()=>d,"isSupported"),setEnabled:re,isOnlineUpdateEnabled:e(()=>ae,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>de,"isOnlineUpdateLocked"),setOnlineUpdate:ue,isSidebarFavoriteStarEnabled:e(()=>V,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:mt,destroy:e(()=>{f||(f=!0,S++,Oe++,pt++,w=void 0,N.clear(),le(),L())},"destroy")}}e(pr,"setupSidebarEntry");function mr(t){if(typeof t!="string"||t.length===0||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u957F\u5EA6\u987B\u4E3A 1\uFF5E1024 \u4E2A\u5B57\u7B26");return t}e(mr,"checkedId");var di={parse(t){let r=te(t);if(!r||typeof r!="object"||typeof r.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:mr(r.sessionId),favorite:r.favorite}}},ci={parse(t){let r=te(t);if(!r||!Array.isArray(r.favoriteSessionIds)||r.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(r.favoriteSessionIds.map(mr))]}},safeParse(t){try{return{success:!0,data:this.parse(t)}}catch(r){return{success:!1,error:r}}}};function Oa(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return["favoriteSessions","setSessionFavorite"].map(r=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},parameters:r==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:t("FavoriteInput",di)}],result:t("FavoriteState",ci),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Oa,"favoriteInvocations");function fr(t,{days:r,now:i=Date.now(),favorites:a=new Set,currentId:o,pending:g=new Map}){if(!t||!Number.isInteger(r)||r<1||r>36500||a.has(t.id)||t.id===o||(t.retainedBy?.mainView??0)>0||t.running||(t.runningSubagentCount??0)>0||t.pendingInteraction!=null||g.has(t.id))return!1;let d=typeof t.updatedAt=="number"?t.updatedAt:Date.parse(t.updatedAt??"");return Number.isFinite(d)&&d<=i-r*864e5}e(fr,"idleArchiveCandidate");async function Hn(t,r,{onProgress:i,refresh:a}={}){let o=[...new Set(t.map(mr))],g={requested:o,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},d=e(()=>i?.({total:o.length,done:g.succeeded.length+g.skipped.length+g.failures.length,succeeded:g.succeeded.length,skipped:g.skipped.length,failed:g.failures.length}),"report");d();for(let k of o){try{(await r(k)?g.succeeded:g.skipped).push(k)}catch(b){g.failures.push({sessionId:k,message:b instanceof Error?b.message:String(b)}),g.remaining.push(k)}d()}try{await a?.()}catch(k){g.refreshError=k instanceof Error?k.message:String(k)}return g}e(Hn,"runSessionBatch");function La({workspaces:t,sessions:r,archive:i,restore:a,deleteOne:o,getFavorites:g,refresh:d,currentSessionId:k}){return async(b,I,S={})=>{if(!["archive","restore","undo","delete"].includes(b))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return Hn(I,async f=>{let N=t.getSnapshot().archivedSessionIds.includes(f);if(b==="archive"){if(N||!r.getSnapshot().byId[f])return!1;if(S.idleDays!==void 0){let le=new Set((await g()).favoriteSessionIds),ne=r.getSnapshot();if(!fr(ne.byId[f],{days:S.idleDays,favorites:le,currentId:k(ne),pending:S.getPending?.()??S.pending}))return!1}return await i(f),t.getSnapshot().archivedSessionIds.includes(f)}return N?b==="delete"?(await o(f),!0):!((await a(f))?.archivedSessionIds??t.getSnapshot().archivedSessionIds).includes(f):!1},{onProgress:S.onProgress,refresh:d})}}e(La,"createSessionOrganizer");function ui(t){return!t||t<=0?"0 B":t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/(1024*1024)).toFixed(1)+" MB"}e(ui,"formatBytes");function Fa(t,r){let i=t.createElement;function a(g,d){return i(r??(b=>i("button",{type:"button",disabled:b.disabled,onClick:b.onClick},b.children)),{variant:"outline",size:"sm",...d},g)}e(a,"textButton");function o({title:g,failures:d,separator:k}){let[b,I]=t.useState(!1),S=i("ul",null,d.map(f=>i("li",{key:f.sessionId},f.sessionId,k,f.message)));return i(Ln,{title:g,open:b,onToggle:e(()=>I(f=>!f),"onToggle")},S)}return e(o,"FailureDetails"),e(function({t:d,archived:k,busy:b,ready:I,days:S,onDays:f,count:w,onPreview:N,progress:_,result:H,onRetry:L,undoCount:W,onUndo:le,onReload:ne,orphanCount:re=0,orphanSizeBytes:ae=0,orphanCleaning:de=!1,onCleanOrphans:Oe,cacheCount:ue=0,cacheRepair:V,onRebuildCaches:pt,onRetryCaches:mt,onReloadCaches:St,onDismissCaches:Me}){return i(t.Fragment,null,i("style",null,".dsham_organizer,.dsham_batchFeedback{display:grid;gap:12px;margin:0 0 16px;padding:14px 16px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.dsham_organizerControls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.dsham_organizer label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary)}.dsham_number{width:88px;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.dsham_number:hover{border-color:var(--dsw-alias-border-l3)}.dsham_number:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}.dsham_disclosure{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}.dsham_foldChevron{transition:transform 150ms ease}.dsham_foldChevron.is-open{transform:rotate(180deg)}.dsham_organizer p,.dsham_batchFeedback p{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsham_batchFeedback progress{width:100%}.dsham_batchFeedback details{font-size:12px;overflow-wrap:anywhere}.dsham_archivePreview{max-height:260px;overflow:auto;display:grid;gap:8px;padding:8px 0}.dsham_archivePreview label{display:flex;gap:8px;align-items:center;overflow-wrap:anywhere}"),(!k||!I)&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},!I&&a(d("organizer.reloadFavorites"),{disabled:b,onClick:ne}),!k&&i(t.Fragment,null,i("label",null,d("organizer.idleDays"),i(sa,{min:1,max:36500,value:S===""?null:Number(S),disabled:b,"aria-label":d("organizer.idleDays"),onChange:e(ft=>f(ft==null?"":String(ft)),"onChange")})),a(d("organizer.preview",{n:w}),{disabled:b||!I||w===0,onClick:N}))),!k&&i("p",null,d("organizer.rules"))),re>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,d("organizer.orphanTitle",{n:re})),Oe&&a(d(de?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:b||de,onClick:Oe})),i("p",null,d("organizer.orphanDesc",{size:ui(ae)}))),ue>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,d("organizer.cacheTitle",{n:ue})),pt&&a(d(V?.busy?"organizer.cacheRebuilding":"organizer.cacheRebuild"),{disabled:b||V?.busy,onClick:pt})),i("p",null,d("organizer.cacheDesc"))),V&&(V.result||V.progress||V.error||V.refreshError)&&i("section",{className:"dsham_batchFeedback","aria-label":d("organizer.cacheRebuild")},V.progress&&i("div",{role:"status"},i("progress",{value:V.progress.done,max:Math.max(1,V.progress.total)}),d("organizer.progressCount",V.progress)),V.result&&i("div",{role:"status"},i("p",null,d("organizer.result",{succeeded:V.result.rebuiltSessionIds.length,skipped:V.result.skippedSessionIds.length,failed:V.result.failures.length})),V.result.failures.length>0&&i(o,{title:d("organizer.failureDetails"),failures:V.result.failures,separator:d("common.separator")}),V.result.failures.length>0&&mt&&a(d("organizer.cacheRetry",{n:V.result.failures.length}),{disabled:b||V.busy,onClick:mt})),V.error&&i("p",{role:"alert"},d("organizer.cacheError",{detail:V.error})),V.refreshError&&i("p",{role:"alert"},d("organizer.refreshError",{detail:V.refreshError})),i("div",{className:"dsham_organizerControls"},St&&a(d("organizer.cacheCheck"),{disabled:b||V.busy,onClick:St}),Me&&a(d("organizer.dismiss"),{disabled:b||V.busy,onClick:Me}))),(_||H||W>0)&&i("section",{className:"dsham_batchFeedback","aria-label":d("organizer.feedback")},_&&i("div",{role:"status","aria-live":"polite"},i("progress",{value:_.done,max:Math.max(1,_.total),"aria-label":d("organizer.progress")}),d("organizer.progressCount",{done:_.done,total:_.total})),H&&i("div",{role:"status"},i("strong",null,d(`organizer.${H.kind??"archive"}Result`)),i("p",null,d("organizer.result",{succeeded:H.succeeded.length,skipped:H.skipped.length,failed:H.failures.length})),H.failures.length>0&&i(o,{title:d("organizer.failureDetails"),failures:H.failures,separator:d("common.separator")}),H.refreshError&&i("p",{role:"alert"},d("organizer.refreshError",{detail:H.refreshError})),H.remaining.length>0&&a(d("organizer.retry",{n:H.remaining.length}),{disabled:b,onClick:L})),W>0&&i("div",{className:"dsham_organizerControls"},a(d("organizer.undo",{n:W}),{disabled:b,onClick:le}),i("p",null,d("organizer.undoHint")))))},"OrganizerPanel")}e(Fa,"createOrganizerPanel");var Ba={"organizer.cacheTitle":"\u53D1\u73B0 {n} \u4E2A\u4F1A\u8BDD\u7F3A\u5C11\u53EF\u7528\u5217\u8868\u7F13\u5B58","organizer.cacheDesc":"\u68C0\u67E5\u5DE5\u4F5C\u533A\u3001\u672A\u5206\u7EC4\u53CA\u5F52\u6863\u666E\u901A\u4F1A\u8BDD\u7684\u5934\u90E8\u4E0E\u5B98\u65B9\u7F13\u5B58\u3002\u70B9\u51FB\u540E\u9010\u6761\u53EA\u8BFB\u65E5\u5FD7\u5E76\u91CD\u5EFA\u5B98\u65B9\u5217\u8868\u7F13\u5B58\uFF1B\u8DF3\u8FC7\u6D3B\u52A8\u4F1A\u8BDD\uFF0C\u4E0D\u6253\u5F00\u4F1A\u8BDD\u3001\u4E0D\u8C03\u7528\u6A21\u578B\uFF0C\u4E5F\u4E0D\u6539\u53D8\u5F52\u6863\u6216\u5B9A\u65F6\u4EFB\u52A1\u3002\u8D85\u65F6\u8868\u793A\u4FDD\u5B58\u672A\u786E\u8BA4\uFF0C\u53EF\u91CD\u8BD5\u3002","organizer.cacheRebuild":"\u91CD\u5EFA\u5217\u8868\u7F13\u5B58","organizer.cacheRebuilding":"\u91CD\u5EFA\u4E2D\u2026","organizer.cacheRetry":"\u91CD\u8BD5\u5931\u8D25 {n} \u6761","organizer.cacheCheck":"\u5237\u65B0\u5217\u8868\u5E76\u91CD\u65B0\u68C0\u6D4B","organizer.cacheError":"\u7F13\u5B58\u68C0\u6D4B\u5931\u8D25\uFF1A{detail}","organizer.dismiss":"\u5B8C\u6210","organizer.feedback":"\u64CD\u4F5C\u53CD\u9988","organizer.allSessions":"\u5168\u90E8\u4F1A\u8BDD","organizer.favoriteFilter":"\u6536\u85CF\u7B5B\u9009","organizer.archiveResult":"\u5F52\u6863\u7ED3\u679C","organizer.restoreResult":"\u6062\u590D\u7ED3\u679C","organizer.deleteResult":"\u5220\u9664\u7ED3\u679C","organizer.undoResult":"\u64A4\u56DE\u7ED3\u679C","organizer.favorite":"\u6536\u85CF","organizer.unfavorite":"\u53D6\u6D88\u6536\u85CF","organizer.favoritesOnly":"\u53EA\u770B\u6536\u85CF","organizer.reloadFavorites":"\u91CD\u65B0\u52A0\u8F7D\u6536\u85CF","organizer.idleDays":"\u95F2\u7F6E\u5929\u6570","organizer.preview":"\u9884\u89C8\u95F2\u7F6E\u5F52\u6863\uFF08{n}\uFF09","organizer.rules":"\u6309\u6700\u540E\u6D3B\u52A8\u65F6\u95F4\u7B5B\u9009\uFF0C\u9075\u5FAA\u5F53\u524D\u5217\u8868\u7B5B\u9009\u6761\u4EF6\uFF1B\u6392\u9664\u6536\u85CF\u3001\u5F53\u524D\u6253\u5F00\u3001\u6B63\u5728\u6267\u884C\u53CA\u7B49\u5F85\u4EA4\u4E92\u7684\u4F1A\u8BDD\u3002","organizer.progress":"\u6279\u91CF\u64CD\u4F5C\u8FDB\u5EA6","organizer.progressCount":"\u5DF2\u5904\u7406 {done} / {total}","organizer.result":"\u6210\u529F {succeeded} \xB7 \u8DF3\u8FC7 {skipped} \xB7 \u5931\u8D25 {failed}","organizer.failureDetails":"\u67E5\u770B\u5931\u8D25\u8BE6\u60C5","organizer.refreshError":"\u64CD\u4F5C\u7ED3\u679C\u5DF2\u4FDD\u7559\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\uFF1A{detail}","organizer.retry":"\u91CD\u8BD5\u5269\u4F59 {n} \u6761","organizer.undo":"\u64A4\u56DE\u672C\u6B21\u5F52\u6863\uFF08{n}\uFF09","organizer.undoHint":"\u4EC5\u4FDD\u7559\u672C\u6B21\u6253\u5F00\u7BA1\u7406\u9875\u671F\u95F4\u6700\u8FD1\u4E00\u6279\u5F52\u6863\uFF1B\u5173\u95ED\u9875\u9762\u6216\u5237\u65B0\u540E\u6E05\u9664\u3002\u64A4\u56DE\u4E0D\u4F1A\u6062\u590D\u5DF2\u5220\u9664\u7684\u4F1A\u8BDD\u3002","organizer.idleConfirm":"\u8BF7\u68C0\u67E5\u4EE5\u4E0B\u5019\u9009\uFF0C\u53EF\u53D6\u6D88\u52FE\u9009\uFF1B\u6267\u884C\u524D\u518D\u6B21\u6392\u9664\u6536\u85CF\u53CA\u6D3B\u8DC3\u4F1A\u8BDD\u3002","organizer.manualConfirm":"\u4EC5\u5F52\u6863\u4EE5\u4E0B\u52FE\u9009\u4F1A\u8BDD\uFF1B\u53EF\u9010\u6761\u53D6\u6D88\u3002\u5F52\u6863\u540E\u53EF\u64A4\u56DE\u672C\u6279\u64CD\u4F5C\u3002","organizer.orphanTitle":"\u53D1\u73B0 {n} \u4E2A\u65E0\u4E3B\u5B64\u513F\u5B50\u4EE3\u7406","organizer.orphanDesc":"\u6BCD\u4F1A\u8BDD\u5DF2\u88AB\u5916\u90E8\u5220\u9664\uFF0C\u8FD9\u4E9B\u5B50\u4EE3\u7406\u5728\u65E5\u5E38\u804A\u5929\u5217\u8868\u4E2D\u4E0D\u53EF\u89C1\uFF0C\u5171\u5360\u7528\u7EA6 {size} \u78C1\u76D8\u7A7A\u95F4\u3002\u6E05\u7406\u4E0D\u53EF\u64A4\u9500\u3002","organizer.cleanOrphans":"\u6E05\u7406\u5168\u90E8\u5B64\u513F","organizer.cleaning":"\u6E05\u7406\u4E2D\u2026","organizer.orphanCleanSuccess":"\u5DF2\u6210\u529F\u6E05\u7406 {n} \u4E2A\u65E0\u4E3B\u5B50\u4EE3\u7406\u4F1A\u8BDD\u3002"},Ha={"organizer.cacheTitle":"Found {n} sessions without usable list caches","organizer.cacheDesc":"Checks headers and official caches for workspace, ungrouped, and archived ordinary sessions. On click, reads logs one at a time and rebuilds official caches. Skips active sessions; never opens sessions, calls models or changes archives or schedules. Timeout means persistence is unconfirmed and can be retried.","organizer.cacheRebuild":"Rebuild list caches","organizer.cacheRebuilding":"Rebuilding\u2026","organizer.cacheRetry":"Retry {n} failed","organizer.cacheCheck":"Refresh lists and check again","organizer.cacheError":"Cache check failed: {detail}","organizer.dismiss":"Done","organizer.feedback":"Operation feedback","organizer.allSessions":"All sessions","organizer.favoriteFilter":"Favorites filter","organizer.archiveResult":"Archive results","organizer.restoreResult":"Restore results","organizer.deleteResult":"Delete results","organizer.undoResult":"Undo results","organizer.favorite":"Favorite","organizer.unfavorite":"Unfavorite","organizer.favoritesOnly":"Favorites only","organizer.reloadFavorites":"Reload favorites","organizer.idleDays":"Idle days","organizer.preview":"Preview idle archives ({n})","organizer.rules":"Uses last activity, the current list filters. Excludes favorites, open, running and waiting sessions.","organizer.progress":"Batch progress","organizer.progressCount":"Processed {done} / {total}","organizer.result":"Succeeded {succeeded} \xB7 Skipped {skipped} \xB7 Failed {failed}","organizer.failureDetails":"Failure details","organizer.refreshError":"Results retained, but refresh failed: {detail}","organizer.retry":"Retry remaining {n}","organizer.undo":"Undo this archive batch ({n})","organizer.undoHint":"Only the latest archive batch while this page is open is retained. Closing or refreshing clears undo. Deleted sessions cannot be restored.","organizer.idleConfirm":"Review and deselect candidates. Favorites and active sessions are checked again before archiving.","organizer.manualConfirm":"Only checked sessions below will be archived. You can undo this batch afterward.","organizer.orphanTitle":"Found {n} orphan subagents","organizer.orphanDesc":"Parent sessions were deleted externally. These subagents are hidden from normal chat lists and occupy ~{size} disk space. Removal cannot be undone.","organizer.cleanOrphans":"Clean up all orphans","organizer.cleaning":"Cleaning up\u2026","organizer.orphanCleanSuccess":"Successfully cleaned up {n} orphan subagent sessions."},Ua={"organizer.cacheTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u0441\u0435\u0441\u0441\u0438\u0439 \u0431\u0435\u0437 \u043F\u0440\u0438\u0433\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430 \u0441\u043F\u0438\u0441\u043A\u0430","organizer.cacheDesc":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0438 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u043A\u0435\u0448 \u0441\u0435\u0441\u0441\u0438\u0439 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043E\u0431\u043B\u0430\u0441\u0442\u0435\u0439, \u0431\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B \u0438 \u0430\u0440\u0445\u0438\u0432\u0430. \u041F\u043E \u043D\u0430\u0436\u0430\u0442\u0438\u044E \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u043F\u043E \u043E\u0434\u043D\u043E\u043C\u0443 \u0434\u043B\u044F \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430. \u0410\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u043F\u0443\u0441\u043A\u0430\u044E\u0442\u0441\u044F; \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u043C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u0430\u0440\u0445\u0438\u0432\u044B \u0438 \u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u044F \u043D\u0435 \u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F. \u0422\u0430\u0439\u043C-\u0430\u0443\u0442 \u043E\u0437\u043D\u0430\u0447\u0430\u0435\u0442 \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u043E\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435; \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u043F\u043E\u0432\u0442\u043E\u0440.","organizer.cacheRebuild":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043A\u0435\u0448 \u0441\u043F\u0438\u0441\u043A\u043E\u0432","organizer.cacheRebuilding":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u2026","organizer.cacheRetry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C {n} \u043E\u0448\u0438\u0431\u043E\u043A","organizer.cacheCheck":"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u0438 \u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C","organizer.cacheError":"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0435\u0448\u0430: {detail}","organizer.dismiss":"\u0413\u043E\u0442\u043E\u0432\u043E","organizer.feedback":"\u041E\u0442\u0437\u044B\u0432 \u043E\u0431 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.allSessions":"\u0412\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","organizer.favoriteFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.archiveResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438","organizer.restoreResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F","organizer.deleteResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F","organizer.undoResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043E\u0442\u043C\u0435\u043D\u044B","organizer.favorite":"\u0412 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.unfavorite":"\u0423\u0431\u0440\u0430\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.favoritesOnly":"\u0422\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.reloadFavorites":"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.idleDays":"\u0414\u043D\u0438 \u043F\u0440\u043E\u0441\u0442\u043E\u044F","organizer.preview":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 \u043F\u0440\u043E\u0441\u0442\u043E\u044F ({n})","organizer.rules":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C \u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0441\u043F\u0438\u0441\u043A\u0430. \u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435, \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u043D\u044B\u0435 \u0438 \u043E\u0436\u0438\u0434\u0430\u044E\u0449\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438.","organizer.progress":"\u0425\u043E\u0434 \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.progressCount":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {done} / {total}","organizer.result":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E {succeeded} \xB7 \u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E {skipped} \xB7 \u041E\u0448\u0438\u0431\u043E\u043A {failed}","organizer.failureDetails":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u043E\u0448\u0438\u0431\u043E\u043A","organizer.refreshError":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C: {detail}","organizer.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043E\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044F {n}","organizer.undo":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u044D\u0442\u0443 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044E ({n})","organizer.undoHint":"\u0421\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F, \u043F\u043E\u043A\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0430 \u044D\u0442\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430. \u0417\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u0438\u043B\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u0442 \u043E\u0442\u043C\u0435\u043D\u0443. \u0423\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u043B\u044C\u0437\u044F.","organizer.idleConfirm":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043A\u0430\u043D\u0434\u0438\u0434\u0430\u0442\u043E\u0432, \u043C\u043E\u0436\u043D\u043E \u0441\u043D\u044F\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443. \u041F\u0435\u0440\u0435\u0434 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0438 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E.","organizer.manualConfirm":"\u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435 \u043D\u0438\u0436\u0435 \u0441\u0435\u0441\u0441\u0438\u0438. \u042D\u0442\u0443 \u043F\u0430\u043A\u0435\u0442\u043D\u0443\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044E \u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0437\u0436\u0435.","organizer.orphanTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432","organizer.orphanDesc":"\u0420\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437\u0432\u043D\u0435. \u041F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u044B \u0441\u043A\u0440\u044B\u0442\u044B \u0438\u0437 \u043E\u0431\u044B\u0447\u043D\u044B\u0445 \u0441\u043F\u0438\u0441\u043A\u043E\u0432 \u0447\u0430\u0442\u043E\u0432 \u0438 \u0437\u0430\u043D\u0438\u043C\u0430\u044E\u0442 ~{size} \u0434\u0438\u0441\u043A\u043E\u0432\u043E\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430. \u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","organizer.cleanOrphans":"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435\u0445 \u0441\u0438\u0440\u043E\u0442","organizer.cleaning":"\u041E\u0447\u0438\u0441\u0442\u043A\u0430\u2026","organizer.orphanCleanSuccess":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432."};var on=Function("return globalThis.__dshArchiveReactDOM")(),Wa=Function("return globalThis.__dshArchiveReactDOMClient")(),qa=on.createPortal,No=on.flushSync,Do=Wa?.createRoot,zo=Wa?.hydrateRoot,Mo=on.findDOMNode,Po=on.unmountComponentAtNode,Oo=on.unstable_batchedUpdates,Lo=on.version;function hi(t){var r={exports:{}},i=r.exports;Object.defineProperty(i,Symbol.toStringTag,{value:"Module"});let a=t("react/jsx-runtime"),o=t("react"),g=t("react-dom"),d=t("@deepseek-ai/dsh-client-ui-primitives");function k({open:n,onClose:s,title:l,description:h,footer:y,children:p,className:E,width:C,portalToBody:D=!1,closeLabel:F,t:j}){let P=o.useRef(null),q=o.useCallback(()=>P.current?.closest(".dsham_settings")??document.body,[]),[u,Ee]=o.useState(null);o.useEffect(()=>{if(!n){Ee(null);return}Ee(D?typeof document<"u"?document.body:null:q())},[n,q,D]),o.useEffect(()=>{if(!n)return;let vt=e(at=>{at.key==="Escape"&&(at.preventDefault(),at.stopPropagation(),"stopImmediatePropagation"in at&&typeof at.stopImmediatePropagation=="function"&&at.stopImmediatePropagation(),s())},"onKey");return window.addEventListener("keydown",vt,!0),()=>window.removeEventListener("keydown",vt,!0)},[n,s]);let Le=F||j("common.close"),pe=(0,a.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,a.jsx)("div",{className:"dsham_modalMask",onClick:s}),(0,a.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof l=="string"?l:void 0,className:Ya("dsham_modalDialog",E),style:{width:C??560},children:[(0,a.jsxs)("div",{className:"dsham_modalHeader",children:[(0,a.jsx)("h2",{title:typeof l=="string"?l:void 0,children:l}),(0,a.jsx)("button",{type:"button",className:"dsham_modalClose",onClick:s,"aria-label":Le,title:Le,children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),h!=null&&(0,a.jsx)("p",{children:h}),p!=null&&(0,a.jsx)("div",{className:"dsham_modalBody",children:p}),y!=null&&(0,a.jsx)("div",{className:"dsham_modalFooter",children:y})]})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{refObject:P,getContainer:q}),n&&u?qa(pe,u):null]})}e(k,"SettingsModal");function b({refObject:n,getContainer:s}){return(0,a.jsx)("span",{hidden:!0,ref:n,"data-get-container":s})}e(b,"SettingsModalAnchor");function I({variant:n="outline",icon:s,children:l,className:h,disabled:y,title:p,onClick:E,"aria-label":C,"aria-pressed":D,"aria-expanded":F,"aria-haspopup":j}){return(0,a.jsx)(d.Button,{variant:n,size:"sm",className:h,disabled:y,title:p,onClick:E,"aria-label":C,"aria-pressed":D,"aria-expanded":F,"aria-haspopup":j,icon:s,children:l})}e(I,"settingsButton");function S({variant:n="outline",danger:s=!1,disabled:l,onClick:h,children:y}){return(0,a.jsx)(d.Button,{variant:s?"outline":n,className:s?"dsham_btnDanger":void 0,disabled:l,onClick:h,children:y})}e(S,"modalFooterButton");function f(n,s){let l={className:n?"dsham_archiveTabsLocked":void 0,children:s};return n&&(l.inert=""),l}e(f,"tabsShell");let w=Fa(o,d.Button),{HighlightedText:N,useArchiveSearch:_,useArchivePreview:H,DiscoveryFilters:L,SearchStatus:W,PreviewContent:le}=fa(o,{Button:d.Button,SegmentedControl:d.SegmentedControl}),ne={refresh:["M13.5 5.5V2.5m0 0h-3m3 0-2.1 2.1A5.5 5.5 0 1 0 13.2 12"],download:["M8 2v8m0 0 3-3m-3 3-3-3M3 13v2h10v-2"],copy:["M5 5h8v8H5z","M3 3h8"],close:["m4 4 8 8M12 4 4 12"]};function re(n){let s=document.createElement("span"),l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("viewBox","0 0 16 16"),l.setAttribute("width","16"),l.setAttribute("height","16"),l.setAttribute("fill","none"),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","1.5"),l.setAttribute("stroke-linecap","round"),l.setAttribute("stroke-linejoin","round"),l.setAttribute("aria-hidden","true");for(let h of ne[n]){let y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",h),l.append(y)}return s.append(l),s}e(re,"createPluginUpdateIcon");let ae={parse(n){if(typeof n!="string"||n.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(n)}`);return n}},de={parse(n){let s=te(n);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("result must be an object");let l=s.archivedSessionIds;if(!Array.isArray(l)||l.some(h=>typeof h!="string"))throw new TypeError("archivedSessionIds must be a string array");return s}},Oe={parse(n){let s=te(n);if(typeof s!="object"||s===null||Array.isArray(s)||s.deleted!==!0)throw new TypeError("deleted must be true");return s}},ue={parse(n){let s=te(n);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("target must be an object");if(s.scope==="all"||s.scope==="ungrouped"||s.scope==="workspace"&&typeof s.workspaceId=="string"&&s.workspaceId.length>0||s.scope==="sessions"&&Array.isArray(s.sessionIds)&&s.sessionIds.length>0&&s.sessionIds.every(l=>typeof l=="string"&&l.length>0))return s;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},V={parse(n){let s=te(n);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("result must be an object");for(let l of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(s[l])||s[l].some(h=>typeof h!="string"))throw new TypeError(`${l} must be a string array`);if(!Array.isArray(s.failures)||s.failures.some(l=>typeof l!="object"||l===null||typeof l.sessionId!="string"||typeof l.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return s}},pt={parse(n){let s=te(n);if(typeof s!="object"||s===null||Array.isArray(s)||!Array.isArray(s.items))throw new TypeError("result.items must be an array");if(s.items.some(l=>typeof l!="object"||l===null||typeof l.sessionId!="string"||typeof l.createdAt!="number"||!Number.isFinite(l.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");return s}},mt={parse(n){let s=te(n);if(!s||typeof s.sessionId!="string"||!s.sessionId||typeof s.targetWorkspaceId!="string"||!s.targetWorkspaceId)throw new TypeError("sessionId and targetWorkspaceId must be non-empty strings");return{sessionId:s.sessionId,targetWorkspaceId:s.targetWorkspaceId}}},St={parse(n){let s=te(n);if(!s||s.ok!==!0)throw new TypeError("session move result must be ok: true");return s}};function Me(n,s){return{mode:"strict",typeSymbol:n,create:e(()=>s,"create"),schema:s}}e(Me,"strictCodec");let ft={package:"@michengai/dsh-archive-manager",descriptors:[...Oa(),...ua(),...Sa(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:Me("@deepseek-ai/dsh-session/types#SessionId",ae)}],result:Me("@michengai/dsh-archive-manager/types#ArchivedSessionIds",de),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:Me("@deepseek-ai/dsh-session/types#SessionId",ae)}],result:Me("@michengai/dsh-archive-manager/types#Deleted",Oe),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteArchivedSessions",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteArchivedSessions",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",codec:Me("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",ue)}],result:Me("@michengai/dsh-archive-manager/types#DeletedBatch",V),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/archivedSessionMetadata",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"archivedSessionMetadata",invocation:{kind:"direct"},parameters:[],result:Me("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",pt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/diagnoseOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"diagnoseOrphanSubagents",invocation:{kind:"direct"},parameters:[],result:Me("@michengai/dsh-archive-manager/types#OrphanSubagentDiagnosis",{parse(n){let s=te(n);if(!s||typeof s.count!="number"||!Array.isArray(s.items)||typeof s.totalSizeBytes!="number")throw new TypeError("invalid orphan subagent diagnosis");return s}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/cleanOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"cleanOrphanSubagents",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",acceptsUndefined:!0,codec:Me("@michengai/dsh-archive-manager/types#CleanOrphanTarget",{parse(n){if(n==null)return{};let s=te(n);if(!s)throw new TypeError("target must be an object");if(s.sessionIds!==void 0&&(!Array.isArray(s.sessionIds)||s.sessionIds.some(l=>typeof l!="string")))throw new TypeError("sessionIds must be an array of strings");return s}})}],result:Me("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let s=te(n);if(!s||!Array.isArray(s.cleanedSessionIds)||!Array.isArray(s.skippedSessionIds)||!Array.isArray(s.failures))throw new TypeError("invalid orphan subagent clean result");return s}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/moveSessionToWorkspace",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"moveSessionToWorkspace",invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:Me("@michengai/dsh-archive-manager/types#SessionMoveInput",mt)}],result:Me("@michengai/dsh-archive-manager/types#SessionMoveResult",St),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]};function et(n,s){if(typeof document>"u"||document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")!==null)return;let l=document.createElement("style");l.dataset.plugin="@michengai/dsh-archive-manager",l.dataset.pluginCss=n,l.textContent=s,document.head.appendChild(l)}e(et,"ensurePluginStyle");function O(n){if(typeof document>"u")return;document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")?.remove()}e(O,"removePluginStyle"),et("dsh-archive-manager/DangerButton.css",".dsham_btnDanger:not(:disabled){color:var(--dsw-alias-state-error-primary,#ef7272);border-color:var(--dsw-alias-state-error-primary,#ef7272)}"),et("dsh-archive-manager/IconAction.css",".dsham_iconAction{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:22px!important;min-width:22px!important;height:22px!important;padding:0!important;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px)!important;background:transparent;color:var(--dsw-alias-label-secondary)}.dsham_iconAction:not(:disabled):hover{color:var(--dsw-alias-link,#4176e6)!important;border-color:var(--dsw-alias-link,#4176e6)!important}.dsham_iconAction.dsham_iconDanger{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction.dsham_iconDanger:not(:disabled):hover{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction svg{width:16px!important;height:16px!important;flex:none!important}"),et("dsh-archive-manager/Modal.css",".dsham_modalRoot{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.dsham_modalMask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1,rgb(0 0 0 / 45%));backdrop-filter:var(--dsw-mask-blur,blur(16px));-webkit-backdrop-filter:var(--dsw-mask-blur,blur(16px))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;box-sizing:border-box;max-width:calc(100vw - 48px);max-height:min(85vh,760px);padding:22px 24px 20px;overflow:hidden;border:1px solid var(--dsw-alias-border-l1,rgba(128,128,128,.2));border-radius:var(--dsw-radius-panel,28px);background-color:var(--dsw-alias-surface-overlay,var(--dsw-alias-bg-base,Canvas));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-surface-overlay,Canvas));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}.dsham_modalHeader h2,.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.dsham_modalClose{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:28px;height:28px;padding:0;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;flex:none;transition:background-color .15s ease,color .15s ease}.dsham_modalClose:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.dsham_modalClose svg{display:block;width:14px;height:14px}.dsham_modalDialog>p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.dsham_modalBody{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}.dsham_modalFooter{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:8px}.dsham_modalWide{width:min(900px,calc(100vw - 48px))!important;max-height:min(88vh,820px)!important}.dsham_modalWide .dsham_modalBody{overflow:hidden}.dsham_modalWide .dsham_previewMessages{max-height:none;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}"),et("dsh-archive-manager/SidebarPopover.css",".dsham_sidebarCardRoot{position:fixed;inset:0;z-index:1200;pointer-events:none}.dsham_sidebarCardBackdrop{position:fixed;inset:0;pointer-events:auto;background:transparent}.dsham_sidebarCard{position:fixed;pointer-events:auto;box-sizing:border-box;width:290px;max-height:calc(100vh - 32px);overflow-y:auto;padding:16px 18px 14px;border-radius:var(--dsw-radius-lg,14px);background:var(--dsw-menu-surface-fill);backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:none;box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:8px}.dsham_sidebarCardTitle{margin:0;font-size:14px;font-weight:600;line-height:20px;color:var(--dsw-alias-label-primary)}.dsham_sidebarCardDesc{margin:0;font-size:13px;line-height:18px;color:var(--dsw-alias-label-secondary)}.dsham_sidebarCardError{margin-top:2px;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef7272);white-space:pre-line}.dsham_sidebarCardFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.dsham_sidebarCardBtn{border:none;background:transparent;padding:5px 12px;border-radius:var(--dsw-radius-sm,6px);font:inherit;font-size:13px;font-weight:500;line-height:18px;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.dsham_sidebarCardBtnCancel{color:var(--dsw-alias-label-primary)}.dsham_sidebarCardBtnCancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.dsham_sidebarCardBtnDanger{color:var(--dsw-alias-state-error-primary,#ef7272)}.dsham_sidebarCardBtnDanger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger,#f25a5a26)}.dsham_sidebarCardBtn:disabled{opacity:.4;cursor:default}"),et("dsh-archive-manager/MoveSubmenu.css",".dsham_moveSessionWrap{position:relative}.dsham_moveSubmenu{position:fixed;z-index:99999;min-width:160px;max-width:260px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.25) transparent;background:var(--dsw-menu-surface-fill,var(--dsw-alias-surface-overlay,#1e1e22));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,0.12));border-radius:var(--dsw-radius-md,8px);box-shadow:var(--dsw-elevation-prominent,0 6px 20px rgba(0,0,0,0.45));padding:4px;display:flex;flex-direction:column;gap:2px}.dsham_moveSubmenu::-webkit-scrollbar{width:6px}.dsham_moveSubmenu::-webkit-scrollbar-track{background:transparent}.dsham_moveSubmenu::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.2);border-radius:3px}.dsham_moveSubmenu::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.35)}.dsham_moveSubmenuBtn{display:flex;align-items:center;width:100%;padding:6px 10px;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-primary,#ededed);font:inherit;font-size:13px;line-height:20px;text-align:left;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background-color .12s ease}.dsham_moveSubmenuBtn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,0.08))}.dsham_moveSubmenuBtn:focus-visible:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,0.08));outline:none}");let se="M8 1.75l1.934 3.918 4.324.628-3.129 3.05.738 4.306L8 11.618l-3.867 2.034.738-4.306-3.129-3.05 4.324-.628L8 1.75z";function Ge(n){return n?'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="'+se+'"/></svg>':'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round" aria-hidden="true"><path d="'+se+'"/></svg>'}e(Ge,"starSvg");function Vt(n){return!!n?.querySelector("[data-state]")}e(Vt,"resolveRowHasStatus");let ln="[data-row-key^='session:']{position:relative}.dsham_starSlot{display:none;position:absolute;left:calc(8px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(8px + var(--dsh-workspace-indent,0px));top:50%;transform:translateY(-50%);align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:20px;z-index:1;pointer-events:none}[data-row-key^='session:']:hover .dsham_starSlot,.dsham_starSlot[data-favorited='true']{display:inline-flex;pointer-events:auto}[data-row-key^='session:']:hover>span:first-child:not(:has([data-state])),[data-row-key^='session:'][data-dsham-favorited='true']:not([data-dsham-has-status='true'])>span:first-child:not(:has([data-state])){opacity:0}[data-row-key^='session:'][data-dsham-has-status='true']>span:first-child,[data-row-key^='session:']>span:first-child:has([data-state]){opacity:1}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_starSlot,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_starSlot{width:10px;height:10px;top:auto;bottom:3px;left:calc(15px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(15px + var(--dsh-workspace-indent,0px));transform:none}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar{width:10px;height:10px}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar svg,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar svg{width:10px;height:10px;filter:drop-shadow(0 0 1px rgba(0,0,0,0.85))}.dsham_rowStar{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);cursor:pointer;flex:none;border-radius:var(--dsw-radius-xs,4px)}.dsham_starSlot[data-favorited='true'] .dsham_rowStar{color:#e8b931}.dsham_rowStar svg{display:block;width:16px;height:16px;flex:none}";et("dsh-archive-manager/RowFavorite.css",ln);let Tn="dsh-archive-manager:workspace-favorites-only",dt="data-dsham-favorites-hidden",Zt="data-dsham-favorites-only",Q="dsham_rowStar",Re="dsham_starSlot",gt=["\u4EC5\u663E\u793A\u5DF2\u5F52\u6863","Archived only","\u0422\u043E\u043B\u044C\u043A\u043E \u0430\u0440\u0445\u0438\u0432\u043D\u044B\u0435"];et("dsh-archive-manager/FavoritesFilter.css",`[data-dsham-favorites-hidden='true']{display:none!important}button[data-dsham-favorites-only='true'][data-active='true']::after{content:"\\2713";margin-left:auto;padding-left:12px;font-size:12px;line-height:1;color:var(--dsw-alias-state-business-primary,#3b82f6)}`);function Va(){try{return window.localStorage.getItem(Tn)==="1"}catch{return!1}}e(Va,"readWorkspaceFavoritesOnly");function $a(n){try{window.localStorage.setItem(Tn,n?"1":"0")}catch{}}e($a,"writeWorkspaceFavoritesOnly");function vr(n,s){let l=e(p=>s.favorites.has(p)||s.sessions?.[p]?.blank===!0,"visibleSession"),h=new Map,y=null;for(let p of n){if(p.startsWith("workspace:")){y=p,h.set(p,!1);continue}p.startsWith("session:")&&y!==null&&l(p.slice(8))&&h.set(y,!0)}return n.map(p=>p.startsWith("session:")?l(p.slice(8)):p.startsWith("workspace:")?h.get(p)===!0||s.groupHasFavorite?.(p.slice(10))===!0:!p.startsWith("overflow:"))}e(vr,"favoritesOnlyVisibility");function br(n,s){let l=new Map,h=new Set;for(let p of s){let E=!1;for(let C of p.sessionIds)h.add(C),n.has(C)&&(E=!0);l.set(p.workspaceId,E)}let y=!1;for(let p of n)if(!h.has(p)){y=!0;break}return p=>p===""||p==="ungrouped"?y:l.get(p)===!0}e(br,"favoriteGroupPredicate");function yr(n,s,l,h){let y={dispose:e(()=>{},"dispose"),setFavoriteStarEnabled:e(U=>{},"setFavoriteStarEnabled"),isFavoriteStarEnabled:e(()=>!0,"isFavoriteStarEnabled")};if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return y;let p=Va(),E=typeof h=="function"?h():!0,C=!1,D=!1,F=e(()=>{E?et("dsh-archive-manager/RowFavorite.css",ln):O("dsh-archive-manager/RowFavorite.css")},"updateStarStyle");F();let j=e(U=>{let je=U;typeof je?.detail?.enabled=="boolean"?E=je.detail.enabled:typeof h=="function"&&(E=h()),F(),nt()},"onStarToggle");typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("dsham-favorite-star-toggle",j);let P=0,q=200,u=null,Ee=new Set,Le=e(U=>{if(!E){for(let J of U)Array.from(J.children).find(Fe=>Fe.classList.contains(Re))?.remove(),J.removeAttribute("data-dsham-favorited"),J.removeAttribute("data-dsham-has-status");return}let je=s.getSnapshot();for(let J of U){let K=J.getAttribute("data-row-key")??"";if(!K.startsWith("session:"))continue;let Fe=K.slice(8),Xe=Array.from(J.children).find(Ye=>Ye.tagName==="SPAN"&&Array.from(Ye.classList).some(At=>At==="slot"||At.endsWith("_slot")))??null;if(Xe===null){J.removeAttribute("data-dsham-has-status");continue}let M=Array.from(J.children).find(Ye=>Ye.classList.contains(Re))??null;if(!je.ready){M?.remove(),J.removeAttribute("data-dsham-favorited"),J.removeAttribute("data-dsham-has-status");continue}M!==null&&(M.parentElement!==J||M.nextElementSibling!==null)&&J.appendChild(M),M===null&&(M=document.createElement("span"),M.className=Re,J.appendChild(M)),M.dataset.sessionId=Fe,Vt(Xe)?J.setAttribute("data-dsham-has-status","true"):J.removeAttribute("data-dsham-has-status");let xe=M.querySelector("."+Q);xe===null&&(xe=document.createElement("button"),xe.type="button",xe.className=Q,xe.addEventListener("click",Ye=>{Ye.preventDefault(),Ye.stopPropagation(),s.toggle(M?.dataset.sessionId??"")}),M.appendChild(xe));let $e=je.ids.has(Fe);if($e?J.setAttribute("data-dsham-favorited","true"):J.removeAttribute("data-dsham-favorited"),M.dataset.favorited===String($e))continue;let st=l()($e?"organizer.unfavorite":"organizer.favorite");M.dataset.favorited=String($e),xe.setAttribute("aria-pressed",String($e)),xe.setAttribute("aria-label",st),xe.title=st,xe.innerHTML=Ge($e)}},"ensureRowStars"),pe=e(U=>{let je=s.getSnapshot();if(!p||!je.ready){for(let M of U)M.hasAttribute(dt)&&M.removeAttribute(dt);P=0,u=null,Ee.clear();return}let J=U.map(M=>M.getAttribute("data-row-key")??""),K=br(je.ids,n.workspaces.list?.getSnapshot?.()?.items??[]),Fe=vr(J,{favorites:je.ids,sessions:n.sessions.list?.getSnapshot?.()?.byId,groupHasFavorite:K});u!==null&&(U.length<=u.rows&&Ee.add(u.key),u=null);let Xe=!1;if(P<q)for(let M=0;M<U.length;M+=1){let Ie=U[M],xe=J[M];if(!xe.startsWith("overflow:")||Ie.getAttribute("aria-expanded")!=="false")continue;let $e=xe.slice(9);if(!(Ee.has($e)||!K($e))){try{Ie.click(),P+=1,u={key:$e,rows:U.length},Xe=!0}catch(st){console.warn("archive-manager: favorites-only expand failed",st)}break}}for(let M=0;M<U.length;M+=1){let Ie=U[M];Fe[M]?Ie.hasAttribute(dt)&&Ie.removeAttribute(dt):Ie.setAttribute(dt,"true")}Xe&&nt()},"applyVisibility"),vt=e(U=>{let je=U.parentElement;if(je===null)return null;let J=je.cloneNode(!0),K=J.querySelector('button[role="menuitem"]');if(K===null)return null;let Fe=Array.from(K.querySelectorAll("span")),Xe=Fe[0]??null,M=Fe[Fe.length-1]??null;Xe!==null&&(Xe.innerHTML=Ge(!1)),M!==null&&(M.textContent=l()("organizer.favoritesOnly"));for(let Ie of Array.from(K.querySelectorAll("svg")))Ie.closest("span")===null&&Ie.remove();return K.setAttribute(Zt,"true"),K.setAttribute("role","menuitemcheckbox"),K.dataset.active=String(p),K.setAttribute("aria-checked",String(p)),K.setAttribute("aria-label",l()("organizer.favoritesOnly")),K.onclick=Ie=>{Ie.preventDefault(),Ie.stopPropagation(),Jt(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0}))},J},"buildMenuRow"),at=e(()=>{if(!C){for(let U of Array.from(document.querySelectorAll("button["+Zt+"]")))U.dataset.active=String(p),U.setAttribute("aria-checked",String(p));for(let U of Array.from(document.querySelectorAll('[role="menu"]'))){let je=Array.from(U.querySelectorAll('button[role="menuitem"]')).find(Fe=>gt.some(Xe=>(Fe.textContent??"").includes(Xe)));if(je===void 0||U.querySelector("["+Zt+"]")!==null)continue;let J=je.parentElement;if(J===null)continue;let K=vt(je);K!==null&&J.parentElement?.insertBefore(K,J.nextSibling)}}},"injectMenuRows"),nt=e(()=>{if(D||C)return;D=!0;let U=e(()=>{if(D=!1,C)return;let je=Array.from(document.querySelectorAll("[data-row-key]"));at(),Le(je),pe(je),s.getSnapshot().ready||Xt()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(U):setTimeout(U,16)},"schedulePass"),Jt=e(()=>{p=!p,ut=20,P=0,u=null,Ee.clear(),$a(p),nt()},"toggle"),ct=null,ut=20,Xt=e(()=>{ct!==null||C||ut<=0||(ut-=1,ct=setTimeout(()=>{ct=null,s.ensure(),nt()},600))},"scheduleRetry"),xt=new MutationObserver(U=>{jn(U,'[data-row-key], [role="menu"]')&&nt()});xt.observe(document.body,{childList:!0,subtree:!0}),s.ensure().catch(()=>{});let Et=[s.subscribe(()=>nt()),typeof n.sessions.list?.subscribe=="function"?n.sessions.list.subscribe(()=>nt()):null,typeof n.workspaces.list?.subscribe=="function"?n.workspaces.list.subscribe(()=>nt()):null].filter(U=>typeof U=="function");return nt(),{dispose(){C=!0,typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("dsham-favorite-star-toggle",j),xt.disconnect();for(let U of Et)U();for(let U of Array.from(document.querySelectorAll("["+dt+"]")))U.removeAttribute(dt);for(let U of Array.from(document.querySelectorAll("["+Zt+"]")))U.parentElement?.remove();for(let U of Array.from(document.querySelectorAll("."+Re)))U.remove();for(let U of Array.from(document.querySelectorAll("[data-dsham-favorited]")))U.removeAttribute("data-dsham-favorited");for(let U of Array.from(document.querySelectorAll("[data-dsham-has-status]")))U.removeAttribute("data-dsham-has-status");ct!==null&&(clearTimeout(ct),ct=null)},setFavoriteStarEnabled(U){E=U,F(),nt()},isFavoriteStarEnabled:e(()=>E,"isFavoriteStarEnabled")}}e(yr,"setupWorkspaceFavoritesOnly");function wr(){let n,s={ready:!1,ids:new Set,pending:new Set},l,h=0,y=new Set,p=e(C=>{s=C;for(let D of y)try{D()}catch(F){console.warn("archive-manager: favorite listener failed",F)}},"publish"),E=e((C,D)=>{let F=new Set(C);for(let u of s.pending)u!==D&&(s.ids.has(u)?F.add(u):F.delete(u));let j=new Set(s.pending);D!==void 0?j.delete(D):s.pending.size===0&&j.clear();let P=s.ids.size===F.size&&[...F].every(u=>s.ids.has(u)),q=s.pending.size===j.size&&[...j].every(u=>s.pending.has(u));P&&q&&s.ready||p({ready:!0,ids:F,pending:j})},"adopt");return{bind(C){n=C},subscribe(C){return y.add(C),()=>{y.delete(C)}},getSnapshot:e(()=>s,"getSnapshot"),adopt:e(C=>E(C),"adopt"),ensure(){return n===void 0||s.ready?Promise.resolve():l!==void 0?l:Date.now()<h?Promise.resolve():(l=n.favoriteSessions().then(C=>{E(C.favoriteSessionIds)}).catch(C=>{console.warn("archive-manager: load favorites failed, will retry",C),h=Date.now()+600}).finally(()=>{l=void 0}),l)},async toggle(C){if(n===void 0||!s.ready||s.pending.has(C))return;let D=s.ids.has(C),F=!D,j=new Set(s.ids);F?j.add(C):j.delete(C);let P=new Set(s.pending);P.add(C),p({ready:!0,ids:j,pending:P});try{let q=await n.setSessionFavorite({sessionId:C,favorite:F});if(!Array.isArray(q?.favoriteSessionIds))throw new TypeError("favorite response is missing favoriteSessionIds");E(q.favoriteSessionIds,C)}catch(q){console.warn("archive-manager: sidebar favorite toggle failed",q);let u=new Set(s.ids);D?u.add(C):u.delete(C);let Ee=new Set(s.pending);Ee.delete(C),p({ready:!0,ids:u,pending:Ee})}}}}e(wr,"createFavoriteRowStore");function Ga(){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,a.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z"})})}e(Ga,"GithubMark16");function Ka(){let n=d.IconEditOutlineRegular;return(0,a.jsx)(n,{size:16})}e(Ka,"FeedbackIcon");function Un({archiveSessions:n,archiveSession:s,sessionStore:l,workspaceStore:h,unarchiveSession:y,deleteSession:p,unarchiveSessions:E,deleteArchivedSessions:C,archivedSessionMetadata:D,openConversation:F,focusSessionWorkspace:j,viewState:P,close:q,t:u,diagnoseOrphanSubagents:Ee,cleanOrphanSubagents:Le,diagnoseSessionCaches:pe,rebuildSessionCaches:vt,refreshCacheLists:at,searchSessionContent:nt,searchArchivedContent:Jt,previewArchivedSession:ct,favoriteSessions:ut,setSessionFavorite:Xt,favoriteSync:xt,organizeBatch:Et,useSessionPendingInteraction:U,useSessionStatus:je}){let J=(0,o.useSyncExternalStore)(l.subscribe,l.getSnapshot),K=(0,o.useSyncExternalStore)(h.subscribe,h.getSnapshot),[Fe,Xe]=(0,o.useState)("archived"),M=Fe==="archived",[Ie,xe]=(0,o.useState)(null),[$e,st]=(0,o.useState)(null),[Ye,At]=(0,o.useState)(null),Mt=e((c,x=null)=>{$(null),qe(null),we(!1),st(x),xe(c)},"requestArchive"),$t=e(()=>{Z||(xe(null),st(null),$(null))},"closeArchive"),Tt=(0,o.useRef)(!1),[Ae,Lt]=(0,o.useState)(null),cn=(0,o.useRef)(!1),[Z,We]=(0,o.useState)(!1),[kt,$]=(0,o.useState)(null),[Dn,qe]=(0,o.useState)(null),Qt=e(c=>{$(null),qe(null),Lt(c)},"requestDelete"),[_t,un]=(0,o.useState)(P?.query??""),[ht,Ft]=(0,o.useState)(P?.project??"all"),[Rt,hn]=(0,o.useState)(P?.sortBy??"updated"),[pn,mn]=(0,o.useState)({}),[Bt,fn]=(0,o.useState)(()=>new Set),jt=(0,o.useRef)(new Set),[bt,yt]=(0,o.useState)([]),[m,v]=(0,o.useState)([]),[T,G]=(0,o.useState)(!1),[ke,ce]=(0,o.useState)(!1),Ne=(0,o.useRef)(!1),[_e,me]=(0,o.useState)(!1),[Be,Ze]=o.useState("content"),[it,wt]=o.useState(""),[ee,ie]=o.useState(""),[z,oe]=(0,o.useState)(()=>new Set),[Te,ye]=(0,o.useState)("30"),[Je,we]=(0,o.useState)(!1),[fe,ge]=(0,o.useState)(null),[Se,X]=(0,o.useState)(null),[De,Ct]=(0,o.useState)([]),ze=(0,o.useRef)(!1),Qe=(0,o.useRef)(null),he=rs(U??es,je??ts,typeof je=="function"),Pt=(0,o.useRef)(he.pending);Pt.current=he.pending;let ot=(0,o.useMemo)(()=>new Set(m),[m]),en=e(async()=>{if(ut)try{let c=await ut();v(c.favoriteSessionIds),G(!0),xt?.adopt(c.favoriteSessionIds)}catch(c){G(!1),$(Ue(c))}},"loadFavorites");(0,o.useEffect)(()=>{let c=!0;return ut&&ut().then(x=>{c&&(v(x.favoriteSessionIds),G(!0),xt?.adopt(x.favoriteSessionIds))}).catch(x=>{c&&$(Ue(x))}),()=>{c=!1}},[ut]),(0,o.useEffect)(()=>{if(xt)return xt.subscribe(()=>{let c=xt.getSnapshot();c.ready&&(v([...c.ids]),G(!0))})},[xt]);let gn=e(async c=>{if(!(Ne.current||Z||!T)){Ne.current=!0,ce(!0),$(null);try{let x=await Xt({sessionId:c,favorite:!ot.has(c)});v(x.favoriteSessionIds),xt?.adopt(x.favoriteSessionIds)}catch(x){$(Ue(x))}finally{Ne.current=!1,ce(!1)}}},"toggleFavorite"),He=e(async(c,x,{idle:Y=!1,retry:ve=!1}={})=>{if(!(ze.current||Ne.current||jt.current.size>0||!Et)){ze.current=!0,We(!0),$(null),qe(null),X(null),c==="archive"&&!ve&&Ct([]);try{let R=await Et(c,x,{idleDays:Y?Number(Te):void 0,getPending:e(()=>Pt.current,"getPending"),onProgress:e(be=>{ge(be),c==="archive"&&be.total>0&&be.done>=be.total&&(xe(null),st(null),we(!1))},"onProgress")});return X({...R,kind:c,tab:Fe}),Qe.current=R.remaining.length?{kind:c,ids:R.remaining,idle:Y}:null,c==="archive"&&Ct(be=>[...new Set([...be,...R.succeeded])]),(c==="undo"||c==="restore"||c==="delete")&&Ct(be=>be.filter(lt=>!R.succeeded.includes(lt)&&!R.skipped.includes(lt))),yt(be=>be.filter(lt=>!R.succeeded.includes(lt)&&!R.skipped.includes(lt))),c==="delete"&&v(be=>be.filter(lt=>!R.succeeded.includes(lt))),R}catch(R){$(Ue(R))}finally{ze.current=!1,We(!1),ge(null)}}},"executeBatch"),[rt,tn]=(0,o.useState)(null),[nn,vn]=(0,o.useState)({diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null}),Pe=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!pe||!vt||!at)return;let c=xa({diagnose:pe,rebuild:vt,refresh:at});Pe.current=c;let x=c.subscribe(()=>{vn(c.snapshot())});return c.load(),()=>{x(),c.dispose(),Pe.current=null}},[pe,vt,at]),(0,o.useEffect)(()=>{Pe.current?.snapshot().busy||Pe.current?.load()},[K.archivedSessionIds]);let Gt=e(async(c=!1)=>{if(!(Z||ze.current||!Pe.current||Pe.current.snapshot().busy)){ze.current=!0,We(!0);try{await Pe.current.run(c)}finally{ze.current=!1,Nt.current&&We(!1)}}},"runCacheRebuild"),[rn,Ht]=(0,o.useState)(!1),Kt=e(()=>{typeof Ee=="function"&&Ee().then(tn).catch(c=>{console.warn("archive-manager: diagnose orphan subagents failed",c)})},"loadOrphans");(0,o.useEffect)(()=>{Kt()},[K.archivedSessionIds]);let Ss=e(async()=>{if(!(rn||typeof Le!="function")){Ht(!0),$(null),qe(null);try{let c=await Le({});(c.cleanedSessionIds.length>0||c.skippedSessionIds.length>0)&&Kt(),c.failures.length>0?(qe(null),$(_n(c.failures,u))):c.cleanedSessionIds.length>0&&($(null),qe(u("organizer.orphanCleanSuccess",{n:c.cleanedSessionIds.length})))}catch(c){$(Ue(c))}finally{Ht(!1)}}},"cleanOrphans"),Nt=(0,o.useRef)(!0),Xn=(0,o.useRef)(!1);(0,o.useEffect)(()=>(Nt.current=!0,()=>{Nt.current=!1}),[]);let zn=e(async(c,x=!1)=>{if(Z||Xn.current)return;Xn.current=!0,We(!0),$(null);let Y=!1;try{await Ca({prepare:x?async ve=>{await j?.(ve)}:void 0,restore:e(async ve=>{await y(ve),Y=!0},"restore"),open:e(async ve=>{await F(ve),Nt.current&&q?.()},"open")},c.id,x,()=>Nt.current)}catch(ve){if(!Nt.current)return;if(Y){Xe("unarchived");let R=Ut.find(be=>be.sessions.some(lt=>lt.id===c.id));R!==void 0&&Ft(R.key)}$(ka(ve,u))}finally{Xn.current=!1,Nt.current&&We(!1)}},"viewConversation");(0,o.useEffect)(()=>{P&&Object.assign(P,{query:_t,project:ht,sortBy:Rt})},[_t,ht,Rt,P]);let Mn=(0,o.useMemo)(()=>M?K.archivedSessionIds:Fr(J.byId,K.archivedSessionIds),[M,J.byId,K.archivedSessionIds]),Ut=(0,o.useMemo)(()=>Br(J.byId,K.items,Mn,u("group.ungrouped")),[J.byId,K,Mn,u]),xs=e(c=>{Z||jt.current.size>0||(It.close(),Xe(c),yt([]),xe(null),st(null),$(null),qe(null),Ft("all"),un(""),c!=="archived"&&Rt==="archived"&&hn("updated"))},"switchTab"),$r=e(async(c,x=!1)=>{if(!(Tt.current||Z||!c?.length)){if(Et){Tt.current=!0;try{let Y=await He("archive",c,{idle:x}),ve=Y?.failures.map(R=>Er(R.sessionId,R.message)).find(R=>R!==void 0);if(ve!==void 0&&typeof s=="function"){let R=J.byId[ve.sessionId];At({sessionId:ve.sessionId,title:R===void 0?ve.sessionId:tt(R,u),kinds:ve.kinds.join(", ")}),xe(null),st(null),$(null);return}Y&&(xe(null),st(null),we(!1))}finally{Tt.current=!1}return}Tt.current=!0,We(!0),$(null),qe(null);try{let Y=await n(c);xe(null),st(null),Y.archivedSessionIdsAdded.length>0&&qe(u("archives.archiveSuccess",{n:Y.archivedSessionIdsAdded.length})),Y.failures&&Y.failures.length>0?$(_n(Y.failures,u)):(yt([]),Xe("archived"),Ft("all"),un(""))}catch(Y){let ve=Cr(Y);if(ve!==void 0&&typeof s=="function"){let R=J.byId[ve.sessionId];At({sessionId:ve.sessionId,title:R===void 0?ve.sessionId:tt(R,u),kinds:ve.kinds.join(", ")}),xe(null),st(null),$(null)}else{let R=Rn(Y);$(R===void 0?u("archives.archiveBatchFailed",{detail:Y instanceof Error?Y.message:String(Y)}):u("archives.archiveActive",{kinds:R.join(", ")}))}}finally{Tt.current=!1,We(!1)}}},"performArchive"),ks=e(()=>$r(Ie,Je),"confirmArchive"),Cs=e(async c=>{$(null),qe(null);try{await or(c.id),Nt.current&&qe(u("details.copied"))}catch(x){Nt.current&&$(typeof On(x)=="string"&&String(On(x)).startsWith("copy.")?u(String(On(x))):Ue(x))}},"copyId"),Qn=(0,o.useMemo)(()=>Hr(Ut,Rt,pn,u,M?K.archivedSessionIds:void 0),[Ut,Rt,pn,u,M,K.archivedSessionIds]);(0,o.useEffect)(()=>{if(Z)return;let c=!1;return D().then(x=>{c||mn(Object.fromEntries(x.items.map(Y=>[Y.sessionId,Y.createdAt])))}).catch(()=>{c||mn({})}),()=>{c=!0}},[D,K.archivedSessionIds,Z]),(0,o.useEffect)(()=>{ht!=="all"&&!Ut.some(c=>c.key===ht)&&Ft("all")},[Ut,ht]);let Gr=!lr(it,ee),Kr=Qn.filter(c=>ht==="all"||ht===c.key).map(c=>({...c,sessions:c.sessions.filter(x=>(!_e||ot.has(x.id))&&pa(x.updatedAt,it,ee))})).filter(c=>c.sessions.length),er=Be==="content"&&!Gr,bn=_(Kr.flatMap(c=>c.sessions.map(x=>x.id)),_t,er,nt??Jt),tr=new Map(bn.items.map(c=>[c.sessionId,c])),It=H(ct,M?K.archivedSessionIds:[]),Yr=_t.trim().toLocaleLowerCase(),yn=Kr.map(c=>({...c,sessions:c.sessions.filter(x=>!Yr||tt(x,u).toLocaleLowerCase().includes(Yr)||tr.has(x.id))})).filter(c=>c.sessions.length),Zr=T?yn.flatMap(c=>c.sessions).filter(c=>fr(c,{days:Number(Te),favorites:ot,currentId:Bn(J),pending:he.pending})).map(c=>c.id):[],wn=(0,o.useMemo)(()=>Pr(yn),[yn]),nr=(0,o.useMemo)(()=>new Set(bt),[bt]),Es=(0,o.useMemo)(()=>{let c=new Set(K.archivedSessionIds);return De.reduce((x,Y)=>x+(c.has(Y)?1:0),0)},[De,K.archivedSessionIds]),rr=wn.filter(c=>nr.has(c)).length,Ts=wn.length>0&&rr===wn.length;(0,o.useEffect)(()=>{yt(c=>Or(c,Mn))},[Mn]);let Is=e((c,x)=>{yt(Y=>Yn(Y,[c],x))},"toggleSessionSelection"),As=e(c=>{yt(x=>Yn(x,wn,c))},"toggleVisibleSelection"),_s=e(c=>{Z||jt.current.has(c)||(jt.current.add(c),fn(new Set(jt.current)),$(null),qe(null),y(c).catch(x=>{$(xr(x,u))}).finally(()=>{jt.current.delete(c),fn(new Set(jt.current))}))},"onUnarchive"),Jr=e(async c=>{if(!Z){if(Et){let x=dn(K.archivedSessionIds,K.items,c),Y=await He("restore",x);return Y&&{unarchivedSessionIds:Y.succeeded}}We(!0),$(null),qe(null);try{let x=await E(c);return x.unarchivedSessionIds.length>0&&qe(u("archives.restoreSuccess",{n:x.unarchivedSessionIds.length})),x.failures&&x.failures.length>0&&$(_n(x.failures,u,xr)),x}catch(x){$(u("archives.restoreBatchFailed",{detail:x instanceof Error?x.message:String(x)}))}finally{We(!1)}}},"onBatchUnarchive"),Rs=e(async()=>{if(bt.length===0)return;let c=await Jr({scope:"sessions",sessionIds:bt});if(c!==void 0){let x=new Set(c.unarchivedSessionIds);yt(Y=>Y.filter(ve=>!x.has(ve)))}},"onSelectedUnarchive"),Xr=e(()=>{Z||Lt(null)},"closeDelete");(0,o.useEffect)(()=>{if(Ae===null)return;let c=e(x=>{x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),"stopImmediatePropagation"in x&&typeof x.stopImmediatePropagation=="function"&&x.stopImmediatePropagation(),Z||Lt(null))},"onKeyDown");return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[Ae,Z]);let js=e(async()=>{if(Z||cn.current||Ae===null)return;if(Ae.kind!=="batch"){cn.current=!0,We(!0),$(null),qe(null);try{await p(Ae.session.id),Lt(null)}catch(x){$(Wn(x,u))}finally{cn.current=!1,We(!1)}return}if(ze.current||Ne.current||jt.current.size>0)return;let{target:c}=Ae;if(c.scope==="sessions"&&dn(K.archivedSessionIds,K.items,c).length===0){Lt(null);return}ze.current=!0,We(!0),$(null),qe(null),X(null),ge(null);try{let x=await C(c),Y=Lr(x,u);Y.kind==="error"?$(Y.message):qe(Y.message);let ve=new Set([...x.deletedSessionIds,...x.skippedSessionIds]);Ct(be=>be.filter(lt=>!ve.has(lt))),yt(be=>be.filter(lt=>!ve.has(lt))),v(be=>be.filter(lt=>!ve.has(lt)));let R=x.failures.map(be=>be.sessionId);Qe.current=R.length>0?{kind:"delete",ids:R,idle:!1}:null,X({requested:x.requestedSessionIds,succeeded:x.deletedSessionIds,skipped:x.skippedSessionIds,failures:x.failures,remaining:R,refreshError:"refreshError"in x&&typeof x.refreshError=="string"?x.refreshError:null,kind:"delete",tab:Fe}),Lt(null)}catch(x){$(Wn(x,u))}finally{ze.current=!1,We(!1)}},"confirmDelete"),Ot=Ae?.kind==="batch"?Ae.target.scope:null,Ns=Ot==="ungrouped"?u("archives.deleteUngroupedTitle"):Ot==="workspace"?u("archives.deleteProjectTitle",{name:Ae?.kind==="batch"?Ae.title:""}):u(Ot==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),Qr=Ae===null?void 0:Ot==="ungrouped"?u("archives.deleteUngroupedDesc",{n:Ae.kind==="batch"?Ae.count:0}):Ot==="workspace"?u("archives.deleteProjectDesc",{name:Ae?.kind==="batch"?Ae.title:"",n:Ae.kind==="batch"?Ae.count:0}):Ot==="sessions"?u("archives.deleteSelectedDesc",{n:Ae.kind==="batch"?Ae.count:0}):u("deleteSession.desc",{name:tt(Ae.kind==="session"?Ae.session:{},u)}),Ds=u(Ot==="ungrouped"?"archives.deleteUngroupedConfirm":Ot==="workspace"?"archives.deleteProjectConfirm":Ot==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,a.jsxs)("section",{className:"dsham_settings","aria-label":u("archives.title"),children:[(0,a.jsx)("style",{children:ss+ls+ds+cs+us}),(0,a.jsxs)("div",{className:"dsham_settingsHeader",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"dsham_settingsTitleRow",children:[(0,a.jsx)("h2",{children:u("archives.title")}),(0,a.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,a.jsx)(d.Button,{variant:"outline",size:"sm","aria-label":u("archives.viewProject"),icon:(0,a.jsx)(Ga,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:u("archives.viewProject")}),(0,a.jsx)(d.Button,{variant:"outline",size:"sm","aria-label":u("archives.feedback"),icon:(0,a.jsx)(Ka,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:u("archives.feedback")})]})]}),(0,a.jsx)("p",{className:"dsham_settingsIntro",children:u("archives.description")})]}),o.createElement("div",f(Z||Bt.size>0,(0,a.jsx)(d.SegmentedTabs,{className:"dsham_archiveTabs",label:u("archives.title"),value:Fe==="unarchived"?"unarchived":"archived",onChange:e(c=>xs(c==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:(0,a.jsxs)("span",{className:"dsham_tabLabel",children:[(0,a.jsx)(d.IconArchiveOutlineMedium,{size:14}),(0,a.jsx)("span",{children:u("archives.tab.archived")})]}),id:"dsham-tab-archived",panelId:"dsham-archive-panel"},{value:"unarchived",label:(0,a.jsxs)("span",{className:"dsham_tabLabel",children:[(0,a.jsx)(d.IconFolderCloseMedium,{size:14}),(0,a.jsx)("span",{children:u("archives.tab.unarchived")})]}),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,a.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":u(Fe==="unarchived"?"archives.tab.unarchived":"archives.tab.archived"),children:[(0,a.jsx)("div",{className:"dsham_settingsToolbar",children:(0,a.jsxs)("div",{className:"dsham_settingsSearch",children:[(0,a.jsx)(Kn,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:_e?"favorites":"all",options:[{value:"all",label:u("organizer.allSessions")},{value:"favorites",label:u("organizer.favoritesOnly")}],onChange:e(c=>typeof me=="function"&&me(c==="favorites"),"onChange"),"aria-label":u("organizer.favoriteFilter")}),(0,a.jsx)(Kn,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:Be,options:[{value:"title",label:u("discovery.titleOnly")},{value:"content",label:u("discovery.titleAndContent")}],onChange:e(c=>typeof Ze=="function"&&Ze(c),"onChange"),"aria-label":u("discovery.scope")}),(0,a.jsx)(d.Input,{id:"dsham-search-input",className:"dsham_searchField",type:"search",icon:(0,a.jsx)(d.IconSearchOutlineMedium,{size:16,"aria-hidden":!0}),autoComplete:"off",spellCheck:!1,maxLength:200,value:_t,onChange:e(c=>un(c.target.value),"onChange"),placeholder:u(er?"discovery.searchPlaceholder":M?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":u(er?"discovery.searchPlaceholder":M?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,a.jsx)(hs,{id:"dsham-sort-filter",t:u,disabled:Z,favoritesOnly:_e,setFavoritesOnly:me,favoriteBusy:Z||ke||!T,sortBy:!M&&Rt==="archived"?"updated":Rt,setSortBy:hn,options:[...M?[{value:"archived",label:u("archives.sortArchived")}]:[],{value:"updated",label:u("archives.sortUpdated")},{value:"created",label:u("archives.sortCreated")},{value:"alphabetical",label:u("archives.sortAlphabetical")}]}),(0,a.jsx)(Kn,{id:"dsham-project-filter",className:"dsham_projectFilter",value:ht,title:ht==="all"?u("archives.allProjects"):Qn.find(c=>c.key===ht)?.title??ht,options:[{value:"all",label:u("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:u("archives.allProjects")},...Qn.map(c=>({value:c.key,label:c.title,title:c.title}))],onChange:Ft,"aria-label":u("archives.projectFilter")}),o.createElement(L,{t:u,from:it,to:ee,onFrom:wt,onTo:ie,invalid:Gr,onClear:e(()=>{wt(""),ie("")},"onClear")})]})}),o.createElement("style",null,ga),o.createElement(W,{state:bn,t:u}),Et&&(0,a.jsx)(w,{t:u,archived:M,busy:Z||ke||Bt.size>0,ready:T,days:Te,onDays:ye,count:Zr.length,onPreview:e(()=>{Mt(Zr),we(!0)},"onPreview"),progress:fe,result:Se?.tab===Fe?Se:null,onRetry:e(()=>{let c=Qe.current;c&&(c.kind==="delete"?Qt({kind:"batch",target:{scope:"sessions",sessionIds:c.ids},count:c.ids.length}):He(c.kind,c.ids,{idle:c.idle,retry:!0}))},"onRetry"),undoCount:Es,onUndo:e(()=>He("undo",De,{retry:!0}),"onUndo"),onReload:en,orphanCount:rt?.count??0,cacheCount:nn.diagnosis.count,cacheRepair:nn,onRebuildCaches:e(()=>Gt(),"onRebuildCaches"),onRetryCaches:e(()=>Gt(!0),"onRetryCaches"),onReloadCaches:e(async()=>{try{await at?.(),await Pe.current?.load(),(Pe.current?.snapshot().diagnosis.count??0)===0&&Pe.current?.dismiss()}catch(c){Nt.current&&$(Ue(c))}},"onReloadCaches"),onDismissCaches:e(()=>Pe.current?.dismiss(),"onDismissCaches"),orphanSizeBytes:rt?.totalSizeBytes??0,orphanCleaning:rn,onCleanOrphans:Ss}),Ut.length>0&&(0,a.jsx)(Dr,{selectedCount:bt.length,hiddenCount:bt.length-rr,allVisibleSelected:Ts,selectedVisibleCount:rr,visibleCount:wn.length,busy:Z,t:u,onToggle:As,onClear:e(()=>yt([]),"onClear"),onArchive:M?void 0:()=>Mt([...bt]),onRestore:Rs,onDelete:e(()=>Qt({kind:"batch",target:{scope:"sessions",sessionIds:bt},count:bt.length}),"onDelete")}),Ut.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:u(M?"archives.empty":"archives.emptyUnarchived")}):yn.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:bn.status==="loading"||bn.status==="error"||bn.failures.length?null:u("archives.emptyFiltered")}):yn.map(c=>{let x=fs(c.key),Y=Ut.find(R=>R.key===c.key)?.sessions.map(R=>R.id)??[],ve=M?dn(K.archivedSessionIds,K.items,x).length:Y.length;return(0,a.jsxs)("section",{className:"dsham_settingsGroup",children:[(0,a.jsxs)("div",{className:"dsham_settingsGroupHeading",children:[(0,a.jsx)("h3",{className:"dsham_settingsGroupTitle",children:(0,a.jsxs)("button",{type:"button",className:"dsham_groupToggle","aria-expanded":!z.has(c.key),"aria-controls":"dsham-group-"+encodeURIComponent(c.key),onClick:e(()=>oe(R=>{let be=new Set(R);return be.has(c.key)?be.delete(c.key):be.add(c.key),be}),"onClick"),children:[(0,a.jsx)(z.has(c.key)?d.IconChevronRightOutlineMedium:d.IconChevronDownOutlineMedium,{}),(0,a.jsx)(d.IconFolderOpenOutlineMedium,{}),(0,a.jsx)("span",{children:c.title})]})}),(0,a.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,a.jsx)("span",{className:"dsham_settingsCount",children:u("archives.sessionCount",{n:c.sessions.length})}),(0,a.jsx)(ms,{group:c,busy:Z,onArchive:M?void 0:()=>Mt(Y,c),onRestore:e(()=>Jr(x),"onRestore"),onDelete:e(()=>Qt({kind:"batch",target:x,title:c.title,count:ve}),"onDelete"),t:u})]})]}),(0,a.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(c.key),hidden:z.has(c.key)||void 0,children:!z.has(c.key)&&c.sessions.map(R=>(0,a.jsxs)("div",{className:"dsham_settingsRow","data-selected":nr.has(R.id),children:[(0,a.jsx)(zr,{checked:nr.has(R.id),disabled:Z,label:u("archives.selectSession",{name:tt(R,u)}),onChange:e(be=>Is(R.id,be.target.checked),"onChange")}),(0,a.jsxs)("div",{className:"dsham_settingsContent",children:[(0,a.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:tt(R,u),"aria-label":u("archives.openSession")+u("common.separator")+tt(R,u),disabled:Z||Bt.has(R.id),onClick:e(()=>zn(R),"onClick"),children:tt(R,u)}),(0,a.jsx)("div",{className:"dsham_settingsMeta",children:[as(R.updatedAt,u)]}),tr.has(R.id)&&o.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:Z,title:u(M?"discovery.preview":"archives.openSession"),onClick:e(()=>M?It.open(R,_t):zn(R),"onClick")},o.createElement(N,{text:tr.get(R.id)?.snippet??"",query:_t}))]}),(0,a.jsxs)("div",{className:"dsham_settingsActions",children:[typeof Xt=="function"&&I({variant:"outline",className:"dsham_iconAction"+(ot.has(R.id)?" dsham_favoriteOn":""),title:u(ot.has(R.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":ot.has(R.id),"aria-label":u(ot.has(R.id)?"organizer.unfavorite":"organizer.favorite")+u("common.separator")+tt(R,u),disabled:Z||ke||!T,onClick:e(()=>gn(R.id),"onClick"),children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:ot.has(R.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,a.jsx)("path",{d:se})})}),I({variant:"outline",className:"dsham_iconAction",title:u(M?"archives.restore":"archives.archiveSelected"),"aria-label":u(M?"archives.restore":"archives.archiveSelected"),disabled:Z||Bt.has(R.id),onClick:e(()=>M?_s(R.id):$r([R.id]),"onClick"),icon:(0,a.jsx)(M?d.IconRefreshOutlineMedium:d.IconArchiveOutlineMedium,{size:16})}),M&&(0,a.jsx)(ps,{busy:Z||Bt.has(R.id),t:u,title:tt(R,u),onCopyId:e(()=>Cs(R),"onCopyId"),onPreview:typeof ct=="function"?()=>It.open(R,_t):void 0,onRestoreOpen:e(()=>zn(R,!0),"onRestoreOpen"),onDelete:e(()=>Qt({kind:"session",session:R}),"onDelete")})]})]},R.id))})]},c.key)}),o.createElement(k,{width:900,className:"dsham_modalWide",portalToBody:!0,t:u,open:It.target!==null,onClose:It.close,title:It.target?tt(It.target.session,u):u("discovery.preview"),footer:S({variant:"primary",disabled:Z,onClick:e(()=>{if(It.target){let c=It.target.session;return It.close(),zn(c)}},"onClick"),children:u("discovery.openFull")}),children:o.createElement(le,{preview:It,t:u,MarkdownText:d.MarkdownText})}),Ie===null&&kt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:kt}),Dn!==null&&(0,a.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:Dn}),(0,a.jsx)(k,{t:u,open:Ie!==null,onClose:$t,title:u("archives.archiveTitle",{n:Ie?.length??0}),description:$e===null?u("archives.archiveSelectedDesc"):u($e.key===Nn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:$e.title,n:Ie?.length??0}),footer:(0,a.jsxs)(a.Fragment,{children:[S({disabled:Z,onClick:$t,children:u("cancel")}),S({variant:"primary",disabled:Z||!Ie?.length,onClick:ks,children:u("archives.archiveSelected")})]}),children:(0,a.jsxs)(a.Fragment,{children:[Et&&(0,a.jsx)("p",{children:u(Je?"organizer.idleConfirm":"organizer.manualConfirm")}),Et&&(0,a.jsx)("div",{className:"dsham_archivePreview",children:(Ie??[]).map(c=>(0,a.jsxs)("label",{children:[(0,a.jsx)(ar,{checked:!0,disabled:Z,label:tt(J.byId[c]??{id:c},u),onChange:e(()=>xe(x=>(x??[]).filter(Y=>Y!==c)),"onChange")}),tt(J.byId[c]??{id:c},u)]},c))}),fe&&(0,a.jsxs)("div",{role:"status",children:[(0,a.jsx)("progress",{value:fe.done,max:Math.max(1,fe.total)}),u("organizer.progressCount",{done:fe.done,total:fe.total})]}),kt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:kt})]})}),(0,a.jsx)(k,{t:u,open:Ye!==null,onClose:e(()=>{Z||(At(null),$(null))},"onClose"),title:u("archiveActive.title"),...Ye===null?{}:{description:u("archiveActive.desc",{name:Ye.title,kinds:Ye.kinds})},footer:(0,a.jsxs)(a.Fragment,{children:[S({disabled:Z,onClick:e(()=>{Z||(At(null),$(null))},"onClick"),children:u("cancel")}),S({danger:!0,disabled:Z,onClick:e(async()=>{if(!(Tt.current||Z||Ye===null||typeof s!="function")){Tt.current=!0,We(!0),$(null);try{await s(Ye.sessionId,{stopActivity:!0}),yt(c=>c.filter(x=>Ye===null||x!==Ye.sessionId)),Xe("archived"),qe(u("archives.archiveSuccess",{n:1})),At(null)}catch(c){$(c instanceof Error?c.message:String(c))}finally{Tt.current=!1,We(!1)}}},"onClick"),children:u("archiveActive.confirm")})]}),children:kt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:kt})}),(0,a.jsx)(k,{t:u,open:Ae!==null,onClose:Xr,title:Ns,...Qr===void 0?{}:{description:Qr},footer:(0,a.jsxs)(a.Fragment,{children:[S({disabled:Z,onClick:Xr,children:u("cancel")}),S({danger:!0,disabled:Z,onClick:js,children:Ds})]}),children:(0,a.jsxs)(a.Fragment,{children:[Z&&(0,a.jsxs)("div",{role:"status",children:[Ae?.kind==="batch"?u("archives.deleteBatchPending"):u("deleteSession.pending"),fe&&(0,a.jsx)("progress",{value:fe.done,max:Math.max(1,fe.total),"aria-label":u("organizer.progress")}),fe&&u("organizer.progressCount",{done:fe.done,total:fe.total})]}),kt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:kt})]})})]})]})}e(Un,"ArchivedSessionsSection");function Sr(n){var s,l,h="";if(typeof n=="string"||typeof n=="number")h+=n;else if(typeof n=="object")if(Array.isArray(n)){var y=n.length;for(s=0;s<y;s++)n[s]&&(l=Sr(n[s]))&&(h&&(h+=" "),h+=l)}else for(l in n)n[l]&&(h&&(h+=" "),h+=l);return h}e(Sr,"r");function Ya(...n){for(var s,l,h=0,y="",p=arguments.length;h<p;h++)(s=arguments[h])&&(l=Sr(s))&&(y&&(y+=" "),y+=l);return y}e(Ya,"clsx");function An(n){let s=n instanceof Error?n.message:String(n);return s.includes("UNKNOWN_SESSION")||s.includes("no such session")}e(An,"isUnknownSessionError");function Wn(n,s){if(An(n))return s("deleteSession.unknown");let l=n instanceof Error?n.message:String(n);return s("deleteSession.failed",{detail:l})}e(Wn,"formatDeleteError");function xr(n,s){if(An(n))return s("archives.unarchiveUnknown");let l=n instanceof Error?n.message:String(n);return s("archives.unarchiveFailed",{detail:l})}e(xr,"formatUnarchiveError");function _n(n,s,l=kr){return n.map(h=>h.sessionId+s("common.separator")+l(new Error(h.message),s)).join(`
22
+ `)}e(_n,"formatBatchFailures");function kr(n,s){if(An(n))return s("archives.archiveUnknown");let l=n instanceof Error?n.message:String(n);return s("archives.archiveFailed",{detail:l})}e(kr,"formatArchiveError");function Rn(n){if(n===null||typeof n!="object")return;let s=te(n),l=s.rpcError!==null&&typeof s.rpcError=="object"?te(s.rpcError):void 0,h=s.name==="WorkspaceActiveSessionError"?s.activity:void 0,y=l?.details,p=s.name==="WorkspaceArchiveError"&&l?.code==="workspace/session-active"&&y!==null&&typeof y=="object"?te(y).activity:void 0,E=Array.isArray(h)?h:Array.isArray(p)?p:void 0;if(E===void 0)return;let C=E.flatMap(D=>{if(D===null||typeof D!="object")return[];let F=te(D).kind;return typeof F=="string"&&F.length>0?[F]:[]});return C.length>0?C:void 0}e(Rn,"activeSessionActivity");function Cr(n){let s=Rn(n);if(s===void 0||n===null||typeof n!="object")return;let l=te(n),h=l.rpcError!==null&&typeof l.rpcError=="object"?te(l.rpcError).details:void 0,y=h!==null&&typeof h=="object"?te(h).sessionId:void 0,p=typeof l.sessionId=="string"?l.sessionId:typeof y=="string"?y:void 0;return p===void 0?void 0:{sessionId:p,kinds:s}}e(Cr,"activeSessionRefusal");function Er(n,s){let l=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(s);if(l===null)return;let h=l[1].split(", ").filter(y=>y.length>0);return h.length>0?{sessionId:n,kinds:h}:void 0}e(Er,"activeArchiveFromMessage");function Za(n,s){let l=n instanceof Error?n.message:String(n);return s("archives.forkFailed",{detail:l})}e(Za,"formatForkError");function qn(n,s,l){if(!n||l.has(n))return!1;let h=s?.[n];return!(h===void 0||h.origin==="subagent"||h.blank)}e(qn,"isWorkspaceTaskCandidate");function Tr(n){let s=n?.closest("[data-row-key]")??null;if(s===null)return null;let l=s.getAttribute("data-row-key")??"";if(!l.startsWith("workspace:"))return null;let h=l.slice(10);if(!h)return null;let y=s.querySelector(".title")??s.querySelector("[class*='title']");return{workspaceId:h,title:y?.textContent?.trim()||h}}e(Tr,"workspaceMenuTriggerFrom");function Vn(n){let s=n.querySelector('[class*="rowActions"]');if(!s)return null;let l=Array.from(s.querySelectorAll("button"));if(l.length===0)return null;let h=e(p=>!!((p.getAttribute("class")??"").includes("dsham_rowStar")||typeof p.closest=="function"&&p.closest(".dsham_starSlot")),"isStarButton");return l.find(p=>{if(h(p))return!1;if(p.getAttribute("aria-haspopup")==="menu")return!0;let E=(p.getAttribute("aria-label")??p.getAttribute("title")??"").toLowerCase();return/new|create|新建|add|\+|созда/.test(E)?!1:/action|操作|действи|more|更多|选项|options|menu/.test(E)})??null}e(Vn,"findRowMenuButton");function Ir(n,s){if(Vn(s)===n)return!0;let h=(n.getAttribute("aria-label")??n.getAttribute("title")??"").toLowerCase();return/action|操作|действи|more|更多/.test(h)}e(Ir,"isRowMenuButton");function Ar(){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let n=e(s=>{let l=s.target;if(!l||l.closest("input, textarea, [contenteditable='true']"))return;let h=l.closest('[data-row-key^="workspace:"], [data-row-key^="session:"]');if(!h)return;let y=l.closest("button");if(y&&!Ir(y,h))return;let p=Vn(h);p&&(s.preventDefault(),s.stopPropagation(),p.click())},"onContextMenu");return document.addEventListener("contextmenu",n,!0),()=>{document.removeEventListener("contextmenu",n,!0)}}e(Ar,"setupSidebarRowContextMenu");function $n(n,s=!0){let l=(n.textContent??"").toLowerCase();return l.includes("\u5220\u9664\u5DE5\u4F5C\u533A")||l.includes("delete workspace")||l.includes("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435")?!0:s&&/(?:^|[_\s-])danger(?:$|[_\s-])/i.test(n.className)}e($n,"isWorkspaceDeleteMenuItem");let Ja=new Map,Xa=new Set,Qa=new Map;function es(n){return n(Ja)}e(es,"useEmptySessionPendingInteraction");function ts(n){return n(Qa)}e(ts,"useEmptySessionStatus");function ns(n){let s=new Map,l=new Set;if(n instanceof Map)for(let[h,y]of n)y?.pendingInteraction!==void 0&&s.set(h,y.pendingInteraction),y?.completionUnread===!0&&l.add(h);return{pending:s,completed:l}}e(ns,"factsFromSessionStatus");function rs(n,s,l){let h=n(p=>p),y=s(p=>p);return l?ns(y):{pending:h,completed:Xa}}e(rs,"useSessionUiFacts");let _r={listeners:new Set,request(n){for(let s of this.listeners)s(n)},subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}};function tt(n,s){return n.blank?s("session.new"):n.title??n.displayTitle??""}e(tt,"displayTitle");function as(n,s){let l=new Date(n),h=`${String(l.getHours()).padStart(2,"0")}:${String(l.getMinutes()).padStart(2,"0")}`;return s("archives.timestamp",{date:s("date.ymd",{y:l.getFullYear(),m:l.getMonth()+1,d:l.getDate()}),time:h})}e(as,"archiveTimeLabel");let ss=[".dsham_archiveTabsLocked{opacity:.5}",".dsham_archiveTabs{display:grid!important;box-sizing:border-box!important;height:32px!important;min-height:32px!important;max-height:32px!important;padding:2px!important;border:0!important;border-radius:var(--dsw-radius-sm,8px)!important;box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l2)!important;background:var(--dsw-alias-bg-layer-1)!important}",'.dsham_archiveTabs>span[aria-hidden="true"],.dsham_archiveTabs>[class*="indicator"]{inset:2px auto 2px 2px!important;width:calc((100% - 4px)/2)!important;border-radius:6px!important;border:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12))!important;background:var(--dsw-alias-bg-layer-3,rgba(255,255,255,.08))!important;box-shadow:none!important}',".dsham_archiveTabs [role=tab]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;height:28px!important;padding:0 12px!important;border-radius:6px!important;font-size:13px!important;line-height:20px!important;color:var(--dsw-alias-label-secondary)!important;text-align:center!important;box-sizing:border-box!important;transition:color 150ms ease!important}",".dsham_archiveTabs [role=tab]:hover{color:var(--dsw-alias-label-primary)!important}",'.dsham_archiveTabs [role=tab][aria-selected="true"]{color:var(--dsw-alias-label-primary)!important;font-weight:600!important}',".dsham_tabLabel{display:inline-flex;align-items:center;justify-content:center;gap:6px}",".dsham_tabLabel svg{flex:none;display:block}"].join(""),zt="data-dsham-nav-icon",is='[role="dialog"] nav button',Gn=[`[${zt}] > svg { display: none !important; }`,`[${zt}]::before {`," content: '';"," flex: none;"," width: 16px;"," height: 16px;"," background-color: currentColor;",' -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;',' mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;'," -webkit-mask-repeat: no-repeat;"," mask-repeat: no-repeat;"," -webkit-mask-position: center;"," mask-position: center;"," -webkit-mask-size: 16px 16px;"," mask-size: 16px 16px;","}"].join(`
23
+ `);function os(n,s){let l=String(s??"").trim();return l.length>0&&String(n??"").trim()===l}e(os,"isOwnSettingsNavRow");function jn(n,s){for(let l of n){if(l.type==="characterData"){let y=l.target.parentElement;if(y!==null&&y.closest(s)!==null)return!0;continue}let h=l.target;if(h&&h.nodeType===1&&(typeof h.matches=="function"&&h.matches(s)||typeof h.closest=="function"&&h.closest(s)!==null))return!0;if(l.addedNodes)for(let y of l.addedNodes){if(y.nodeType!==1)continue;let p=y;if(typeof p.matches=="function"&&p.matches(s)||typeof p.querySelector=="function"&&p.querySelector(s)!==null||typeof p.closest=="function"&&p.closest(s)!==null)return!0}if(l.removedNodes)for(let y of l.removedNodes){if(y.nodeType!==1)continue;let p=y;if(typeof p.matches=="function"&&p.matches(s)||typeof p.querySelector=="function"&&p.querySelector(s)!==null||typeof p.closest=="function"&&p.closest(s)!==null)return!0}}return!1}e(jn,"mutationTouches");function Rr(n,s){return os(n.textContent,s)?n.getAttribute(zt)===""?!1:(n.setAttribute(zt,""),!0):n.hasAttribute(zt)?(n.removeAttribute(zt),!0):!1}e(Rr,"applySettingsNavIcon");function jr(n){return n.hasAttribute(zt)?(n.removeAttribute(zt),!0):!1}e(jr,"restoreSettingsNavIcon");function Nr(n){typeof document>"u"||typeof MutationObserver>"u"||n.effect(()=>{let s="dsham-nav-icon-style",l=document.getElementById(s);l===null?(l=document.createElement("style"),l.id=s,l.textContent=Gn,(document.head??document.documentElement).append(l)):l.textContent!==Gn&&(l.textContent=Gn);let h=!1,y=!1,p=e(()=>{if(y=!1,h)return;let D=n.locale.bind(Ke)("archived.badge");for(let F of document.querySelectorAll(is))Rr(F,D)},"sync"),E=e(()=>{y||h||(y=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(p):setTimeout(p,16))},"schedule");p();let C=new MutationObserver(D=>{jn(D,'[role="dialog"] nav')&&E()});return C.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{h=!0,C.disconnect();for(let D of document.querySelectorAll(`[${zt}]`))jr(D);l?.remove()}},"archive-manager: settings nav icon")}e(Nr,"installSettingsNavIcon");let ls=[".dsham_settings{container-type:inline-size;min-width:0;box-sizing:border-box;width:100%;padding:0 0 32px;color:var(--dsw-alias-label-primary)}",".dsham_settingsHeader{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:16px}",".dsham_settings h2{margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;white-space:nowrap}",".dsham_settingsIntro{margin:12px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px}",".dsham_settingsToolbar{display:flex;align-items:center;gap:8px;margin-bottom:16px;width:100%;min-width:0}",".dsham_settingsSearch{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}","@container(max-width:520px){.dsham_settingsSearch{flex-wrap:wrap}}",".dsham_settingsSearch .dsham_searchField{flex:1 1 0;min-width:120px;width:auto;box-sizing:border-box}",".dsham_viewSortContainer{flex:0 0 auto;position:relative;box-sizing:border-box}",".dsham_viewSortBtn{height:32px!important;padding:0 8px!important;font-size:13px!important;box-sizing:border-box}",".dsham_viewSortBtn.has-filter{border-color:var(--dsw-alias-state-business-primary)!important;color:var(--dsw-alias-state-business-primary)!important}",".dsham_settingsFilter{display:inline-flex;position:relative}",".dsham_settingsSearch .dsham_projectFilter{flex:0 0 auto;max-width:120px;min-width:0;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter > span{display:inline-block;max-width:100%;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter .dsham_menuSelectBtn{display:inline-flex!important;width:100%;max-width:120px;padding:0 8px;box-sizing:border-box;overflow:hidden}",".dsham_settingsSearch .dsham_projectFilter .dsham_selectLabel{flex:1 1 auto;min-width:0;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}",".dsham_settingsSearch .dsham_dateFilter{flex:0 0 125px;width:125px;min-width:125px;position:relative;box-sizing:border-box}",".dsham_dateRange{width:100%;box-sizing:border-box}",".dsham_dateTrigger{height:32px!important;padding:0 8px!important;gap:5px!important;border:0.5px solid var(--dsw-alias-border-l2)!important;border-radius:var(--dsw-radius-sm,8px)!important;background:var(--dsw-alias-bg-layer-1)!important;box-sizing:border-box}",".dsham_dateTrigger .dsham_dateText{font-size:12px!important;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".dsham_srOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;opacity:0;pointer-events:none}",".dsham_menuSelectBtn{display:inline-flex!important;align-items:center;justify-content:space-between;gap:6px;width:auto!important;max-width:100%;min-width:0!important;height:32px!important;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-sizing:border-box;font:inherit;font-size:13px;cursor:pointer}",".dsham_selectLabel{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:normal;text-align:left}",".dsham_settingsGroup{margin:0 0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill));overflow:hidden;transition:border-color 150ms ease}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:0 10px;margin:0;user-select:none}",".dsham_settingsGroupTitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}",".dsham_settingsGroupTitle svg{flex:none;color:var(--dsw-alias-label-secondary)}",".dsham_settingsCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px}",".dsham_settingsList{display:grid;overflow:hidden;border:0;border-top:1px solid var(--dsw-alias-border-l2);border-radius:0;background:transparent}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:4px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsMeta{margin-top:1px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:13px}",".dsham_settingsActions{display:flex;align-items:center;gap:4px;flex:none}",".dsham_settingsEmpty{padding:28px 8px;color:var(--dsw-alias-label-secondary);text-align:center}",".dsham_settingsError{margin-top:10px;color:var(--dsw-alias-state-error-primary);font-size:12px;white-space:pre-line}","@container(max-width:520px){.dsham_settingsHeader{margin-bottom:16px}.dsham_settingsGroup{margin-bottom:10px}.dsham_settingsRow{padding:4px 8px}.dsham_settingsActions{gap:2px}}"].join(""),ds=".dsham_settingsTitleLink{display:block;max-width:100%;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;line-height:16px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.dsham_settingsTitleLink:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}.dsham_settingsTitleLink:disabled{cursor:default;opacity:.6}.dsham_groupToggle{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;padding:4px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsham_groupToggle span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsham_settingsRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsRow[data-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsTitleLink:focus-visible,.dsham_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#3b82f6);outline-offset:2px}@container(max-width:400px){.dsham_settingsRow{gap:6px;padding:4px 6px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:10px}}.dsham_settingsGroupMeta{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap}.dsham_settingsStatus{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:12px}.dsham_checkbox{flex:none;box-sizing:border-box;width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);cursor:pointer}.dsham_checkbox:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.dsham_checkbox:disabled{opacity:.5;cursor:default}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",cs=".dsham_settingsTitleRow{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}.dsham_settingsLinks{display:flex;align-items:center;gap:8px;flex-wrap:wrap}@media(max-width:720px){.dsham_settingsTitleRow{flex-wrap:wrap}}",us=".dsham_settingsSelection{margin:-8px 0 16px;padding:4px 0 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsham_settingsSelectionMain{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;min-height:36px}.dsham_settingsSelectionSummary{display:flex;flex-wrap:wrap;align-items:center;gap:12px;min-width:0;max-width:100%}.dsham_settingsSelectionToggle{display:inline-flex;flex:none;white-space:nowrap;align-items:center;gap:12px;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;cursor:pointer}.dsham_settingsSelectionActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:100%;margin-left:auto}.dsham_settingsSelectionScope{margin:8px 0 0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow-wrap:anywhere}";function Kn({id:n,className:s,value:l,options:h,onChange:y,disabled:p=!1,"aria-label":E,title:C,tabIndex:D,"aria-hidden":F}){let[j,P]=o.useState(!1),q=o.useMemo(()=>h.map(Le=>({id:Le.value,label:Le.label})),[h]),u=h.find(Le=>Le.value===l),Ee=u?.label??E;return(0,a.jsx)("div",{id:n,tabIndex:D,"aria-hidden":F,className:s===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${s}`,children:(0,a.jsx)(d.Menu,{open:j,onClose:e(()=>P(!1),"onClose"),onSelect:e(Le=>{p||y(Le),P(!1)},"onSelect"),selectedId:l,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,a.jsxs)(d.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":E,"aria-expanded":j,disabled:p,tabIndex:D,"aria-hidden":F,title:C??u?.title??u?.label??E,className:"dsham_menuSelectBtn"+(j?" is-open":""),onClick:e(()=>{p||P(Le=>!Le)},"onClick"),children:[(0,a.jsx)("span",{className:"dsham_selectLabel",children:Ee}),(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:4,transition:"transform 150ms ease",transform:j?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:q})})}e(Kn,"ArchiveProjectSelect");function hs({id:n,t:s,disabled:l=!1,favoritesOnly:h,setFavoritesOnly:y,favoriteBusy:p=!1,sortBy:E,setSortBy:C,options:D}){let[F,j]=o.useState(!1),P=o.useMemo(()=>{let pe=[];typeof y=="function"&&(pe.push({type:"label",id:"lbl_view_filter",text:s("organizer.favoriteFilter")||"\u7B5B\u9009\u4F1A\u8BDD"}),pe.push({id:"filter:all",label:s("organizer.allSessions")||"\u5168\u90E8\u4F1A\u8BDD"}),pe.push({id:"filter:favorites",label:s("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF"}),pe.push({type:"separator",id:"sep_view_filter"})),pe.push({type:"label",id:"lbl_view_sort",text:s("archives.sortLabel")||"\u6392\u5E8F\u65B9\u5F0F"});for(let vt of D)pe.push({id:`sort:${vt.value}`,label:vt.label});return pe},[s,y,D]),q=e(pe=>{pe.startsWith("filter:")?typeof y=="function"&&!p&&y(pe==="filter:favorites"):pe.startsWith("sort:")&&C(pe.slice(5)),j(!1)},"onSelect"),u=D.find(pe=>pe.value===E),Ee=h?s("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":s("organizer.allChats")||"\u5168\u90E8\u804A\u5929",Le=`${Ee} \xB7 ${u?.label??E}`;return(0,a.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,a.jsx)(d.Menu,{open:F,onClose:e(()=>j(!1),"onClose"),onSelect:q,selectedIds:[h?"filter:favorites":"filter:all",`sort:${E}`],align:"end",portal:!0,dense:!0,listClassName:"dsham_viewSortDropdown",anchor:(0,a.jsxs)(d.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":s("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":F,disabled:l,title:Le,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(F?" is-open":"")+(h?" has-filter":""),onClick:e(()=>{l||j(pe=>!pe)},"onClick"),children:[(0,a.jsxs)("svg",{viewBox:"0 0 16 16",width:13,height:13,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"none",marginRight:4},children:[(0,a.jsx)("line",{x1:2.5,y1:4.5,x2:13.5,y2:4.5}),(0,a.jsx)("circle",{cx:5,cy:4.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"}),(0,a.jsx)("line",{x1:2.5,y1:11.5,x2:13.5,y2:11.5}),(0,a.jsx)("circle",{cx:11,cy:11.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"})]}),(0,a.jsx)("span",{className:"dsham_selectLabel",children:Ee}),(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:11,height:11,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:3,transition:"transform 150ms ease",transform:F?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:P})]})}e(hs,"ArchiveViewSortMenu");function Dr({selectedCount:n,hiddenCount:s,allVisibleSelected:l,selectedVisibleCount:h,visibleCount:y,busy:p,t:E,onToggle:C,onClear:D,onRestore:F,onDelete:j,onArchive:P}){let q=n>0;return(0,a.jsxs)("div",{className:"dsham_settingsSelection",children:[(0,a.jsxs)("div",{className:"dsham_settingsSelectionMain",children:[(0,a.jsxs)("div",{className:"dsham_settingsSelectionSummary",children:[(0,a.jsxs)("label",{className:"dsham_settingsSelectionToggle",title:E("archives.selectAllFiltered"),children:[(0,a.jsx)(zr,{checked:l,indeterminate:h>0&&!l,disabled:p||y===0,label:E("archives.selectAllFiltered"),onChange:e(u=>C(u.target.checked),"onChange")}),(0,a.jsx)("span",{"aria-live":"polite",children:q?E("archives.selectedCount",{n}):E("archives.selectAllFiltered")})]}),q&&I({disabled:p,"aria-label":E("archives.clearSelection"),onClick:D,children:E("archives.clearSelectionShort")})]}),q&&(0,a.jsxs)("div",{className:"dsham_settingsSelectionActions",children:P?[I({disabled:p,onClick:P,children:E("archives.archiveSelected")})]:[I({disabled:p,"aria-label":E("archives.restoreSelected"),onClick:F,children:E("archives.restore")}),I({disabled:p,className:"dsham_btnDanger","aria-label":E("archives.deleteSelected"),onClick:j,children:E("archives.deleteSelectionShort")})]})]}),s>0&&(0,a.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:E("archives.selectionHiddenHint",{hidden:s})})]})}e(Dr,"ArchiveSelectionToolbar");function zr({checked:n,indeterminate:s=!1,disabled:l=!1,label:h,onChange:y}){return(0,a.jsx)(ar,{checked:n,indeterminate:s,disabled:l,label:h,onChange:y})}e(zr,"ArchiveSelectionCheckbox");function Mr(){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:[3.5,8,12.5].map(n=>(0,a.jsx)("circle",{cx:n,cy:8,r:1.15,fill:"none",stroke:"currentColor",strokeWidth:1.5},n))})}e(Mr,"moreIcon");function ps({busy:n,title:s,t:l,onPreview:h,onRestoreOpen:y,onDelete:p,onCopyId:E}){let[C,D]=(0,o.useState)(!1),F=e(P=>{if(!n){if(D(!1),P==="copyId")return E?.();if(P==="preview")return h?.();if(P==="restoreOpen")return y?.();P==="delete"&&p?.()}},"choose"),j=[...h?[{id:"preview",label:l("discovery.preview"),icon:(0,a.jsx)(d.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...y?[{id:"restoreOpen",label:l("archives.restoreOpen"),icon:(0,a.jsx)(d.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...E?[{id:"copyId",label:l("details.copyId"),icon:(0,a.jsx)(d.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...p?[{id:"delete",label:l("menu.deleteSession"),icon:(0,a.jsx)(d.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,a.jsx)(d.Menu,{open:!n&&C,align:"end",portal:!0,dense:!0,items:j,onSelect:F,onClose:e(()=>D(!1),"onClose"),anchor:I({variant:"outline",className:"dsham_iconAction",disabled:n,title:l("archives.moreActions"),"aria-label":l("archives.moreActions")+l("common.separator")+s,"aria-haspopup":"menu","aria-expanded":C&&!n,icon:Mr(),onClick:e(()=>{n||D(P=>!P)},"onClick")})})}e(ps,"ArchivedSessionMenu");function ms({group:n,busy:s,onArchive:l,onRestore:h,onDelete:y,t:p}){let E=n.key===Nn,C=l?[{id:"archive",label:p(E?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,a.jsx)(d.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:p(E?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,a.jsx)(d.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:p(E?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,a.jsx)(d.IconTrashOutlineMedium,{size:16}),danger:!0}],[D,F]=(0,o.useState)(!1),j=p(E?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),P=e(q=>{s||(q==="archive"?l?.():q==="restore"?h?.():q==="delete"&&y?.())},"choose");return(0,a.jsx)(d.Menu,{open:!s&&D,align:"end",portal:!0,dense:!0,items:C,onSelect:e(q=>{F(!1),P(q)},"onSelect"),onClose:e(()=>F(!1),"onClose"),anchor:I({variant:"outline",className:"dsham_iconAction",disabled:s,"aria-label":j,"aria-haspopup":"menu","aria-expanded":D&&!s,icon:Mr(),onClick:e(()=>{s||F(q=>!q)},"onClick")})})}e(ms,"ArchivedGroupActions");let Nn="__ungrouped__";function fs(n){return n===Nn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}e(fs,"archivedBatchTargetForGroup");function dn(n,s,l){let h=[...new Set(n??[])];if(l.scope==="all")return h;if(l.scope==="sessions"){let p=new Set(l.sessionIds??[]);return h.filter(E=>p.has(E))}if(l.scope==="workspace"){let p=new Set(s.find(E=>E.workspaceId===l.workspaceId)?.sessionIds??[]);return h.filter(E=>p.has(E))}let y=new Set(s.flatMap(p=>p.sessionIds));return h.filter(p=>!y.has(p))}e(dn,"deriveArchivedBatchIds");function Pr(n){return[...new Set(n.flatMap(s=>s.sessions.map(l=>l.id)))]}e(Pr,"archivedSessionIdsInGroups");function Or(n,s){let l=new Set(s);return[...new Set(n)].filter(h=>l.has(h))}e(Or,"pruneArchivedSelection");function Yn(n,s,l){let h=new Set(n);for(let y of s)l?h.add(y):h.delete(y);return[...h]}e(Yn,"toggleArchivedSelection");function Lr(n,s){let l=n.deletedSessionIds.length,h=n.skippedSessionIds.length;return n.failures.length>0?{kind:"error",message:s("archives.deletePartial",{deleted:l,skipped:h,failed:n.failures.length,detail:n.failures[0].message})}:h>0&&l>0?{kind:"notice",message:s("archives.deleteSuccessWithSkipped",{deleted:l,skipped:h})}:h>0?{kind:"notice",message:s("archives.deleteSkipped",{n:h})}:{kind:"notice",message:s("archives.deleteSuccess",{n:l})}}e(Lr,"archivedDeleteFeedback");function Fr(n,s){let l=new Set(s);return Object.values(n).filter(h=>h.origin!=="subagent"&&!h.blank&&!l.has(h.id)).map(h=>h.id)}e(Fr,"unarchivedSessionIds");function Br(n,s,l,h){let y=s.map(C=>({key:C.workspaceId,title:C.title,ids:new Set(C.sessionIds),sessions:[]})),p=[];for(let C of l){let D=n[C];if(D===void 0||D.origin==="subagent")continue;let F=y.find(j=>j.ids?.has(C));(F===void 0?p:F.sessions).push(D)}let E=y.filter(C=>C.sessions.length>0);return p.length>0&&E.push({key:Nn,title:h,sessions:p}),E}e(Br,"deriveArchivedGroups");function Hr(n,s,l,h,y=[]){let p=e((j,P)=>String(j).localeCompare(String(P),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),E=new Map;if(Array.isArray(y))for(let j=0;j<y.length;j++)E.set(y[j],j);let C=e(j=>{let P=s==="created"?l[j.id]:j.updatedAt;return typeof P=="number"&&Number.isFinite(P)?P:Number.NEGATIVE_INFINITY},"timestampOf"),D=e((j,P)=>{if(s==="archived"){let q=E.get(j.id)??-1,Ee=(E.get(P.id)??-1)-q;if(Ee!==0)return Ee}if(s!=="alphabetical"){let q=C(P)-C(j);if(Number.isFinite(q)&&q!==0)return q}return p(tt(j,h),tt(P,h))||p(j.id,P.id)},"compareSessions");return n.map(j=>({...j,sessions:[...j.sessions].sort(D)})).sort((j,P)=>{if(s==="archived"){let q=j.sessions[0]?.id,u=P.sessions[0]?.id,Ee=q!==void 0?E.get(q)??-1:-1,pe=(u!==void 0?E.get(u)??-1:-1)-Ee;if(pe!==0)return pe}if(s!=="alphabetical"){let q=C(P.sessions[0])-C(j.sessions[0]);if(Number.isFinite(q)&&q!==0)return q}return p(j.title,P.title)||p(j.key,P.key)})}e(Hr,"sortArchivedGroups");let Ur={...Ba,...va,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","common.close":"\u5173\u95ED","sidebar.entry.title":"\u4FA7\u8FB9\u680F\u5165\u53E3","sidebar.entry.desc":"\u5728\u5DE6\u4FA7\u4E3B\u5BFC\u822A\u680F\u663E\u793A\u5F52\u6863\u7BA1\u7406\u5668\u3002\u8BBE\u7F6E\u91CC\u7684\u5165\u53E3\u4E0D\u53D8\u3002","sidebar.entry.toggle":"\u5207\u6362\u4FA7\u8FB9\u680F\u5165\u53E3","sidebar.favoriteStar.title":"\u4FA7\u680F\u6536\u85CF\u661F\u6807","sidebar.favoriteStar.desc":"\u5728\u4F1A\u8BDD\u5217\u8868\u884C\u524D\u663E\u793A\u6536\u85CF\u661F\u6807\u3002\u5173\u95ED\u540E\u4E0D\u663E\u793A\u56FE\u6807\uFF0C\u4ECD\u53EF\u901A\u8FC7\u83DC\u5355\u6536\u85CF\u548C\u7B5B\u9009\u3002","sidebar.favoriteStar.toggle":"\u5207\u6362\u4FA7\u680F\u6536\u85CF\u661F\u6807","update.entry.title":"\u5728\u7EBF\u66F4\u65B0","update.entry.desc":"\u5141\u8BB8\u68C0\u67E5\u5E76\u5728\u7EBF\u5B89\u88C5\u5F52\u6863\u7BA1\u7406\u5668\u7684\u65B0\u7248\u672C\u3002\u5173\u95ED\u540E\u9690\u85CF\u66F4\u65B0\u5165\u53E3\u3002","update.entry.toggle":"\u5207\u6362\u5728\u7EBF\u66F4\u65B0","update.entry.locked":"\u5728\u7EBF\u66F4\u65B0\u5DF2\u88AB\u5BBF\u4E3B\u914D\u7F6E\u9501\u5B9A\u7981\u7528","archives.archiveProject":"\u5F52\u6863\u8BE5\u9879\u76EE\u7684\u5168\u90E8\u804A\u5929","archives.archiveUngrouped":"\u5F52\u6863\u5168\u90E8\u672A\u5206\u7EC4\u804A\u5929","archives.archiveProjectDesc":"\u5C06\u201C{name}\u201D\u4E2D\u5168\u90E8 {n} \u6761\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.archiveUngroupedDesc":"\u5C06\u5168\u90E8 {n} \u6761\u672A\u5206\u7EC4\u7684\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.tab.archived":"\u5DF2\u5F52\u6863","archives.tab.unarchived":"\u672A\u5F52\u6863","archives.searchUnarchived":"\u641C\u7D22\u672A\u5F52\u6863\u804A\u5929","archives.emptyUnarchived":"\u6682\u65E0\u672A\u5F52\u6863\u4F1A\u8BDD\u3002","archives.archiveSelected":"\u5F52\u6863","archives.openSession":"\u6253\u5F00","archives.moreActions":"\u66F4\u591A\u64CD\u4F5C","archives.archiveSelectedDesc":"\u5C06\u9009\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\uFF0C\u5305\u542B\u5F53\u524D\u7B5B\u9009\u9690\u85CF\u7684\u5DF2\u9009\u9879\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u67E5\u770B\u548C\u6062\u590D\u3002","archives.archiveSuccess":"\u5DF2\u5F52\u6863 {n} \u6761\u4F1A\u8BDD\u3002","archives.archiveBatchFailed":"\u6279\u91CF\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.navigationUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u65E0\u6CD5\u4FDD\u6301\u5F52\u6863\u5BF9\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u201C\u6062\u590D\u5E76\u6253\u5F00\u201D\u3002","archives.sessionNotRetained":"\u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u6216\u6062\u590D\u540E\u518D\u8BD5\u3002","archives.restoreOpen":"\u6062\u590D\u6253\u5F00","archives.selectedCount":"\u5DF2\u9009 {n} \u6761","archives.selectionHiddenHint":"\u542B\u5F53\u524D\u672A\u663E\u793A\u7684 {hidden} \u6761\uFF0C\u4E5F\u5C06\u53C2\u4E0E\u64CD\u4F5C","archives.clearSelectionShort":"\u6E05\u7A7A","archives.restore":"\u6062\u590D","archives.archiveTitle":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archives.deleteSelectionShort":"\u5220\u9664","archives.clearSelection":"\u6E05\u7A7A\u9009\u62E9","group.ungrouped":"\u672A\u5206\u7EC4","session.new":"\u65B0\u4F1A\u8BDD","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archives.title":"\u5F52\u6863\u4F1A\u8BDD","archives.description":"\u7BA1\u7406\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u6216\u9009\u62E9\u672A\u5F52\u6863\u4F1A\u8BDD\u8FDB\u884C\u6279\u91CF\u5F52\u6863\u3002","archives.viewProject":"GitHub","archives.feedback":"\u95EE\u9898\u53CD\u9988","archives.empty":"\u6682\u65E0\u5DF2\u5F52\u6863\u4F1A\u8BDD","archives.emptyFiltered":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u804A\u5929","archives.searchPlaceholder":"\u641C\u7D22\u5DF2\u5F52\u6863\u804A\u5929","archives.sortLabel":"\u6392\u5E8F\u65B9\u5F0F","archives.viewOptions":"\u89C6\u56FE\u9009\u9879","archives.sortArchived":"\u6700\u8FD1\u5F52\u6863","archives.sortUpdated":"\u66F4\u65B0\u65F6\u95F4","archives.sortCreated":"\u521B\u5EFA\u65F6\u95F4","archives.sortAlphabetical":"\u6309\u5B57\u6BCD\u987A\u5E8F","archives.projectFilter":"\u6309\u9879\u76EE\u7B5B\u9009","archives.allProjects":"\u6240\u6709\u9879\u76EE","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","organizer.allChats":"\u5168\u90E8\u804A\u5929","archives.sessionCount":"{n} \u4E2A\u804A\u5929","archives.selectAllFiltered":"\u5168\u9009\u5F53\u524D\u7B5B\u9009\u7ED3\u679C","archives.selectSession":"\u9009\u62E9\u4F1A\u8BDD\u201C{name}\u201D","archives.restoreSelected":"\u6062\u590D\u6240\u9009","archives.deleteSelected":"\u5220\u9664\u6240\u9009","archives.timestamp":"{date}\uFF0C{time}","archives.restoreProject":"\u6062\u590D\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.restoreUngrouped":"\u5168\u90E8\u6062\u590D","archives.deleteProject":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngrouped":"\u5168\u90E8\u5220\u9664","archives.projectActions":"\u9879\u76EE\u201C{name}\u201D\u7684\u5F52\u6863\u64CD\u4F5C","archives.ungroupedActions":"\u672A\u5206\u7EC4\u804A\u5929\u7684\u5F52\u6863\u64CD\u4F5C","archives.restoreSuccess":"\u5DF2\u6062\u590D {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.restoreBatchFailed":"\u6279\u91CF\u6062\u590D\u5931\u8D25\uFF1A{detail}","archives.deleteSelectedTitle":"\u5220\u9664\u6240\u9009\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteSelectedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u6240\u9009\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteSelectedConfirm":"\u5220\u9664\u6240\u9009\u804A\u5929","archives.deleteProjectTitle":"\u5220\u9664\u201C{name}\u201D\u4E2D\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteProjectDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{name}\u201D\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u9879\u76EE\u76EE\u5F55\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteProjectConfirm":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngroupedTitle":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteUngroupedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u672A\u5206\u7EC4\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u9879\u76EE\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteUngroupedConfirm":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5168\u90E8\u804A\u5929","archives.deleteBatchPending":"\u6B63\u5728\u5220\u9664\u5DF2\u5F52\u6863\u804A\u5929\u2026","archives.deleteSuccess":"\u5DF2\u5220\u9664 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.deleteSuccessWithSkipped":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\uFF1B\u53E6\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deleteSkipped":"\u5DF2\u6E05\u7406 {n} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deletePartial":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u804A\u5929\uFF0C\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\uFF1B{failed} \u4E2A\u5220\u9664\u5931\u8D25\uFF1A{detail}","archives.unarchiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u53D6\u6D88\u5F52\u6863\u3002","archives.unarchiveFailed":"\u53D6\u6D88\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5F52\u6863\u3002","archives.archiveFailed":"\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveActive":"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF08{kinds}\uFF09\u3002","archiveActive.title":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.desc":"\u201C{name}\u201D\u4ECD\u6709\u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\uFF1A{kinds}\u3002\u5F52\u6863\u524D\u4F1A\u505C\u6B62\u8FD9\u4E9B\u5DE5\u4F5C\u3002","archiveActive.confirm":"\u505C\u6B62\u5E76\u5F52\u6863","archives.forkFailed":"\u5206\u53C9\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","deleteSession.title":"\u5220\u9664\u4F1A\u8BDD","deleteSession.confirmTitle":"\u5220\u9664\u4F1A\u8BDD\uFF1F","deleteSession.desc":"\u5C06\u6C38\u4E45\u5220\u9664\u4F1A\u8BDD\u201C{name}\u201D\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u5168\u90E8\u8BB0\u5F55\uFF08\u5BF9\u8BDD\u5185\u5BB9\u3001\u7EDF\u8BA1\u3001\u7F13\u5B58\uFF09\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","deleteSession.pending":"\u6B63\u5728\u5220\u9664\u4F1A\u8BDD\u2026","deleteSession.unknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5220\u9664\u3002","deleteSession.failed":"\u5220\u9664\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","menu.archiveWorkspace":"\u5F52\u6863\u4F1A\u8BDD","menu.copyWorkspacePath":"\u590D\u5236\u76EE\u5F55","menu.openInExplorer":"\u6253\u5F00\u76EE\u5F55","menu.moveSession":"\u79FB\u52A8\u5230\u5DE5\u4F5C\u533A","moveSession.noOtherWorkspaces":"\u6682\u65E0\u53EF\u79FB\u52A8\u7684\u5176\u4ED6\u5DE5\u4F5C\u533A","moveSession.success":"\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C{name}\u201D","archiveWorkspace.title":"\u5F52\u6863 {n} \u4E2A\u4F1A\u8BDD\uFF1F","archiveWorkspace.desc":"\u8FD9\u4F1A\u5C06\u201C{name}\u201D\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\u3002\u4E4B\u540E\u53EF\u4EE5\u5728\u201C\u8BBE\u7F6E \u2192 \u5F52\u6863\u4F1A\u8BDD\u201D\u4E2D\u627E\u5230\u5B83\u4EEC\u3002","archiveWorkspace.confirm":"\u5168\u90E8\u5F52\u6863","archiveWorkspace.pending":"\u6B63\u5728\u5F52\u6863\u4F1A\u8BDD\u2026","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5"},Wr={...Ha,...ba,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","common.close":"Close","sidebar.entry.title":"Sidebar entry","sidebar.entry.desc":"Show Archived Sessions in the left sidebar. The Settings entry stays either way.","sidebar.entry.toggle":"Toggle sidebar entry","sidebar.favoriteStar.title":"Sidebar favorite star","sidebar.favoriteStar.desc":"Show favorite star on session rows in the sidebar. When disabled, the star is hidden while menu actions and filters stay available.","sidebar.favoriteStar.toggle":"Toggle sidebar favorite star","update.entry.title":"Online updates","update.entry.desc":"Allow checking and installing new versions online. Hides the update entry when disabled.","update.entry.toggle":"Toggle online updates","update.entry.locked":"Online updates are disabled by the host configuration.","archives.moreActions":"More actions","archives.archiveProject":"Archive all chats in this project","archives.archiveUngrouped":"Archive all ungrouped chats","archives.archiveProjectDesc":"Archive all {n} unarchived sessions in \u201C{name}\u201D, regardless of the current search filter. You can restore them in Archived.","archives.archiveUngroupedDesc":"Archive all {n} ungrouped, unarchived sessions, regardless of the current search filter. You can restore them in Archived.","archives.tab.archived":"Archived","archives.tab.unarchived":"Unarchived","archives.searchUnarchived":"Search unarchived chats","archives.emptyUnarchived":"No unarchived sessions.","archives.archiveSelected":"Archive","archives.openSession":"Open session","archives.archiveSelectedDesc":"Archive the selected sessions, including selections hidden by the current filter. You can view and restore them in Archived.","archives.archiveSuccess":"Archived {n} sessions.","archives.archiveBatchFailed":"Batch archive failed: {detail}","archives.navigationUnavailable":"This host cannot keep the conversation archived while opening it. Use \u201CRestore and open\u201D instead.","archives.sessionNotRetained":"The host did not keep the requested conversation open. Try again, or restore it before opening.","archives.restoreOpen":"Restore and open","archives.selectedCount":"{n} selected","archives.selectionHiddenHint":"Includes {hidden} hidden by the current filter; actions apply to them too.","archives.clearSelectionShort":"Clear","archives.restore":"Restore","archives.archiveTitle":"Archive {n} chats?","archives.deleteSelectionShort":"Delete","archives.clearSelection":"Clear selection","group.ungrouped":"Ungrouped","session.new":"New Session","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archives.title":"Archived sessions","archives.description":"Manage archived sessions or select unarchived sessions to archive in bulk.","archives.viewProject":"GitHub","archives.feedback":"Issues","archives.empty":"No archived sessions.","archives.emptyFiltered":"No chats match your filters.","archives.searchPlaceholder":"Search archived chats","archives.sortLabel":"Sort order","archives.viewOptions":"View options","archives.sortArchived":"Recently archived","archives.sortUpdated":"Last updated","archives.sortCreated":"Created","archives.sortAlphabetical":"Alphabetical","archives.projectFilter":"Filter by project","archives.allProjects":"All projects","discovery.timeRange":"Date range","organizer.allChats":"All chats","archives.sessionCount":"{n} chats","archives.selectAllFiltered":"Select all results","archives.selectSession":"Select chat {name}","archives.restoreSelected":"Restore selected","archives.deleteSelected":"Delete selected","archives.timestamp":"{date}, {time}","archives.restoreProject":"Restore all chats in this project","archives.restoreUngrouped":"Restore all","archives.deleteProject":"Delete all chats in this project","archives.deleteUngrouped":"Delete all","archives.projectActions":"Archive actions for project {name}","archives.ungroupedActions":"Archive actions for ungrouped chats","archives.restoreSuccess":"Restored {n} archived chats.","archives.restoreBatchFailed":"Could not restore the archived chats: {detail}","archives.deleteSelectedTitle":"Delete selected archived chats","archives.deleteSelectedDesc":"This permanently deletes the selected {n} archived chats, their child agents (including any that are still running), and their records. Other chats are not affected. This cannot be undone.","archives.deleteSelectedConfirm":"Delete selected chats","archives.deleteProjectTitle":"Delete archived chats in {name}","archives.deleteProjectDesc":"This permanently deletes the {n} archived chats in {name}, their child agents, and their records. The project directory and unarchived chats are not affected. This cannot be undone.","archives.deleteProjectConfirm":"Delete all project chats","archives.deleteUngroupedTitle":"Delete ungrouped archived chats","archives.deleteUngroupedDesc":"This permanently deletes the {n} ungrouped archived chats, their child agents, and their records. Other projects and unarchived chats are not affected. This cannot be undone.","archives.deleteUngroupedConfirm":"Delete all ungrouped chats","archives.deleteBatchPending":"Deleting archived chats\u2026","archives.deleteSuccess":"Deleted {n} archived chats.","archives.deleteSuccessWithSkipped":"Deleted {deleted} archived chats and cleared {skipped} stale archive entries for sessions that no longer exist.","archives.deleteSkipped":"Cleared {n} stale archive entries for sessions that no longer exist.","archives.deletePartial":"Deleted {deleted} chats and cleared {skipped} stale archive entries; {failed} could not be deleted: {detail}","archives.unarchiveUnknown":"This session no longer exists, so it cannot be unarchived.","archives.unarchiveFailed":"Could not unarchive the session: {detail}","archives.archiveUnknown":"This session no longer exists, so it cannot be archived.","archives.archiveFailed":"Could not archive the session: {detail}","archives.archiveActive":"This conversation is still running ({kinds}).","archiveActive.title":"Stop and archive","archiveActive.desc":"\u201C{name}\u201D still has work in progress: {kinds}. Archiving stops that work first.","archiveActive.confirm":"Stop and archive","archives.forkFailed":"Could not fork the session: {detail}","deleteSession.title":"Delete session","deleteSession.confirmTitle":"Delete session?","deleteSession.desc":"This permanently deletes session \u201C{name}\u201D, its child agents (including any that are still running), and all of its records (conversation, stats, cache). This cannot be undone.","deleteSession.pending":"Deleting session\u2026","deleteSession.unknown":"This session no longer exists or was already deleted.","deleteSession.failed":"Could not delete the session: {detail}","menu.archiveWorkspace":"Archive sessions","menu.copyWorkspacePath":"Copy folder path","menu.openInExplorer":"Open folder","menu.moveSession":"Move to workspace","moveSession.noOtherWorkspaces":"No other workspaces available","moveSession.success":"Session successfully moved to \u201C{name}\u201D","archiveWorkspace.title":"Archive {n} conversations?","archiveWorkspace.desc":"This archives all conversations in \u201C{name}\u201D. You can find them later in Archived sessions.","archiveWorkspace.confirm":"Archive all","archiveWorkspace.pending":"Archiving conversations\u2026","date.ymd":"{y}-{m}-{d}"},gs={...Ua,...ya,"locale.language":"ru","service.unavailable":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","common.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","sidebar.entry.title":"\u041F\u0443\u043D\u043A\u0442 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.entry.desc":"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0430\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439 \u043D\u0430 \u043B\u0435\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0443\u043D\u043A\u0442 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F.","sidebar.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.favoriteStar.title":"\u0417\u0432\u0435\u0437\u0434\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.favoriteStar.desc":"\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0443 \u0441\u0442\u0440\u043E\u043A \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438 \u0437\u043D\u0430\u0447\u043E\u043A \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F, \u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043C\u0435\u043D\u044E \u0438 \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u043C\u0438.","sidebar.favoriteStar.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","update.entry.title":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.desc":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439 \u043E\u043D\u043B\u0430\u0439\u043D. \u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u043F\u0443\u043D\u043A\u0442 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438.","update.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.locked":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0445\u043E\u0441\u0442\u0430.","archives.moreActions":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E","archives.archiveProject":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.archiveUngrouped":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.archiveProjectDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \xAB{name}\xBB, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveUngroupedDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.tab.archived":"\u0410\u0440\u0445\u0438\u0432","archives.tab.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.searchUnarchived":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.emptyUnarchived":"\u041D\u0435\u0442 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.archiveSelected":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.openSession":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archives.archiveSelectedDesc":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0441\u043A\u0440\u044B\u0442\u044B\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveSuccess":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441\u0435\u0441\u0441\u0438\u0439: {n}.","archives.archiveBatchFailed":"\u041F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {detail}","archives.navigationUnavailable":"\u042D\u0442\u043E\u0442 \u0445\u043E\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438. \u0412\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \xAB\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\xBB.","archives.sessionNotRetained":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0438\u043B\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C.","archives.restoreOpen":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C","archives.selectedCount":"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}","archives.selectionHiddenHint":"\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 {hidden}, \u0441\u043A\u0440\u044B\u0442\u044B\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u0438 \u043A \u043D\u0438\u043C.","archives.clearSelectionShort":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C","archives.restore":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C","archives.archiveTitle":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archives.deleteSelectionShort":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","archives.clearSelection":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440","group.ungrouped":"\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B","session.new":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F","menu.deleteSession":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archived.badge":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.title":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.description":"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0438\u043B\u0438 \u0432\u044B\u0431\u043E\u0440 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438.","archives.viewProject":"GitHub","archives.feedback":"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u044B","archives.empty":"\u041D\u0435\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.emptyFiltered":"\u041D\u0438 \u043E\u0434\u0438\u043D \u0447\u0430\u0442 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0448\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u043C.","archives.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.sortLabel":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430","archives.viewOptions":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0432\u0438\u0434\u0430","archives.sortArchived":"\u041D\u0435\u0434\u0430\u0432\u043D\u043E \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.sortUpdated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","archives.sortCreated":"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F","archives.sortAlphabetical":"\u041F\u043E \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u0443","archives.projectFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0443","archives.allProjects":"\u0412\u0441\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","organizer.allChats":"\u0412\u0441\u0435 \u0447\u0430\u0442\u044B","archives.sessionCount":"{n} \u0447\u0430\u0442\u043E\u0432","archives.selectAllFiltered":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B","archives.selectSession":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0447\u0430\u0442 {name}","archives.restoreSelected":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.deleteSelected":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.timestamp":"{date}, {time}","archives.restoreProject":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.restoreUngrouped":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435","archives.deleteProject":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngrouped":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435","archives.projectActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0435\u043A\u0442\u0430 {name}","archives.ungroupedActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.restoreSuccess":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.restoreBatchFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B: {detail}","archives.deleteSelectedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteSelectedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteSelectedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteProjectTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u0432 {name}","archives.deleteProjectDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0432 {name}, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteProjectConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngroupedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteUngroupedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteUngroupedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteBatchPending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432\u2026","archives.deleteSuccess":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.deleteSuccessWithSkipped":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deleteSkipped":"\u041E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deletePartial":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430; {failed} \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C: {detail}","archives.unarchiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430.","archives.unarchiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430: {detail}","archives.archiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C.","archives.archiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","archives.archiveActive":"\u042D\u0442\u043E\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F ({kinds}).","archiveActive.title":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.desc":"\u0412 \xAB{name}\xBB \u0435\u0449\u0451 \u0438\u0434\u0451\u0442 \u0440\u0430\u0431\u043E\u0442\u0430: {kinds}. \u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442 \u0435\u0451.","archiveActive.confirm":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.forkFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438: {detail}","deleteSession.title":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","deleteSession.confirmTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E?","deleteSession.desc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044E \xAB{name}\xBB, \u0435\u0451 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0432\u0441\u0435 \u0435\u0451 \u0437\u0430\u043F\u0438\u0441\u0438 (\u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0443, \u043A\u044D\u0448). \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","deleteSession.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","deleteSession.unknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u0443\u0436\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0430.","deleteSession.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","menu.archiveWorkspace":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u0438","menu.copyWorkspacePath":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0443\u0442\u044C \u043A \u043F\u0430\u043F\u043A\u0435","menu.openInExplorer":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","menu.moveSession":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0432 \u043F\u0440\u043E\u0435\u043A\u0442","moveSession.noOtherWorkspaces":"\u041D\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u0432","moveSession.success":"\u0421\u0435\u0441\u0441\u0438\u044F \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0430 \u0432 \xAB{name}\xBB","archiveWorkspace.title":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0441\u0435\u0441\u0441\u0438\u0439?","archiveWorkspace.desc":"\u042D\u0442\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432 \xAB{name}\xBB. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u043F\u043E\u0437\u0436\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archiveWorkspace.confirm":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435","archiveWorkspace.pending":"\u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0439\u2026","date.ymd":"{y}-{m}-{d}"},Ke="archive-manager-workspace",vs=["slots","sessions","workspaces","locale","remote","typert"];function Zn(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}e(Zn,"bindObservable");function qr(n){return async s=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(s)}}e(qr,"createUnarchiveSession");async function Jn(n,s,l){let h=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),y=await Hn(s,async E=>{try{await n.archiveSession(E)}catch(C){throw C!==null&&typeof C=="object"&&Rn(C)!==void 0&&typeof te(C).sessionId!="string"&&Object.assign(C,{sessionId:E}),C}return!0},{refresh:l}),p=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:p,archivedSessionIdsAdded:p.filter(E=>!h.has(E)),failures:y.failures}}e(Jn,"archiveSessionsViaOfficial");async function Vr(n,s,l,h){let y=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),p=typeof h=="function"?h:D=>n.unarchiveSession?.(D),E=await Hn(s,async D=>(await p(D),!0),{refresh:l}),C=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:C,unarchivedSessionIds:[...y].filter(D=>!C.includes(D)),failures:E.failures}}e(Vr,"unarchiveSessionsViaOfficial");async function bs(n){ys(n);let s=n.get("remote"),l=e(()=>{},"disposeRemote");return s!==void 0&&(l=await s.$mount(ft)),async()=>{await l()}}e(bs,"apply");function ys(n){n.effect(()=>n.locale.register(Ke,{zh:Ur,en:Wr,ru:gs}),"dsh-archive-manager: dictionaries");let s=e(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),l={},h,y=e(m=>(h=Ea(m,n.sessions,n.workspaces,{onOpened:e(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:e(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>h?.dispose()),"attachArchiveNavigation");n.effect(()=>y(s()),"archive-manager: explicit archived navigation");let p=e(m=>{if(h===void 0)throw new qt("navigationUnavailable");return _r.request(m),h.open(m)},"openConversation"),E=e(async m=>{n.get("layout")?.beginNavigation?.(),_r.request(m)},"focusSessionWorkspace"),C=e(async(m,v)=>{let T=await n.sessions.search(m,v);if(!T.ok)throw new Error(T.error.message);return T.value},"searchSessions"),D=e(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await Ee(),null}catch(m){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",m),m instanceof Error?m.message:String(m)}},"refreshSessionList"),F=qr(n.workspaces),j=e(async(m,...v)=>{let T=n.get("remote.workspaceRegistry");if(!T||typeof T[m]!="function")throw new Error(n.locale.bind(Ke)("service.unavailable"));let ke=await T[m].apply(T,v);if(!ke.ok)throw new Error(ke.error.message);return ke.value},"registryCall"),P=e(()=>j("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),q=e(()=>j("diagnoseSessionCaches"),"diagnoseSessionCaches"),u=e(m=>j("rebuildSessionCaches",m),"rebuildSessionCaches"),Ee=e(async()=>{if(typeof n.sessions.refresh!="function")throw new Error("Official session list refresh is unavailable");let m=await n.sessions.refresh(),v=n.sessions,T=v.manager;if(T?.listState==="error"&&T.listError)throw new Error(Ue(T.listError));if(v.listState==="error"&&v.listError)throw new Error(Ue(v.listError));let G=v.list?.getSnapshot?.();if(G?.state==="error"&&G.error)throw new Error(Ue(G.error));if(m&&typeof m=="object"&&"ok"in m&&m.ok===!1)throw new Error(Ue(m.error??"Session list refresh failed"))},"refreshCacheLists"),Le=e((m={})=>j("cleanOrphanSubagents",m??{}),"cleanOrphanSubagents"),pe=e(m=>j("searchArchivedContent",m),"searchArchivedContent"),vt=e(m=>j("searchSessionContent",m),"searchSessionContent"),at=e(m=>j("previewArchivedSession",m),"previewArchivedSession"),nt=e(()=>j("favoriteSessions"),"favoriteSessions"),Jt=e(m=>j("setSessionFavorite",m),"setSessionFavorite"),ct=wr();ct.bind({favoriteSessions:nt,setSessionFavorite:Jt});let ut,Xt=yr(n,ct,()=>n.locale.bind(Ke),()=>ut?.isSidebarFavoriteStarEnabled()??!0);n.effect(()=>()=>Xt.dispose(),"archive-manager: favorites only filter");let xt=La({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:e(m=>n.workspaces.archiveSession(m),"archive"),restore:e(async m=>{await F(m)},"restore"),deleteOne:e(async m=>{let v=n.get("remote.workspaceRegistry");if(!v)throw new Error(n.locale.bind(Ke)("service.unavailable"));let T=await v.deleteSession(m);if(!T.ok)throw new Error(T.error.message)},"deleteOne"),getFavorites:nt,refresh:e(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:Bn}),Et=e(async m=>{await F(m),await D()},"unarchiveSession"),U=e(async m=>{let v=n.get("remote.workspaceRegistry");if(v===void 0)throw new Error("archive-manager remote service is unavailable");let T=await v.deleteSession(m);if(!T.ok)throw new Error(T.error.message);await D()},"deleteSession"),je=e(async(m,v)=>{let T=n.get("remote.workspaceRegistry");if(T===void 0)throw new Error("archive-manager remote service is unavailable");let G=await T.moveSessionToWorkspace({sessionId:m,targetWorkspaceId:v});if(!G.ok)throw new Error(G.error?.message||"move failed");return await D(),G.value},"moveSession"),J=e(async m=>Jn(n.workspaces,m,D),"archiveSessions"),K=e(async m=>{let v=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},T=dn(v.archivedSessionIds,v.items,m);return Vr(n.workspaces,T,D,F)},"unarchiveSessions"),Fe=e(async m=>{let v=n.get("remote.workspaceRegistry");if(v===void 0)throw new Error("archive-manager remote service is unavailable");let T=await v.deleteArchivedSessions(m);if(!T.ok)throw new Error(T.error.message);let G=await D();return{...T.value,refreshError:G}},"deleteArchivedSessions"),Xe=e(async()=>{let m=n.get("remote.workspaceRegistry");if(m===void 0)throw new Error("archive-manager remote service is unavailable");let v=await m.archivedSessionMetadata();if(!v.ok)throw new Error(v.error.message);return v.value},"archivedSessionMetadata"),M="sidebar.workspaces.session.menu.item",Ie=null,xe=new Set,$e=e(m=>{Ie=m;for(let v of xe)v()},"publishDeleteTarget");function st(){return o.useSyncExternalStore(m=>(xe.add(m),()=>{xe.delete(m)}),()=>Ie,()=>Ie)}e(st,"useDeleteRequest");function Ye({sessionId:m,displayTitle:v,useMenuOpenState:T,t:G}){let[,ke]=T(),ce=d.MenuItemButton,Ne=(0,a.jsx)(d.IconTrashOutlineRegular,{size:14}),_e=e(()=>{ke(!1),$e({sessionId:m,title:v})},"onSelect");return typeof ce=="function"?(0,a.jsx)(ce,{danger:!0,icon:Ne,onSelect:_e,children:G("menu.deleteSession")}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:_e,children:G("menu.deleteSession")})}e(Ye,"DeleteSessionMenuItem");function At({sessionId:m,favoriteRow:v,useMenuOpenState:T,t:G}){let[,ke]=T(),ce=(0,o.useSyncExternalStore)(v.subscribe,v.getSnapshot),Ne=ce.ready&&ce.ids.has(m),_e=e(()=>{ke(!1),v.toggle(m)},"onSelect"),me=d.MenuItemButton,Be=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:Ne?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:se})}),Ze=G(Ne?"organizer.unfavorite":"organizer.favorite");return typeof me=="function"?(0,a.jsx)(me,{icon:Be,onSelect:_e,children:Ze}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:_e,children:Ze})}e(At,"FavoriteMenuItem");let Mt=null,$t=new Set;function Tt(m,v="success"){Mt={text:m,tone:v,seq:Date.now()};for(let T of $t)T()}e(Tt,"showToast");function Ae(){let m=o.useSyncExternalStore(T=>($t.add(T),()=>{$t.delete(T)}),()=>Mt,()=>Mt);if(!m)return null;let v=d.Toast;return typeof v=="function"?(0,a.jsx)(v,{key:m.seq,text:m.text,tone:m.tone,holdMs:3e3,onDone:e(()=>{if(Mt?.seq===m.seq){Mt=null;for(let T of $t)T()}},"onDone")}):(0,a.jsx)("div",{key:m.seq,style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:99999,padding:"8px 16px",borderRadius:8,background:m.tone==="danger"?"#7f1d1d":"#14532d",color:"#fff",fontSize:13,boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:m.text})}e(Ae,"GlobalToastOverlay");function Lt({sessionId:m,displayTitle:v,useMenuOpenState:T,t:G}){let[,ke]=T(),[ce,Ne]=o.useState(!1),[_e,me]=o.useState(null),[Be,Ze]=o.useState(!1),it=o.useRef(null),wt=o.useRef(null),ee=n.workspaces.list?.getSnapshot?.()?.items??[],ie=d.MenuItemButton,z=e(()=>{if(wt.current&&clearTimeout(wt.current),it.current){let ge=it.current.getBoundingClientRect(),Se=typeof window<"u"?window.innerWidth:1024,X=typeof window<"u"?window.innerHeight:768,De=220,Ct=Math.max(140,X-20),ze=Math.min(360,Ct),Qe=ge.right+2;Qe+De>Se-10&&(Qe=Math.max(10,ge.left-De-4));let he=ge.top-4;he+ze>X-10&&(he=Math.max(10,X-ze-10)),he<10&&(he=10),me({top:he,left:Qe,maxHeight:ze})}Ne(!0)},"handleMouseEnter"),oe=e(()=>{wt.current=setTimeout(()=>{Ne(!1)},180)},"handleMouseLeave"),Te=e(async(ge,Se)=>{if(!Be){Ze(!0),Ne(!1),ke(!1);try{await je(m,ge),Tt(G("moveSession.success",{name:Se})||`\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C${Se}\u201D`,"success")}catch(X){let De=X instanceof Error?X.message:String(X);console.warn("archive-manager: move session failed",X),Tt(De,"danger")}finally{Ze(!1)}}},"handleSelectWorkspace"),ye=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,a.jsx)("path",{d:"M2 3.5C2 2.67157 2.67157 2 3.5 2H6.5L8 4H12.5C13.3284 4 14 4.67157 14 5.5V12.5C14 13.3284 13.3284 14 12.5 14H3.5C2.67157 14 2 13.3284 2 12.5V3.5Z"}),(0,a.jsx)("path",{d:"M8 7.5L10.5 10L8 12.5"}),(0,a.jsx)("path",{d:"M5.5 10H10.5"})]}),Je=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{marginLeft:"auto",opacity:.65},children:(0,a.jsx)("path",{d:"M6 3.5L10.5 8L6 12.5"})}),we=(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:8},children:[(0,a.jsx)("span",{children:G("menu.moveSession")}),Je]}),fe=typeof ie=="function"?(0,a.jsx)(ie,{icon:ye,onSelect:e(()=>z(),"onSelect"),children:we}):(0,a.jsxs)("button",{type:"button",role:"menuitem",onClick:e(()=>z(),"onClick"),style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 8px",background:"transparent",border:"none",cursor:"pointer",color:"inherit",textAlign:"left"},children:[ye,we]});return(0,a.jsxs)("div",{ref:it,className:"dsham_moveSessionWrap",onMouseEnter:z,onMouseLeave:oe,children:[fe,ce&&_e&&typeof document<"u"&&typeof g?.createPortal=="function"&&(0,g.createPortal)((0,a.jsxs)("div",{className:"dsham_moveSubmenu",role:"menu",onPointerDown:e(ge=>{ge.stopPropagation()},"onPointerDown"),onMouseDown:e(ge=>{ge.stopPropagation()},"onMouseDown"),onMouseEnter:z,onMouseLeave:oe,style:{top:_e.top,left:_e.left,maxHeight:_e.maxHeight},children:[(0,a.jsx)("div",{style:{position:"absolute",top:0,bottom:0,left:-6,width:8},"aria-hidden":!0}),ee.length===0?(0,a.jsx)("div",{style:{padding:"8px 10px",fontSize:"12px",color:"var(--dsw-alias-label-tertiary, #888)"},children:G("moveSession.noOtherWorkspaces")}):ee.map(ge=>{let Se=ge.title||ge.path||ge.workspaceId;return(0,a.jsx)("button",{type:"button",role:"menuitem",className:"dsham_moveSubmenuBtn",disabled:Be,onPointerDown:e(X=>{X.preventDefault(),X.stopPropagation(),Te(ge.workspaceId,Se)},"onPointerDown"),onClick:e(X=>{X.preventDefault(),X.stopPropagation(),Te(ge.workspaceId,Se)},"onClick"),children:(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1},children:Se})},ge.workspaceId)})]}),document.body)]})}e(Lt,"MoveSessionMenuItem");function cn(m){try{let v=document.querySelector(`[data-row-key="session:${CSS.escape(m)}"]`);return v?(v.hasAttribute("tabindex")||(v.setAttribute("tabindex","-1"),v.addEventListener("blur",()=>v.removeAttribute("tabindex"),{once:!0})),typeof d.focusWithoutRing=="function"?d.focusWithoutRing(v):v.focus(),!0):!1}catch{return!1}}e(cn,"focusSessionRow");function Z({t:m}){let v=st(),[T,G]=(0,o.useState)(!1),[ke,ce]=(0,o.useState)(null),[Ne,_e]=(0,o.useState)(null),me=(0,o.useRef)(null),Be=(0,o.useRef)(null),Ze=(0,o.useRef)(null);if((0,o.useLayoutEffect)(()=>{if(v===null||typeof document>"u"){_e(null);return}let ee=null,ie=e(()=>{if(ee&&ee.isConnected)return ee;try{ee=document.querySelector(`[data-row-key="session:${CSS.escape(v.sessionId)}"]`)}catch{ee=null}return ee},"getTargetRow"),z=e(()=>{let Te=me.current,ye=Te?.offsetWidth||290,Je=Te?.offsetHeight||160,we=8,fe=ie();if(!fe){let De=window.innerWidth,Ct=window.innerHeight,ze=Math.max(16,(Ct-Je)/2),Qe=Math.max(16,(De-ye)/2);_e(he=>he!==null&&he.top===ze&&he.left===Qe?he:{top:ze,left:Qe});return}let ge=fe.getBoundingClientRect(),Se=ge.top-4;Se+Je>window.innerHeight-16&&(Se=window.innerHeight-16-Je),Se<16&&(Se=16);let X=ge.right+we;X+ye>window.innerWidth-16&&(X=ge.left-ye-we),X<16&&(X=16),_e(De=>De!==null&&De.top===Se&&De.left===X?De:{top:Se,left:X})},"updatePosition");z(),window.addEventListener("scroll",z,!0),window.addEventListener("resize",z);let oe=null;return typeof ResizeObserver<"u"&&me.current&&(oe=new ResizeObserver(z),oe.observe(me.current)),()=>{oe?.disconnect(),window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[v]),(0,o.useEffect)(()=>{if(v===null)return;Be.current&&!Be.current.disabled?Be.current.focus():me.current?.focus();let ee=v.sessionId;return()=>{if(!cn(ee)){let z=document.querySelector('[role="treeitem"][aria-selected="true"]');z&&(z.hasAttribute("tabindex")||(z.setAttribute("tabindex","-1"),z.addEventListener("blur",()=>z.removeAttribute("tabindex"),{once:!0})),typeof d.focusWithoutRing=="function"?d.focusWithoutRing(z):z.focus())}}},[v]),(0,o.useEffect)(()=>{v!==null&&T&&me.current?.focus()},[v,T]),(0,o.useEffect)(()=>{if(v===null)return;let ee=e(ie=>{if(ie.key==="Escape"){ie.preventDefault(),ie.stopPropagation(),"stopImmediatePropagation"in ie&&typeof ie.stopImmediatePropagation=="function"&&ie.stopImmediatePropagation(),T||(ce(null),$e(null));return}if(ie.key==="Tab"){if(ie.preventDefault(),T){me.current?.focus();return}let z=Be.current,oe=Ze.current;if(!z||!oe)return;ie.shiftKey?document.activeElement===z?oe.focus():z.focus():document.activeElement===oe?z.focus():oe.focus()}},"onKey");return window.addEventListener("keydown",ee,!0),()=>window.removeEventListener("keydown",ee,!0)},[v,T]),v===null)return null;let it=e(()=>{T||(ce(null),$e(null))},"close"),wt=e(()=>{G(!0),ce(null),U(v.sessionId).then(()=>{G(!1),$e(null)}).catch(ee=>{G(!1),ce(Wn(ee,m))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:it}),(0,a.jsxs)("div",{ref:me,role:"dialog","aria-modal":!0,"aria-label":m("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:Ne?{top:Ne.top,left:Ne.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:m("deleteSession.confirmTitle")}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:m("deleteSession.desc",{name:v.title})}),T&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:m("deleteSession.pending")}),ke!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:ke}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:Be,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:T,onClick:it,children:m("cancel")}),(0,a.jsx)("button",{ref:Ze,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:T,onClick:wt,children:m("deleteSession.title")})]})]})]})}e(Z,"DeleteSessionOverlay");let We=null,kt=new Set,$=e(m=>{We=m;for(let v of kt)v()},"publishArchiveWsTarget");function Dn(){return o.useSyncExternalStore(m=>(kt.add(m),()=>{kt.delete(m)}),()=>We,()=>We)}e(Dn,"useArchiveWsRequest");function qe(m){try{let v=document.querySelector(`[data-row-key="workspace:${CSS.escape(m)}"]`);return v?(v.hasAttribute("tabindex")||(v.setAttribute("tabindex","-1"),v.addEventListener("blur",()=>v.removeAttribute("tabindex"),{once:!0})),typeof d.focusWithoutRing=="function"?d.focusWithoutRing(v):v.focus(),!0):!1}catch{return!1}}e(qe,"focusWorkspaceRow");function Qt({t:m}){let v=Dn(),[T,G]=(0,o.useState)(!1),[ke,ce]=(0,o.useState)(null),[Ne,_e]=(0,o.useState)(null),me=(0,o.useRef)(null),Be=(0,o.useRef)(null),Ze=(0,o.useRef)(null);if((0,o.useLayoutEffect)(()=>{if(v===null||typeof document>"u"){_e(null);return}let ee=null,ie=e(()=>{if(ee&&ee.isConnected)return ee;try{ee=document.querySelector(`[data-row-key="workspace:${CSS.escape(v.workspaceId)}"]`)}catch{ee=null}return ee},"getTargetRow"),z=e(()=>{let Te=me.current,ye=Te?.offsetWidth||290,Je=Te?.offsetHeight||160,we=8,fe=ie();if(!fe){let De=window.innerWidth,Ct=window.innerHeight,ze=Math.max(16,(Ct-Je)/2),Qe=Math.max(16,(De-ye)/2);_e(he=>he!==null&&he.top===ze&&he.left===Qe?he:{top:ze,left:Qe});return}let ge=fe.getBoundingClientRect(),Se=ge.top-4;Se+Je>window.innerHeight-16&&(Se=window.innerHeight-16-Je),Se<16&&(Se=16);let X=ge.right+we;X+ye>window.innerWidth-16&&(X=ge.left-ye-we),X<16&&(X=16),_e(De=>De!==null&&De.top===Se&&De.left===X?De:{top:Se,left:X})},"updatePosition");z(),window.addEventListener("scroll",z,!0),window.addEventListener("resize",z);let oe=null;return typeof ResizeObserver<"u"&&me.current&&(oe=new ResizeObserver(z),oe.observe(me.current)),()=>{oe?.disconnect(),window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[v]),(0,o.useEffect)(()=>{if(v===null)return;Be.current&&!Be.current.disabled?Be.current.focus():me.current?.focus();let ee=v.workspaceId;return()=>{qe(ee)}},[v]),(0,o.useEffect)(()=>{v!==null&&T&&me.current?.focus()},[v,T]),(0,o.useEffect)(()=>{if(v===null)return;let ee=e(ie=>{if(ie.key==="Escape"){ie.preventDefault(),ie.stopPropagation(),"stopImmediatePropagation"in ie&&typeof ie.stopImmediatePropagation=="function"&&ie.stopImmediatePropagation(),T||(ce(null),$(null));return}if(ie.key==="Tab"){if(ie.preventDefault(),T){me.current?.focus();return}let z=Be.current,oe=Ze.current;if(!z||!oe)return;ie.shiftKey?document.activeElement===z?oe.focus():z.focus():document.activeElement===oe?z.focus():oe.focus()}},"onKey");return window.addEventListener("keydown",ee,!0),()=>window.removeEventListener("keydown",ee,!0)},[v,T]),v===null)return null;let it=e(()=>{T||(ce(null),$(null))},"close"),wt=e(()=>{G(!0),ce(null);let ie=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ye=>ye.workspaceId===v.workspaceId),z=n.sessions.list?.getSnapshot?.()?.byId??{},oe=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),Te=(ie?.sessionIds??[]).filter(ye=>qn(ye,z,oe));Jn(n.workspaces,Te,D).then(ye=>{if(G(!1),ye.failures.length>0){ce(_n(ye.failures,m));return}$(null)}).catch(ye=>{G(!1),ce(kr(ye,m))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:it}),(0,a.jsxs)("div",{ref:me,role:"dialog","aria-modal":!0,"aria-label":m("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:Ne?{top:Ne.top,left:Ne.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:m("archiveWorkspace.title",{n:v.count})}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:m("archiveWorkspace.desc",{name:v.title})}),T&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:m("archiveWorkspace.pending")}),ke!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:ke}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:Be,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:T,onClick:it,children:m("cancel")}),(0,a.jsx)("button",{ref:Ze,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:T,onClick:wt,children:m("archiveWorkspace.confirm")})]})]})]})}e(Qt,"ArchiveWorkspaceOverlay");function _t(m){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let v=null,T=!1,G=new Map,ke=!1,ce=e(z=>{let Te=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(we=>we.workspaceId===z);if(Te===void 0)return[];let ye=n.sessions.list?.getSnapshot?.()?.byId??{},Je=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return Te.sessionIds.filter(we=>qn(we,ye,Je))},"workspaceCandidateIds"),Ne=e(()=>{if(ke=!1,!T)for(let[z,oe]of G){if(!z.isConnected){G.delete(z);continue}let Te=ce(oe.workspaceId).length===0;z.disabled=Te,z.style.opacity=Te?"0.5":"",z.style.cursor=Te?"not-allowed":""}},"revalidateItems"),_e=e(()=>{if(G.size===0||ke||T)return;ke=!0;let z=e(()=>Ne(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(z):setTimeout(z,16)},"scheduleRevalidate"),me=e(z=>{v=Tr(z.target)},"rememberWorkspace");document.addEventListener("pointerdown",me,!0),document.addEventListener("click",me,!0);let Be=e(()=>{if(T)return;for(let[oe]of G)oe.isConnected||G.delete(oe);let z=document.querySelectorAll('[role="menu"]');for(let oe of z){if(oe.querySelector('[data-dsham-archive-workspace="true"]'))continue;let Te=Array.from(oe.querySelectorAll('button[role="menuitem"]'));if(Te.length===0)continue;let ye=Te.find(He=>$n(He,!1))??Te.find(He=>$n(He,!0));if(!ye)continue;let Je=Te.find(He=>He!==ye)??ye,we=ye.parentElement;if(!we)continue;let fe=v;if(!fe)continue;let Se=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(He=>He.workspaceId===fe.workspaceId),X=Se?.path??Se?.cwd,Ct=ce(fe.workspaceId).length,ze=document.createElement("div");ze.className=we.className;let Qe=Je.className.split(/\s+/).filter(He=>!/(?:^|[_-])danger(?:$|[_-])/i.test(He)).join(" "),he=document.createElement("button");he.type="button",he.setAttribute("role","menuitem"),he.dataset.dshamArchiveWorkspace="true",he.className=Qe;let Pt=Je.querySelector("span"),ot=Je.querySelectorAll("span")[1],en=document.createElement("span");en.setAttribute("aria-hidden","true"),Pt?.className&&(en.className=Pt.className),en.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"/><path d="M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"/><path d="M6.5 9.5H9.5"/></svg>';let gn=document.createElement("span");if(ot?.className&&(gn.className=ot.className),gn.textContent=m("menu.archiveWorkspace"),he.append(en,gn),ze.append(he),Ct===0&&(he.disabled=!0,he.style.opacity="0.5",he.style.cursor="not-allowed"),he.addEventListener("click",He=>{He.preventDefault(),He.stopPropagation();let rt=ce(fe.workspaceId).length;rt!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),$({workspaceId:fe.workspaceId,title:fe.title,count:rt}))}),X){let He=document.createElement("div");He.className=we.className;let rt=document.createElement("button");rt.type="button",rt.setAttribute("role","menuitem"),rt.dataset.dshamCopyWorkspacePath="true",rt.className=Qe,rt.disabled=!1,rt.style.opacity="",rt.style.cursor="";let tn=document.createElement("span");tn.setAttribute("aria-hidden","true"),Pt?.className&&(tn.className=Pt.className),tn.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 3.5V2.5C10.5 1.94772 10.0523 1.5 9.5 1.5H3.5C2.94772 1.5 2.5 1.94772 2.5 2.5V8.5C2.5 9.05228 2.94772 9.5 3.5 9.5H4.5"/></svg>';let nn=document.createElement("span");ot?.className&&(nn.className=ot.className),nn.textContent=m("menu.copyWorkspacePath"),rt.append(tn,nn),He.append(rt),rt.addEventListener("click",Ht=>{Ht.preventDefault(),Ht.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),or(X).catch(()=>{})});let vn=document.createElement("div");vn.className=we.className;let Pe=document.createElement("button");Pe.type="button",Pe.setAttribute("role","menuitem"),Pe.dataset.dshamOpenExplorer="true",Pe.className=Qe,Pe.disabled=!1,Pe.style.opacity="",Pe.style.cursor="";let Gt=document.createElement("span");Gt.setAttribute("aria-hidden","true"),Pt?.className&&(Gt.className=Pt.className),Gt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"/><path d="M10 8.5L12 10.5L10 12.5"/><path d="M6.5 10.5H12"/></svg>';let rn=document.createElement("span");ot?.className&&(rn.className=ot.className),rn.textContent=m("menu.openInExplorer"),Pe.append(Gt,rn),vn.append(Pe),Pe.addEventListener("click",Ht=>{Ht.preventDefault(),Ht.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),(async()=>{try{let Kt=await fetch(Cn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:X})}).catch(()=>null);if(Kt&&Kt.ok)return}catch{}try{await yt("/open-in-explorer",{method:"POST",body:JSON.stringify({path:X,workspaceId:fe.workspaceId})})}catch(Kt){console.warn("archive-manager: open in explorer failed",Kt)}})()}),we.parentNode?.insertBefore(He,we),we.parentNode?.insertBefore(vn,we)}we.parentNode?.insertBefore(ze,we),G.set(he,{workspaceId:fe.workspaceId})}},"checkAndInject"),Ze=!1,it=e(()=>{if(Ze||T)return;Ze=!0;let z=e(()=>{Ze=!1,!T&&Be()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(z):setTimeout(z,16)},"scheduleInject"),wt=new MutationObserver(z=>{jn(z,'[role="menu"]')&&it()});wt.observe(document.body,{childList:!0,subtree:!0});let ee=n.sessions.list?.subscribe?.(_e),ie=n.workspaces.list?.subscribe?.(_e);return()=>{T=!0,document.removeEventListener("pointerdown",me,!0),document.removeEventListener("click",me,!0),wt.disconnect(),ee?.(),ie?.(),G.clear();for(let z of document.querySelectorAll('[data-dsham-archive-workspace="true"], [data-dsham-copy-workspace-path="true"], [data-dsham-open-explorer="true"]'))z.parentElement?.remove()}}e(_t,"setupWorkspaceMenuInjector");function un(){return typeof n.slots.entries!="function"?!1:n.slots.entries("sidebar.workspaces").some(m=>m.children?.[M]!==void 0)}e(un,"hostSidebarDeclaresSessionMenu");let ht,Ft,Rt,hn,pn,mn,Bt,fn=e(()=>{let m=un()?"menu":"waiting";m!==ht&&(ht=m,m==="menu"&&(Ft??=n.slots.inject(M,()=>n.slots.register({name:M,id:"archive-manager.delete-session",order:500,locale:Ke,inject:e(()=>({}),"inject")},Ye)),Rt??=n.slots.inject(M,()=>n.slots.register({name:M,id:"archive-manager.favorite",order:50,locale:Ke,inject:e(()=>({favoriteRow:ct}),"inject")},At)),hn??=n.slots.inject(M,()=>n.slots.register({name:M,id:"archive-manager.move-session",order:480,locale:Ke,inject:e(()=>({}),"inject")},Lt)),pn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:Ke,inject:e(()=>({t:n.locale.bind(Ke)}),"inject")},Z)),mn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.archive-workspace",locale:Ke,inject:e(()=>({t:n.locale.bind(Ke)}),"inject")},Qt)),Bt??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.toast",locale:Ke,inject:e(()=>({}),"inject")},Ae))))},"reconcileSidebar");fn(),n.effect(()=>_t(n.locale.bind(Ke)),"archive-manager: workspace menu injector"),n.effect(()=>Ar(),"archive-manager: sidebar row contextmenu trigger"),Nr(n);let jt=typeof n.on=="function"?n.on("slots/changed",m=>{if(m==="sidebar.workspaces")try{fn()}catch(v){console.warn("archive-manager: sidebar mode switch failed",v)}}):void 0;n.effect(()=>()=>{jt?.(),Ft?.(),Rt?.(),hn?.(),pn?.(),mn?.(),Bt?.()},"archive-manager: sidebar mode");let bt=e(()=>({archiveSessions:J,archiveSession:e((m,v)=>n.workspaces.archiveSession(m,v),"archiveSession"),sessionStore:Zn(n.sessions.list),workspaceStore:Zn(n.workspaces.list),unarchiveSession:Et,deleteSession:U,unarchiveSessions:K,deleteArchivedSessions:Fe,archivedSessionMetadata:Xe,openConversation:p,focusSessionWorkspace:E,viewState:l,favoriteSessions:nt,setSessionFavorite:Jt,favoriteSync:ct,organizeBatch:xt,diagnoseOrphanSubagents:P,cleanOrphanSubagents:Le,diagnoseSessionCaches:q,rebuildSessionCaches:u,refreshCacheLists:Ee,searchSessionContent:vt,searchArchivedContent:pe,previewArchivedSession:at,t:n.locale.bind(Ke)}),"buildArchivedSectionProps"),yt=e(async(m,v)=>{let T=Cn(`/api/michengai/dsh-archive-manager${m}`),G=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},v?.headers),ke=await fetch(T,Object.assign({},v,{headers:G})),ce=await ke.json();if(!ke.ok||!ce||ce.ok===!1)throw new Error((ce&&typeof ce=="object"&&typeof ce.error=="string"?ce.error:void 0)||`HTTP ${ke.status}`);return ce},"callSettingsApi");ut=pr(n,{callApi:yt,renderPanel:e(m=>(0,a.jsx)(Un,Object.assign({},bt(),m)),"renderPanel"),injectProps:bt,ns:Ke,onOnlineUpdateChange:e(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange"),onSidebarFavoriteStarChange:e(m=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-favorite-star-toggle",{detail:{enabled:m}}))},"onSidebarFavoriteStarChange")}),n.effect(()=>()=>ut?.destroy(),"archive-manager: sidebar entry"),n.effect(()=>za({endpoint:"/api/michengai/dsh-archive-manager/update",packageName:"@michengai/dsh-archive-manager",titleRowSelector:".dsham_settingsTitleRow",linksSelector:".dsham_settingsLinks",zhName:"\u5F52\u6863\u4F1A\u8BDD",enName:"Archived sessions",ruName:"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439",createIcon:re,isEnabled:e(()=>ut.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>{try{return n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(Ke)("archived.badge"),"label"),icon:"archive",locale:Ke,inject:bt},Un)}catch(m){return console.warn("archive-manager: register settings.section failed:",m),()=>{}}})}e(ys,"applyWorkspaceBrowser");async function ws(n,s,l,h){try{await s(n)}catch(y){l(Za(y,h))}}return e(ws,"forkWithFeedback"),i.__test={forkWithFeedback:ws,favoritesOnlyVisibility:vr,favoriteGroupPredicate:br,createFavoriteRowStore:wr,unarchivedSessionIds:Fr,ArchiveSelectionToolbar:Dr,ArchivedSessionsSection:Un,zh:Ur,en:Wr,displayTitle:tt,isUnknownSessionError:An,deriveArchivedGroups:Br,sortArchivedGroups:Hr,deriveArchivedBatchIds:dn,archivedSessionIdsInGroups:Pr,pruneArchivedSelection:Or,toggleArchivedSelection:Yn,archivedDeleteFeedback:Lr,isWorkspaceTaskCandidate:qn,isWorkspaceDeleteMenuItem:$n,workspaceMenuTriggerFrom:Tr,findRowMenuButton:Vn,isRowMenuButton:Ir,setupSidebarRowContextMenu:Ar,applySettingsNavIcon:Rr,restoreSettingsNavIcon:jr,installSettingsNavIcon:Nr,mutationTouches:jn,resolveRowHasStatus:Vt,activeSessionActivity:Rn,activeSessionRefusal:Cr,activeArchiveFromMessage:Er,archiveSessionsViaOfficial:Jn,unarchiveSessionsViaOfficial:Vr,createUnarchiveSession:qr,bindObservable:Zn,ARCHIVE_MANAGER_REMOTE:ft,currentSessionId:Bn,setupSidebarEntry:pr,setupWorkspaceFavoritesOnly:yr},i.apply=bs,i.inject=vs,r.exports}e(hi,"startArchiveClient");
24
24
 
25
25
  return module.exports.startArchiveClient(require);
26
26
  }