@michengai/dsh-archive-manager 1.1.21 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -7,20 +7,21 @@ 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 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=`
10
+ "use strict";var Bn=Object.defineProperty;var Ps=Object.getOwnPropertyDescriptor;var Os=Object.getOwnPropertyNames;var Fs=Object.prototype.hasOwnProperty;var e=(t,r)=>Bn(t,"name",{value:r,configurable:!0});var Bs=(t,r)=>{for(var i in r)Bn(t,i,{get:r[i],enumerable:!0})},Hs=(t,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Os(r))!Fs.call(t,o)&&o!==i&&Bn(t,o,{get:()=>r[o],enumerable:!(a=Ps(r,o))||a.enumerable});return t};var Us=t=>Hs(Bn({},"__esModule",{value:!0}),t);var mi={};Bs(mi,{startArchiveClient:()=>pi});module.exports=Us(mi);function oe(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return t}e(oe,"record");function Ue(t){return String(t&&typeof t=="object"&&"message"in t?t.message??t:t)}e(Ue,"errorMessage");function Hn(t){return t&&typeof t=="object"&&"code"in t?t.code:void 0}e(Hn,"errorCode");var aa=Function("return globalThis.__dshArchiveReact")(),{Children:bi,Component:yi,Fragment:sa,Profiler:wi,PureComponent:Si,StrictMode:xi,Suspense:ki,cloneElement:Ci,createContext:Ei,createElement:ia,createRef:Ti,forwardRef:Ii,isValidElement:_i,lazy:Ai,memo:Ri,startTransition:ji,useCallback:Ni,useContext:Di,useDebugValue:Mi,useDeferredValue:zi,useEffect:oa,useId:Li,useImperativeHandle:Pi,useInsertionEffect:Oi,useLayoutEffect:Fi,useMemo:Bi,useReducer:Hi,useRef:Ui,useState:Ut,useSyncExternalStore:Wi,useTransition:qi,version:Vi}=aa,W=aa;function ca(t){return W.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(ca,"NumberField");function qs(t=W.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(qs,"CalendarIcon");function In(t,r,i){let a=String(r+1).padStart(2,"0"),o=String(i).padStart(2,"0");return`${t}-${a}-${o}`}e(In,"formatYmd");function hn(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(hn,"parseYmd");function Vs(t,r){let i=new Date(t,r,1).getDay(),a=(i===0?7:i)-1,o=new Date(t,r+1,0).getDate(),f=new Date(t,r,0).getDate(),c=[];for(let k=0;k<42;k++){let y=t,I=r,w=0,g=!1;k<a?(w=f-a+k+1,I=r-1,I<0&&(I=11,y--),g=!0):k<a+o?w=k-a+1:(w=k-a-o+1,I=r+1,I>11&&(I=0,y++),g=!0),c.push({year:y,monthIndex:I,day:w,dateStr:In(y,I,w),isOutside:g})}return c}e(Vs,"buildMonthGrid");function $s(t,r=new Date){if(t==="all")return{from:"",to:""};let i=In(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:In(o.getFullYear(),o.getMonth(),o.getDate()),to:i}}e($s,"getPresetRange");function la(t,r,i,a){let o=r+a,f=new Date(t,o+1,0).getDate();return new Date(t,o,Math.min(i,f))}e(la,"shiftMonthClamped");function da(t){let r=t.React||W;function i(T,ne){let Ze=T==="from"?ne:t.from,Yt=T==="to"?ne:t.to;if(Ze===""&&Yt===""){t.onClear();return}T==="from"?t.onFrom(ne):t.onTo(ne)}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 c=(r.useRef??(T=>{let[ne]=r.useState({current:T});return ne}))(null),[k,y]=r.useState(!1),I=hn(t.from||t.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[w,g]=r.useState(I.year),[S,D]=r.useState(I.monthIndex),[j,U]=r.useState(null),[L,H]=r.useState(null),[he,se]=r.useState(null);r.useEffect(()=>{if(!k)return;let T=e(Ze=>{c.current&&!c.current.contains(Ze.target)&&(y(!1),U(null))},"onPointerDown"),ne=e(Ze=>{Ze.key==="Escape"&&(Ze.preventDefault(),Ze.stopPropagation(),y(!1),U(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",T,!0),typeof window<"u"&&window.addEventListener("keydown",ne,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",T,!0),typeof window<"u"&&window.removeEventListener("keydown",ne,!0)}},[k]),r.useEffect(()=>{if(!k||!he||!c.current)return;c.current.querySelector(`[data-date="${he}"]`)?.focus()},[k,he]);let V=t.t?t.t("discovery.today")==="Today"||(t.t("locale.language")||"").startsWith("en"):!1,ce=t.t?t.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(t.t("locale.language")||"").startsWith("ru"):!1,de=V?"en-US":ce?"ru-RU":"zh-CN",Xe=V?["Mo","Tu","We","Th","Fr","Sa","Su"]:ce?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function te(T){T.stopPropagation(),S<=0?(D(11),g(ne=>ne-1)):D(ne=>ne-1)}e(te,"prevMonth");function J(T){T.stopPropagation(),S>=11?(D(0),g(ne=>ne+1)):D(ne=>ne+1)}e(J,"nextMonth");function dt(T){j?(T>=j?(t.onFrom(j),t.onTo(T)):(t.onFrom(T),t.onTo(j)),U(null),y(!1)):(U(T),H(T))}e(dt,"handleDayClick");function vt(T){let ne=$s(T);T==="all"?t.onClear():(t.onFrom(ne.from),t.onTo(ne.to)),U(null),y(!1)}e(vt,"applyPreset");function Ye(T){let ne=In(T.getFullYear(),T.getMonth(),T.getDate());se(ne),j&&H(ne),(T.getFullYear()!==w||T.getMonth()!==S)&&(g(T.getFullYear()),D(T.getMonth()))}e(Ye,"moveFocusToDate");function ke(T,ne){let Ze=hn(T);Ze&&Ye(new Date(Ze.year,Ze.monthIndex,Ze.day+ne))}e(ke,"moveFocus");let ut=t.from,at=t.to;j&&L&&(ut=j<=L?j:L,at=j<=L?L:j);let rn=Vs(w,S),zt=new Date,an=he||ut||In(zt.getFullYear(),zt.getMonth(),zt.getDate()),O=rn.map((T,ne)=>{let Ze=ut===T.dateStr,Yt=at===T.dateStr,mn=!!(ut&&at&&T.dateStr>ut&&T.dateStr<at),jn=T.year===zt.getFullYear()&&T.monthIndex===zt.getMonth()&&T.day===zt.getDate(),ht="dsham_dateDay";T.isOutside&&(ht+=" is-outside"),jn&&(ht+=" is-today"),Ze&&(ht+=" is-start"),Yt&&(ht+=" is-end"),mn&&(ht+=" is-in-range");let sn=!T.isOutside&&(T.dateStr===an||T.day===1&&!rn.some(re=>!re.isOutside&&re.dateStr===an));return r.createElement("div",{key:ne,className:ht,role:"button",tabIndex:sn?0:-1,"data-date":T.dateStr,"aria-label":T.dateStr,"aria-pressed":!!(Ze||Yt||mn),onClick:e(re=>{re.stopPropagation(),dt(T.dateStr)},"onClick"),onKeyDown:e(re=>{if(re.key==="Enter"||re.key===" ")re.preventDefault(),re.stopPropagation(),dt(T.dateStr);else if(re.key==="ArrowLeft")re.preventDefault(),re.stopPropagation(),ke(T.dateStr,-1);else if(re.key==="ArrowRight")re.preventDefault(),re.stopPropagation(),ke(T.dateStr,1);else if(re.key==="ArrowUp")re.preventDefault(),re.stopPropagation(),ke(T.dateStr,-7);else if(re.key==="ArrowDown")re.preventDefault(),re.stopPropagation(),ke(T.dateStr,7);else if(re.key==="Home"){re.preventDefault(),re.stopPropagation();let Ae=hn(T.dateStr);if(Ae){let bt=new Date(Ae.year,Ae.monthIndex,Ae.day),Nn=(bt.getDay()===0?7:bt.getDay())-1;bt.setDate(bt.getDate()-Nn),Ye(bt)}}else if(re.key==="End"){re.preventDefault(),re.stopPropagation();let Ae=hn(T.dateStr);if(Ae){let bt=new Date(Ae.year,Ae.monthIndex,Ae.day),Nn=(bt.getDay()===0?7:bt.getDay())-1;bt.setDate(bt.getDate()+(6-Nn)),Ye(bt)}}else if(re.key==="PageUp"){re.preventDefault(),re.stopPropagation();let Ae=hn(T.dateStr);Ae&&Ye(la(Ae.year,Ae.monthIndex,Ae.day,-1))}else if(re.key==="PageDown"){re.preventDefault(),re.stopPropagation();let Ae=hn(T.dateStr);Ae&&Ye(la(Ae.year,Ae.monthIndex,Ae.day,1))}},"onKeyDown"),onMouseEnter:e(()=>{j&&H(T.dateStr)},"onMouseEnter")},T.day)}),Ne=`${w}\u5E74 ${S+1}\u6708`;try{Ne=new Intl.DateTimeFormat(de,{year:"numeric",month:"long"}).format(new Date(w,S,1))}catch{Ne=V||ce?`${w}-${String(S+1).padStart(2,"0")}`:`${w}\u5E74 ${S+1}\u6708`}return r.createElement("div",{ref:c,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(T=>i("from",T.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(T=>i("to",T.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&&U(null),y(!k)},"onClick"),onKeyDown:e(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),k&&U(null),y(!k))},"onKeyDown")},qs(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(T=>{T.stopPropagation(),t.onClear(),U(null)},"onClick"),children:"\xD7"}):null,r.createElement("span",{className:"dsham_dateChevron"},ua(r.createElement,k))),k&&r.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":t.label,onClick:e(T=>T.stopPropagation(),"onClick")},r.createElement("div",{className:"dsham_datePresets"},r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("all"),"onClick")},t.t?t.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("today"),"onClick")},t.t?t.t("discovery.today"):"\u4ECA\u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("7d"),"onClick")},t.t?t.t("discovery.last7Days"):"\u8FD1 7 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("30d"),"onClick")},t.t?t.t("discovery.last30Days"):"\u8FD1 30 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("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:te,"aria-label":"prev month"},"\u2039"),r.createElement("span",{className:"dsham_dateMonthTitle"},Ne),r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:J,"aria-label":"next month"},"\u203A")),r.createElement("div",{className:"dsham_dateGrid"},Xe.map((T,ne)=>r.createElement("div",{key:ne,className:"dsham_dateWeekday"},T))),r.createElement("div",{className:"dsham_dateGrid"},O))))}e(da,"DateRange");function Un(t){return W.createElement("div",{className:t.className},W.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":t.open,onClick:t.onToggle},ua(W.createElement,t.open),t.title),t.open?W.createElement("div",null,t.children):null)}e(Un,"Disclosure");function ua(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(ua,"foldChevron");function ir(t){let r=W.useRef(null);return W.useEffect(()=>{r.current&&(r.current.indeterminate=!!t.indeterminate&&!t.checked)},[t.indeterminate,t.checked]),W.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(ir,"SelectionCheckbox");var _n=e(t=>{if(typeof t!="string"||!t.length||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return t},"id"),pa=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"),ha={parse(t){let r=oe(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(_n))],query:pa(r.query,!0)}}},Gs={parse(t){let r=oe(t);if(!r)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:_n(r.sessionId),query:pa(r.query??"")}}},or=e((t,r)=>{if(typeof t!="string"||t.length>r)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return t},"boundedString"),ma=e(t=>{if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return t},"sequence"),lr={parse(t){let r=oe(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(oe).map(i=>({sessionId:_n(i.sessionId),seq:ma(i.seq),snippet:or(i.snippet,400)})),failures:r.failures.map(oe).map(i=>({sessionId:_n(i.sessionId),message:or(i.message,500)}))}}},Ks={parse(t){let r=oe(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:_n(r.sessionId),hasEarlier:r.hasEarlier,hasLater:r.hasLater,messages:r.messages.map(oe).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:ma(i.seq),role:i.role,text:or(i.text,2e3),truncated:i.truncated}})}}};async function cr(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(cr,"copySessionText");function fa(){let t=e((i,a)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${i}`,create:e(()=>a,"create"),schema:a}),"codec");return[["searchSessionContent",ha,lr],["searchArchivedContent",ha,lr],["previewArchivedSession",Gs,Ks]].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(fa,"discoveryInvocations");function ga(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,f=0,c;for(let k of t){let y=f+k.toLowerCase().length;if(c===void 0&&y>a&&(c=o),o+=k.length,y>=a+i.length)return{start:c??o,end:o};f=y}return null}e(ga,"findTextRange");function Wn(t,r=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return NaN;let[i,a,o]=t.split("-").map(Number),f=new Date(i,a-1,o);return f.getFullYear()!==i||f.getMonth()!==a-1||f.getDate()!==o?NaN:(r&&f.setDate(f.getDate()+1),f.getTime())}e(Wn,"dayBoundary");function dr(t,r){return(!t||Number.isFinite(Wn(t)))&&(!r||Number.isFinite(Wn(r)))&&(!t||!r||t<=r)}e(dr,"validUpdatedRange");function va(t,r,i){if(!dr(r,i))return!1;if(!r&&!i)return!0;let a=typeof t=="number"?t:Date.parse(t??"");return Number.isFinite(a)&&(!r||a>=Wn(r))&&(!i||a<Wn(i,!0))}e(va,"matchesUpdatedRange");async function ba(t,r,i,{signal:a,onProgress:o}={}){let f=[],c=[],k=[...new Set(t)],y=e(()=>{if(a?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let I=0;I<k.length;I+=20){y();let w=lr.parse(await i({sessionIds:k.slice(I,I+20),query:r}));y(),f.push(...w.items),c.push(...w.failures),o?.({done:Math.min(I+20,k.length),total:k.length,items:[...f],failures:[...c]})}return y(),{items:f,failures:c}}e(ba,"searchArchiveBatches");function ya(t,r={}){let i=t.createElement;function a({text:g,query:S=""}){let D=ga(g,S);return D?i(t.Fragment,null,g.slice(0,D.start),i("mark",null,g.slice(D.start,D.end)),g.slice(D.end)):g}e(a,"HighlightedText");function o(g,S,D,j){let U=JSON.stringify(g),L=JSON.stringify([U,S]),[H,he]=t.useState(0),[se,V]=t.useState({key:"",status:"idle",items:[],failures:[]});return t.useEffect(()=>{if(!D||!S.trim()||!j)return;let de=new AbortController;V({key:L,status:"loading",items:[],failures:[],done:0,total:g.length});let Xe=setTimeout(()=>{ba(JSON.parse(U),S,j,{signal:de.signal,onProgress:e(te=>{de.signal.aborted||V({key:L,status:"loading",...te})},"onProgress")}).then(te=>{de.signal.aborted||V({key:L,status:"ready",done:g.length,total:g.length,...te})}).catch(te=>{de.signal.aborted||V(J=>({...J,key:L,status:"error",error:Ue(te)}))})},350);return()=>{de.abort(),clearTimeout(Xe)}},[U,S,D,j,H]),{...D&&S.trim()&&j?se.key===L?se:{key:L,status:"loading",items:[],failures:[],done:0,total:g.length}:{status:"idle",items:[],failures:[]},retry:e(()=>he(de=>de+1),"retry")}}e(o,"useArchiveSearch");function f(g,S){let[D,j]=t.useState(null),[U,L]=t.useState({status:"idle"}),[H,he]=t.useState(0),se=D,V=D&&S.includes(D.session.id);return t.useEffect(()=>{D&&!V&&j(null)},[D,V]),t.useEffect(()=>{if(!V||typeof window>"u")return;let ce=e(de=>{de.key==="Escape"&&(de.preventDefault(),de.stopPropagation(),de.stopImmediatePropagation(),j(null))},"onKeyDown");return window.addEventListener("keydown",ce,!0),()=>window.removeEventListener("keydown",ce,!0)},[V]),t.useEffect(()=>{if(!D||!V||!g)return;let ce=!0;return L({key:se,status:"loading"}),Promise.resolve().then(()=>g({sessionId:D.session.id,query:D.query})).then(de=>{ce&&L({key:se,status:"ready",value:de})}).catch(de=>{ce&&L({key:se,status:"error",error:Ue(de)})}),()=>{ce=!1}},[se,V,g,H]),{target:V?D:null,...U.key===se?U:{status:"loading"},open:e((ce,de="")=>j({session:ce,query:de}),"open"),close:e(()=>j(null),"close"),retry:e(()=>he(ce=>ce+1),"retry")}}e(f,"useArchivePreview");function c({title:g,failures:S,separator:D}){let[j,U]=t.useState(!1),L=i("ul",null,S.map(H=>i("li",{key:H.sessionId},H.sessionId,D,H.message)));return i(Un,{title:g,open:j,onToggle:e(()=>U(H=>!H),"onToggle")},L)}e(c,"FailureDetails");function k(g,S){let D=r.Button??(j=>i("button",{type:"button",disabled:j.disabled,onClick:j.onClick},j.children));return i(D,{variant:"outline",size:"sm",...S},g)}e(k,"textButton");function y({t:g,from:S,to:D,onFrom:j,onTo:U,invalid:L,onClear:H}){return i("div",{className:"dsham_dateFilter"},i(da,{React:t,from:S,to:D,invalid:L,label:g("discovery.date"),fromLabel:g("discovery.from"),toLabel:g("discovery.to"),onFrom:j,onTo:U,onClear:H,t:g}),L?i("p",{className:"dsham_dateAlert",role:"alert"},g("discovery.invalidDate")):null)}e(y,"DiscoveryFilters");function I({state:g,t:S}){return g.status==="idle"?null:i("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},i("p",null,S(g.status==="loading"?"discovery.searching":g.status==="error"?"discovery.searchError":"discovery.searched",{done:g.done??0,total:g.total??0})),g.status==="error"&&i("p",null,g.error),g.failures.length>0&&i(c,{title:S("discovery.failed",{n:g.failures.length}),failures:g.failures,separator:S("common.separator")}),(g.status==="error"||g.status==="ready"&&g.failures.length>0)&&k(S("discovery.retry"),{onClick:g.retry}))}e(I,"SearchStatus");function w({preview:g,t:S,MarkdownText:D}){let[j,U]=t.useState(!1);if(g.status==="loading")return i("p",{role:"status"},S("discovery.loading"));if(g.status==="error")return i("div",null,i("p",{role:"alert"},g.error),k(S("discovery.retry"),{onClick:g.retry}));let L=g.value;return L?i("div",{className:"dsham_previewMessages"},i("div",{className:"dsham_previewToolbar"},i("span",{title:S("discovery.previewHint")},S("discovery.readOnly")," \xB7 ",S("discovery.messageCount",{n:L.messages.length})),D&&i(r.SegmentedControl??"div",{id:"dsham-preview-mode",label:S("discovery.displayMode"),value:j?"raw":"formatted",options:[{value:"formatted",label:S("discovery.formatted")},{value:"raw",label:S("discovery.raw")}],onChange:e(H=>U(H==="raw"),"onChange")})),L.hasEarlier&&i("p",null,S("discovery.earlier")),!L.messages.length&&i("p",null,S("discovery.empty")),L.messages.map(H=>i("article",{key:H.seq,className:"dsham_previewMessage"},i("div",{className:"dsham_previewRole","data-role":H.role},i("span",{"aria-hidden":!0},S(H.role==="user"?"discovery.you":"discovery.ai")),i("strong",null,S("discovery."+H.role))),j||!D?i("pre",{className:"dsham_previewRaw"},i(a,{text:H.text,query:g.target?.query})):i(D,{text:H.text,streaming:!1,labels:{code:{copyLabel:S("discovery.copyCode"),copiedLabel:S("details.copied")},footnotes:S("discovery.footnotes")}}),H.truncated&&i("small",null,S("discovery.truncated")))),L.hasLater&&i("p",null,S("discovery.later"))):null}return e(w,"PreviewContent"),{HighlightedText:a,useArchiveSearch:o,useArchivePreview:f,DiscoveryFilters:y,SearchStatus:I,PreviewContent:w}}e(ya,"createDiscoveryTools");var wa=[".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(""),Sa={"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"},xa={"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"},ka={"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 Ca=e(t=>{let r=oe(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"),Ys={parse(t){let r=oe(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(Ca)}}},ur={parse(t){let r=oe(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(Ca)}}},hr={parse(t){let r=oe(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 Ea(){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",ur)},{method:"rebuildSessionCaches",parameters:[{name:"input",wire:"input",source:"json",codec:t("CacheRebuildInput",Ys)}],result:t("CacheRebuildResult",hr)}].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(Ea,"cacheRebuildInvocations");function Ta(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},f=!0,c=0,k=[],y,I=new Set,w=e(S=>{if(f){o={...o,...S};for(let D of I)D()}},"update"),g=e(async(S=i)=>{if(!f)return;y!==void 0&&(clearTimeout(y),y=void 0);let D=++c;try{let j=ur.parse(await t.diagnose());f&&D===c&&w({diagnosis:j,error:null})}catch(j){if(S>0&&f&&D===c){y=setTimeout(()=>{y=void 0,f&&D===c&&g(S-1)},a);return}f&&D===c&&w({error:Ue(j)})}},"load");return{snapshot:e(()=>o,"snapshot"),subscribe(S){return I.add(S),()=>{I.delete(S)}},load:g,async run(S=!1){if(!f||o.busy)return;++c,y!==void 0&&(clearTimeout(y),y=void 0);let D=S?[...k]:[...o.diagnosis.items],j={rebuiltSessionIds:[],skippedSessionIds:[],failures:[]};k=[],w({busy:!0,result:null,error:null,refreshError:null,progress:{done:0,total:D.length}});for(let[U,L]of D.entries()){if(!f)return;try{let H=hr.parse(await t.rebuild({items:[L]}));if(!f)return;j.rebuiltSessionIds.push(...H.rebuiltSessionIds),j.skippedSessionIds.push(...H.skippedSessionIds),j.failures.push(...H.failures),H.failures.length&&k.push(L)}catch(H){if(!f)return;j.failures.push({sessionId:L.sessionId,message:Ue(H)}),k.push(L)}w({progress:{done:U+1,total:D.length}})}w({result:j});try{await t.refresh()}catch(U){w({refreshError:Ue(U)})}f&&(await g(),w({busy:!1,progress:null}))},dismiss(){f&&w({result:null,error:null,refreshError:null})},dispose(){f=!1,++c,y!==void 0&&(clearTimeout(y),y=void 0),I.clear()}}}e(Ta,"createCacheRebuildController");var Kt=class extends Error{static{e(this,"ArchiveNavigationError")}code;constructor(r){super(r),this.name="ArchiveNavigationError",this.code=r}};function Ia(t,r){return t instanceof Kt?r(`archives.${t.code}`):Ue(t)}e(Ia,"formatArchiveNavigationError");function Zs(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(Zs,"retainInfoSnapshot");function Js(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(Js,"mainViewSessionId");function qn(t){return Js(t)}e(qn,"currentSessionId");function Xs(t,r,i){return r===void 0||r===""?!1:(t?.byId?.[r]?.retainedBy?.mainView??0)>0||(Zs(i,r)?.retainedBy?.mainView??0)>0}e(Xs,"sessionIsCurrent");async function _a(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(_a,"openArchivedConversation");function Aa(t,r,i,{onOpened:a=e(()=>{},"onOpened"),beginNavigation:o,warn:f=e((...c)=>console.warn(...c),"warn")}={}){let c,k=t?.clearArchivedCurrent,y=t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent"),I=e(S=>Xs(r.list.getSnapshot(),S,r),"viewing"),w=e(function(...S){return c!==void 0&&I(c)&&i.list.getSnapshot().archivedSessionIds.includes(c)?!1:(c=void 0,k?.apply(this,S))},"wrapped"),g=e(()=>t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value===w,"ownsWrapper");if(t&&typeof k=="function")try{if(t.clearArchivedCurrent=w,!g())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(S){f("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",S)}return{open(S){c=S;try{if(typeof k=="function"&&!g()&&i.list.getSnapshot().archivedSessionIds.includes(S))throw f("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new Kt("navigationUnavailable");if(o?.(),typeof t?.openSession!="function")throw f("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new Kt("navigationUnavailable");if(t.openSession(S),!I(S))throw f("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof k=="function"}),new Kt("sessionNotRetained");a()}catch(D){throw c=void 0,D}},dispose(){c=void 0,!(!t||Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value!==w)&&(y?Object.defineProperty(t,"clearArchivedCurrent",y):delete t.clearArchivedCurrent,k?.call(t))}}}e(Aa,"allowArchivedNavigation");var tn=require("@deepseek-ai/dsh-client-ui-primitives");var Ra={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"},ja={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 An(t){return t.toLowerCase().startsWith("zh")?Ra:ja}e(An,"pluginUpdateCopy");function Qs(t,r,i,a){let o=An(t),f=r?.restartDesktop===!0||r?.profileName==="desktop",c=f?{...o,manualHint:o.manualHintDesktop}:o,k=i!=="idle",y=c.checking,I="";return i==="checking"?y=c.checking:i==="updating"?y=c.updating:a.type==="error"?(y=a.message||c.failed,I="error"):a.type==="restart"?(y=f?c.restartDesktop:c.restart,I="success"):a.type==="restarting"?(y=c.restarting,I="success"):r===void 0?y=c.checking:r.latestCheckFailed?(y=c.failed,I="error"):!r.canAutoUpdate&&r.updateAvailable?(y=c.unavailable,I="update"):r.updateAvailable?(y=`${c.found}: v${r.latestVersion??c.unknown}`,I="update"):(y=c.latest,I="success"),{copy:c,busy:k,message:y,kind:I,loading:i==="updating",updateLabel:i==="updating"?c.updating:c.auto,disabled:k||r?.canAutoUpdate!==!0||r.updateAvailable!==!0,currentVersion:r===void 0?c.unknown:`v${r.currentVersion}`,latestVersion:r?.latestVersion===void 0?c.unknown:`v${r.latestVersion}`,profileName:r?.profileName??c.unknown,profileRaw:r?.profileName??"",latestRaw:r?.latestVersion??"latest"}}e(Qs,"describePluginUpdate");function Na(t,r,i){let a="idle",o=r,f={type:"status"},c=0,k=new Set,y=e(()=>{for(let w of k)w()},"emit"),I=e(w=>{o=w,i?.(w)},"assign");return{get posts(){return c},subscribe(w){return k.add(w),()=>{k.delete(w)}},view(w){return Qs(w,o,a,f)},async check(){if(a==="idle"){a="checking",f={type:"status"},y();try{I(await t("GET")),f={type:"status"}}catch(w){f={type:"error",message:w instanceof Error?w.message:""}}finally{a="idle",y()}}},async update(){if(a==="idle"){a="updating",f={type:"status"},c+=1,y();try{let w=await t("POST");I(w),f={type:w.autoReload===!0?"restarting":"restart"}}catch(w){f={type:"error",message:w instanceof Error?w.message:""}}finally{a="idle",y()}}}}}e(Na,"createUpdateFlow");function Da(t,r,i){return`dsh plugin${t.trim()===""?"":` --profile ${t.trim()}`} add ${r}@${i} --registry=https://registry.npmjs.org/`}e(Da,"manualPluginUpdateCommand");function Ma(t,r){return t.key!=="Escape"?!1:(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r(),!0)}e(Ma,"handlePluginUpdateEscape");function ei(){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(ei,"pageBaseHref");function Rn(t){if(typeof t!="string"||t.charAt(0)!=="/"||t.charAt(1)==="/")return t;let r=ei();if(r===void 0)return t;try{return new URL(t.slice(1),r).href}catch{return t}}e(Rn,"resolveApiUrl");function za(t){let i=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(i===void 0)throw new Error("createRoot unavailable");return i(t)}e(za,"mountRoot");var ti="x-michengai-plugin-update",La="michengai-plugin-update-ui",pr=`
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 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=`
14
+ `;function ni(){let t=document.getElementById(La);if(t!==null){t.textContent!==pr&&(t.textContent=pr);return}let r=document.createElement("style");r.id=La,r.textContent=pr,(document.head??document.documentElement).append(r)}e(ni,"ensureStyle");function ri(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(ri,"validPayload");async function Pa(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",[ti]:"1"},body:"{}",...a}),f=await o.json();if(!o.ok||!ri(f))throw new Error(f&&typeof f=="object"&&"error"in f&&typeof f.error=="string"?f.error:An(document.documentElement.lang).failed);return f}e(Pa,"requestStatus");function ai(t){let r=W.useRef(null);return W.useLayoutEffect(()=>{r.current?.replaceChildren(t.node)},[t.node]),W.createElement("span",{ref:r,className:"mpi-icon","aria-hidden":!0})}e(ai,"HostIcon");function si(t){let r=W.useRef(null),[,i]=W.useState(0),[a,o]=W.useState("idle");W.useEffect(()=>t.flow.subscribe(()=>i(w=>w+1)),[t.flow]),W.useEffect(()=>{let w=document.documentElement,g=new MutationObserver(()=>i(S=>S+1));return g.observe(w,{attributes:!0,attributeFilter:["lang"]}),()=>g.disconnect()},[]),W.useEffect(()=>{t.flow.check()},[t.flow]),W.useEffect(()=>{function w(g){Ma(g,t.onClose)}return e(w,"onKey"),document.addEventListener("keydown",w,!0),()=>document.removeEventListener("keydown",w,!0)},[t.onClose]);let f=document.documentElement.lang,c=t.flow.view(f),k=f.toLowerCase().startsWith("zh")?t.zhName:f.toLowerCase().startsWith("ru")?t.ruName:t.enName,y=Da(c.profileRaw,t.packageName,c.latestRaw),I=a==="copied"?c.copy.copied:a==="failed"?c.copy.copyFailed:c.copy.copy;return W.createElement(tn.Modal,{open:!0,className:"mpi-dialog",title:`${k} ${c.copy.update}`,closeLabel:"Close",onClose:t.onClose,footer:[W.createElement(tn.Button,{key:"check",variant:"outline",disabled:c.busy,onClick:e(()=>{t.flow.check()},"onClick")},c.copy.recheck),W.createElement(tn.Button,{key:"update",variant:"primary",disabled:c.disabled,onClick:e(()=>{t.flow.update()},"onClick")},c.updateLabel)]},W.createElement("div",{ref:r},W.createElement("p",{className:"mpi-intro"},c.copy.intro),W.createElement("dl",{className:"mpi-meta"},W.createElement("dt",null,c.copy.current),W.createElement("dd",null,W.createElement("span",{className:"mpi-mono"},c.currentVersion)),W.createElement("dt",null,c.copy.latestLabel),W.createElement("dd",{className:"mpi-latest"},W.createElement("span",{className:"mpi-mono"},c.latestVersion),W.createElement("span",{className:"mpi-status",role:"status","data-kind":c.kind,...c.kind==="update"?{style:{color:"#e8b15a"}}:{}},c.message)),W.createElement("dt",null,c.copy.profile),W.createElement("dd",null,W.createElement("span",{className:"mpi-mono"},c.profileName))),c.busy?W.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},W.createElement("div",{className:"dssm-update-progress-bar"})):null,W.createElement("section",{className:"mpi-manual"},W.createElement("h3",null,c.copy.manual),W.createElement("p",null,c.copy.manualHint),W.createElement("div",{className:"mpi-command"},W.createElement("code",null,y),W.createElement(tn.Button,{variant:"outline",size:"sm",disabled:c.busy,onClick:e(()=>{let w=navigator.clipboard?.writeText(y);if(w===void 0){o("failed");return}w.then(()=>{o("copied"),window.setTimeout(()=>o("idle"),1400)}).catch(()=>o("failed"))},"onClick")},I)))))}e(si,"UpdateDialog");function Oa(t){if(typeof document>"u"||document.body===null)return()=>{};let r=Rn(t.endpoint);ni();let i=new AbortController,a,o,f,c,k,y,I;function w(){f?.unmount(),f=void 0,o=void 0,c=void 0}e(w,"unmountCheck");function g(){if(f===void 0)return;c===void 0&&(c=t.createIcon("refresh"));let se=c;f.render(W.createElement(tn.Button,{variant:"outline",size:"sm",onClick:D,icon:W.createElement(ai,{node:se})},W.createElement("span",{"data-mpi-label":""},An(document.documentElement.lang).check)))}e(g,"renderCheck");function S(){y?.unmount(),y=void 0,k?.remove(),k=void 0}e(S,"closeDialog");function D(){S();let se=document.createElement("div");se.className="mpi-dialog-root",document.body.append(se),k=se,y=za(se),y.render(W.createElement(si,{flow:Na(V=>Pa(r,V,i.signal),a,V=>{a=V,j()}),packageName:t.packageName,zhName:t.zhName,enName:t.enName,ruName:t.ruName,onClose:S}))}e(D,"openDialog");function j(){let se=document.querySelector(t.titleRowSelector);if(se===null)return;let V=se.querySelector("h1,h2"),ce=se.querySelector(t.linksSelector);if(t.isEnabled&&!t.isEnabled()){if(k!==void 0&&S(),ce!==null){let te=ce.querySelector(`[data-mpi-check="${t.packageName}"]`);te!==null&&(w(),te.remove())}if(V!==null){let te=V.querySelector(`.mpi-version[data-package="${t.packageName}"]`);te!==null&&te.remove()}return}if(V!==null&&a!==void 0){let te=V.querySelector(`.mpi-version[data-package="${t.packageName}"]`);te===null&&(te=document.createElement("span"),te.className="mpi-version",te.dataset.package=t.packageName,V.append(te));let J=`v${a.currentVersion}`;te.textContent!==J&&(te.textContent=J)}if(o!==void 0&&!o.isConnected&&w(),ce===null)return;let de=ce.querySelector(`[data-mpi-check="${t.packageName}"]`);if(de!==null){let te=de.querySelector("[data-mpi-label]");(te===null||te.textContent!==An(document.documentElement.lang).check)&&g();return}let Xe=document.createElement("span");Xe.dataset.mpiCheck=t.packageName,Xe.className="mpi-check-host",ce.append(Xe),o=Xe,f=za(Xe),g()}e(j,"applyControls");let U=new MutationObserver(()=>{I===void 0&&(I=window.requestAnimationFrame(()=>{I=void 0,j()}))});U.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]});let L,H=e(async()=>L||(L=(async()=>{try{return a=await Pa(r,"GET",i.signal),j(),a}finally{L=void 0}})(),L),"load"),he=e(()=>{j(),(!t.isEnabled||t.isEnabled())&&H().catch(()=>{})},"onToggle");return typeof window<"u"&&window.addEventListener("dsham-update-toggle",he),j(),H().catch(()=>{}),()=>{i.abort(),U.disconnect(),S(),w(),typeof window<"u"&&window.removeEventListener("dsham-update-toggle",he),I!==void 0&&window.cancelAnimationFrame(I),document.querySelectorAll(`[data-mpi-check="${t.packageName}"],.mpi-version[data-package="${t.packageName}"]`).forEach(se=>se.remove())}}e(Oa,"observePluginUpdate");var nn=require("@deepseek-ai/dsh-client-ui-primitives");var We=ia,ii="@michengai/dsh-archive-manager",mr="archived-sessions",oi=4,Fa="dsham-sidebar-entry-style",li=`
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 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");
21
+ .dsham_bundle_error{font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef4444);margin-top:2px}
22
+ `;function Ba(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(Fa)!==null||typeof document.createElement!="function")return;let t=document.createElement("style");t.id=Fa,t.textContent=li,(document.head??document.documentElement)?.appendChild?.(t)}e(Ba,"ensureSidebarEntryStyle");function ci(t){let r=t&&typeof t.size=="number"?t.size:16;return We(nn.IconArchiveOutlineMedium,{size:r})}e(ci,"ArchiveSidebarIcon");function fr(t){Ba();let{t:r,location:i,onLocationChange:a,errorMessage:o,enabled:f=!1,onToggle:c,disabled:k,onlineUpdateEnabled:y=!0,onToggleOnlineUpdate:I,onlineUpdateDisabled:w,onlineUpdateLocked:g=!1,sidebarFavoriteStarEnabled:S=!0,onToggleSidebarFavoriteStar:D,sidebarFavoriteStarDisabled:j}=t,U=i??(f?"both":"settings"),L=e(he=>{(he==="both"||he==="sidebar"||he==="settings")&&(typeof a=="function"?a(he):typeof c=="function"&&c(he!=="settings"))},"handleLocationChange"),H=[We("div",{key:"entry-location",className:"dsham_bundle_row"},We("div",{className:"dsham_bundle_label_box"},We("span",{className:"dsham_bundle_title"},r("entry.location.title")),We("span",{className:"dsham_bundle_desc"},r("entry.location.desc")),o?We("span",{className:"dsham_bundle_error",role:"alert"},o):null),We(nn.SegmentedControl,{id:"dsham-bundle-entry-location",value:U,onChange:L,label:r("entry.location.title"),disabled:k,options:[{value:"both",label:r("entry.location.both")},{value:"sidebar",label:r("entry.location.sidebar")},{value:"settings",label:r("entry.location.settings")}]}))];if(typeof I=="function"){let he=g?`${r("update.entry.desc")} (${r("update.entry.locked")})`:r("update.entry.desc");H.push(We("div",{key:"online-update",className:"dsham_bundle_row"},We("div",{className:"dsham_bundle_label_box"},We("span",{className:"dsham_bundle_title"},r("update.entry.title")),We("span",{className:"dsham_bundle_desc"},he)),We(nn.Switch,{checked:y,onChange:I,label:r("update.entry.toggle"),disabled:w||g,title:g?r("update.entry.locked"):void 0})))}return typeof D=="function"&&H.push(We("div",{key:"sidebar-favorite-star",className:"dsham_bundle_row"},We("div",{className:"dsham_bundle_label_box"},We("span",{className:"dsham_bundle_title"},r("sidebar.favoriteStar.title")),We("span",{className:"dsham_bundle_desc"},r("sidebar.favoriteStar.desc"))),We(nn.Switch,{checked:S,onChange:D,label:r("sidebar.favoriteStar.toggle"),disabled:j}))),We(sa,null,H)}e(fr,"ArchiveBundleConfigCard");function gr(t){let[r,i]=Ut(t.getLocation),[a,o]=Ut(t.getOnlineUpdateEnabled?t.getOnlineUpdateEnabled:()=>!0),[f,c]=Ut(t.getOnlineUpdateLocked?t.getOnlineUpdateLocked:()=>!1),[k,y]=Ut(t.getSidebarFavoriteStarEnabled?t.getSidebarFavoriteStarEnabled:()=>!0),[I,w]=Ut(null),[g,S]=Ut(!1),[D,j]=Ut(!1),[U,L]=Ut(!1);oa(()=>{let V=e(()=>{i(t.getLocation()),w(null),t.getOnlineUpdateEnabled&&o(t.getOnlineUpdateEnabled()),t.getOnlineUpdateLocked&&c(t.getOnlineUpdateLocked()),t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())},"syncState");return V(),t.subscribe(V)},[t]);let H=e(V=>{S(!0),w(null),i(V),t.setLocation(V).catch(ce=>{console.error("archive-manager: setLocation failed:",ce),i(t.getLocation()),w(t.t("entry.location.saveFailed")||"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B")}).finally(()=>{S(!1)})},"onLocationChange"),he=t.setOnlineUpdate?V=>{t.getOnlineUpdateLocked?.()||(j(!0),o(V),t.setOnlineUpdate(V).catch(()=>{t.getOnlineUpdateEnabled&&o(t.getOnlineUpdateEnabled())}).finally(()=>{j(!1)}))}:void 0,se=t.setSidebarFavoriteStar?V=>{L(!0),y(V),t.setSidebarFavoriteStar(V).catch(()=>{t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())}).finally(()=>{L(!1)})}:void 0;return We(fr,{t:t.t,location:r,errorMessage:I,disabled:g,onLocationChange:H,onlineUpdateEnabled:a,onlineUpdateDisabled:D||f,onlineUpdateLocked:f,onToggleOnlineUpdate:he,sidebarFavoriteStarEnabled:k,sidebarFavoriteStarDisabled:U,onToggleSidebarFavoriteStar:se})}e(gr,"ArchiveBundleConfigCardWrapper");function vr(t,r){if(Ba(),!t.locale)return{getLocation:e(()=>"settings","getLocation"),setLocation:e(async()=>"settings","setLocation"),isSettingsSectionEnabled:e(()=>!0,"isSettingsSectionEnabled"),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,f="settings",c=!1,k=!1,y=null,I=null,w=0,g=!1,S,D=new Set,j=e(()=>f==="both"||f==="sidebar","isSidebarEnabled"),U=e(()=>f==="both"||f==="settings","isSettingsSectionEnabled"),L=e(()=>{if(!g)for(let O of D)try{O()}catch{}},"notify"),H=e(()=>{if(g||!k||!j()||y)return;let O=t.slots.register({name:"main",key:mr,locale:o,inject:e(()=>{let Ne=typeof r.injectProps=="function"?r.injectProps():{};return Object.assign({t:t.locale?.bind?t.locale.bind(o):void 0},Ne)},"inject")},Ne=>We("div",{className:"dsham_mainPanel"},a(Ne)));y=typeof O=="function"?O:()=>{}},"mountMain"),he=e(()=>{if(y){try{y()}catch{}y=null}},"unmountMain"),se=e(()=>{if(g||!c||!j()||I)return;let O=t.slots.register({name:"sidebar.panellist",id:mr,order:oi,label:e(()=>t.locale.bind(o)("archives.title"),"label"),locale:o},Ne=>ci(Ne&&typeof Ne=="object"&&"size"in Ne?Ne:void 0));I=typeof O=="function"?O:()=>{}},"mountRow"),V=e(()=>{if(I){try{I()}catch{}I=null}},"unmountRow"),ce=e(()=>{if(!g)if(j())H(),se();else{if(S?.panelInfo&&typeof S.selectPanel=="function")try{S.panelInfo.getSnapshot().activePanelId===mr&&S.selectPanel(null)}catch{}V(),he()}},"sync"),de=e(async O=>{if(g)return f;let Ne=++w,T=f;if(f=O,ce(),L(),typeof r.onLocationChange=="function")try{r.onLocationChange(O)}catch{}try{return await i("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({location:O})}),O}catch(ne){if(Ne===w&&(f=T,ce(),L(),typeof r.onLocationChange=="function"))try{r.onLocationChange(T)}catch{}throw ne}},"setLocation"),Xe=e(async O=>(await de(O?"both":"settings"),j()),"setEnabled"),te=!0,J=!1,dt=0,vt=e(async O=>{if(g||J)return te;let Ne=++dt;if(te=O,L(),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})}),Ne===dt&&typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(O)}catch{}return O}catch(T){if(Ne===dt&&(te=!O,L(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(!O)}catch{}throw T}},"setOnlineUpdate"),Ye=!0,ke=0,ut=e(async O=>{if(g)return Ye;let Ne=++ke;if(Ye=O,L(),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(T){if(Ne===ke&&(Ye=!O,L(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(!O)}catch{}throw T}},"setSidebarFavoriteStar"),at=w;i("/sidebar-entry").then(O=>{if(!g&&w===at&&O&&(O.location==="both"||O.location==="sidebar"||O.location==="settings"?f=O.location:typeof O.enabled=="boolean"&&(f=O.enabled?"both":"settings"),ce(),L(),typeof r.onLocationChange=="function"))try{r.onLocationChange(f)}catch{}}).catch(()=>{});let rn=dt;i("/online-update").then(O=>{if(!g&&dt===rn&&O&&typeof O.enabled=="boolean"&&(te=O.enabled,O.locked===!0&&(J=!0),L(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(te)}catch{}}).catch(()=>{});let zt=ke;i("/sidebar-favorite-star").then(O=>{if(!g&&ke===zt&&O&&typeof O.enabled=="boolean"&&(Ye=O.enabled,L(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(Ye)}catch{}}).catch(()=>{});let an=t;return typeof an.inject=="function"&&an.inject(["layout"],O=>{!g&&O.layout&&(S=O.layout)}),t.slots.inject("main",()=>{if(!g)return k=!0,H(),()=>{k=!1,he()}}),t.slots.inject("sidebar.panellist",()=>{if(!g)return c=!0,se(),()=>{c=!1,V()}}),t.slots.inject("plugins.bundle.config",()=>{if(!g)return t.slots.register({name:"plugins.bundle.config",key:ii,locale:o},O=>O&&O.view==="summary"?null:We(gr,{t:t.locale.bind(o),getLocation:e(()=>f,"getLocation"),setLocation:de,getEnabled:e(()=>j(),"getEnabled"),setSidebar:Xe,getOnlineUpdateEnabled:e(()=>te,"getOnlineUpdateEnabled"),setOnlineUpdate:vt,getOnlineUpdateLocked:e(()=>J,"getOnlineUpdateLocked"),getSidebarFavoriteStarEnabled:e(()=>Ye,"getSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:ut,subscribe:e(Ne=>(D.add(Ne),()=>{D.delete(Ne)}),"subscribe")}))}),{getLocation:e(()=>f,"getLocation"),setLocation:de,isSettingsSectionEnabled:U,isEnabled:e(()=>j(),"isEnabled"),isSupported:e(()=>c,"isSupported"),setEnabled:Xe,isOnlineUpdateEnabled:e(()=>te,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>J,"isOnlineUpdateLocked"),setOnlineUpdate:vt,isSidebarFavoriteStarEnabled:e(()=>Ye,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:ut,destroy:e(()=>{g||(g=!0,w++,dt++,ke++,S=void 0,D.clear(),V(),he())},"destroy")}}e(vr,"setupSidebarEntry");function br(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(br,"checkedId");var di={parse(t){let r=oe(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:br(r.sessionId),favorite:r.favorite}}},ui={parse(t){let r=oe(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(br))]}},safeParse(t){try{return{success:!0,data:this.parse(t)}}catch(r){return{success:!1,error:r}}}};function Ha(){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",ui),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Ha,"favoriteInvocations");function yr(t,{days:r,now:i=Date.now(),favorites:a=new Set,currentId:o,pending:f=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||f.has(t.id))return!1;let c=typeof t.updatedAt=="number"?t.updatedAt:Date.parse(t.updatedAt??"");return Number.isFinite(c)&&c<=i-r*864e5}e(yr,"idleArchiveCandidate");async function Vn(t,r,{onProgress:i,refresh:a}={}){let o=[...new Set(t.map(br))],f={requested:o,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},c=e(()=>i?.({total:o.length,done:f.succeeded.length+f.skipped.length+f.failures.length,succeeded:f.succeeded.length,skipped:f.skipped.length,failed:f.failures.length}),"report");c();for(let k of o){try{(await r(k)?f.succeeded:f.skipped).push(k)}catch(y){f.failures.push({sessionId:k,message:y instanceof Error?y.message:String(y)}),f.remaining.push(k)}c()}try{await a?.()}catch(k){f.refreshError=k instanceof Error?k.message:String(k)}return f}e(Vn,"runSessionBatch");function Ua({workspaces:t,sessions:r,archive:i,restore:a,deleteOne:o,getFavorites:f,refresh:c,currentSessionId:k}){return async(y,I,w={})=>{if(!["archive","restore","undo","delete"].includes(y))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return Vn(I,async g=>{let D=t.getSnapshot().archivedSessionIds.includes(g);if(y==="archive"){if(D||!r.getSnapshot().byId[g])return!1;if(w.idleDays!==void 0){let he=new Set((await f()).favoriteSessionIds),se=r.getSnapshot();if(!yr(se.byId[g],{days:w.idleDays,favorites:he,currentId:k(se),pending:w.getPending?.()??w.pending}))return!1}return await i(g),t.getSnapshot().archivedSessionIds.includes(g)}return D?y==="delete"?(await o(g),!0):!((await a(g))?.archivedSessionIds??t.getSnapshot().archivedSessionIds).includes(g):!1},{onProgress:w.onProgress,refresh:c})}}e(Ua,"createSessionOrganizer");function hi(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(hi,"formatBytes");function Wa(t,r){let i=t.createElement;function a(f,c){return i(r??(y=>i("button",{type:"button",disabled:y.disabled,onClick:y.onClick},y.children)),{variant:"outline",size:"sm",...c},f)}e(a,"textButton");function o({title:f,failures:c,separator:k}){let[y,I]=t.useState(!1),w=i("ul",null,c.map(g=>i("li",{key:g.sessionId},g.sessionId,k,g.message)));return i(Un,{title:f,open:y,onToggle:e(()=>I(g=>!g),"onToggle")},w)}return e(o,"FailureDetails"),e(function({t:c,archived:k,busy:y,ready:I,days:w,onDays:g,count:S,onPreview:D,progress:j,result:U,onRetry:L,undoCount:H,onUndo:he,onReload:se,orphanCount:V=0,orphanSizeBytes:ce=0,orphanCleaning:de=!1,onCleanOrphans:Xe,cacheCount:te=0,cacheRepair:J,onRebuildCaches:dt,onRetryCaches:vt,onReloadCaches:Ye,onDismissCaches:ke}){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(c("organizer.reloadFavorites"),{disabled:y,onClick:se}),!k&&i(t.Fragment,null,i("label",null,c("organizer.idleDays"),i(ca,{min:1,max:36500,value:w===""?null:Number(w),disabled:y,"aria-label":c("organizer.idleDays"),onChange:e(ut=>g(ut==null?"":String(ut)),"onChange")})),a(c("organizer.preview",{n:S}),{disabled:y||!I||S===0,onClick:D}))),!k&&i("p",null,c("organizer.rules"))),V>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,c("organizer.orphanTitle",{n:V})),Xe&&a(c(de?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:y||de,onClick:Xe})),i("p",null,c("organizer.orphanDesc",{size:hi(ce)}))),te>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,c("organizer.cacheTitle",{n:te})),dt&&a(c(J?.busy?"organizer.cacheRebuilding":"organizer.cacheRebuild"),{disabled:y||J?.busy,onClick:dt})),i("p",null,c("organizer.cacheDesc"))),J&&(J.result||J.progress||J.error||J.refreshError)&&i("section",{className:"dsham_batchFeedback","aria-label":c("organizer.cacheRebuild")},J.progress&&i("div",{role:"status"},i("progress",{value:J.progress.done,max:Math.max(1,J.progress.total)}),c("organizer.progressCount",J.progress)),J.result&&i("div",{role:"status"},i("p",null,c("organizer.result",{succeeded:J.result.rebuiltSessionIds.length,skipped:J.result.skippedSessionIds.length,failed:J.result.failures.length})),J.result.failures.length>0&&i(o,{title:c("organizer.failureDetails"),failures:J.result.failures,separator:c("common.separator")}),J.result.failures.length>0&&vt&&a(c("organizer.cacheRetry",{n:J.result.failures.length}),{disabled:y||J.busy,onClick:vt})),J.error&&i("p",{role:"alert"},c("organizer.cacheError",{detail:J.error})),J.refreshError&&i("p",{role:"alert"},c("organizer.refreshError",{detail:J.refreshError})),i("div",{className:"dsham_organizerControls"},Ye&&a(c("organizer.cacheCheck"),{disabled:y||J.busy,onClick:Ye}),ke&&a(c("organizer.dismiss"),{disabled:y||J.busy,onClick:ke}))),(j||U||H>0)&&i("section",{className:"dsham_batchFeedback","aria-label":c("organizer.feedback")},j&&i("div",{role:"status","aria-live":"polite"},i("progress",{value:j.done,max:Math.max(1,j.total),"aria-label":c("organizer.progress")}),c("organizer.progressCount",{done:j.done,total:j.total})),U&&i("div",{role:"status"},i("strong",null,c(`organizer.${U.kind??"archive"}Result`)),i("p",null,c("organizer.result",{succeeded:U.succeeded.length,skipped:U.skipped.length,failed:U.failures.length})),U.failures.length>0&&i(o,{title:c("organizer.failureDetails"),failures:U.failures,separator:c("common.separator")}),U.refreshError&&i("p",{role:"alert"},c("organizer.refreshError",{detail:U.refreshError})),U.remaining.length>0&&a(c("organizer.retry",{n:U.remaining.length}),{disabled:y,onClick:L})),H>0&&i("div",{className:"dsham_organizerControls"},a(c("organizer.undo",{n:H}),{disabled:y,onClick:he}),i("p",null,c("organizer.undoHint")))))},"OrganizerPanel")}e(Wa,"createOrganizerPanel");var qa={"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"},Va={"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."},$a={"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 pn=Function("return globalThis.__dshArchiveReactDOM")(),Ga=Function("return globalThis.__dshArchiveReactDOMClient")(),Ka=pn.createPortal,Do=pn.flushSync,Mo=Ga?.createRoot,zo=Ga?.hydrateRoot,Lo=pn.findDOMNode,Po=pn.unmountComponentAtNode,Oo=pn.unstable_batchedUpdates,Fo=pn.version;function pi(t){var r={exports:{}},i=r.exports;Object.defineProperty(i,Symbol.toStringTag,{value:"Module"});let a=t("react/jsx-runtime"),o=t("react"),f=t("react-dom"),c=t("@deepseek-ai/dsh-client-ui-primitives");function k({open:n,onClose:s,title:l,description:h,footer:v,children:m,className:C,width:E,portalToBody:N=!1,closeLabel:F,t:A}){let P=o.useRef(null),B=o.useCallback(()=>P.current?.closest(".dsham_settings")??document.body,[]),[u,Ce]=o.useState(null);o.useEffect(()=>{if(!n){Ce(null);return}Ce(N?typeof document<"u"?document.body:null:B())},[n,B,N]),o.useEffect(()=>{if(!n)return;let yt=e(st=>{st.key==="Escape"&&(st.preventDefault(),st.stopPropagation(),"stopImmediatePropagation"in st&&typeof st.stopImmediatePropagation=="function"&&st.stopImmediatePropagation(),s())},"onKey");return window.addEventListener("keydown",yt,!0),()=>window.removeEventListener("keydown",yt,!0)},[n,s]);let ze=F||A("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:Qa("dsham_modalDialog",C),style:{width:E??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":ze,title:ze,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}),m!=null&&(0,a.jsx)("div",{className:"dsham_modalBody",children:m}),v!=null&&(0,a.jsx)("div",{className:"dsham_modalFooter",children:v})]})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{refObject:P,getContainer:B}),n&&u?Ka(pe,u):null]})}e(k,"SettingsModal");function y({refObject:n,getContainer:s}){return(0,a.jsx)("span",{hidden:!0,ref:n,"data-get-container":s})}e(y,"SettingsModalAnchor");function I({variant:n="outline",icon:s,children:l,className:h,disabled:v,title:m,onClick:C,"aria-label":E,"aria-pressed":N,"aria-expanded":F,"aria-haspopup":A}){return(0,a.jsx)(c.Button,{variant:n,size:"sm",className:h,disabled:v,title:m,onClick:C,"aria-label":E,"aria-pressed":N,"aria-expanded":F,"aria-haspopup":A,icon:s,children:l})}e(I,"settingsButton");function w({variant:n="outline",danger:s=!1,disabled:l,onClick:h,children:v}){return(0,a.jsx)(c.Button,{variant:s?"outline":n,className:s?"dsham_btnDanger":void 0,disabled:l,onClick:h,children:v})}e(w,"modalFooterButton");function g(n,s){let l={className:n?"dsham_archiveTabsLocked":void 0,children:s};return n&&(l.inert=""),l}e(g,"tabsShell");let S=Wa(o,c.Button),{HighlightedText:D,useArchiveSearch:j,useArchivePreview:U,DiscoveryFilters:L,SearchStatus:H,PreviewContent:he}=ya(o,{Button:c.Button,SegmentedControl:c.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 V(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 se[n]){let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",h),l.append(v)}return s.append(l),s}e(V,"createPluginUpdateIcon");let ce={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=oe(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}},Xe={parse(n){let s=oe(n);if(typeof s!="object"||s===null||Array.isArray(s)||s.deleted!==!0)throw new TypeError("deleted must be true");return s}},te={parse(n){let s=oe(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")}},J={parse(n){let s=oe(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}},dt={parse(n){let s=oe(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}},vt={parse(n){let s=oe(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}}},Ye={parse(n){let s=oe(n);if(!s||s.ok!==!0)throw new TypeError("session move result must be ok: true");return s}};function ke(n,s){return{mode:"strict",typeSymbol:n,create:e(()=>s,"create"),schema:s}}e(ke,"strictCodec");let ut={package:"@michengai/dsh-archive-manager",descriptors:[...Ha(),...fa(),...Ea(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:ke("@deepseek-ai/dsh-session/types#SessionId",ce)}],result:ke("@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:ke("@deepseek-ai/dsh-session/types#SessionId",ce)}],result:ke("@michengai/dsh-archive-manager/types#Deleted",Xe),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:ke("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",te)}],result:ke("@michengai/dsh-archive-manager/types#DeletedBatch",J),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:ke("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",dt),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:ke("@michengai/dsh-archive-manager/types#OrphanSubagentDiagnosis",{parse(n){let s=oe(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:ke("@michengai/dsh-archive-manager/types#CleanOrphanTarget",{parse(n){if(n==null)return{};let s=oe(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:ke("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let s=oe(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:ke("@michengai/dsh-archive-manager/types#SessionMoveInput",vt)}],result:ke("@michengai/dsh-archive-manager/types#SessionMoveResult",Ye),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]};function at(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(at,"ensurePluginStyle");function rn(n){if(typeof document>"u")return;document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")?.remove()}e(rn,"removePluginStyle"),at("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)}"),at("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}"),at("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}"),at("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}"),at("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 ne="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 Ze(n){return n?'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="'+ne+'"/></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="'+ne+'"/></svg>'}e(Ze,"starSvg");function Yt(n){return!!n?.querySelector("[data-state]")}e(Yt,"resolveRowHasStatus");let mn="[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}";at("dsh-archive-manager/RowFavorite.css",mn);let jn="dsh-archive-manager:workspace-favorites-only",ht="data-dsham-favorites-hidden",sn="data-dsham-favorites-only",re="dsham_rowStar",Ae="dsham_starSlot",bt=["\u4EC5\u663E\u793A\u5DF2\u5F52\u6863","Archived only","\u0422\u043E\u043B\u044C\u043A\u043E \u0430\u0440\u0445\u0438\u0432\u043D\u044B\u0435"];at("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 Ya(){try{return window.localStorage.getItem(jn)==="1"}catch{return!1}}e(Ya,"readWorkspaceFavoritesOnly");function Za(n){try{window.localStorage.setItem(jn,n?"1":"0")}catch{}}e(Za,"writeWorkspaceFavoritesOnly");function wr(n,s){let l=e(m=>s.favorites.has(m)||s.sessions?.[m]?.blank===!0,"visibleSession"),h=new Map,v=null;for(let m of n){if(m.startsWith("workspace:")){v=m,h.set(m,!1);continue}m.startsWith("session:")&&v!==null&&l(m.slice(8))&&h.set(v,!0)}return n.map(m=>m.startsWith("session:")?l(m.slice(8)):m.startsWith("workspace:")?h.get(m)===!0||s.groupHasFavorite?.(m.slice(10))===!0:!m.startsWith("overflow:"))}e(wr,"favoritesOnlyVisibility");function Sr(n,s){let l=new Map,h=new Set;for(let m of s){let C=!1;for(let E of m.sessionIds)h.add(E),n.has(E)&&(C=!0);l.set(m.workspaceId,C)}let v=!1;for(let m of n)if(!h.has(m)){v=!0;break}return m=>m===""||m==="ungrouped"?v:l.get(m)===!0}e(Sr,"favoriteGroupPredicate");function xr(n,s,l,h){let v={dispose:e(()=>{},"dispose"),setFavoriteStarEnabled:e(q=>{},"setFavoriteStarEnabled"),isFavoriteStarEnabled:e(()=>!0,"isFavoriteStarEnabled")};if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return v;let m=Ya(),C=typeof h=="function"?h():!0,E=!1,N=!1,F=e(()=>{C?at("dsh-archive-manager/RowFavorite.css",mn):rn("dsh-archive-manager/RowFavorite.css")},"updateStarStyle");F();let A=e(q=>{let Re=q;typeof Re?.detail?.enabled=="boolean"?C=Re.detail.enabled:typeof h=="function"&&(C=h()),F(),tt()},"onStarToggle");typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("dsham-favorite-star-toggle",A);let P=0,B=200,u=null,Ce=new Set,ze=e(q=>{if(!C){for(let ee of q)Array.from(ee.children).find(Le=>Le.classList.contains(Ae))?.remove(),ee.removeAttribute("data-dsham-favorited"),ee.removeAttribute("data-dsham-has-status");return}let Re=s.getSnapshot();for(let ee of q){let K=ee.getAttribute("data-row-key")??"";if(!K.startsWith("session:"))continue;let Le=K.slice(8),Qe=Array.from(ee.children).find(Je=>Je.tagName==="SPAN"&&Array.from(Je.classList).some(At=>At==="slot"||At.endsWith("_slot")))??null;if(Qe===null){ee.removeAttribute("data-dsham-has-status");continue}let M=Array.from(ee.children).find(Je=>Je.classList.contains(Ae))??null;if(!Re.ready){M?.remove(),ee.removeAttribute("data-dsham-favorited"),ee.removeAttribute("data-dsham-has-status");continue}M!==null&&(M.parentElement!==ee||M.nextElementSibling!==null)&&ee.appendChild(M),M===null&&(M=document.createElement("span"),M.className=Ae,ee.appendChild(M)),M.dataset.sessionId=Le,Yt(Qe)?ee.setAttribute("data-dsham-has-status","true"):ee.removeAttribute("data-dsham-has-status");let we=M.querySelector("."+re);we===null&&(we=document.createElement("button"),we.type="button",we.className=re,we.addEventListener("click",Je=>{Je.preventDefault(),Je.stopPropagation(),s.toggle(M?.dataset.sessionId??"")}),M.appendChild(we));let Ke=Re.ids.has(Le);if(Ke?ee.setAttribute("data-dsham-favorited","true"):ee.removeAttribute("data-dsham-favorited"),M.dataset.favorited===String(Ke))continue;let it=l()(Ke?"organizer.unfavorite":"organizer.favorite");M.dataset.favorited=String(Ke),we.setAttribute("aria-pressed",String(Ke)),we.setAttribute("aria-label",it),we.title=it,we.innerHTML=Ze(Ke)}},"ensureRowStars"),pe=e(q=>{let Re=s.getSnapshot();if(!m||!Re.ready){for(let M of q)M.hasAttribute(ht)&&M.removeAttribute(ht);P=0,u=null,Ce.clear();return}let ee=q.map(M=>M.getAttribute("data-row-key")??""),K=Sr(Re.ids,n.workspaces.list?.getSnapshot?.()?.items??[]),Le=wr(ee,{favorites:Re.ids,sessions:n.sessions.list?.getSnapshot?.()?.byId,groupHasFavorite:K});u!==null&&(q.length<=u.rows&&Ce.add(u.key),u=null);let Qe=!1;if(P<B)for(let M=0;M<q.length;M+=1){let Ie=q[M],we=ee[M];if(!we.startsWith("overflow:")||Ie.getAttribute("aria-expanded")!=="false")continue;let Ke=we.slice(9);if(!(Ce.has(Ke)||!K(Ke))){try{Ie.click(),P+=1,u={key:Ke,rows:q.length},Qe=!0}catch(it){console.warn("archive-manager: favorites-only expand failed",it)}break}}for(let M=0;M<q.length;M+=1){let Ie=q[M];Le[M]?Ie.hasAttribute(ht)&&Ie.removeAttribute(ht):Ie.setAttribute(ht,"true")}Qe&&tt()},"applyVisibility"),yt=e(q=>{let Re=q.parentElement;if(Re===null)return null;let ee=Re.cloneNode(!0),K=ee.querySelector('button[role="menuitem"]');if(K===null)return null;let Le=Array.from(K.querySelectorAll("span")),Qe=Le[0]??null,M=Le[Le.length-1]??null;Qe!==null&&(Qe.innerHTML=Ze(!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(sn,"true"),K.setAttribute("role","menuitemcheckbox"),K.dataset.active=String(m),K.setAttribute("aria-checked",String(m)),K.setAttribute("aria-label",l()("organizer.favoritesOnly")),K.onclick=Ie=>{Ie.preventDefault(),Ie.stopPropagation(),on(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0}))},ee},"buildMenuRow"),st=e(()=>{if(!E){for(let q of Array.from(document.querySelectorAll("button["+sn+"]")))q.dataset.active=String(m),q.setAttribute("aria-checked",String(m));for(let q of Array.from(document.querySelectorAll('[role="menu"]'))){let Re=Array.from(q.querySelectorAll('button[role="menuitem"]')).find(Le=>bt.some(Qe=>(Le.textContent??"").includes(Qe)));if(Re===void 0||q.querySelector("["+sn+"]")!==null)continue;let ee=Re.parentElement;if(ee===null)continue;let K=yt(Re);K!==null&&ee.parentElement?.insertBefore(K,ee.nextSibling)}}},"injectMenuRows"),tt=e(()=>{if(N||E)return;N=!0;let q=e(()=>{if(N=!1,E)return;let Re=Array.from(document.querySelectorAll("[data-row-key]"));st(),ze(Re),pe(Re),s.getSnapshot().ready||ln()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(q):setTimeout(q,16)},"schedulePass"),on=e(()=>{m=!m,Ge=20,P=0,u=null,Ce.clear(),Za(m),tt()},"toggle"),pt=null,Ge=20,ln=e(()=>{pt!==null||E||Ge<=0||(Ge-=1,pt=setTimeout(()=>{pt=null,s.ensure(),tt()},600))},"scheduleRetry"),xt=new MutationObserver(q=>{Pn(q,'[data-row-key], [role="menu"]')&&tt()});xt.observe(document.body,{childList:!0,subtree:!0}),s.ensure().catch(()=>{});let Tt=[s.subscribe(()=>tt()),typeof n.sessions.list?.subscribe=="function"?n.sessions.list.subscribe(()=>tt()):null,typeof n.workspaces.list?.subscribe=="function"?n.workspaces.list.subscribe(()=>tt()):null].filter(q=>typeof q=="function");return tt(),{dispose(){E=!0,typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("dsham-favorite-star-toggle",A),xt.disconnect();for(let q of Tt)q();for(let q of Array.from(document.querySelectorAll("["+ht+"]")))q.removeAttribute(ht);for(let q of Array.from(document.querySelectorAll("["+sn+"]")))q.parentElement?.remove();for(let q of Array.from(document.querySelectorAll("."+Ae)))q.remove();for(let q of Array.from(document.querySelectorAll("[data-dsham-favorited]")))q.removeAttribute("data-dsham-favorited");for(let q of Array.from(document.querySelectorAll("[data-dsham-has-status]")))q.removeAttribute("data-dsham-has-status");pt!==null&&(clearTimeout(pt),pt=null)},setFavoriteStarEnabled(q){C=q,F(),tt()},isFavoriteStarEnabled:e(()=>C,"isFavoriteStarEnabled")}}e(xr,"setupWorkspaceFavoritesOnly");function kr(){let n,s={ready:!1,ids:new Set,pending:new Set},l,h=0,v=new Set,m=e(E=>{s=E;for(let N of v)try{N()}catch(F){console.warn("archive-manager: favorite listener failed",F)}},"publish"),C=e((E,N)=>{let F=new Set(E);for(let u of s.pending)u!==N&&(s.ids.has(u)?F.add(u):F.delete(u));let A=new Set(s.pending);N!==void 0?A.delete(N):s.pending.size===0&&A.clear();let P=s.ids.size===F.size&&[...F].every(u=>s.ids.has(u)),B=s.pending.size===A.size&&[...A].every(u=>s.pending.has(u));P&&B&&s.ready||m({ready:!0,ids:F,pending:A})},"adopt");return{bind(E){n=E},subscribe(E){return v.add(E),()=>{v.delete(E)}},getSnapshot:e(()=>s,"getSnapshot"),adopt:e(E=>C(E),"adopt"),ensure(){return n===void 0||s.ready?Promise.resolve():l!==void 0?l:Date.now()<h?Promise.resolve():(l=n.favoriteSessions().then(E=>{C(E.favoriteSessionIds)}).catch(E=>{console.warn("archive-manager: load favorites failed, will retry",E),h=Date.now()+600}).finally(()=>{l=void 0}),l)},async toggle(E){if(n===void 0||!s.ready||s.pending.has(E))return;let N=s.ids.has(E),F=!N,A=new Set(s.ids);F?A.add(E):A.delete(E);let P=new Set(s.pending);P.add(E),m({ready:!0,ids:A,pending:P});try{let B=await n.setSessionFavorite({sessionId:E,favorite:F});if(!Array.isArray(B?.favoriteSessionIds))throw new TypeError("favorite response is missing favoriteSessionIds");C(B.favoriteSessionIds,E)}catch(B){console.warn("archive-manager: sidebar favorite toggle failed",B);let u=new Set(s.ids);N?u.add(E):u.delete(E);let Ce=new Set(s.pending);Ce.delete(E),m({ready:!0,ids:u,pending:Ce})}}}}e(kr,"createFavoriteRowStore");function Ja(){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(Ja,"GithubMark16");function Xa(){let n=c.IconEditOutlineRegular;return(0,a.jsx)(n,{size:16})}e(Xa,"FeedbackIcon");function Dn({archiveSessions:n,archiveSession:s,sessionStore:l,workspaceStore:h,unarchiveSession:v,deleteSession:m,unarchiveSessions:C,deleteArchivedSessions:E,archivedSessionMetadata:N,openConversation:F,focusSessionWorkspace:A,viewState:P,close:B,t:u,diagnoseOrphanSubagents:Ce,cleanOrphanSubagents:ze,diagnoseSessionCaches:pe,rebuildSessionCaches:yt,refreshCacheLists:st,searchSessionContent:tt,searchArchivedContent:on,previewArchivedSession:pt,favoriteSessions:Ge,setSessionFavorite:ln,favoriteSync:xt,organizeBatch:Tt,useSessionPendingInteraction:q,useSessionStatus:Re}){let ee=(0,o.useSyncExternalStore)(l.subscribe,l.getSnapshot),K=(0,o.useSyncExternalStore)(h.subscribe,h.getSnapshot),[Le,Qe]=(0,o.useState)("archived"),M=Le==="archived",[Ie,we]=(0,o.useState)(null),[Ke,it]=(0,o.useState)(null),[Je,At]=(0,o.useState)(null),Pt=e((d,x=null)=>{G(null),$e(null),z(!1),it(x),we(d)},"requestArchive"),Zt=e(()=>{X||(we(null),it(null),G(null))},"closeArchive"),It=(0,o.useRef)(!1),[_e,Wt]=(0,o.useState)(null),gn=(0,o.useRef)(!1),[X,Ve]=(0,o.useState)(!1),[kt,G]=(0,o.useState)(null),[Fn,$e]=(0,o.useState)(null),cn=e(d=>{G(null),$e(null),Wt(d)},"requestDelete"),[Rt,vn]=(0,o.useState)(P?.query??""),[mt,qt]=(0,o.useState)(P?.project??"all"),[jt,bn]=(0,o.useState)(P?.sortBy??"updated"),[yn,wn]=(0,o.useState)({}),[Vt,Sn]=(0,o.useState)(()=>new Set),Nt=(0,o.useRef)(new Set),[ft,wt]=(0,o.useState)([]),[Dt,Ct]=(0,o.useState)([]),[Jt,Ot]=(0,o.useState)(!1),[xn,p]=(0,o.useState)(!1),b=(0,o.useRef)(!1),[_,Y]=(0,o.useState)(!1),[Ee,ie]=o.useState("content"),[De,je]=o.useState(""),[me,Pe]=o.useState(""),[Oe,St]=(0,o.useState)(()=>new Set),[gt,le]=(0,o.useState)("30"),[ae,z]=(0,o.useState)(!1),[$,be]=(0,o.useState)(null),[fe,Fe]=(0,o.useState)(null),[Se,Be]=(0,o.useState)([]),He=(0,o.useRef)(!1),Me=(0,o.useRef)(null),Q=os(q??as,Re??ss,typeof Re=="function"),Te=(0,o.useRef)(Q.pending);Te.current=Q.pending;let xe=(0,o.useMemo)(()=>new Set(Dt),[Dt]),ot=e(async()=>{if(Ge)try{let d=await Ge();Ct(d.favoriteSessionIds),Ot(!0),xt?.adopt(d.favoriteSessionIds)}catch(d){Ot(!1),G(Ue(d))}},"loadFavorites");(0,o.useEffect)(()=>{let d=!0;return Ge&&Ge().then(x=>{d&&(Ct(x.favoriteSessionIds),Ot(!0),xt?.adopt(x.favoriteSessionIds))}).catch(x=>{d&&G(Ue(x))}),()=>{d=!1}},[Ge]),(0,o.useEffect)(()=>{if(xt)return xt.subscribe(()=>{let d=xt.getSnapshot();d.ready&&(Ct([...d.ids]),Ot(!0))})},[xt]);let nt=e(async d=>{if(!(b.current||X||!Jt)){b.current=!0,p(!0),G(null);try{let x=await ln({sessionId:d,favorite:!xe.has(d)});Ct(x.favoriteSessionIds),xt?.adopt(x.favoriteSessionIds)}catch(x){G(Ue(x))}finally{b.current=!1,p(!1)}}},"toggleFavorite"),ue=e(async(d,x,{idle:Z=!1,retry:ge=!1}={})=>{if(!(He.current||b.current||Nt.current.size>0||!Tt)){He.current=!0,Ve(!0),G(null),$e(null),Fe(null),d==="archive"&&!ge&&Be([]);try{let R=await Tt(d,x,{idleDays:Z?Number(gt):void 0,getPending:e(()=>Te.current,"getPending"),onProgress:e(ve=>{be(ve),d==="archive"&&ve.total>0&&ve.done>=ve.total&&(we(null),it(null),z(!1))},"onProgress")});return Fe({...R,kind:d,tab:Le}),Me.current=R.remaining.length?{kind:d,ids:R.remaining,idle:Z}:null,d==="archive"&&Be(ve=>[...new Set([...ve,...R.succeeded])]),(d==="undo"||d==="restore"||d==="delete")&&Be(ve=>ve.filter(ct=>!R.succeeded.includes(ct)&&!R.skipped.includes(ct))),wt(ve=>ve.filter(ct=>!R.succeeded.includes(ct)&&!R.skipped.includes(ct))),d==="delete"&&Ct(ve=>ve.filter(ct=>!R.succeeded.includes(ct))),R}catch(R){G(Ue(R))}finally{He.current=!1,Ve(!1),be(null)}}},"executeBatch"),[Ft,$t]=(0,o.useState)(null),[Xt,kn]=(0,o.useState)({diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null}),ye=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!pe||!yt||!st)return;let d=Ta({diagnose:pe,rebuild:yt,refresh:st});ye.current=d;let x=d.subscribe(()=>{kn(d.snapshot())});return d.load(),()=>{x(),d.dispose(),ye.current=null}},[pe,yt,st]),(0,o.useEffect)(()=>{ye.current?.snapshot().busy||ye.current?.load()},[K.archivedSessionIds]);let rt=e(async(d=!1)=>{if(!(X||He.current||!ye.current||ye.current.snapshot().busy)){He.current=!0,Ve(!0);try{await ye.current.run(d)}finally{He.current=!1,lt.current&&Ve(!1)}}},"runCacheRebuild"),[Qt,dn]=(0,o.useState)(!1),un=e(()=>{typeof Ce=="function"&&Ce().then($t).catch(d=>{console.warn("archive-manager: diagnose orphan subagents failed",d)})},"loadOrphans");(0,o.useEffect)(()=>{un()},[K.archivedSessionIds]);let Et=e(async()=>{if(!(Qt||typeof ze!="function")){dn(!0),G(null),$e(null);try{let d=await ze({});(d.cleanedSessionIds.length>0||d.skippedSessionIds.length>0)&&un(),d.failures.length>0?($e(null),G(zn(d.failures,u))):d.cleanedSessionIds.length>0&&(G(null),$e(u("organizer.orphanCleanSuccess",{n:d.cleanedSessionIds.length})))}catch(d){G(Ue(d))}finally{dn(!1)}}},"cleanOrphans"),lt=(0,o.useRef)(!0),en=(0,o.useRef)(!1);(0,o.useEffect)(()=>(lt.current=!0,()=>{lt.current=!1}),[]);let Mt=e(async(d,x=!1)=>{if(X||en.current)return;en.current=!0,Ve(!0),G(null);let Z=!1;try{await _a({prepare:x?async ge=>{await A?.(ge)}:void 0,restore:e(async ge=>{await v(ge),Z=!0},"restore"),open:e(async ge=>{await F(ge),lt.current&&B?.()},"open")},d.id,x,()=>lt.current)}catch(ge){if(!lt.current)return;if(Z){Qe("unarchived");let R=Gt.find(ve=>ve.sessions.some(ct=>ct.id===d.id));R!==void 0&&qt(R.key)}G(Ia(ge,u))}finally{en.current=!1,lt.current&&Ve(!1)}},"viewConversation");(0,o.useEffect)(()=>{P&&Object.assign(P,{query:Rt,project:mt,sortBy:jt})},[Rt,mt,jt,P]);let Bt=(0,o.useMemo)(()=>M?K.archivedSessionIds:Ur(ee.byId,K.archivedSessionIds),[M,ee.byId,K.archivedSessionIds]),Gt=(0,o.useMemo)(()=>Wr(ee.byId,K.items,Bt,u("group.ungrouped")),[ee.byId,K,Bt,u]),Es=e(d=>{X||Nt.current.size>0||(_t.close(),Qe(d),wt([]),we(null),it(null),G(null),$e(null),qt("all"),vn(""),d!=="archived"&&jt==="archived"&&bn("updated"))},"switchTab"),Zr=e(async(d,x=!1)=>{if(!(It.current||X||!d?.length)){if(Tt){It.current=!0;try{let Z=await ue("archive",d,{idle:x}),ge=Z?.failures.map(R=>_r(R.sessionId,R.message)).find(R=>R!==void 0);if(ge!==void 0&&typeof s=="function"){let R=ee.byId[ge.sessionId];At({sessionId:ge.sessionId,title:R===void 0?ge.sessionId:et(R,u),kinds:ge.kinds.join(", ")}),we(null),it(null),G(null);return}Z&&(we(null),it(null),z(!1))}finally{It.current=!1}return}It.current=!0,Ve(!0),G(null),$e(null);try{let Z=await n(d);we(null),it(null),Z.archivedSessionIdsAdded.length>0&&$e(u("archives.archiveSuccess",{n:Z.archivedSessionIdsAdded.length})),Z.failures&&Z.failures.length>0?G(zn(Z.failures,u)):(wt([]),Qe("archived"),qt("all"),vn(""))}catch(Z){let ge=Ir(Z);if(ge!==void 0&&typeof s=="function"){let R=ee.byId[ge.sessionId];At({sessionId:ge.sessionId,title:R===void 0?ge.sessionId:et(R,u),kinds:ge.kinds.join(", ")}),we(null),it(null),G(null)}else{let R=Ln(Z);G(R===void 0?u("archives.archiveBatchFailed",{detail:Z instanceof Error?Z.message:String(Z)}):u("archives.archiveActive",{kinds:R.join(", ")}))}}finally{It.current=!1,Ve(!1)}}},"performArchive"),Ts=e(()=>Zr(Ie,ae),"confirmArchive"),Is=e(async d=>{G(null),$e(null);try{await cr(d.id),lt.current&&$e(u("details.copied"))}catch(x){lt.current&&G(typeof Hn(x)=="string"&&String(Hn(x)).startsWith("copy.")?u(String(Hn(x))):Ue(x))}},"copyId"),tr=(0,o.useMemo)(()=>qr(Gt,jt,yn,u,M?K.archivedSessionIds:void 0),[Gt,jt,yn,u,M,K.archivedSessionIds]);(0,o.useEffect)(()=>{if(X)return;let d=!1;return N().then(x=>{d||wn(Object.fromEntries(x.items.map(Z=>[Z.sessionId,Z.createdAt])))}).catch(()=>{d||wn({})}),()=>{d=!0}},[N,K.archivedSessionIds,X]),(0,o.useEffect)(()=>{mt!=="all"&&!Gt.some(d=>d.key===mt)&&qt("all")},[Gt,mt]);let Jr=!dr(De,me),Xr=tr.filter(d=>mt==="all"||mt===d.key).map(d=>({...d,sessions:d.sessions.filter(x=>(!_||xe.has(x.id))&&va(x.updatedAt,De,me))})).filter(d=>d.sessions.length),nr=Ee==="content"&&!Jr,Cn=j(Xr.flatMap(d=>d.sessions.map(x=>x.id)),Rt,nr,tt??on),rr=new Map(Cn.items.map(d=>[d.sessionId,d])),_t=U(pt,M?K.archivedSessionIds:[]),Qr=Rt.trim().toLocaleLowerCase(),En=Xr.map(d=>({...d,sessions:d.sessions.filter(x=>!Qr||et(x,u).toLocaleLowerCase().includes(Qr)||rr.has(x.id))})).filter(d=>d.sessions.length),ea=Jt?En.flatMap(d=>d.sessions).filter(d=>yr(d,{days:Number(gt),favorites:xe,currentId:qn(ee),pending:Q.pending})).map(d=>d.id):[],Tn=(0,o.useMemo)(()=>Fr(En),[En]),ar=(0,o.useMemo)(()=>new Set(ft),[ft]),_s=(0,o.useMemo)(()=>{let d=new Set(K.archivedSessionIds);return Se.reduce((x,Z)=>x+(d.has(Z)?1:0),0)},[Se,K.archivedSessionIds]),sr=Tn.filter(d=>ar.has(d)).length,As=Tn.length>0&&sr===Tn.length;(0,o.useEffect)(()=>{wt(d=>Br(d,Bt))},[Bt]);let Rs=e((d,x)=>{wt(Z=>Xn(Z,[d],x))},"toggleSessionSelection"),js=e(d=>{wt(x=>Xn(x,Tn,d))},"toggleVisibleSelection"),Ns=e(d=>{X||Nt.current.has(d)||(Nt.current.add(d),Sn(new Set(Nt.current)),G(null),$e(null),v(d).catch(x=>{G(Er(x,u))}).finally(()=>{Nt.current.delete(d),Sn(new Set(Nt.current))}))},"onUnarchive"),ta=e(async d=>{if(!X){if(Tt){let x=fn(K.archivedSessionIds,K.items,d),Z=await ue("restore",x);return Z&&{unarchivedSessionIds:Z.succeeded}}Ve(!0),G(null),$e(null);try{let x=await C(d);return x.unarchivedSessionIds.length>0&&$e(u("archives.restoreSuccess",{n:x.unarchivedSessionIds.length})),x.failures&&x.failures.length>0&&G(zn(x.failures,u,Er)),x}catch(x){G(u("archives.restoreBatchFailed",{detail:x instanceof Error?x.message:String(x)}))}finally{Ve(!1)}}},"onBatchUnarchive"),Ds=e(async()=>{if(ft.length===0)return;let d=await ta({scope:"sessions",sessionIds:ft});if(d!==void 0){let x=new Set(d.unarchivedSessionIds);wt(Z=>Z.filter(ge=>!x.has(ge)))}},"onSelectedUnarchive"),na=e(()=>{X||Wt(null)},"closeDelete");(0,o.useEffect)(()=>{if(_e===null)return;let d=e(x=>{x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),"stopImmediatePropagation"in x&&typeof x.stopImmediatePropagation=="function"&&x.stopImmediatePropagation(),X||Wt(null))},"onKeyDown");return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[_e,X]);let Ms=e(async()=>{if(X||gn.current||_e===null)return;if(_e.kind!=="batch"){gn.current=!0,Ve(!0),G(null),$e(null);try{await m(_e.session.id),Wt(null)}catch(x){G($n(x,u))}finally{gn.current=!1,Ve(!1)}return}if(He.current||b.current||Nt.current.size>0)return;let{target:d}=_e;if(d.scope==="sessions"&&fn(K.archivedSessionIds,K.items,d).length===0){Wt(null);return}He.current=!0,Ve(!0),G(null),$e(null),Fe(null),be(null);try{let x=await E(d),Z=Hr(x,u);Z.kind==="error"?G(Z.message):$e(Z.message);let ge=new Set([...x.deletedSessionIds,...x.skippedSessionIds]);Be(ve=>ve.filter(ct=>!ge.has(ct))),wt(ve=>ve.filter(ct=>!ge.has(ct))),Ct(ve=>ve.filter(ct=>!ge.has(ct)));let R=x.failures.map(ve=>ve.sessionId);Me.current=R.length>0?{kind:"delete",ids:R,idle:!1}:null,Fe({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:Le}),Wt(null)}catch(x){G($n(x,u))}finally{He.current=!1,Ve(!1)}},"confirmDelete"),Ht=_e?.kind==="batch"?_e.target.scope:null,zs=Ht==="ungrouped"?u("archives.deleteUngroupedTitle"):Ht==="workspace"?u("archives.deleteProjectTitle",{name:_e?.kind==="batch"?_e.title:""}):u(Ht==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),ra=_e===null?void 0:Ht==="ungrouped"?u("archives.deleteUngroupedDesc",{n:_e.kind==="batch"?_e.count:0}):Ht==="workspace"?u("archives.deleteProjectDesc",{name:_e?.kind==="batch"?_e.title:"",n:_e.kind==="batch"?_e.count:0}):Ht==="sessions"?u("archives.deleteSelectedDesc",{n:_e.kind==="batch"?_e.count:0}):u("deleteSession.desc",{name:et(_e.kind==="session"?_e.session:{},u)}),Ls=u(Ht==="ungrouped"?"archives.deleteUngroupedConfirm":Ht==="workspace"?"archives.deleteProjectConfirm":Ht==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,a.jsxs)("section",{className:"dsham_settings","aria-label":u("archives.title"),children:[(0,a.jsx)("style",{children:cs+hs+ps+ms+fs}),(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)(c.Button,{variant:"outline",size:"sm","aria-label":u("archives.viewProject"),icon:(0,a.jsx)(Ja,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:u("archives.viewProject")}),(0,a.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":u("archives.feedback"),icon:(0,a.jsx)(Xa,{}),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",g(X||Vt.size>0,(0,a.jsx)(c.SegmentedTabs,{className:"dsham_archiveTabs",label:u("archives.title"),value:Le==="unarchived"?"unarchived":"archived",onChange:e(d=>Es(d==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:(0,a.jsxs)("span",{className:"dsham_tabLabel",children:[(0,a.jsx)(c.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)(c.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(Le==="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)(Jn,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:_?"favorites":"all",options:[{value:"all",label:u("organizer.allSessions")},{value:"favorites",label:u("organizer.favoritesOnly")}],onChange:e(d=>typeof Y=="function"&&Y(d==="favorites"),"onChange"),"aria-label":u("organizer.favoriteFilter")}),(0,a.jsx)(Jn,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:Ee,options:[{value:"title",label:u("discovery.titleOnly")},{value:"content",label:u("discovery.titleAndContent")}],onChange:e(d=>typeof ie=="function"&&ie(d),"onChange"),"aria-label":u("discovery.scope")}),(0,a.jsx)(c.Input,{id:"dsham-search-input",className:"dsham_searchField",type:"search",icon:(0,a.jsx)(c.IconSearchOutlineMedium,{size:16,"aria-hidden":!0}),autoComplete:"off",spellCheck:!1,maxLength:200,value:Rt,onChange:e(d=>vn(d.target.value),"onChange"),placeholder:u(nr?"discovery.searchPlaceholder":M?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":u(nr?"discovery.searchPlaceholder":M?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,a.jsx)(gs,{id:"dsham-sort-filter",t:u,disabled:X,favoritesOnly:_,setFavoritesOnly:Y,favoriteBusy:X||xn||!Jt,sortBy:!M&&jt==="archived"?"updated":jt,setSortBy:bn,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)(Jn,{id:"dsham-project-filter",className:"dsham_projectFilter",value:mt,title:mt==="all"?u("archives.allProjects"):tr.find(d=>d.key===mt)?.title??mt,options:[{value:"all",label:u("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:u("archives.allProjects")},...tr.map(d=>({value:d.key,label:d.title,title:d.title}))],onChange:qt,"aria-label":u("archives.projectFilter")}),o.createElement(L,{t:u,from:De,to:me,onFrom:je,onTo:Pe,invalid:Jr,onClear:e(()=>{je(""),Pe("")},"onClear")})]})}),o.createElement("style",null,wa),o.createElement(H,{state:Cn,t:u}),Tt&&(0,a.jsx)(S,{t:u,archived:M,busy:X||xn||Vt.size>0,ready:Jt,days:gt,onDays:le,count:ea.length,onPreview:e(()=>{Pt(ea),z(!0)},"onPreview"),progress:$,result:fe?.tab===Le?fe:null,onRetry:e(()=>{let d=Me.current;d&&(d.kind==="delete"?cn({kind:"batch",target:{scope:"sessions",sessionIds:d.ids},count:d.ids.length}):ue(d.kind,d.ids,{idle:d.idle,retry:!0}))},"onRetry"),undoCount:_s,onUndo:e(()=>ue("undo",Se,{retry:!0}),"onUndo"),onReload:ot,orphanCount:Ft?.count??0,cacheCount:Xt.diagnosis.count,cacheRepair:Xt,onRebuildCaches:e(()=>rt(),"onRebuildCaches"),onRetryCaches:e(()=>rt(!0),"onRetryCaches"),onReloadCaches:e(async()=>{try{await st?.(),await ye.current?.load(),(ye.current?.snapshot().diagnosis.count??0)===0&&ye.current?.dismiss()}catch(d){lt.current&&G(Ue(d))}},"onReloadCaches"),onDismissCaches:e(()=>ye.current?.dismiss(),"onDismissCaches"),orphanSizeBytes:Ft?.totalSizeBytes??0,orphanCleaning:Qt,onCleanOrphans:Et}),Gt.length>0&&(0,a.jsx)(Lr,{selectedCount:ft.length,hiddenCount:ft.length-sr,allVisibleSelected:As,selectedVisibleCount:sr,visibleCount:Tn.length,busy:X,t:u,onToggle:js,onClear:e(()=>wt([]),"onClear"),onArchive:M?void 0:()=>Pt([...ft]),onRestore:Ds,onDelete:e(()=>cn({kind:"batch",target:{scope:"sessions",sessionIds:ft},count:ft.length}),"onDelete")}),Gt.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:u(M?"archives.empty":"archives.emptyUnarchived")}):En.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:Cn.status==="loading"||Cn.status==="error"||Cn.failures.length?null:u("archives.emptyFiltered")}):En.map(d=>{let x=ys(d.key),Z=Gt.find(R=>R.key===d.key)?.sessions.map(R=>R.id)??[],ge=M?fn(K.archivedSessionIds,K.items,x).length:Z.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":!Oe.has(d.key),"aria-controls":"dsham-group-"+encodeURIComponent(d.key),onClick:e(()=>St(R=>{let ve=new Set(R);return ve.has(d.key)?ve.delete(d.key):ve.add(d.key),ve}),"onClick"),children:[(0,a.jsx)(Oe.has(d.key)?c.IconChevronRightOutlineMedium:c.IconChevronDownOutlineMedium,{}),(0,a.jsx)(Oe.has(d.key)?c.IconFolderCloseMedium:c.IconFolderOpenOutlineMedium,{}),(0,a.jsx)("span",{children:d.title})]})}),(0,a.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,a.jsx)("span",{className:"dsham_settingsCount",children:u("archives.sessionCount",{n:d.sessions.length})}),(0,a.jsx)(bs,{group:d,busy:X,onArchive:M?void 0:()=>Pt(Z,d),onRestore:e(()=>ta(x),"onRestore"),onDelete:e(()=>cn({kind:"batch",target:x,title:d.title,count:ge}),"onDelete"),t:u})]})]}),(0,a.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(d.key),hidden:Oe.has(d.key)||void 0,children:!Oe.has(d.key)&&d.sessions.map(R=>(0,a.jsxs)("div",{className:"dsham_settingsRow","data-selected":ar.has(R.id),children:[(0,a.jsx)(Pr,{checked:ar.has(R.id),disabled:X,label:u("archives.selectSession",{name:et(R,u)}),onChange:e(ve=>Rs(R.id,ve.target.checked),"onChange")}),(0,a.jsxs)("div",{className:"dsham_settingsContent",children:[(0,a.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:et(R,u),"aria-label":u("archives.openSession")+u("common.separator")+et(R,u),disabled:X||Vt.has(R.id),onClick:e(()=>Mt(R),"onClick"),children:et(R,u)}),(0,a.jsx)("div",{className:"dsham_settingsMeta",children:[ls(R.updatedAt,u)]}),rr.has(R.id)&&o.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:X,title:u(M?"discovery.preview":"archives.openSession"),onClick:e(()=>M?_t.open(R,Rt):Mt(R),"onClick")},o.createElement(D,{text:rr.get(R.id)?.snippet??"",query:Rt}))]}),(0,a.jsxs)("div",{className:"dsham_settingsActions",children:[typeof ln=="function"&&I({variant:"outline",className:"dsham_iconAction"+(xe.has(R.id)?" dsham_favoriteOn":""),title:u(xe.has(R.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":xe.has(R.id),"aria-label":u(xe.has(R.id)?"organizer.unfavorite":"organizer.favorite")+u("common.separator")+et(R,u),disabled:X||xn||!Jt,onClick:e(()=>nt(R.id),"onClick"),children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:xe.has(R.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,a.jsx)("path",{d:ne})})}),I({variant:"outline",className:"dsham_iconAction",title:u(M?"archives.restore":"archives.archiveSelected"),"aria-label":u(M?"archives.restore":"archives.archiveSelected"),disabled:X||Vt.has(R.id),onClick:e(()=>M?Ns(R.id):Zr([R.id]),"onClick"),icon:(0,a.jsx)(M?c.IconRefreshOutlineMedium:c.IconArchiveOutlineMedium,{size:16})}),M&&(0,a.jsx)(vs,{busy:X||Vt.has(R.id),t:u,title:et(R,u),onCopyId:e(()=>Is(R),"onCopyId"),onPreview:typeof pt=="function"?()=>_t.open(R,Rt):void 0,onRestoreOpen:e(()=>Mt(R,!0),"onRestoreOpen"),onDelete:e(()=>cn({kind:"session",session:R}),"onDelete")})]})]},R.id))})]},d.key)}),o.createElement(k,{width:900,className:"dsham_modalWide",portalToBody:!0,t:u,open:_t.target!==null,onClose:_t.close,title:_t.target?et(_t.target.session,u):u("discovery.preview"),footer:w({variant:"primary",disabled:X,onClick:e(()=>{if(_t.target){let d=_t.target.session;return _t.close(),Mt(d)}},"onClick"),children:u("discovery.openFull")}),children:o.createElement(he,{preview:_t,t:u,MarkdownText:c.MarkdownText})}),Ie===null&&kt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:kt}),Fn!==null&&(0,a.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:Fn}),(0,a.jsx)(k,{t:u,open:Ie!==null,onClose:Zt,title:u("archives.archiveTitle",{n:Ie?.length??0}),description:Ke===null?u("archives.archiveSelectedDesc"):u(Ke.key===On?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:Ke.title,n:Ie?.length??0}),footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:X,onClick:Zt,children:u("cancel")}),w({variant:"primary",disabled:X||!Ie?.length,onClick:Ts,children:u("archives.archiveSelected")})]}),children:(0,a.jsxs)(a.Fragment,{children:[Tt&&(0,a.jsx)("p",{children:u(ae?"organizer.idleConfirm":"organizer.manualConfirm")}),Tt&&(0,a.jsx)("div",{className:"dsham_archivePreview",children:(Ie??[]).map(d=>(0,a.jsxs)("label",{children:[(0,a.jsx)(ir,{checked:!0,disabled:X,label:et(ee.byId[d]??{id:d},u),onChange:e(()=>we(x=>(x??[]).filter(Z=>Z!==d)),"onChange")}),et(ee.byId[d]??{id:d},u)]},d))}),$&&(0,a.jsxs)("div",{role:"status",children:[(0,a.jsx)("progress",{value:$.done,max:Math.max(1,$.total)}),u("organizer.progressCount",{done:$.done,total:$.total})]}),kt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:kt})]})}),(0,a.jsx)(k,{t:u,open:Je!==null,onClose:e(()=>{X||(At(null),G(null))},"onClose"),title:u("archiveActive.title"),...Je===null?{}:{description:u("archiveActive.desc",{name:Je.title,kinds:Je.kinds})},footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:X,onClick:e(()=>{X||(At(null),G(null))},"onClick"),children:u("cancel")}),w({danger:!0,disabled:X,onClick:e(async()=>{if(!(It.current||X||Je===null||typeof s!="function")){It.current=!0,Ve(!0),G(null);try{await s(Je.sessionId,{stopActivity:!0}),wt(d=>d.filter(x=>Je===null||x!==Je.sessionId)),Qe("archived"),$e(u("archives.archiveSuccess",{n:1})),At(null)}catch(d){G(d instanceof Error?d.message:String(d))}finally{It.current=!1,Ve(!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:_e!==null,onClose:na,title:zs,...ra===void 0?{}:{description:ra},footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:X,onClick:na,children:u("cancel")}),w({danger:!0,disabled:X,onClick:Ms,children:Ls})]}),children:(0,a.jsxs)(a.Fragment,{children:[X&&(0,a.jsxs)("div",{role:"status",children:[_e?.kind==="batch"?u("archives.deleteBatchPending"):u("deleteSession.pending"),$&&(0,a.jsx)("progress",{value:$.done,max:Math.max(1,$.total),"aria-label":u("organizer.progress")}),$&&u("organizer.progressCount",{done:$.done,total:$.total})]}),kt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:kt})]})})]})]})}e(Dn,"ArchivedSessionsSection");function Cr(n){var s,l,h="";if(typeof n=="string"||typeof n=="number")h+=n;else if(typeof n=="object")if(Array.isArray(n)){var v=n.length;for(s=0;s<v;s++)n[s]&&(l=Cr(n[s]))&&(h&&(h+=" "),h+=l)}else for(l in n)n[l]&&(h&&(h+=" "),h+=l);return h}e(Cr,"r");function Qa(...n){for(var s,l,h=0,v="",m=arguments.length;h<m;h++)(s=arguments[h])&&(l=Cr(s))&&(v&&(v+=" "),v+=l);return v}e(Qa,"clsx");function Mn(n){let s=n instanceof Error?n.message:String(n);return s.includes("UNKNOWN_SESSION")||s.includes("no such session")}e(Mn,"isUnknownSessionError");function $n(n,s){if(Mn(n))return s("deleteSession.unknown");let l=n instanceof Error?n.message:String(n);return s("deleteSession.failed",{detail:l})}e($n,"formatDeleteError");function Er(n,s){if(Mn(n))return s("archives.unarchiveUnknown");let l=n instanceof Error?n.message:String(n);return s("archives.unarchiveFailed",{detail:l})}e(Er,"formatUnarchiveError");function zn(n,s,l=Tr){return n.map(h=>h.sessionId+s("common.separator")+l(new Error(h.message),s)).join(`
23
+ `)}e(zn,"formatBatchFailures");function Tr(n,s){if(Mn(n))return s("archives.archiveUnknown");let l=n instanceof Error?n.message:String(n);return s("archives.archiveFailed",{detail:l})}e(Tr,"formatArchiveError");function Ln(n){if(n===null||typeof n!="object")return;let s=oe(n),l=s.rpcError!==null&&typeof s.rpcError=="object"?oe(s.rpcError):void 0,h=s.name==="WorkspaceActiveSessionError"?s.activity:void 0,v=l?.details,m=s.name==="WorkspaceArchiveError"&&l?.code==="workspace/session-active"&&v!==null&&typeof v=="object"?oe(v).activity:void 0,C=Array.isArray(h)?h:Array.isArray(m)?m:void 0;if(C===void 0)return;let E=C.flatMap(N=>{if(N===null||typeof N!="object")return[];let F=oe(N).kind;return typeof F=="string"&&F.length>0?[F]:[]});return E.length>0?E:void 0}e(Ln,"activeSessionActivity");function Ir(n){let s=Ln(n);if(s===void 0||n===null||typeof n!="object")return;let l=oe(n),h=l.rpcError!==null&&typeof l.rpcError=="object"?oe(l.rpcError).details:void 0,v=h!==null&&typeof h=="object"?oe(h).sessionId:void 0,m=typeof l.sessionId=="string"?l.sessionId:typeof v=="string"?v:void 0;return m===void 0?void 0:{sessionId:m,kinds:s}}e(Ir,"activeSessionRefusal");function _r(n,s){let l=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(s);if(l===null)return;let h=l[1].split(", ").filter(v=>v.length>0);return h.length>0?{sessionId:n,kinds:h}:void 0}e(_r,"activeArchiveFromMessage");function es(n,s){let l=n instanceof Error?n.message:String(n);return s("archives.forkFailed",{detail:l})}e(es,"formatForkError");function Gn(n,s,l){if(!n||l.has(n))return!1;let h=s?.[n];return!(h===void 0||h.origin==="subagent"||h.blank)}e(Gn,"isWorkspaceTaskCandidate");function Ar(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 v=s.querySelector(".title")??s.querySelector("[class*='title']");return{workspaceId:h,title:v?.textContent?.trim()||h}}e(Ar,"workspaceMenuTriggerFrom");function Kn(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(m=>!!((m.getAttribute("class")??"").includes("dsham_rowStar")||typeof m.closest=="function"&&m.closest(".dsham_starSlot")),"isStarButton");return l.find(m=>{if(h(m))return!1;if(m.getAttribute("aria-haspopup")==="menu")return!0;let C=(m.getAttribute("aria-label")??m.getAttribute("title")??"").toLowerCase();return/new|create|新建|add|\+|созда/.test(C)?!1:/action|操作|действи|more|更多|选项|options|menu/.test(C)})??null}e(Kn,"findRowMenuButton");function Rr(n,s){if(Kn(s)===n)return!0;let h=(n.getAttribute("aria-label")??n.getAttribute("title")??"").toLowerCase();return/action|操作|действи|more|更多/.test(h)}e(Rr,"isRowMenuButton");function jr(){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 v=l.closest("button");if(v&&!Rr(v,h))return;let m=Kn(h);m&&(s.preventDefault(),s.stopPropagation(),m.click())},"onContextMenu");return document.addEventListener("contextmenu",n,!0),()=>{document.removeEventListener("contextmenu",n,!0)}}e(jr,"setupSidebarRowContextMenu");function Yn(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(Yn,"isWorkspaceDeleteMenuItem");let ts=new Map,ns=new Set,rs=new Map;function as(n){return n(ts)}e(as,"useEmptySessionPendingInteraction");function ss(n){return n(rs)}e(ss,"useEmptySessionStatus");function is(n){let s=new Map,l=new Set;if(n instanceof Map)for(let[h,v]of n)v?.pendingInteraction!==void 0&&s.set(h,v.pendingInteraction),v?.completionUnread===!0&&l.add(h);return{pending:s,completed:l}}e(is,"factsFromSessionStatus");function os(n,s,l){let h=n(m=>m),v=s(m=>m);return l?is(v):{pending:h,completed:ns}}e(os,"useSessionUiFacts");let Nr={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 et(n,s){return n.blank?s("session.new"):n.title??n.displayTitle??""}e(et,"displayTitle");function ls(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(ls,"archiveTimeLabel");let cs=[".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(""),Lt="data-dsham-nav-icon",ds='[role="dialog"] nav button',Zn=[`[${Lt}] > svg { display: none !important; }`,`[${Lt}]::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(`
24
+ `);function us(n,s){let l=String(s??"").trim();return l.length>0&&String(n??"").trim()===l}e(us,"isOwnSettingsNavRow");function Pn(n,s){for(let l of n){if(l.type==="characterData"){let v=l.target.parentElement;if(v!==null&&v.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 v of l.addedNodes){if(v.nodeType!==1)continue;let m=v;if(typeof m.matches=="function"&&m.matches(s)||typeof m.querySelector=="function"&&m.querySelector(s)!==null||typeof m.closest=="function"&&m.closest(s)!==null)return!0}if(l.removedNodes)for(let v of l.removedNodes){if(v.nodeType!==1)continue;let m=v;if(typeof m.matches=="function"&&m.matches(s)||typeof m.querySelector=="function"&&m.querySelector(s)!==null||typeof m.closest=="function"&&m.closest(s)!==null)return!0}}return!1}e(Pn,"mutationTouches");function Dr(n,s){return us(n.textContent,s)?n.getAttribute(Lt)===""?!1:(n.setAttribute(Lt,""),!0):n.hasAttribute(Lt)?(n.removeAttribute(Lt),!0):!1}e(Dr,"applySettingsNavIcon");function Mr(n){return n.hasAttribute(Lt)?(n.removeAttribute(Lt),!0):!1}e(Mr,"restoreSettingsNavIcon");function zr(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=Zn,(document.head??document.documentElement).append(l)):l.textContent!==Zn&&(l.textContent=Zn);let h=!1,v=!1,m=e(()=>{if(v=!1,h)return;let N=n.locale.bind(qe)("archived.badge");for(let F of document.querySelectorAll(ds))Dr(F,N)},"sync"),C=e(()=>{v||h||(v=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(m):setTimeout(m,16))},"schedule");m();let E=new MutationObserver(N=>{Pn(N,'[role="dialog"] nav')&&C()});return E.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{h=!0,E.disconnect();for(let N of document.querySelectorAll(`[${Lt}]`))Mr(N);l?.remove()}},"archive-manager: settings nav icon")}e(zr,"installSettingsNavIcon");let hs=[".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_settingsList[hidden]{display:none!important;border:0!important}",".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(""),ps=".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}",ms=".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}}",fs=".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 Jn({id:n,className:s,value:l,options:h,onChange:v,disabled:m=!1,"aria-label":C,title:E,tabIndex:N,"aria-hidden":F}){let[A,P]=o.useState(!1),B=o.useMemo(()=>h.map(ze=>({id:ze.value,label:ze.label})),[h]),u=h.find(ze=>ze.value===l),Ce=u?.label??C;return(0,a.jsx)("div",{id:n,tabIndex:N,"aria-hidden":F,className:s===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${s}`,children:(0,a.jsx)(c.Menu,{open:A,onClose:e(()=>P(!1),"onClose"),onSelect:e(ze=>{m||v(ze),P(!1)},"onSelect"),selectedId:l,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,a.jsxs)(c.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":C,"aria-expanded":A,disabled:m,tabIndex:N,"aria-hidden":F,title:E??u?.title??u?.label??C,className:"dsham_menuSelectBtn"+(A?" is-open":""),onClick:e(()=>{m||P(ze=>!ze)},"onClick"),children:[(0,a.jsx)("span",{className:"dsham_selectLabel",children:Ce}),(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:A?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:B})})}e(Jn,"ArchiveProjectSelect");function gs({id:n,t:s,disabled:l=!1,favoritesOnly:h,setFavoritesOnly:v,favoriteBusy:m=!1,sortBy:C,setSortBy:E,options:N}){let[F,A]=o.useState(!1),P=o.useMemo(()=>{let pe=[];typeof v=="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 yt of N)pe.push({id:`sort:${yt.value}`,label:yt.label});return pe},[s,v,N]),B=e(pe=>{pe.startsWith("filter:")?typeof v=="function"&&!m&&v(pe==="filter:favorites"):pe.startsWith("sort:")&&E(pe.slice(5)),A(!1)},"onSelect"),u=N.find(pe=>pe.value===C),Ce=h?s("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":s("organizer.allChats")||"\u5168\u90E8\u804A\u5929",ze=`${Ce} \xB7 ${u?.label??C}`;return(0,a.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,a.jsx)(c.Menu,{open:F,onClose:e(()=>A(!1),"onClose"),onSelect:B,selectedIds:[h?"filter:favorites":"filter:all",`sort:${C}`],align:"end",portal:!0,dense:!0,listClassName:"dsham_viewSortDropdown",anchor:(0,a.jsxs)(c.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":s("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":F,disabled:l,title:ze,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(F?" is-open":"")+(h?" has-filter":""),onClick:e(()=>{l||A(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:Ce}),(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(gs,"ArchiveViewSortMenu");function Lr({selectedCount:n,hiddenCount:s,allVisibleSelected:l,selectedVisibleCount:h,visibleCount:v,busy:m,t:C,onToggle:E,onClear:N,onRestore:F,onDelete:A,onArchive:P}){let B=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:C("archives.selectAllFiltered"),children:[(0,a.jsx)(Pr,{checked:l,indeterminate:h>0&&!l,disabled:m||v===0,label:C("archives.selectAllFiltered"),onChange:e(u=>E(u.target.checked),"onChange")}),(0,a.jsx)("span",{"aria-live":"polite",children:B?C("archives.selectedCount",{n}):C("archives.selectAllFiltered")})]}),B&&I({disabled:m,"aria-label":C("archives.clearSelection"),onClick:N,children:C("archives.clearSelectionShort")})]}),B&&(0,a.jsxs)("div",{className:"dsham_settingsSelectionActions",children:P?[I({disabled:m,onClick:P,children:C("archives.archiveSelected")})]:[I({disabled:m,"aria-label":C("archives.restoreSelected"),onClick:F,children:C("archives.restore")}),I({disabled:m,className:"dsham_btnDanger","aria-label":C("archives.deleteSelected"),onClick:A,children:C("archives.deleteSelectionShort")})]})]}),s>0&&(0,a.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:C("archives.selectionHiddenHint",{hidden:s})})]})}e(Lr,"ArchiveSelectionToolbar");function Pr({checked:n,indeterminate:s=!1,disabled:l=!1,label:h,onChange:v}){return(0,a.jsx)(ir,{checked:n,indeterminate:s,disabled:l,label:h,onChange:v})}e(Pr,"ArchiveSelectionCheckbox");function Or(){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(Or,"moreIcon");function vs({busy:n,title:s,t:l,onPreview:h,onRestoreOpen:v,onDelete:m,onCopyId:C}){let[E,N]=(0,o.useState)(!1),F=e(P=>{if(!n){if(N(!1),P==="copyId")return C?.();if(P==="preview")return h?.();if(P==="restoreOpen")return v?.();P==="delete"&&m?.()}},"choose"),A=[...h?[{id:"preview",label:l("discovery.preview"),icon:(0,a.jsx)(c.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...v?[{id:"restoreOpen",label:l("archives.restoreOpen"),icon:(0,a.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...C?[{id:"copyId",label:l("details.copyId"),icon:(0,a.jsx)(c.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...m?[{id:"delete",label:l("menu.deleteSession"),icon:(0,a.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,a.jsx)(c.Menu,{open:!n&&E,align:"end",portal:!0,dense:!0,items:A,onSelect:F,onClose:e(()=>N(!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":E&&!n,icon:Or(),onClick:e(()=>{n||N(P=>!P)},"onClick")})})}e(vs,"ArchivedSessionMenu");function bs({group:n,busy:s,onArchive:l,onRestore:h,onDelete:v,t:m}){let C=n.key===On,E=l?[{id:"archive",label:m(C?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,a.jsx)(c.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:m(C?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,a.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:m(C?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,a.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}],[N,F]=(0,o.useState)(!1),A=m(C?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),P=e(B=>{s||(B==="archive"?l?.():B==="restore"?h?.():B==="delete"&&v?.())},"choose");return(0,a.jsx)(c.Menu,{open:!s&&N,align:"end",portal:!0,dense:!0,items:E,onSelect:e(B=>{F(!1),P(B)},"onSelect"),onClose:e(()=>F(!1),"onClose"),anchor:I({variant:"outline",className:"dsham_iconAction",disabled:s,"aria-label":A,"aria-haspopup":"menu","aria-expanded":N&&!s,icon:Or(),onClick:e(()=>{s||F(B=>!B)},"onClick")})})}e(bs,"ArchivedGroupActions");let On="__ungrouped__";function ys(n){return n===On?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}e(ys,"archivedBatchTargetForGroup");function fn(n,s,l){let h=[...new Set(n??[])];if(l.scope==="all")return h;if(l.scope==="sessions"){let m=new Set(l.sessionIds??[]);return h.filter(C=>m.has(C))}if(l.scope==="workspace"){let m=new Set(s.find(C=>C.workspaceId===l.workspaceId)?.sessionIds??[]);return h.filter(C=>m.has(C))}let v=new Set(s.flatMap(m=>m.sessionIds));return h.filter(m=>!v.has(m))}e(fn,"deriveArchivedBatchIds");function Fr(n){return[...new Set(n.flatMap(s=>s.sessions.map(l=>l.id)))]}e(Fr,"archivedSessionIdsInGroups");function Br(n,s){let l=new Set(s);return[...new Set(n)].filter(h=>l.has(h))}e(Br,"pruneArchivedSelection");function Xn(n,s,l){let h=new Set(n);for(let v of s)l?h.add(v):h.delete(v);return[...h]}e(Xn,"toggleArchivedSelection");function Hr(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(Hr,"archivedDeleteFeedback");function Ur(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(Ur,"unarchivedSessionIds");function Wr(n,s,l,h){let v=s.map(E=>({key:E.workspaceId,title:E.title,ids:new Set(E.sessionIds),sessions:[]})),m=[];for(let E of l){let N=n[E];if(N===void 0||N.origin==="subagent")continue;let F=v.find(A=>A.ids?.has(E));(F===void 0?m:F.sessions).push(N)}let C=v.filter(E=>E.sessions.length>0);return m.length>0&&C.push({key:On,title:h,sessions:m}),C}e(Wr,"deriveArchivedGroups");function qr(n,s,l,h,v=[]){let m=e((A,P)=>String(A).localeCompare(String(P),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),C=new Map;if(Array.isArray(v))for(let A=0;A<v.length;A++)C.set(v[A],A);let E=e(A=>{let P=s==="created"?l[A.id]:A.updatedAt;return typeof P=="number"&&Number.isFinite(P)?P:Number.NEGATIVE_INFINITY},"timestampOf"),N=e((A,P)=>{if(s==="archived"){let B=C.get(A.id)??-1,Ce=(C.get(P.id)??-1)-B;if(Ce!==0)return Ce}if(s!=="alphabetical"){let B=E(P)-E(A);if(Number.isFinite(B)&&B!==0)return B}return m(et(A,h),et(P,h))||m(A.id,P.id)},"compareSessions");return n.map(A=>({...A,sessions:[...A.sessions].sort(N)})).sort((A,P)=>{if(s==="archived"){let B=A.sessions[0]?.id,u=P.sessions[0]?.id,Ce=B!==void 0?C.get(B)??-1:-1,pe=(u!==void 0?C.get(u)??-1:-1)-Ce;if(pe!==0)return pe}if(s!=="alphabetical"){let B=E(P.sessions[0])-E(A.sessions[0]);if(Number.isFinite(B)&&B!==0)return B}return m(A.title,P.title)||m(A.key,P.key)})}e(qr,"sortArchivedGroups");let Vr={...qa,...Sa,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","common.close":"\u5173\u95ED","entry.location.title":"\u5165\u53E3\u5C55\u793A\u4F4D\u7F6E","entry.location.desc":"\u9009\u62E9\u5F52\u6863\u7BA1\u7406\u5165\u53E3\u7684\u5C55\u793A\u4F4D\u7F6E\uFF08\u81F3\u5C11\u4FDD\u7559\u4E00\u5904\uFF0C\u9632\u6B62\u65E0\u6CD5\u6253\u5F00\u9762\u677F\uFF09\u3002","entry.location.both":"\u4E24\u8FB9\u663E\u793A","entry.location.sidebar":"\u4EC5\u4FA7\u8FB9\u680F","entry.location.settings":"\u4EC5\u8BBE\u7F6E","entry.location.saveFailed":"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B","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"},$r={...Va,...xa,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","common.close":"Close","entry.location.title":"Entry placement","entry.location.desc":"Choose where to show the entry (at least one is retained to avoid losing access).","entry.location.both":"Both","entry.location.sidebar":"Sidebar only","entry.location.settings":"Settings only","entry.location.saveFailed":"Failed to save entry location. Please check your network or restart the host.","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}"},ws={...$a,...ka,"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","entry.location.title":"\u0420\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430","entry.location.desc":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435, \u0433\u0434\u0435 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \u0432\u0445\u043E\u0434\u0430 (\u0445\u043E\u0442\u044F \u0431\u044B \u043E\u0434\u0438\u043D \u043E\u0441\u0442\u0430\u0435\u0442\u0441\u044F \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u043C).","entry.location.both":"\u041E\u0431\u0430 \u043C\u0435\u0441\u0442\u0430","entry.location.sidebar":"\u0422\u043E\u043B\u044C\u043A\u043E \u0431\u043E\u043A\u043E\u0432\u0430\u044F \u043F\u0430\u043D\u0435\u043B\u044C","entry.location.settings":"\u0422\u043E\u043B\u044C\u043A\u043E \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438","entry.location.saveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u0435\u0442\u044C \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0445\u043E\u0441\u0442.","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}"},qe="archive-manager-workspace",Ss=["slots","sessions","workspaces","locale","remote","typert"];function Qn(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}e(Qn,"bindObservable");function Gr(n){return async s=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(s)}}e(Gr,"createUnarchiveSession");async function er(n,s,l){let h=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),v=await Vn(s,async C=>{try{await n.archiveSession(C)}catch(E){throw E!==null&&typeof E=="object"&&Ln(E)!==void 0&&typeof oe(E).sessionId!="string"&&Object.assign(E,{sessionId:C}),E}return!0},{refresh:l}),m=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:m,archivedSessionIdsAdded:m.filter(C=>!h.has(C)),failures:v.failures}}e(er,"archiveSessionsViaOfficial");async function Kr(n,s,l,h){let v=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),m=typeof h=="function"?h:N=>n.unarchiveSession?.(N),C=await Vn(s,async N=>(await m(N),!0),{refresh:l}),E=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:E,unarchivedSessionIds:[...v].filter(N=>!E.includes(N)),failures:C.failures}}e(Kr,"unarchiveSessionsViaOfficial");function Yr({triggerRect:n,viewport:s,itemCount:l,measuredHeight:h}){let v=s.width,m=s.height,C=220,E=Math.max(140,m-20),N=Math.min(360,E),F=l===0?44:34*l+8,A=Math.min(N,Math.max(20,typeof h=="number"&&h>0?h:F)),P=n.right+2;P+C>v-10&&(P=Math.max(10,n.left-C-4));let B=n.top-4;if(B+A>m-10){let u=n.bottom+4-A;u>=10?B=u:B=Math.max(10,m-A-10)}return B<10&&(B=10),{top:B,left:P,maxHeight:N}}e(Yr,"computeSubmenuPosition");async function xs(n){ks(n);let s=n.get("remote"),l=e(()=>{},"disposeRemote");return s!==void 0&&(l=await s.$mount(ut)),async()=>{await l()}}e(xs,"apply");function ks(n){n.effect(()=>n.locale.register(qe,{zh:Vr,en:$r,ru:ws}),"dsh-archive-manager: dictionaries");let s=e(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),l={},h,v=e(p=>(h=Aa(p,n.sessions,n.workspaces,{onOpened:e(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:e(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>h?.dispose()),"attachArchiveNavigation");n.effect(()=>v(s()),"archive-manager: explicit archived navigation");let m=e(p=>{if(h===void 0)throw new Kt("navigationUnavailable");return Nr.request(p),h.open(p)},"openConversation"),C=e(async p=>{n.get("layout")?.beginNavigation?.(),Nr.request(p)},"focusSessionWorkspace"),E=e(async(p,b)=>{let _=await n.sessions.search(p,b);if(!_.ok)throw new Error(_.error.message);return _.value},"searchSessions"),N=e(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await Ce(),null}catch(p){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",p),p instanceof Error?p.message:String(p)}},"refreshSessionList"),F=Gr(n.workspaces),A=e(async(p,...b)=>{let _=n.get("remote.workspaceRegistry");if(!_||typeof _[p]!="function")throw new Error(n.locale.bind(qe)("service.unavailable"));let Ee=await _[p].apply(_,b);if(!Ee.ok)throw new Error(Ee.error.message);return Ee.value},"registryCall"),P=e(()=>A("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),B=e(()=>A("diagnoseSessionCaches"),"diagnoseSessionCaches"),u=e(p=>A("rebuildSessionCaches",p),"rebuildSessionCaches"),Ce=e(async()=>{if(typeof n.sessions.refresh!="function")throw new Error("Official session list refresh is unavailable");let p=await n.sessions.refresh(),b=n.sessions,_=b.manager;if(_?.listState==="error"&&_.listError)throw new Error(Ue(_.listError));if(b.listState==="error"&&b.listError)throw new Error(Ue(b.listError));let Y=b.list?.getSnapshot?.();if(Y?.state==="error"&&Y.error)throw new Error(Ue(Y.error));if(p&&typeof p=="object"&&"ok"in p&&p.ok===!1)throw new Error(Ue(p.error??"Session list refresh failed"))},"refreshCacheLists"),ze=e((p={})=>A("cleanOrphanSubagents",p??{}),"cleanOrphanSubagents"),pe=e(p=>A("searchArchivedContent",p),"searchArchivedContent"),yt=e(p=>A("searchSessionContent",p),"searchSessionContent"),st=e(p=>A("previewArchivedSession",p),"previewArchivedSession"),tt=e(()=>A("favoriteSessions"),"favoriteSessions"),on=e(p=>A("setSessionFavorite",p),"setSessionFavorite"),pt=kr();pt.bind({favoriteSessions:tt,setSessionFavorite:on});let Ge,ln=xr(n,pt,()=>n.locale.bind(qe),()=>Ge?.isSidebarFavoriteStarEnabled()??!0);n.effect(()=>()=>ln.dispose(),"archive-manager: favorites only filter");let xt=Ua({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:e(p=>n.workspaces.archiveSession(p),"archive"),restore:e(async p=>{await F(p)},"restore"),deleteOne:e(async p=>{let b=n.get("remote.workspaceRegistry");if(!b)throw new Error(n.locale.bind(qe)("service.unavailable"));let _=await b.deleteSession(p);if(!_.ok)throw new Error(_.error.message)},"deleteOne"),getFavorites:tt,refresh:e(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:qn}),Tt=e(async p=>{await F(p),await N()},"unarchiveSession"),q=e(async p=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let _=await b.deleteSession(p);if(!_.ok)throw new Error(_.error.message);await N()},"deleteSession"),Re=e(async(p,b)=>{let _=n.get("remote.workspaceRegistry");if(_===void 0)throw new Error("archive-manager remote service is unavailable");let Y=await _.moveSessionToWorkspace({sessionId:p,targetWorkspaceId:b});if(!Y.ok)throw new Error(Y.error?.message||"move failed");return await N(),Y.value},"moveSession"),ee=e(async p=>er(n.workspaces,p,N),"archiveSessions"),K=e(async p=>{let b=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},_=fn(b.archivedSessionIds,b.items,p);return Kr(n.workspaces,_,N,F)},"unarchiveSessions"),Le=e(async p=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let _=await b.deleteArchivedSessions(p);if(!_.ok)throw new Error(_.error.message);let Y=await N();return{..._.value,refreshError:Y}},"deleteArchivedSessions"),Qe=e(async()=>{let p=n.get("remote.workspaceRegistry");if(p===void 0)throw new Error("archive-manager remote service is unavailable");let b=await p.archivedSessionMetadata();if(!b.ok)throw new Error(b.error.message);return b.value},"archivedSessionMetadata"),M="sidebar.workspaces.session.menu.item",Ie=null,we=new Set,Ke=e(p=>{Ie=p;for(let b of we)b()},"publishDeleteTarget");function it(){return o.useSyncExternalStore(p=>(we.add(p),()=>{we.delete(p)}),()=>Ie,()=>Ie)}e(it,"useDeleteRequest");function Je({sessionId:p,displayTitle:b,useMenuOpenState:_,t:Y}){let[,Ee]=_(),ie=c.MenuItemButton,De=(0,a.jsx)(c.IconTrashOutlineRegular,{size:14}),je=e(()=>{Ee(!1),Ke({sessionId:p,title:b})},"onSelect");return typeof ie=="function"?(0,a.jsx)(ie,{danger:!0,icon:De,onSelect:je,children:Y("menu.deleteSession")}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:je,children:Y("menu.deleteSession")})}e(Je,"DeleteSessionMenuItem");function At({sessionId:p,favoriteRow:b,useMenuOpenState:_,t:Y}){let[,Ee]=_(),ie=(0,o.useSyncExternalStore)(b.subscribe,b.getSnapshot),De=ie.ready&&ie.ids.has(p),je=e(()=>{Ee(!1),b.toggle(p)},"onSelect"),me=c.MenuItemButton,Pe=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:De?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:ne})}),Oe=Y(De?"organizer.unfavorite":"organizer.favorite");return typeof me=="function"?(0,a.jsx)(me,{icon:Pe,onSelect:je,children:Oe}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:je,children:Oe})}e(At,"FavoriteMenuItem");let Pt=null,Zt=new Set;function It(p,b="success"){Pt={text:p,tone:b,seq:Date.now()};for(let _ of Zt)_()}e(It,"showToast");function _e(){let p=o.useSyncExternalStore(_=>(Zt.add(_),()=>{Zt.delete(_)}),()=>Pt,()=>Pt);if(!p)return null;let b=c.Toast;return typeof b=="function"?(0,a.jsx)(b,{key:p.seq,text:p.text,tone:p.tone,holdMs:3e3,onDone:e(()=>{if(Pt?.seq===p.seq){Pt=null;for(let _ of Zt)_()}},"onDone")}):(0,a.jsx)("div",{key:p.seq,style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:99999,padding:"8px 16px",borderRadius:8,background:p.tone==="danger"?"#7f1d1d":"#14532d",color:"#fff",fontSize:13,boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:p.text})}e(_e,"GlobalToastOverlay");function Wt({sessionId:p,displayTitle:b,useMenuOpenState:_,t:Y}){let[,Ee]=_(),[ie,De]=o.useState(!1),[je,me]=o.useState(null),[Pe,Oe]=o.useState(!1),St=o.useRef(null),gt=o.useRef(null),le=o.useRef(null),ae=n.workspaces.list?.getSnapshot?.()?.items??[],z=c.MenuItemButton,$=e(Q=>{if(!St.current)return;let Te=St.current.getBoundingClientRect(),xe=typeof window<"u"?window.innerWidth:1024,ot=typeof window<"u"?window.innerHeight:768,nt=Yr({triggerRect:Te,viewport:{width:xe,height:ot},itemCount:ae.length,measuredHeight:Q});me(ue=>ue&&ue.top===nt.top&&ue.left===nt.left&&ue.maxHeight===nt.maxHeight?ue:nt)},"updatePosition"),be=e(()=>{le.current&&clearTimeout(le.current),$(),De(!0)},"handleMouseEnter");o.useLayoutEffect(()=>{if(!ie||!gt.current)return;let Q=gt.current.offsetHeight;Q>0&&$(Q)},[ie,ae.length]);let fe=e(()=>{le.current=setTimeout(()=>{De(!1)},180)},"handleMouseLeave"),Fe=e(async(Q,Te)=>{if(!Pe){Oe(!0),De(!1),Ee(!1);try{await Re(p,Q),It(Y("moveSession.success",{name:Te})||`\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C${Te}\u201D`,"success")}catch(xe){let ot=xe instanceof Error?xe.message:String(xe);console.warn("archive-manager: move session failed",xe),It(ot,"danger")}finally{Oe(!1)}}},"handleSelectWorkspace"),Se=(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"})]}),Be=(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"})}),He=(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:8},children:[(0,a.jsx)("span",{children:Y("menu.moveSession")}),Be]}),Me=typeof z=="function"?(0,a.jsx)(z,{icon:Se,onSelect:e(()=>be(),"onSelect"),children:He}):(0,a.jsxs)("button",{type:"button",role:"menuitem",onClick:e(()=>be(),"onClick"),style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 8px",background:"transparent",border:"none",cursor:"pointer",color:"inherit",textAlign:"left"},children:[Se,He]});return(0,a.jsxs)("div",{ref:St,className:"dsham_moveSessionWrap",onMouseEnter:be,onMouseLeave:fe,children:[Me,ie&&je&&typeof document<"u"&&typeof f?.createPortal=="function"&&(0,f.createPortal)((0,a.jsxs)("div",{ref:gt,className:"dsham_moveSubmenu",role:"menu",onPointerDown:e(Q=>{Q.stopPropagation()},"onPointerDown"),onMouseDown:e(Q=>{Q.stopPropagation()},"onMouseDown"),onMouseEnter:be,onMouseLeave:fe,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}),ae.length===0?(0,a.jsx)("div",{style:{padding:"8px 10px",fontSize:"12px",color:"var(--dsw-alias-label-tertiary, #888)"},children:Y("moveSession.noOtherWorkspaces")}):ae.map(Q=>{let Te=Q.title||Q.path||Q.workspaceId;return(0,a.jsxs)("button",{type:"button",role:"menuitem",className:"dsham_moveSubmenuBtn",disabled:Pe,onPointerDown:e(xe=>{xe.preventDefault(),xe.stopPropagation(),Fe(Q.workspaceId,Te)},"onPointerDown"),onClick:e(xe=>{xe.preventDefault(),xe.stopPropagation(),Fe(Q.workspaceId,Te)},"onClick"),children:[(0,a.jsx)("span",{"aria-hidden":!0,style:{display:"inline-flex",flex:"none",marginRight:8},children:(0,a.jsx)(c.IconFolderCloseMedium,{size:14})}),(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},children:Te})]},Q.workspaceId)})]}),document.body)]})}e(Wt,"MoveSessionMenuItem");function gn(p){try{let b=document.querySelector(`[data-row-key="session:${CSS.escape(p)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(gn,"focusSessionRow");function X({t:p}){let b=it(),[_,Y]=(0,o.useState)(!1),[Ee,ie]=(0,o.useState)(null),[De,je]=(0,o.useState)(null),me=(0,o.useRef)(null),Pe=(0,o.useRef)(null),Oe=(0,o.useRef)(null);if((0,o.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){je(null);return}let le=null,ae=e(()=>{if(le&&le.isConnected)return le;try{le=document.querySelector(`[data-row-key="session:${CSS.escape(b.sessionId)}"]`)}catch{le=null}return le},"getTargetRow"),z=e(()=>{let be=me.current,fe=be?.offsetWidth||290,Fe=be?.offsetHeight||160,Se=8,Be=ae();if(!Be){let Te=window.innerWidth,xe=window.innerHeight,ot=Math.max(16,(xe-Fe)/2),nt=Math.max(16,(Te-fe)/2);je(ue=>ue!==null&&ue.top===ot&&ue.left===nt?ue:{top:ot,left:nt});return}let He=Be.getBoundingClientRect(),Me=He.top-4;Me+Fe>window.innerHeight-16&&(Me=window.innerHeight-16-Fe),Me<16&&(Me=16);let Q=He.right+Se;Q+fe>window.innerWidth-16&&(Q=He.left-fe-Se),Q<16&&(Q=16),je(Te=>Te!==null&&Te.top===Me&&Te.left===Q?Te:{top:Me,left:Q})},"updatePosition");z(),window.addEventListener("scroll",z,!0),window.addEventListener("resize",z);let $=null;return typeof ResizeObserver<"u"&&me.current&&($=new ResizeObserver(z),$.observe(me.current)),()=>{$?.disconnect(),window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[b]),(0,o.useEffect)(()=>{if(b===null)return;Pe.current&&!Pe.current.disabled?Pe.current.focus():me.current?.focus();let le=b.sessionId;return()=>{if(!gn(le)){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 c.focusWithoutRing=="function"?c.focusWithoutRing(z):z.focus())}}},[b]),(0,o.useEffect)(()=>{b!==null&&_&&me.current?.focus()},[b,_]),(0,o.useEffect)(()=>{if(b===null)return;let le=e(ae=>{if(ae.key==="Escape"){ae.preventDefault(),ae.stopPropagation(),"stopImmediatePropagation"in ae&&typeof ae.stopImmediatePropagation=="function"&&ae.stopImmediatePropagation(),_||(ie(null),Ke(null));return}if(ae.key==="Tab"){if(ae.preventDefault(),_){me.current?.focus();return}let z=Pe.current,$=Oe.current;if(!z||!$)return;ae.shiftKey?document.activeElement===z?$.focus():z.focus():document.activeElement===$?z.focus():$.focus()}},"onKey");return window.addEventListener("keydown",le,!0),()=>window.removeEventListener("keydown",le,!0)},[b,_]),b===null)return null;let St=e(()=>{_||(ie(null),Ke(null))},"close"),gt=e(()=>{Y(!0),ie(null),q(b.sessionId).then(()=>{Y(!1),Ke(null)}).catch(le=>{Y(!1),ie($n(le,p))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:St}),(0,a.jsxs)("div",{ref:me,role:"dialog","aria-modal":!0,"aria-label":p("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:De?{top:De.top,left:De.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:p("deleteSession.confirmTitle")}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:p("deleteSession.desc",{name:b.title})}),_&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:p("deleteSession.pending")}),Ee!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Ee}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:Pe,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:_,onClick:St,children:p("cancel")}),(0,a.jsx)("button",{ref:Oe,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:_,onClick:gt,children:p("deleteSession.title")})]})]})]})}e(X,"DeleteSessionOverlay");let Ve=null,kt=new Set,G=e(p=>{Ve=p;for(let b of kt)b()},"publishArchiveWsTarget");function Fn(){return o.useSyncExternalStore(p=>(kt.add(p),()=>{kt.delete(p)}),()=>Ve,()=>Ve)}e(Fn,"useArchiveWsRequest");function $e(p){try{let b=document.querySelector(`[data-row-key="workspace:${CSS.escape(p)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e($e,"focusWorkspaceRow");function cn({t:p}){let b=Fn(),[_,Y]=(0,o.useState)(!1),[Ee,ie]=(0,o.useState)(null),[De,je]=(0,o.useState)(null),me=(0,o.useRef)(null),Pe=(0,o.useRef)(null),Oe=(0,o.useRef)(null);if((0,o.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){je(null);return}let le=null,ae=e(()=>{if(le&&le.isConnected)return le;try{le=document.querySelector(`[data-row-key="workspace:${CSS.escape(b.workspaceId)}"]`)}catch{le=null}return le},"getTargetRow"),z=e(()=>{let be=me.current,fe=be?.offsetWidth||290,Fe=be?.offsetHeight||160,Se=8,Be=ae();if(!Be){let Te=window.innerWidth,xe=window.innerHeight,ot=Math.max(16,(xe-Fe)/2),nt=Math.max(16,(Te-fe)/2);je(ue=>ue!==null&&ue.top===ot&&ue.left===nt?ue:{top:ot,left:nt});return}let He=Be.getBoundingClientRect(),Me=He.top-4;Me+Fe>window.innerHeight-16&&(Me=window.innerHeight-16-Fe),Me<16&&(Me=16);let Q=He.right+Se;Q+fe>window.innerWidth-16&&(Q=He.left-fe-Se),Q<16&&(Q=16),je(Te=>Te!==null&&Te.top===Me&&Te.left===Q?Te:{top:Me,left:Q})},"updatePosition");z(),window.addEventListener("scroll",z,!0),window.addEventListener("resize",z);let $=null;return typeof ResizeObserver<"u"&&me.current&&($=new ResizeObserver(z),$.observe(me.current)),()=>{$?.disconnect(),window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[b]),(0,o.useEffect)(()=>{if(b===null)return;Pe.current&&!Pe.current.disabled?Pe.current.focus():me.current?.focus();let le=b.workspaceId;return()=>{$e(le)}},[b]),(0,o.useEffect)(()=>{b!==null&&_&&me.current?.focus()},[b,_]),(0,o.useEffect)(()=>{if(b===null)return;let le=e(ae=>{if(ae.key==="Escape"){ae.preventDefault(),ae.stopPropagation(),"stopImmediatePropagation"in ae&&typeof ae.stopImmediatePropagation=="function"&&ae.stopImmediatePropagation(),_||(ie(null),G(null));return}if(ae.key==="Tab"){if(ae.preventDefault(),_){me.current?.focus();return}let z=Pe.current,$=Oe.current;if(!z||!$)return;ae.shiftKey?document.activeElement===z?$.focus():z.focus():document.activeElement===$?z.focus():$.focus()}},"onKey");return window.addEventListener("keydown",le,!0),()=>window.removeEventListener("keydown",le,!0)},[b,_]),b===null)return null;let St=e(()=>{_||(ie(null),G(null))},"close"),gt=e(()=>{Y(!0),ie(null);let ae=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(fe=>fe.workspaceId===b.workspaceId),z=n.sessions.list?.getSnapshot?.()?.byId??{},$=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),be=(ae?.sessionIds??[]).filter(fe=>Gn(fe,z,$));er(n.workspaces,be,N).then(fe=>{if(Y(!1),fe.failures.length>0){ie(zn(fe.failures,p));return}G(null)}).catch(fe=>{Y(!1),ie(Tr(fe,p))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:St}),(0,a.jsxs)("div",{ref:me,role:"dialog","aria-modal":!0,"aria-label":p("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:De?{top:De.top,left:De.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:p("archiveWorkspace.title",{n:b.count})}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:p("archiveWorkspace.desc",{name:b.title})}),_&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:p("archiveWorkspace.pending")}),Ee!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Ee}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:Pe,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:_,onClick:St,children:p("cancel")}),(0,a.jsx)("button",{ref:Oe,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:_,onClick:gt,children:p("archiveWorkspace.confirm")})]})]})]})}e(cn,"ArchiveWorkspaceOverlay");function Rt(p){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let b=null,_=!1,Y=new Map,Ee=!1,ie=e(z=>{let be=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Se=>Se.workspaceId===z);if(be===void 0)return[];let fe=n.sessions.list?.getSnapshot?.()?.byId??{},Fe=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return be.sessionIds.filter(Se=>Gn(Se,fe,Fe))},"workspaceCandidateIds"),De=e(()=>{if(Ee=!1,!_)for(let[z,$]of Y){if(!z.isConnected){Y.delete(z);continue}let be=ie($.workspaceId).length===0;z.disabled=be,z.style.opacity=be?"0.5":"",z.style.cursor=be?"not-allowed":""}},"revalidateItems"),je=e(()=>{if(Y.size===0||Ee||_)return;Ee=!0;let z=e(()=>De(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(z):setTimeout(z,16)},"scheduleRevalidate"),me=e(z=>{b=Ar(z.target)},"rememberWorkspace");document.addEventListener("pointerdown",me,!0),document.addEventListener("click",me,!0);let Pe=e(()=>{if(_)return;for(let[$]of Y)$.isConnected||Y.delete($);let z=document.querySelectorAll('[role="menu"]');for(let $ of z){if($.querySelector('[data-dsham-archive-workspace="true"]'))continue;let be=Array.from($.querySelectorAll('button[role="menuitem"]'));if(be.length===0)continue;let fe=be.find(ye=>Yn(ye,!1))??be.find(ye=>Yn(ye,!0));if(!fe)continue;let Fe=be.find(ye=>ye!==fe)??fe,Se=fe.parentElement;if(!Se)continue;let Be=b;if(!Be)continue;let Me=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ye=>ye.workspaceId===Be.workspaceId),Q=Me?.path??Me?.cwd,xe=ie(Be.workspaceId).length,ot=document.createElement("div");ot.className=Se.className;let nt=Fe.className.split(/\s+/).filter(ye=>!/(?:^|[_-])danger(?:$|[_-])/i.test(ye)).join(" "),ue=document.createElement("button");ue.type="button",ue.setAttribute("role","menuitem"),ue.dataset.dshamArchiveWorkspace="true",ue.className=nt;let Ft=Fe.querySelector("span"),$t=Fe.querySelectorAll("span")[1],Xt=document.createElement("span");Xt.setAttribute("aria-hidden","true"),Ft?.className&&(Xt.className=Ft.className),Xt.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 kn=document.createElement("span");if($t?.className&&(kn.className=$t.className),kn.textContent=p("menu.archiveWorkspace"),ue.append(Xt,kn),ot.append(ue),xe===0&&(ue.disabled=!0,ue.style.opacity="0.5",ue.style.cursor="not-allowed"),ue.addEventListener("click",ye=>{ye.preventDefault(),ye.stopPropagation();let rt=ie(Be.workspaceId).length;rt!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),G({workspaceId:Be.workspaceId,title:Be.title,count:rt}))}),Q){let ye=document.createElement("div");ye.className=Se.className;let rt=document.createElement("button");rt.type="button",rt.setAttribute("role","menuitem"),rt.dataset.dshamCopyWorkspacePath="true",rt.className=nt,rt.disabled=!1,rt.style.opacity="",rt.style.cursor="";let Qt=document.createElement("span");Qt.setAttribute("aria-hidden","true"),Ft?.className&&(Qt.className=Ft.className),Qt.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 dn=document.createElement("span");$t?.className&&(dn.className=$t.className),dn.textContent=p("menu.copyWorkspacePath"),rt.append(Qt,dn),ye.append(rt),rt.addEventListener("click",Mt=>{Mt.preventDefault(),Mt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),cr(Q).catch(()=>{})});let un=document.createElement("div");un.className=Se.className;let Et=document.createElement("button");Et.type="button",Et.setAttribute("role","menuitem"),Et.dataset.dshamOpenExplorer="true",Et.className=nt,Et.disabled=!1,Et.style.opacity="",Et.style.cursor="";let lt=document.createElement("span");lt.setAttribute("aria-hidden","true"),Ft?.className&&(lt.className=Ft.className),lt.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 en=document.createElement("span");$t?.className&&(en.className=$t.className),en.textContent=p("menu.openInExplorer"),Et.append(lt,en),un.append(Et),Et.addEventListener("click",Mt=>{Mt.preventDefault(),Mt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),(async()=>{try{let Bt=await fetch(Rn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:Q})}).catch(()=>null);if(Bt&&Bt.ok)return}catch{}try{await wt("/open-in-explorer",{method:"POST",body:JSON.stringify({path:Q,workspaceId:Be.workspaceId})})}catch(Bt){console.warn("archive-manager: open in explorer failed",Bt)}})()}),Se.parentNode?.insertBefore(ye,Se),Se.parentNode?.insertBefore(un,Se)}Se.parentNode?.insertBefore(ot,Se),Y.set(ue,{workspaceId:Be.workspaceId})}},"checkAndInject"),Oe=!1,St=e(()=>{if(Oe||_)return;Oe=!0;let z=e(()=>{Oe=!1,!_&&Pe()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(z):setTimeout(z,16)},"scheduleInject"),gt=new MutationObserver(z=>{Pn(z,'[role="menu"]')&&St()});gt.observe(document.body,{childList:!0,subtree:!0});let le=n.sessions.list?.subscribe?.(je),ae=n.workspaces.list?.subscribe?.(je);return()=>{_=!0,document.removeEventListener("pointerdown",me,!0),document.removeEventListener("click",me,!0),gt.disconnect(),le?.(),ae?.(),Y.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(Rt,"setupWorkspaceMenuInjector");function vn(){return typeof n.slots.entries!="function"?!1:n.slots.entries("sidebar.workspaces").some(p=>p.children?.[M]!==void 0)}e(vn,"hostSidebarDeclaresSessionMenu");let mt,qt,jt,bn,yn,wn,Vt,Sn=e(()=>{let p=vn()?"menu":"waiting";p!==mt&&(mt=p,p==="menu"&&(qt??=n.slots.inject(M,()=>n.slots.register({name:M,id:"archive-manager.delete-session",order:500,locale:qe,inject:e(()=>({}),"inject")},Je)),jt??=n.slots.inject(M,()=>n.slots.register({name:M,id:"archive-manager.favorite",order:50,locale:qe,inject:e(()=>({favoriteRow:pt}),"inject")},At)),bn??=n.slots.inject(M,()=>n.slots.register({name:M,id:"archive-manager.move-session",order:480,locale:qe,inject:e(()=>({}),"inject")},Wt)),yn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:qe,inject:e(()=>({t:n.locale.bind(qe)}),"inject")},X)),wn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.archive-workspace",locale:qe,inject:e(()=>({t:n.locale.bind(qe)}),"inject")},cn)),Vt??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.toast",locale:qe,inject:e(()=>({}),"inject")},_e))))},"reconcileSidebar");Sn(),n.effect(()=>Rt(n.locale.bind(qe)),"archive-manager: workspace menu injector"),n.effect(()=>jr(),"archive-manager: sidebar row contextmenu trigger"),zr(n);let Nt=typeof n.on=="function"?n.on("slots/changed",p=>{if(p==="sidebar.workspaces")try{Sn()}catch(b){console.warn("archive-manager: sidebar mode switch failed",b)}}):void 0;n.effect(()=>()=>{Nt?.(),qt?.(),jt?.(),bn?.(),yn?.(),wn?.(),Vt?.()},"archive-manager: sidebar mode");let ft=e(()=>({archiveSessions:ee,archiveSession:e((p,b)=>n.workspaces.archiveSession(p,b),"archiveSession"),sessionStore:Qn(n.sessions.list),workspaceStore:Qn(n.workspaces.list),unarchiveSession:Tt,deleteSession:q,unarchiveSessions:K,deleteArchivedSessions:Le,archivedSessionMetadata:Qe,openConversation:m,focusSessionWorkspace:C,viewState:l,favoriteSessions:tt,setSessionFavorite:on,favoriteSync:pt,organizeBatch:xt,diagnoseOrphanSubagents:P,cleanOrphanSubagents:ze,diagnoseSessionCaches:B,rebuildSessionCaches:u,refreshCacheLists:Ce,searchSessionContent:yt,searchArchivedContent:pe,previewArchivedSession:st,t:n.locale.bind(qe)}),"buildArchivedSectionProps"),wt=e(async(p,b)=>{let _=Rn(`/api/michengai/dsh-archive-manager${p}`),Y=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},b?.headers),Ee=await fetch(_,Object.assign({},b,{headers:Y})),ie=await Ee.json();if(!Ee.ok||!ie||ie.ok===!1)throw new Error((ie&&typeof ie=="object"&&typeof ie.error=="string"?ie.error:void 0)||`HTTP ${Ee.status}`);return ie},"callSettingsApi"),Dt=null,Ct=!1,Jt=e(()=>{if(!(!Ct||Dt)&&!(Ge&&!Ge.isSettingsSectionEnabled()))try{let p=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(qe)("archived.badge"),"label"),icon:"archive",locale:qe,inject:ft},Dn);Dt=typeof p=="function"?p:()=>{}}catch(p){console.warn("archive-manager: register settings.section failed:",p),Dt=null}},"mountSettingsSection"),Ot=e(()=>{if(Dt){try{Dt()}catch{}Dt=null}},"unmountSettingsSection"),xn=e(()=>{Ge?.isSettingsSectionEnabled?.()??!0?Jt():Ot()},"syncSettingsSection");Ge=vr(n,{callApi:wt,renderPanel:e(p=>(0,a.jsx)(Dn,Object.assign({},ft(),p)),"renderPanel"),injectProps:ft,ns:qe,onOnlineUpdateChange:e(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange"),onSidebarFavoriteStarChange:e(p=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-favorite-star-toggle",{detail:{enabled:p}}))},"onSidebarFavoriteStarChange"),onLocationChange:e(()=>{xn()},"onLocationChange")}),n.effect(()=>()=>{Ge?.destroy(),Ot()},"archive-manager: sidebar entry"),n.effect(()=>Oa({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:V,isEnabled:e(()=>Ge.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>{Ct=!0;try{if(Ge&&!Ge.isSettingsSectionEnabled())return()=>{Ct=!1,Ot()};let p=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(qe)("archived.badge"),"label"),icon:"archive",locale:qe,inject:ft},Dn);return Dt=typeof p=="function"?p:()=>{},()=>{Ct=!1,Ot()}}catch(p){return console.warn("archive-manager: register settings.section failed:",p),()=>{Ct=!1}}})}e(ks,"applyWorkspaceBrowser");async function Cs(n,s,l,h){try{await s(n)}catch(v){l(es(v,h))}}return e(Cs,"forkWithFeedback"),i.__test={computeSubmenuPosition:Yr,forkWithFeedback:Cs,favoritesOnlyVisibility:wr,favoriteGroupPredicate:Sr,createFavoriteRowStore:kr,unarchivedSessionIds:Ur,ArchiveSelectionToolbar:Lr,ArchivedSessionsSection:Dn,zh:Vr,en:$r,displayTitle:et,isUnknownSessionError:Mn,deriveArchivedGroups:Wr,sortArchivedGroups:qr,deriveArchivedBatchIds:fn,archivedSessionIdsInGroups:Fr,pruneArchivedSelection:Br,toggleArchivedSelection:Xn,archivedDeleteFeedback:Hr,isWorkspaceTaskCandidate:Gn,isWorkspaceDeleteMenuItem:Yn,workspaceMenuTriggerFrom:Ar,findRowMenuButton:Kn,isRowMenuButton:Rr,setupSidebarRowContextMenu:jr,applySettingsNavIcon:Dr,restoreSettingsNavIcon:Mr,installSettingsNavIcon:zr,mutationTouches:Pn,resolveRowHasStatus:Yt,activeSessionActivity:Ln,activeSessionRefusal:Ir,activeArchiveFromMessage:_r,archiveSessionsViaOfficial:er,unarchiveSessionsViaOfficial:Kr,createUnarchiveSession:Gr,bindObservable:Qn,ARCHIVE_MANAGER_REMOTE:ut,currentSessionId:qn,setupSidebarEntry:vr,ArchiveBundleConfigCard:fr,ArchiveBundleConfigCardWrapper:gr,setupWorkspaceFavoritesOnly:xr},i.apply=xs,i.inject=Ss,r.exports}e(pi,"startArchiveClient");
24
25
 
25
26
  return module.exports.startArchiveClient(require);
26
27
  }