ai-agent-session-center 2.10.12 → 2.10.15

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.
@@ -0,0 +1 @@
1
+ import{x,h as i,k as e,m as A}from"./index-B1i4xmXp.js";const P="_container_3h9eq_6",F="_filterBar_3h9eq_15",$="_toggleLabel_3h9eq_42",U="_taskList_3h9eq_61",Y="_groupHeader_3h9eq_69",G="_groupChevron_3h9eq_78",V="_collapsed_3h9eq_86",W="_groupLabel_3h9eq_90",K="_groupCount_3h9eq_99",z="_taskCard_3h9eq_107",J="_completed_3h9eq_124",Q="_taskTitle_3h9eq_128",X="_overdue_3h9eq_133",Z="_dueToday_3h9eq_138",ee="_checkbox_3h9eq_145",te="_taskContent_3h9eq_160",se="_taskHeader_3h9eq_165",ae="_taskTitleInput_3h9eq_189",ne="_priorityBadge_3h9eq_204",oe="_priorityUrgent_3h9eq_231",le="_priorityHigh_3h9eq_237",ie="_priorityMedium_3h9eq_243",re="_priorityLow_3h9eq_249",ce="_taskMeta_3h9eq_257",de="_dueDate_3h9eq_265",ue="_dueDateOverdue_3h9eq_271",pe="_dueDateToday_3h9eq_275",he="_tag_3h9eq_279",ge="_tagInput_3h9eq_294",me="_addTagBtn_3h9eq_307",_e="_description_3h9eq_327",fe="_descriptionToggle_3h9eq_337",ve="_deleteBtn_3h9eq_354",xe="_addForm_3h9eq_375",ye="_titleInput_3h9eq_418",Ce="_tagsInput_3h9eq_423",je="_addBtn_3h9eq_428",Te="_emptyState_3h9eq_454",ke="_loading_3h9eq_475",De="_stats_3h9eq_488",be="_statsSep_3h9eq_498",we="_confirmOverlay_3h9eq_504",qe="_confirmBtn_3h9eq_513",Se="_cancelBtn_3h9eq_528",s={container:P,filterBar:F,toggleLabel:$,taskList:U,groupHeader:Y,groupChevron:G,collapsed:V,groupLabel:W,groupCount:K,taskCard:z,completed:J,taskTitle:Q,overdue:X,dueToday:Z,checkbox:ee,taskContent:te,taskHeader:se,taskTitleInput:ae,priorityBadge:ne,priorityUrgent:oe,priorityHigh:le,priorityMedium:ie,priorityLow:re,taskMeta:ce,dueDate:de,dueDateOverdue:ue,dueDateToday:pe,tag:he,tagInput:ge,addTagBtn:me,description:_e,descriptionToggle:fe,deleteBtn:ve,addForm:xe,titleInput:ye,tagsInput:Ce,addBtn:je,emptyState:Te,loading:ke,stats:De,statsSep:be,confirmOverlay:we,confirmBtn:qe,cancelBtn:Se},Ne=[{value:"all",label:"All priorities"},{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Be=[{value:"priority",label:"Priority"},{value:"dueDate",label:"Due date"},{value:"createdAt",label:"Created"}];function Ie(){const t=x(n=>n.filter),l=x(n=>n.setFilter),o=x(n=>n.tasks),c=i.useMemo(()=>{const n=new Set;for(const d of o.values())for(const v of d.tags)v&&n.add(v);return[...n].sort((d,v)=>d.localeCompare(v))},[o]),u=i.useCallback(n=>l({search:n}),[l]),p=i.useCallback(n=>l({priority:n.target.value}),[l]),_=i.useCallback(n=>l({tag:n.target.value}),[l]),g=i.useCallback(n=>l({sortBy:n.target.value}),[l]),f=i.useCallback(()=>l({showCompleted:!t.showCompleted}),[l,t.showCompleted]);return e.jsxs("div",{className:s.filterBar,children:[e.jsx(A,{value:t.search,onChange:u,placeholder:"Search tasks...",debounceMs:200}),e.jsx("select",{value:t.priority,onChange:p,children:Ne.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),e.jsxs("select",{value:t.tag,onChange:_,disabled:c.length===0,children:[e.jsx("option",{value:"all",children:"All tags"}),c.map(n=>e.jsxs("option",{value:n,children:["#",n]},n))]}),e.jsx("select",{value:t.sortBy,onChange:g,children:Be.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),e.jsxs("label",{className:s.toggleLabel,children:[e.jsx("input",{type:"checkbox",checked:t.showCompleted,onChange:f}),"Show completed"]})]})}const Le={urgent:s.priorityUrgent,high:s.priorityHigh,medium:s.priorityMedium,low:s.priorityLow},Oe=["low","medium","high","urgent"];function Re(t){if(!t)return null;const l=new Date;l.setHours(0,0,0,0);const o=new Date(t+"T00:00:00");return o<l?"overdue":o.getTime()===l.getTime()?"today":"future"}function Ee(t){return new Date(t+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric"})}function N({task:t}){const l=x(a=>a.toggleTask),o=x(a=>a.updateTask),c=x(a=>a.deleteTask),[u,p]=i.useState(!1),[_,g]=i.useState(t.title),[f,n]=i.useState(!1),[d,v]=i.useState(""),[j,r]=i.useState(!1),[y,m]=i.useState(!1),T=i.useRef(null),b=i.useRef(null);i.useEffect(()=>{u&&(T.current?.focus(),T.current?.select())},[u]),i.useEffect(()=>{f&&b.current?.focus()},[f]),i.useEffect(()=>{u||g(t.title)},[t.title,u]);const k=i.useCallback(()=>{p(!1);const a=_.trim();a&&a!==t.title?o(t.id,{title:a}):g(t.title)},[_,t.id,t.title,o]),w=i.useCallback(()=>{l(t.id)},[l,t.id]),h=i.useCallback(()=>{c(t.id),m(!1)},[c,t.id]),C=i.useCallback(()=>{v(t.tags.join(", ")),n(!0)},[t.tags]),R=i.useCallback(a=>{o(t.id,{priority:a.target.value})},[t.id,o]),S=i.useCallback(()=>{n(!1);const a=d.split(",").map(M=>M.trim()).filter(Boolean),E=t.tags.join(","),H=a.join(",");E!==H&&o(t.id,{tags:a})},[d,t.id,t.tags,o]),D=Re(t.dueDate),q=[s.taskCard];return t.completed&&q.push(s.completed),!t.completed&&D==="overdue"&&q.push(s.overdue),!t.completed&&D==="today"&&q.push(s.dueToday),e.jsxs("div",{className:q.join(" "),children:[e.jsx("input",{type:"checkbox",className:s.checkbox,checked:t.completed,onChange:w,"aria-label":`Mark "${t.title}" as ${t.completed?"incomplete":"complete"}`}),e.jsxs("div",{className:s.taskContent,children:[e.jsxs("div",{className:s.taskHeader,children:[u?e.jsx("input",{ref:T,className:s.taskTitleInput,value:_,onChange:a=>g(a.target.value),onBlur:k,onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),k()),a.key==="Escape"&&(g(t.title),p(!1))},onClick:a=>a.stopPropagation()}):e.jsx("span",{className:s.taskTitle,onClick:()=>{g(t.title),p(!0)},title:"Click to edit",children:t.title}),e.jsx("select",{className:`${s.priorityBadge} ${Le[t.priority]}`,value:t.priority,onChange:R,onClick:a=>a.stopPropagation(),title:"Change priority",children:Oe.map(a=>e.jsx("option",{value:a,children:a.toUpperCase()},a))})]}),e.jsxs("div",{className:s.taskMeta,children:[t.dueDate&&e.jsxs("span",{className:`${s.dueDate} ${D==="overdue"?s.dueDateOverdue:""} ${D==="today"?s.dueDateToday:""}`,children:[D==="overdue"&&"Overdue: ",D==="today"&&"Today: ",Ee(t.dueDate)]}),f?e.jsx("input",{ref:b,className:s.tagInput,value:d,onChange:a=>v(a.target.value),onBlur:S,onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),S()),a.key==="Escape"&&n(!1)},onClick:a=>a.stopPropagation(),placeholder:"tag1, tag2, ..."}):e.jsxs(e.Fragment,{children:[t.tags.map(a=>e.jsx("span",{className:s.tag,onClick:C,title:"Click to edit tags",style:{cursor:"pointer"},children:a},a)),e.jsx("button",{className:s.addTagBtn,onClick:C,title:"Add / edit tags",children:"+"})]})]}),t.description&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:s.descriptionToggle,onClick:()=>r(a=>!a),children:j?"- Hide details":"+ Show details"}),j&&e.jsx("div",{className:s.description,children:t.description})]})]}),y?e.jsxs("div",{className:s.confirmOverlay,children:[e.jsx("span",{children:"Delete?"}),e.jsx("button",{className:s.confirmBtn,onClick:h,children:"Yes"}),e.jsx("button",{className:s.cancelBtn,onClick:()=>m(!1),children:"No"})]}):e.jsx("button",{className:s.deleteBtn,onClick:()=>m(!0),"aria-label":`Delete "${t.title}"`,title:"Delete task",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})}function He(){const t=x(d=>d.createTask),[l,o]=i.useState(""),[c,u]=i.useState("medium"),[p,_]=i.useState(""),[g,f]=i.useState(""),n=i.useCallback(d=>{d.preventDefault();const v=l.trim();if(!v)return;const j=g.split(",").map(r=>r.trim()).filter(Boolean);t({title:v,priority:c,tags:j,dueDate:p||void 0}),o(""),u("medium"),_(""),f("")},[l,c,p,g,t]);return e.jsxs("form",{className:s.addForm,onSubmit:n,children:[e.jsx("input",{type:"text",className:s.titleInput,placeholder:"New task title...",value:l,onChange:d=>o(d.target.value),required:!0}),e.jsxs("select",{value:c,onChange:d=>u(d.target.value),children:[e.jsx("option",{value:"urgent",children:"Urgent"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"low",children:"Low"})]}),e.jsx("input",{type:"date",value:p,onChange:d=>_(d.target.value),title:"Due date (optional)"}),e.jsx("input",{type:"text",className:s.tagsInput,placeholder:"Tags (comma-sep)",value:g,onChange:d=>f(d.target.value)}),e.jsx("button",{type:"submit",className:s.addBtn,disabled:!l.trim(),children:"ADD"})]})}const B=["urgent","high","medium","low"],I={urgent:0,high:1,medium:2,low:3},Me={urgent:"Urgent",high:"High",medium:"Medium",low:"Low"};function Ae(t,l,o,c){if(o!=="all"&&t.priority!==o||c!=="all"&&!t.tags.includes(c))return!1;if(l){const u=l.toLowerCase(),p=t.title.toLowerCase().includes(u),_=(t.description??"").toLowerCase().includes(u);if(!p&&!_)return!1}return!0}function L(t,l){return[...t].sort((o,c)=>{if(l==="priority"){const u=I[o.priority],p=I[c.priority];return u!==p?u-p:new Date(c.createdAt).getTime()-new Date(o.createdAt).getTime()}return l==="dueDate"?!o.dueDate&&!c.dueDate?0:o.dueDate?c.dueDate?o.dueDate.localeCompare(c.dueDate):-1:1:new Date(c.createdAt).getTime()-new Date(o.createdAt).getTime()})}function O({label:t,count:l,collapsed:o,onToggle:c}){return e.jsxs("div",{className:s.groupHeader,onClick:c,children:[e.jsx("svg",{className:`${s.groupChevron} ${o?s.collapsed:""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),e.jsx("span",{className:s.groupLabel,children:t}),e.jsx("span",{className:s.groupCount,children:l})]})}function Fe(){const t=x(r=>r.tasks),l=x(r=>r.loading),o=x(r=>r.filter),c=x(r=>r.fetchTasks),[u,p]=i.useState(new Set);i.useEffect(()=>{c()},[c]);const _=i.useCallback(r=>{p(y=>{const m=new Set(y);return m.has(r)?m.delete(r):m.add(r),m})},[]),{groups:g,completedTasks:f,totalIncomplete:n,totalCompleted:d}=i.useMemo(()=>{const y=[...t.values()].filter(h=>Ae(h,o.search,o.priority,o.tag)),m=y.filter(h=>!h.completed),T=y.filter(h=>h.completed),b=L(m,o.sortBy),k=new Map;for(const h of B)k.set(h,[]);for(const h of b){const C=k.get(h.priority);C&&C.push(h)}const w=[];for(const h of B){const C=k.get(h)??[];C.length>0&&w.push({id:h,label:Me[h],tasks:C})}return{groups:w,completedTasks:L(T,o.sortBy),totalIncomplete:m.length,totalCompleted:T.length}},[t,o]);if(l)return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.loading,children:"Loading tasks..."})});const v=g.length===0&&f.length===0,j=t.size===0;return e.jsxs("div",{className:s.container,"data-testid":"agenda-view",children:[e.jsx(Ie,{}),e.jsxs("div",{className:s.stats,children:[e.jsxs("span",{children:[n," task",n!==1?"s":""]}),e.jsx("span",{className:s.statsSep,children:"|"}),e.jsxs("span",{children:[d," completed"]})]}),e.jsx("div",{className:s.taskList,children:j?e.jsxs("div",{className:s.emptyState,children:[e.jsx("div",{children:"No tasks yet"}),e.jsx("span",{children:"Add your first task below"})]}):v?e.jsxs("div",{className:s.emptyState,children:[e.jsx("div",{children:"No tasks match the current filter"}),e.jsx("span",{children:"Try adjusting your search or filter criteria"})]}):e.jsxs(e.Fragment,{children:[g.map(r=>{const y=u.has(r.id);return e.jsxs("div",{children:[e.jsx(O,{label:r.label,count:r.tasks.length,collapsed:y,onToggle:()=>_(r.id)}),!y&&r.tasks.map(m=>e.jsx(N,{task:m},m.id))]},r.id)}),o.showCompleted&&f.length>0&&e.jsxs("div",{children:[e.jsx(O,{label:"Completed",count:f.length,collapsed:u.has("__completed__"),onToggle:()=>_("__completed__")}),!u.has("__completed__")&&f.map(r=>e.jsx(N,{task:r},r.id))]})]})}),e.jsx(He,{})]})}export{Fe as default};
@@ -1,4 +1,4 @@
1
- import{U as _r,B as Mm,N as xr,C as Yl,V as wn,D as Ot,F as Ff,M as ki,E as ft,R as Tm,G as Yt,H as Vt,I as Uu,J as Rl,W as Du,K as Hr,L as tn,O as fo,Q as ci,T as Sr,X as dr,Y as mo,Z as xo,_ as F_,$ as Ta,a0 as Iu,a1 as ym,a2 as br,a3 as va,a4 as Xt,a5 as Am,a6 as kt,a7 as si,a8 as Cm,a9 as vl,aa as Dr,ab as ma,ac as ba,ad as go,ae as Bi,af as ps,ag as O_,ah as Rm,ai as vo,aj as Vn,ak as wl,al as pa,am as hs,an as wm,ao as Pm,ap as co,aq as Lm,ar as Um,as as Dm,at as Im,au as Nm,av as Fm,aw as Om,ax as km,ay as Bm,az as Gm,aA as zm,aB as Hm,aC as Vm,aD as Wm,aE as jm,aF as Xm,aG as Ym,aH as _l,aI as os,aJ as qm,aK as Fi,aL as Km,aM as Zm,aN as ql,aO as Qm,aP as Kl,aQ as Jm,aR as $m,aS as eg,aT as Of,aU as Ut,aV as kf,aW as Bf,aX as ui,aY as _a,aZ as po,a_ as ho,a$ as li,b0 as ga,b1 as oi,b2 as Gf,b3 as tg,b4 as zf,b5 as Hf,b6 as Vf,b7 as ms,b8 as Wf,b9 as jf,ba as Xf,bb as bo,bc as ng,bd as rg,be as ig,bf as ag,bg as Yf,bh as og,bi as sg,bj as lg,bk as Sl,bl as xl,bm as bl,bn as El,bo as Nu,bp as Fu,bq as Ou,br as ku,bs as Bu,bt as Gu,bu as zu,bv as Hu,bw as Vu,bx as Wu,by as ju,bz as Xu,bA as Yu,bB as qu,bC as Ku,bD as Zu,bE as Qu,bF as Ju,bG as $u,bH as ef,bI as tf,bJ as nf,bK as rf,bL as af,bM as of,bN as sf,bO as lf,bP as cf,bQ as uf,bR as ff,bS as df,bT as pf,bU as Pl,bV as Ll,bW as Ul,bX as Dl,bY as Il,bZ as Nl,b_ as Fl,b$ as cg,c0 as hf,c1 as ug,c2 as cs,c3 as fg,c4 as mf,c5 as gf,c6 as Ol,c7 as kl,c8 as Bl,c9 as qf,ca as Kf,cb as _s,cc as dg,cd as pg,ce as hg,cf as Zf,cg as ph,ch as Qf,ci as Jf,cj as $f,ck as ed,cl as Ss,cm as td,cn as nd,co as rd,cp as hh,cq as id,cr as _o,cs as Ea,ct as ad,cu as mg,cv as gg,cw as k_,cx as vf,cy as Kn,cz as Gl,cA as vg,cB as _g,cC as B_,cD as Sg,cE as xg,cF as bg,cG as od,cH as Eg,cI as Mg,cJ as G_,cK as z_,cL as H_,cM as V_,cN as W_,cO as j_,cP as X_,cQ as Y_,cR as q_,cS as K_,cT as Z_,cU as Q_,cV as J_,cW as $_,cX as eS,cY as tS,cZ as nS,c_ as rS,c$ as iS,d0 as Tg,d1 as aS,d2 as oS,d3 as sS,d4 as lS,d5 as sd,d6 as cS,d7 as uS,d8 as fS,d9 as dS,da as pS,db as hS,dc as mS,dd as gS,de as vS,df as _S,dg as yg,dh as SS,di as xS,dj as bS,dk as ES,dl as MS,dm as TS,dn as yS,dp as AS,dq as CS,dr as RS,ds as wS,dt as PS,du as LS,dv as US,dw as DS,dx as IS,dy as NS,dz as FS,dA as OS,dB as kS,dC as BS,dD as GS,dE as zS,dF as HS,dG as VS,dH as WS,dI as jS,dJ as XS,dK as YS,dL as qS,dM as ua,dN as KS,dO as ZS,dP as QS,dQ as JS,dR as $S,dS as ex,dT as _f,dU as tx,dV as nx,dW as rx,dX as ix,dY as ax,dZ as ox,d_ as sx,d$ as lx,e0 as cx,e1 as ux,e2 as fx,e3 as dx,e4 as px,e5 as hx,e6 as mx,e7 as gx,e8 as Ag,e9 as Cg,ea as vx,eb as _x,ec as Sx,ed as xx,ee as bx,ef as Ex,eg as Mx,eh as Tx,ei as yx,ej as Ax,ek as Cx,el as Rx,em as wx,en as Px,eo as Lx,ep as Ux,eq as Dx,er as Ix,es as Nx,et as Fx,eu as Ox,ev as kx,ew as Rg,ex as Bx,ey as Gx,ez as zx,eA as Hx,eB as wg,eC as Vx,eD as Wx,eE as jx,eF as Xx,eG as Yx,eH as qx,eI as Kx,eJ as Zx,eK as Qx,eL as Jx,eM as $x,eN as fa,eO as eb,eP as tb,eQ as Sf,eR as nb,eS as rb,eT as ib,eU as ab,eV as ob,eW as sb,eX as fr,eY as lb,eZ as cb,e_ as ub,e$ as fb,f0 as db,f1 as pb,f2 as hb,f3 as mb,f4 as gb,f5 as vb,f6 as _b,f7 as Sb,f8 as xb,f9 as bb,fa as Eb,fb as Mb,fc as Tb,fd as yb,fe as Pg,ff as Ab,fg as Cb,fh as Rb,fi as wb,fj as Pb,fk as Lb,fl as Ub,fm as zl,fn as Db,fo as Ib,fp as Lg,fq as Nb,fr as Fb,fs as Ob,ft as Ug,fu as Dg,fv as kb,fw as Bb,fx as Gb,fy as zb,fz as Hb,fA as Ig,fB as Vb,fC as Wb,fD as jb,fE as Xb,fF as Yb,fG as qb,fH as Kb,fI as Zb,fJ as Qb,fK as Ng,fL as Jb,fM as xf,fN as $b,fO as eE,fP as tE,fQ as nE,fR as rE,fS as iE,fT as aE,fU as oE,fV as sE,fW as lE,fX as cE,fY as uE,fZ as fE,f_ as dE,f$ as da,g0 as pE,g1 as hE,g2 as mE,g3 as gE,g4 as vE,g5 as _E,g6 as SE,g7 as xE,g8 as bE,g9 as EE,ga as ME,gb as TE,gc as yE,gd as AE,ge as CE,gf as RE,gg as wE,gh as PE,gi as LE,gj as UE,gk as DE,gl as IE,gm as NE,gn as FE,go as OE,gp as kE,gq as BE,gr as GE,gs as zE,gt as HE,gu as VE,gv as WE,gw as Fg,gx as jE,gy as Og,gz as XE,h as oe,k as Q,gA as ld,gB as YE,gC as qE,gD as fi,gE as oa,gF as kg,gG as KE,gH as ol,gI as mh,gJ as ZE,gK as QE,gL as JE,gM as $E,gN as Zl,gO as sl,gP as Ml,gQ as kn,gR as es,gS as gh,gT as bf,gU as du,gV as e1,gW as t1,gX as n1,gY as r1,gZ as Hl,w as vh,g_ as i1,g$ as a1,h0 as o1,h1 as s1,h2 as l1,h3 as c1,h4 as u1,h5 as f1,h6 as d1}from"./index-ZH9kWQk6.js";function Bg(){let n=null,r=!1,s=null,l=null;function a(i,f){s(i,f),l=n.requestAnimationFrame(a)}return{start:function(){r!==!0&&s!==null&&(l=n.requestAnimationFrame(a),r=!0)},stop:function(){n.cancelAnimationFrame(l),r=!1},setAnimationLoop:function(i){s=i},setContext:function(i){n=i}}}function p1(n){const r=new WeakMap;function s(u,d){const p=u.array,h=u.usage,v=p.byteLength,S=n.createBuffer();n.bindBuffer(d,S),n.bufferData(d,p,h),u.onUploadCallback();let b;if(p instanceof Float32Array)b=n.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)b=n.HALF_FLOAT;else if(p instanceof Uint16Array)u.isFloat16BufferAttribute?b=n.HALF_FLOAT:b=n.UNSIGNED_SHORT;else if(p instanceof Int16Array)b=n.SHORT;else if(p instanceof Uint32Array)b=n.UNSIGNED_INT;else if(p instanceof Int32Array)b=n.INT;else if(p instanceof Int8Array)b=n.BYTE;else if(p instanceof Uint8Array)b=n.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)b=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:S,type:b,bytesPerElement:p.BYTES_PER_ELEMENT,version:u.version,size:v}}function l(u,d,p){const h=d.array,v=d.updateRanges;if(n.bindBuffer(p,u),v.length===0)n.bufferSubData(p,0,h);else{v.sort((b,A)=>b.start-A.start);let S=0;for(let b=1;b<v.length;b++){const A=v[S],P=v[b];P.start<=A.start+A.count+1?A.count=Math.max(A.count,P.start+P.count-A.start):(++S,v[S]=P)}v.length=S+1;for(let b=0,A=v.length;b<A;b++){const P=v[b];n.bufferSubData(p,P.start*h.BYTES_PER_ELEMENT,h,P.start,P.count)}d.clearUpdateRanges()}d.onUploadCallback()}function a(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function i(u){u.isInterleavedBufferAttribute&&(u=u.data);const d=r.get(u);d&&(n.deleteBuffer(d.buffer),r.delete(u))}function f(u,d){if(u.isInterleavedBufferAttribute&&(u=u.data),u.isGLBufferAttribute){const h=r.get(u);(!h||h.version<u.version)&&r.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}const p=r.get(u);if(p===void 0)r.set(u,s(u,d));else if(p.version<u.version){if(p.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");l(p.buffer,u,d),p.version=u.version}}return{get:a,remove:i,update:f}}var h1=`#ifdef USE_ALPHAHASH
1
+ import{U as _r,A as Mm,N as xr,B as Yl,V as wn,C as Ot,F as Ff,M as ki,D as ft,R as Tm,E as Yt,G as Vt,H as Uu,I as Rl,W as Du,J as Hr,K as tn,L as fo,O as ci,Q as Sr,T as dr,X as mo,Y as xo,Z as F_,_ as Ta,$ as Iu,a0 as ym,a1 as br,a2 as va,a3 as Xt,a4 as Am,a5 as kt,a6 as si,a7 as Cm,a8 as vl,a9 as Dr,aa as ma,ab as ba,ac as go,ad as Bi,ae as ps,af as O_,ag as Rm,ah as vo,ai as Vn,aj as wl,ak as pa,al as hs,am as wm,an as Pm,ao as co,ap as Lm,aq as Um,ar as Dm,as as Im,at as Nm,au as Fm,av as Om,aw as km,ax as Bm,ay as Gm,az as zm,aA as Hm,aB as Vm,aC as Wm,aD as jm,aE as Xm,aF as Ym,aG as _l,aH as os,aI as qm,aJ as Fi,aK as Km,aL as Zm,aM as ql,aN as Qm,aO as Kl,aP as Jm,aQ as $m,aR as eg,aS as Of,aT as Ut,aU as kf,aV as Bf,aW as ui,aX as _a,aY as po,aZ as ho,a_ as li,a$ as ga,b0 as oi,b1 as Gf,b2 as tg,b3 as zf,b4 as Hf,b5 as Vf,b6 as ms,b7 as Wf,b8 as jf,b9 as Xf,ba as bo,bb as ng,bc as rg,bd as ig,be as ag,bf as Yf,bg as og,bh as sg,bi as lg,bj as Sl,bk as xl,bl,bm as El,bn as Nu,bo as Fu,bp as Ou,bq as ku,br as Bu,bs as Gu,bt as zu,bu as Hu,bv as Vu,bw as Wu,bx as ju,by as Xu,bz as Yu,bA as qu,bB as Ku,bC as Zu,bD as Qu,bE as Ju,bF as $u,bG as ef,bH as tf,bI as nf,bJ as rf,bK as af,bL as of,bM as sf,bN as lf,bO as cf,bP as uf,bQ as ff,bR as df,bS as pf,bT as Pl,bU as Ll,bV as Ul,bW as Dl,bX as Il,bY as Nl,bZ as Fl,b_ as cg,b$ as hf,c0 as ug,c1 as cs,c2 as fg,c3 as mf,c4 as gf,c5 as Ol,c6 as kl,c7 as Bl,c8 as qf,c9 as Kf,ca as _s,cb as dg,cc as pg,cd as hg,ce as Zf,cf as ph,cg as Qf,ch as Jf,ci as $f,cj as ed,ck as Ss,cl as td,cm as nd,cn as rd,co as hh,cp as id,cq as _o,cr as Ea,cs as ad,ct as mg,cu as gg,cv as k_,cw as vf,cx as Kn,cy as Gl,cz as vg,cA as _g,cB as B_,cC as Sg,cD as xg,cE as bg,cF as od,cG as Eg,cH as Mg,cI as G_,cJ as z_,cK as H_,cL as V_,cM as W_,cN as j_,cO as X_,cP as Y_,cQ as q_,cR as K_,cS as Z_,cT as Q_,cU as J_,cV as $_,cW as eS,cX as tS,cY as nS,cZ as rS,c_ as iS,c$ as Tg,d0 as aS,d1 as oS,d2 as sS,d3 as lS,d4 as sd,d5 as cS,d6 as uS,d7 as fS,d8 as dS,d9 as pS,da as hS,db as mS,dc as gS,dd as vS,de as _S,df as yg,dg as SS,dh as xS,di as bS,dj as ES,dk as MS,dl as TS,dm as yS,dn as AS,dp as CS,dq as RS,dr as wS,ds as PS,dt as LS,du as US,dv as DS,dw as IS,dx as NS,dy as FS,dz as OS,dA as kS,dB as BS,dC as GS,dD as zS,dE as HS,dF as VS,dG as WS,dH as jS,dI as XS,dJ as YS,dK as qS,dL as ua,dM as KS,dN as ZS,dO as QS,dP as JS,dQ as $S,dR as ex,dS as _f,dT as tx,dU as nx,dV as rx,dW as ix,dX as ax,dY as ox,dZ as sx,d_ as lx,d$ as cx,e0 as ux,e1 as fx,e2 as dx,e3 as px,e4 as hx,e5 as mx,e6 as gx,e7 as Ag,e8 as Cg,e9 as vx,ea as _x,eb as Sx,ec as xx,ed as bx,ee as Ex,ef as Mx,eg as Tx,eh as yx,ei as Ax,ej as Cx,ek as Rx,el as wx,em as Px,en as Lx,eo as Ux,ep as Dx,eq as Ix,er as Nx,es as Fx,et as Ox,eu as kx,ev as Rg,ew as Bx,ex as Gx,ey as zx,ez as Hx,eA as wg,eB as Vx,eC as Wx,eD as jx,eE as Xx,eF as Yx,eG as qx,eH as Kx,eI as Zx,eJ as Qx,eK as Jx,eL as $x,eM as fa,eN as eb,eO as tb,eP as Sf,eQ as nb,eR as rb,eS as ib,eT as ab,eU as ob,eV as sb,eW as fr,eX as lb,eY as cb,eZ as ub,e_ as fb,e$ as db,f0 as pb,f1 as hb,f2 as mb,f3 as gb,f4 as vb,f5 as _b,f6 as Sb,f7 as xb,f8 as bb,f9 as Eb,fa as Mb,fb as Tb,fc as yb,fd as Pg,fe as Ab,ff as Cb,fg as Rb,fh as wb,fi as Pb,fj as Lb,fk as Ub,fl as zl,fm as Db,fn as Ib,fo as Lg,fp as Nb,fq as Fb,fr as Ob,fs as Ug,ft as Dg,fu as kb,fv as Bb,fw as Gb,fx as zb,fy as Hb,fz as Ig,fA as Vb,fB as Wb,fC as jb,fD as Xb,fE as Yb,fF as qb,fG as Kb,fH as Zb,fI as Qb,fJ as Ng,fK as Jb,fL as xf,fM as $b,fN as eE,fO as tE,fP as nE,fQ as rE,fR as iE,fS as aE,fT as oE,fU as sE,fV as lE,fW as cE,fX as uE,fY as fE,fZ as dE,f_ as da,f$ as pE,g0 as hE,g1 as mE,g2 as gE,g3 as vE,g4 as _E,g5 as SE,g6 as xE,g7 as bE,g8 as EE,g9 as ME,ga as TE,gb as yE,gc as AE,gd as CE,ge as RE,gf as wE,gg as PE,gh as LE,gi as UE,gj as DE,gk as IE,gl as NE,gm as FE,gn as OE,go as kE,gp as BE,gq as GE,gr as zE,gs as HE,gt as VE,gu as WE,gv as Fg,gw as jE,gx as Og,gy as XE,h as oe,k as Q,gz as ld,gA as YE,gB as qE,gC as fi,gD as oa,gE as kg,gF as KE,gG as ol,gH as mh,gI as ZE,gJ as QE,gK as JE,gL as $E,gM as Zl,gN as sl,gO as Ml,gP as kn,gQ as es,gR as gh,gS as bf,gT as du,gU as e1,gV as t1,gW as n1,gX as r1,gY as Hl,v as vh,gZ as i1,g_ as a1,g$ as o1,h0 as s1,h1 as l1,h2 as c1,h3 as u1,h4 as f1,h5 as d1}from"./index-B1i4xmXp.js";function Bg(){let n=null,r=!1,s=null,l=null;function a(i,f){s(i,f),l=n.requestAnimationFrame(a)}return{start:function(){r!==!0&&s!==null&&(l=n.requestAnimationFrame(a),r=!0)},stop:function(){n.cancelAnimationFrame(l),r=!1},setAnimationLoop:function(i){s=i},setContext:function(i){n=i}}}function p1(n){const r=new WeakMap;function s(u,d){const p=u.array,h=u.usage,v=p.byteLength,S=n.createBuffer();n.bindBuffer(d,S),n.bufferData(d,p,h),u.onUploadCallback();let b;if(p instanceof Float32Array)b=n.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)b=n.HALF_FLOAT;else if(p instanceof Uint16Array)u.isFloat16BufferAttribute?b=n.HALF_FLOAT:b=n.UNSIGNED_SHORT;else if(p instanceof Int16Array)b=n.SHORT;else if(p instanceof Uint32Array)b=n.UNSIGNED_INT;else if(p instanceof Int32Array)b=n.INT;else if(p instanceof Int8Array)b=n.BYTE;else if(p instanceof Uint8Array)b=n.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)b=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:S,type:b,bytesPerElement:p.BYTES_PER_ELEMENT,version:u.version,size:v}}function l(u,d,p){const h=d.array,v=d.updateRanges;if(n.bindBuffer(p,u),v.length===0)n.bufferSubData(p,0,h);else{v.sort((b,A)=>b.start-A.start);let S=0;for(let b=1;b<v.length;b++){const A=v[S],P=v[b];P.start<=A.start+A.count+1?A.count=Math.max(A.count,P.start+P.count-A.start):(++S,v[S]=P)}v.length=S+1;for(let b=0,A=v.length;b<A;b++){const P=v[b];n.bufferSubData(p,P.start*h.BYTES_PER_ELEMENT,h,P.start,P.count)}d.clearUpdateRanges()}d.onUploadCallback()}function a(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function i(u){u.isInterleavedBufferAttribute&&(u=u.data);const d=r.get(u);d&&(n.deleteBuffer(d.buffer),r.delete(u))}function f(u,d){if(u.isInterleavedBufferAttribute&&(u=u.data),u.isGLBufferAttribute){const h=r.get(u);(!h||h.version<u.version)&&r.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}const p=r.get(u);if(p===void 0)r.set(u,s(u,d));else if(p.version<u.version){if(p.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");l(p.buffer,u,d),p.version=u.version}}return{get:a,remove:i,update:f}}var h1=`#ifdef USE_ALPHAHASH
2
2
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
3
3
  #endif`,m1=`#ifdef USE_ALPHAHASH
4
4
  const float ALPHA_HASH_SCALE = 0.05;
@@ -0,0 +1 @@
1
+ import{S as ae,p as G,r as b,s as F,a as R,n as U,i as Q,b as z,t as ie,c as D,f as ne,d as re,e as K,g as J,h as v,j as X,u as ee,k as s,l as k,m as oe,o as M}from"./index-B1i4xmXp.js";var le=class extends ae{constructor(e,t){super(),this.options=t,this.#s=e,this.#i=null,this.#a=G(),this.bindMethods(),this.setOptions(t)}#s;#e=void 0;#m=void 0;#t=void 0;#r;#d;#a;#i;#f;#u;#h;#o;#l;#n;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),W(this.#e,this.options)?this.#c():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,a=this.#e;if(this.options=this.#s.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof b(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!F(this.options,t)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&V(this.#e,a,this.options,t)&&this.#c(),this.updateResult(),n&&(this.#e!==a||b(this.options.enabled,this.#e)!==b(t.enabled,this.#e)||R(this.options.staleTime,this.#e)!==R(t.staleTime,this.#e))&&this.#v();const r=this.#_();n&&(this.#e!==a||b(this.options.enabled,this.#e)!==b(t.enabled,this.#e)||r!==this.#n)&&this.#y(r)}getOptimisticResult(e){const t=this.#s.getQueryCache().build(this.#s,e),a=this.createResult(t,e);return de(this,a)&&(this.#t=a,this.#d=this.options,this.#r=this.#e.state),a}getCurrentResult(){return this.#t}trackResult(e,t){return new Proxy(e,{get:(a,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#s.defaultQueryOptions(e),a=this.#s.getQueryCache().build(this.#s,t);return a.fetch().then(()=>this.createResult(a,t))}fetch(e){return this.#c({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#t))}#c(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(U)),t}#v(){this.#b();const e=R(this.options.staleTime,this.#e);if(Q||this.#t.isStale||!z(e))return;const a=ie(this.#t.dataUpdatedAt,e)+1;this.#o=D.setTimeout(()=>{this.#t.isStale||this.updateResult()},a)}#_(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#n=e,!(Q||b(this.options.enabled,this.#e)===!1||!z(this.#n)||this.#n===0)&&(this.#l=D.setInterval(()=>{(this.options.refetchIntervalInBackground||ne.isFocused())&&this.#c()},this.#n))}#g(){this.#v(),this.#y(this.#_())}#b(){this.#o&&(D.clearTimeout(this.#o),this.#o=void 0)}#x(){this.#l&&(D.clearInterval(this.#l),this.#l=void 0)}createResult(e,t){const a=this.#e,n=this.options,r=this.#t,h=this.#r,o=this.#d,f=e!==a?e.state:this.#m,{state:d}=e;let u={...d},x=!1,p;if(t._optimisticResults){const g=this.hasListeners(),w=!g&&W(e,t),E=g&&V(e,a,t,n);(w||E)&&(u={...u,...re(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:c,errorUpdatedAt:_,status:l}=u;p=u.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&l==="pending"){let g;r?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(g=r.data,y=!0):g=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,g!==void 0&&(l="success",p=K(r?.data,g,t),x=!0)}if(t.select&&p!==void 0&&!y)if(r&&p===h?.data&&t.select===this.#f)p=this.#u;else try{this.#f=t.select,p=t.select(p),p=K(r?.data,p,t),this.#u=p,this.#i=null}catch(g){this.#i=g}this.#i&&(c=this.#i,p=this.#u,_=Date.now(),l="error");const j=u.fetchStatus==="fetching",T=l==="pending",I=l==="error",$=T&&j,H=p!==void 0,S={status:l,fetchStatus:u.fetchStatus,isPending:T,isSuccess:l==="success",isError:I,isInitialLoading:$,isLoading:$,data:p,dataUpdatedAt:u.dataUpdatedAt,error:c,errorUpdatedAt:_,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>f.dataUpdateCount||u.errorUpdateCount>f.errorUpdateCount,isFetching:j,isRefetching:j&&!T,isLoadingError:I&&!H,isPaused:u.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:I&&H,isStale:A(e,t),refetch:this.refetch,promise:this.#a,isEnabled:b(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const g=S.data!==void 0,w=S.status==="error"&&!g,E=B=>{w?B.reject(S.error):g&&B.resolve(S.data)},q=()=>{const B=this.#a=S.promise=G();E(B)},N=this.#a;switch(N.status){case"pending":e.queryHash===a.queryHash&&E(N);break;case"fulfilled":(w||S.data!==N.value)&&q();break;case"rejected":(!w||S.error!==N.reason)&&q();break}}return S}updateResult(){const e=this.#t,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#d=this.options,this.#r.data!==void 0&&(this.#h=this.#e),F(t,e))return;this.#t=t;const a=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,r=typeof n=="function"?n():n;if(r==="all"||!r&&!this.#p.size)return!0;const h=new Set(r??this.#p);return this.options.throwOnError&&h.add("error"),Object.keys(this.#t).some(o=>{const m=o;return this.#t[m]!==e[m]&&h.has(m)})};this.#S({listeners:a()})}#j(){const e=this.#s.getQueryCache().build(this.#s,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#m=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#S(e){J.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#t)}),this.#s.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ce(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function W(e,t){return ce(e,t)||e.state.data!==void 0&&L(e,t,t.refetchOnMount)}function L(e,t,a){if(b(t.enabled,e)!==!1&&R(t.staleTime,e)!=="static"){const n=typeof a=="function"?a(e):a;return n==="always"||n!==!1&&A(e,t)}return!1}function V(e,t,a,n){return(e!==t||b(n.enabled,e)===!1)&&(!a.suspense||e.state.status!=="error")&&A(e,a)}function A(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(R(t.staleTime,e))}function de(e,t){return!F(e.getCurrentResult(),t)}var te=v.createContext(!1),ue=()=>v.useContext(te);te.Provider;function he(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pe=v.createContext(he()),me=()=>v.useContext(pe),fe=(e,t,a)=>{const n=a?.state.error&&typeof e.throwOnError=="function"?X(e.throwOnError,[a.state.error,a]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{v.useEffect(()=>{e.clearReset()},[e])},_e=({result:e,errorResetBoundary:t,throwOnError:a,query:n,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(r&&e.data===void 0||X(a,[e.error,n])),ye=e=>{if(e.suspense){const a=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>a(n(...r)):a(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ge=(e,t)=>e.isLoading&&e.isFetching&&!t,be=(e,t)=>e?.suspense&&t.isPending,Y=(e,t,a)=>t.fetchOptimistic(e).catch(()=>{a.clearReset()});function xe(e,t,a){const n=ue(),r=me(),h=ee(),o=h.defaultQueryOptions(e);h.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const m=h.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",ye(o),fe(o,r,m),ve(r);const f=!h.getQueryCache().get(o.queryHash),[d]=v.useState(()=>new t(h,o)),u=d.getOptimisticResult(o),x=!n&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(p=>{const c=x?d.subscribe(J.batchCalls(p)):U;return d.updateResult(),c},[d,x]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(o)},[o,d]),be(o,u))throw Y(o,d,r);if(_e({result:u,errorResetBoundary:r,throwOnError:o.throwOnError,query:m,suspense:o.suspense}))throw u.error;return h.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!Q&&ge(u,n)&&(f?Y(o,d,r):m?.promise)?.catch(U).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?u:d.trackResult(u)}function P(e,t){return xe(e,le)}const je="auth_token";function Se(){try{return localStorage.getItem(je)}catch{return null}}function C(e,t){const a=Se();if(a){const n=new Headers(t?.headers);return n.has("Authorization")||n.set("Authorization",`Bearer ${a}`),fetch(e,{...t,headers:n})}return fetch(e,t)}function Te({tabs:e,activeTab:t,onTabChange:a,containerClassName:n,panelClassName:r,tabListClassName:h,tabClassName:o,activeTabClassName:m}){return s.jsxs("div",{className:n,children:[s.jsx("div",{role:"tablist",className:h,style:h?void 0:{display:"flex",gap:"2px",borderBottom:"1px solid var(--border-subtle, rgba(255,255,255,0.06))",marginBottom:"12px"},children:e.map(f=>{const d=t===f.id,u=[o,d&&m].filter(Boolean).join(" ");return s.jsx("button",{role:"tab","aria-selected":d,onClick:()=>a(f.id),className:u||void 0,style:u?void 0:{padding:"8px 16px",background:d?"var(--bg-accent, rgba(0,229,255,0.1))":"transparent",border:"none",borderBottom:d?"2px solid var(--accent-cyan, #00e5ff)":"2px solid transparent",color:d?"var(--accent-cyan, #00e5ff)":"var(--text-secondary, #8888aa)",cursor:"pointer",fontSize:"0.85rem",fontFamily:"var(--font-mono, monospace)",transition:"color 0.15s, background 0.15s"},children:f.label},f.id)})}),s.jsx("div",{role:"tabpanel",className:r,children:e.find(f=>f.id===t)?.content})]})}const we="_container_1uen7_5",Ce="_filters_1uen7_15",Re="_filterGroup_1uen7_22",Ee="_filterLabel_1uen7_28",Ne="_filterInput_1uen7_36",Be="_sortToggle_1uen7_54",De="_results_1uen7_72",Oe="_emptyState_1uen7_80",Ie="_row_1uen7_89",ke="_rowTitle_1uen7_107",Me="_rowProject_1uen7_115",Pe="_rowDate_1uen7_123",Fe="_rowDuration_1uen7_129",Ue="_rowStatus_1uen7_135",Qe="_rowMeta_1uen7_165",Le="_resumeBtn_1uen7_171",Ae="_deleteBtn_1uen7_189",$e="_pagination_1uen7_207",He="_pageBtn_1uen7_215",qe="_pageBtnActive_1uen7_236",Ge="_pageEllipsis_1uen7_242",ze="_detailOverlay_1uen7_249",Ke="_detailCard_1uen7_259",We="_detailTabs_1uen7_273",Ve="_detailTabPanel_1uen7_281",Ye="_detailHeader_1uen7_289",Ze="_detailTitle_1uen7_296",Je="_detailMeta_1uen7_302",Xe="_detailCloseBtn_1uen7_309",et="_detailBody_1uen7_322",tt="_convoEntry_1uen7_327",st="_convoEntryHeader_1uen7_335",at="_copyBtn_1uen7_342",it="_convoPrompt_1uen7_364",nt="_convoResponse_1uen7_369",rt="_convoTime_1uen7_374",ot="_convoText_1uen7_380",lt="_activityEntry_1uen7_387",ct="_activityTime_1uen7_395",dt="_activityBadge_1uen7_401",ut="_activityBadgeTool_1uen7_410",ht="_activityBadgeEvent_1uen7_415",pt="_activityDetail_1uen7_420",i={container:we,filters:Ce,filterGroup:Re,filterLabel:Ee,filterInput:Ne,sortToggle:Be,results:De,emptyState:Oe,row:Ie,rowTitle:ke,rowProject:Me,rowDate:Pe,rowDuration:Fe,rowStatus:Ue,rowMeta:Qe,resumeBtn:Le,deleteBtn:Ae,pagination:$e,pageBtn:He,pageBtnActive:qe,pageEllipsis:Ge,detailOverlay:ze,detailCard:Ke,detailTabs:We,detailTabPanel:Ve,detailHeader:Ye,detailTitle:Ze,detailMeta:Je,detailCloseBtn:Xe,detailBody:et,convoEntry:tt,convoEntryHeader:st,copyBtn:at,convoPrompt:it,convoResponse:nt,convoTime:rt,convoText:ot,activityEntry:lt,activityTime:ct,activityBadge:dt,activityBadgeTool:ut,activityBadgeEvent:ht,activityDetail:pt},se=50;function O(e){if(e<1e3)return"<1s";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const a=Math.floor(t/60);return a<60?`${a}m ${t%60}s`:`${Math.floor(a/60)}h ${a%60}m`}function mt(e){return e?new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):"--"}function Z(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1})}function ft(e){const t=new URLSearchParams;e.query&&t.set("query",e.query),e.project&&t.set("project",e.project),e.status==="archived"?t.set("archived","true"):e.status&&t.set("status",e.status),e.dateFrom&&t.set("dateFrom",String(new Date(e.dateFrom).getTime())),e.dateTo&&t.set("dateTo",String(new Date(e.dateTo+"T23:59:59").getTime()));const a={date:"started_at",duration:"last_activity_at",prompts:"started_at",tools:"started_at"};return t.set("sortBy",a[e.sortBy]||"started_at"),t.set("sortDir",e.sortDir),t.set("page",String(e.page)),t.set("pageSize",String(se)),t.toString()}function St(){const e=ee(),[t,a]=v.useState({query:"",project:"",status:"",dateFrom:"",dateTo:"",sortBy:"date",sortDir:"desc",page:1}),[n,r]=v.useState(null),{data:h}=P({queryKey:["db-projects"],queryFn:async()=>{const l=await C("/api/db/projects");if(!l.ok)throw new Error("Failed to load projects");return l.json()},staleTime:6e4}),{data:o,isLoading:m}=P({queryKey:["db-sessions",t],queryFn:async()=>{const l=await C(`/api/db/sessions?${ft(t)}`);if(!l.ok)throw new Error("Failed to load sessions");return l.json()}}),{data:f}=P({queryKey:["db-session-detail",n],queryFn:async()=>{if(!n)return null;const l=await C(`/api/db/sessions/${encodeURIComponent(n)}`);if(!l.ok)throw new Error("Failed to load session detail");return l.json()},enabled:!!n}),d=v.useCallback((l,y)=>{a(j=>({...j,[l]:y,page:l==="page"?y:1}))},[]),u=v.useCallback(async(l,y)=>{l.stopPropagation(),window.confirm("Delete this session from history? This cannot be undone.")&&(await C(`/api/db/sessions/${encodeURIComponent(y)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["db-sessions"]}))},[e]),x=v.useCallback(async(l,y)=>{l.stopPropagation();try{const T=await(await C(`/api/sessions/${encodeURIComponent(y)}/resume`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();T.ok?k("Resuming Claude session in terminal","success"):k(T.error||"Resume failed","error")}catch(j){k(j.message,"error")}},[]),p=o?.sessions??[],c=o?.total??0,_=Math.ceil(c/se);return s.jsxs("div",{className:i.container,"data-testid":"history-view",children:[s.jsxs("div",{className:i.filters,children:[s.jsx(oe,{value:t.query,onChange:l=>d("query",l),placeholder:"Search prompts..."}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Project"}),s.jsx(M,{value:t.project,onChange:l=>d("project",l),options:[{value:"",label:"All"},...h?.map(l=>({value:l.project_path,label:l.project_name}))??[]]})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Status"}),s.jsx(M,{value:t.status,onChange:l=>d("status",l),options:[{value:"",label:"All"},{value:"idle",label:"Idle"},{value:"working",label:"Working"},{value:"waiting",label:"Waiting"},{value:"ended",label:"Ended"},{value:"archived",label:"Archived"}]})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"From"}),s.jsx("input",{type:"date",className:i.filterInput,value:t.dateFrom,onChange:l=>d("dateFrom",l.target.value)})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"To"}),s.jsx("input",{type:"date",className:i.filterInput,value:t.dateTo,onChange:l=>d("dateTo",l.target.value)})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Sort"}),s.jsx(M,{value:t.sortBy,onChange:l=>d("sortBy",l),options:[{value:"date",label:"Date"},{value:"duration",label:"Activity"},{value:"prompts",label:"Prompts"},{value:"tools",label:"Tools"}]}),s.jsx("button",{className:i.sortToggle,onClick:()=>d("sortDir",t.sortDir==="desc"?"asc":"desc"),children:t.sortDir.toUpperCase()})]})]}),s.jsxs("div",{className:i.results,children:[m&&s.jsx("div",{className:i.emptyState,children:"Loading..."}),!m&&p.length===0&&s.jsx("div",{className:i.emptyState,children:"No sessions found"}),p.map(l=>s.jsx(_t,{session:l,onClick:()=>r(l.id),onResume:y=>x(y,l.id),onDelete:y=>u(y,l.id)},l.id))]}),_>1&&s.jsx(yt,{currentPage:t.page,totalPages:_,onPageChange:l=>d("page",l)}),n&&f&&s.jsx(bt,{detail:f,onClose:()=>r(null)})]})}function vt(){return s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("polyline",{points:"1 4 1 10 7 10"}),s.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})}function _t({session:e,onClick:t,onResume:a,onDelete:n}){const r=e.ended_at&&e.started_at?O(e.ended_at-e.started_at):e.started_at?O(Date.now()-e.started_at):"--";return s.jsxs("div",{className:i.row,onClick:t,children:[s.jsx("span",{className:i.rowTitle,children:e.title||e.project_name||e.id}),s.jsx("span",{className:i.rowProject,children:e.project_name}),s.jsx("span",{className:i.rowDate,children:mt(e.started_at)}),s.jsx("span",{className:i.rowDuration,children:r}),s.jsx("span",{className:i.rowStatus,"data-status":e.status,children:e.status.toUpperCase()}),s.jsxs("span",{className:i.rowMeta,children:[e.total_prompts," prompts"]}),s.jsxs("span",{className:i.rowMeta,children:[e.total_tool_calls," tools"]}),s.jsx("button",{className:i.resumeBtn,onClick:a,title:"Resume session","aria-label":"Resume session",children:s.jsx(vt,{})}),s.jsx("button",{className:i.deleteBtn,onClick:n,title:"Delete session","aria-label":"Delete session",children:"x"})]})}function yt({currentPage:e,totalPages:t,onPageChange:a}){const n=[];for(let o=1;o<=t;o++)(o===1||o===t||o>=e-2&&o<=e+2)&&n.push(o);const r=[];let h=0;for(const o of n)typeof o=="number"&&(h&&o-h>1&&r.push("ellipsis"),r.push(o),h=o);return s.jsxs("div",{className:i.pagination,children:[s.jsx("button",{className:i.pageBtn,disabled:e<=1,onClick:()=>a(e-1),children:"Prev"}),r.map((o,m)=>o==="ellipsis"?s.jsx("span",{className:i.pageEllipsis,children:"..."},`e-${m}`):s.jsx("button",{className:`${i.pageBtn} ${o===e?i.pageBtnActive:""}`,onClick:()=>a(o),children:o},o)),s.jsx("button",{className:i.pageBtn,disabled:e>=t,onClick:()=>a(e+1),children:"Next"})]})}function gt({text:e}){const[t,a]=v.useState(!1),n=r=>{r.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})};return s.jsx("button",{className:i.copyBtn,onClick:n,"aria-label":"Copy to clipboard",title:"Copy to clipboard",children:t?"✓":"⎘"})}function bt({detail:e,onClose:t}){const[a,n]=v.useState("conversation"),{session:r,prompts:h,responses:o,tool_calls:m,events:f}=e,d=[...h.map(c=>({type:"prompt",timestamp:c.timestamp,text:c.text})),...o.map(c=>({type:"response",timestamp:c.timestamp,text:c.text_excerpt}))].sort((c,_)=>c.timestamp-_.timestamp),u=[...m.map(c=>({kind:"tool",label:c.tool_name,detail:c.tool_input_summary,timestamp:c.timestamp})),...f.map(c=>({kind:"event",label:c.event_type,detail:c.detail,timestamp:c.timestamp}))].sort((c,_)=>_.timestamp-c.timestamp),x=r.ended_at&&r.started_at?O(r.ended_at-r.started_at):r.started_at?O(Date.now()-r.started_at):"--",p=[{id:"conversation",label:`Conversation (${d.length})`,content:s.jsxs("div",{className:i.detailBody,children:[d.length===0&&s.jsx("div",{className:i.emptyState,children:"No conversation recorded"}),d.map((c,_)=>s.jsxs("div",{className:`${i.convoEntry} ${c.type==="prompt"?i.convoPrompt:i.convoResponse}`,children:[s.jsxs("div",{className:i.convoEntryHeader,children:[s.jsx("div",{className:i.convoTime,children:Z(c.timestamp)}),s.jsx(gt,{text:c.text})]}),s.jsx("div",{className:i.convoText,children:c.text})]},_))]})},{id:"activity",label:`Activity (${u.length})`,content:s.jsxs("div",{className:i.detailBody,children:[u.length===0&&s.jsx("div",{className:i.emptyState,children:"No activity recorded"}),u.map((c,_)=>s.jsxs("div",{className:i.activityEntry,children:[s.jsx("span",{className:i.activityTime,children:Z(c.timestamp)}),s.jsx("span",{className:`${i.activityBadge} ${c.kind==="tool"?i.activityBadgeTool:i.activityBadgeEvent}`,children:c.label}),s.jsx("span",{className:i.activityDetail,children:c.detail})]},_))]})}];return s.jsx("div",{className:i.detailOverlay,onClick:t,children:s.jsxs("div",{className:i.detailCard,onClick:c=>c.stopPropagation(),children:[s.jsxs("div",{className:i.detailHeader,children:[s.jsxs("div",{children:[s.jsx("h2",{className:i.detailTitle,children:r.project_name||r.id}),s.jsxs("div",{className:i.detailMeta,children:[s.jsxs("span",{children:["Status: ",r.status.toUpperCase()]}),s.jsxs("span",{children:["Model: ",r.model||"--"]}),s.jsxs("span",{children:["Duration: ",x]}),s.jsxs("span",{children:[r.total_prompts," prompts / ",r.total_tool_calls," tools"]})]})]}),s.jsx("button",{className:i.detailCloseBtn,onClick:t,"aria-label":"Close",children:"x"})]}),s.jsx(Te,{tabs:p,activeTab:a,onTabChange:n,containerClassName:i.detailTabs,panelClassName:i.detailTabPanel})]})})}export{St as default};
@@ -1 +1 @@
1
- import{z as o,k as s,A as e,P as l}from"./index-ZH9kWQk6.js";function c(){const[t]=o(),a=t.get("path");if(!a)return s.jsx("div",{className:e.standalone,children:s.jsxs("div",{className:e.standaloneEmpty,children:["No project path specified. Use ",s.jsx("code",{children:"?path=/your/project"})," to open a project."]})});const i=a.split("/").filter(Boolean).pop()||a,n=t.get("file")||void 0;return s.jsxs("div",{className:e.standalone,children:[s.jsxs("div",{className:e.standaloneHeader,children:[s.jsx("span",{className:e.standaloneTitle,children:i}),s.jsx("span",{className:e.standalonePath,children:a})]}),s.jsx("div",{className:e.standaloneContent,children:s.jsx(l,{projectPath:a,initialPath:n,initialIsFile:!!n,persistId:`browser-${a}`})})]})}export{c as default};
1
+ import{y as o,k as s,z as e,P as l}from"./index-B1i4xmXp.js";function c(){const[t]=o(),a=t.get("path");if(!a)return s.jsx("div",{className:e.standalone,children:s.jsxs("div",{className:e.standaloneEmpty,children:["No project path specified. Use ",s.jsx("code",{children:"?path=/your/project"})," to open a project."]})});const i=a.split("/").filter(Boolean).pop()||a,n=t.get("file")||void 0;return s.jsxs("div",{className:e.standalone,children:[s.jsxs("div",{className:e.standaloneHeader,children:[s.jsx("span",{className:e.standaloneTitle,children:i}),s.jsx("span",{className:e.standalonePath,children:a})]}),s.jsx("div",{className:e.standaloneContent,children:s.jsx(l,{projectPath:a,initialPath:n,initialIsFile:!!n,persistId:`browser-${a}`})})]})}export{c as default};
@@ -1 +1 @@
1
- import{v as x,w as $,h as d,m as S,k as e,x as a,q as D}from"./index-ZH9kWQk6.js";const B="_controls_uyjqd_6",E="_title_uyjqd_11",M="_stats_uyjqd_13",T="_statsSep_uyjqd_17",H="_content_uyjqd_19",P="_viewGroup_uyjqd_21",z="_groupHeader_uyjqd_22",G="_sessionName_uyjqd_23",R="_label_uyjqd_24",U="_sid_uyjqd_25",K="_itemCount_uyjqd_26",L="_table_uyjqd_28",O="_pos_uyjqd_34",Q="_text_uyjqd_36",V="_date_uyjqd_37",W="_deleteBtn_uyjqd_38",t={controls:B,title:E,stats:M,statsSep:T,content:H,viewGroup:P,groupHeader:z,sessionName:G,label:R,sid:U,itemCount:K,table:L,pos:O,text:Q,date:V,deleteBtn:W};let F=Date.now();function Y(){return F++}function J(o){return new Date(o).toLocaleTimeString("en-US",{hour12:!1})}function Z(){const o=x(s=>s.queues),y=x(s=>s.add),w=x(s=>s.remove),b=x(s=>s.moveToSession),h=$(s=>s.sessions),[l,k]=d.useState(""),[m,g]=d.useState(""),[i,f]=d.useState(null),p=Array.from(new Set([...o.keys(),...h.keys()])).filter(s=>{const n=o.get(s);return n&&n.length>0}),q=Array.from(o.values()).reduce((s,n)=>s+n.length,0),N=d.useCallback(()=>{const s=m.trim();if(!s||!l)return;const n=o.get(l)??[],c={id:Y(),sessionId:l,text:s,position:n.length,createdAt:Date.now()};y(l,c),g(""),S("Prompt added to queue","info",2e3)},[m,l,o,y]),A=d.useCallback(s=>{i&&(b([i.itemId],i.fromSessionId,s),f(null),S("Prompt moved","info",2e3))},[i,b]),j=Array.from(h.entries()),C=d.useMemo(()=>[{value:"",label:"Select session..."},...j.map(([s,n])=>({value:s,label:`${n.projectName||s.slice(0,8)}${n.title?` — ${n.title}`:""}`}))],[j]);return e.jsxs("div",{"data-testid":"queue-view",style:{height:"100%",overflow:"auto"},children:[e.jsx("div",{className:t.controls,children:e.jsx("h2",{className:t.title,children:"PROMPT QUEUE"})}),e.jsxs("div",{className:t.stats,children:[e.jsxs("span",{children:[q," queued prompt",q!==1?"s":""]}),e.jsx("span",{className:t.statsSep,children:"|"}),e.jsxs("span",{children:[p.length," session",p.length!==1?"s":""]})]}),e.jsx("div",{style:{padding:"0 24px 16px"},children:e.jsxs("div",{className:a.queueCompose,children:[e.jsx(D,{value:l,onChange:k,options:C,placeholder:"Select session...",style:{minWidth:"180px",fontSize:"11px"}}),e.jsx("textarea",{className:a.queueTextarea,placeholder:"Add a prompt to the queue...",rows:2,value:m,onChange:s=>g(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),N())}}),e.jsx("button",{className:`${a.toolbarBtn} ${a.queueAddBtn}`,onClick:N,disabled:!m.trim()||!l,children:"ADD"})]})}),e.jsx("div",{className:t.content,children:p.length===0?e.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:"var(--text-dim)",fontSize:"13px"},children:"No prompts in queue. Add prompts from session detail panels or above."}):p.map(s=>{const n=o.get(s)??[],c=h.get(s);return e.jsxs("div",{className:t.viewGroup,children:[e.jsxs("div",{className:t.groupHeader,children:[e.jsx("span",{className:t.sessionName,children:c?.projectName||"Unknown"}),c?.label&&e.jsx("span",{className:t.label,children:c.label}),e.jsx("span",{className:t.sid,children:s.slice(0,8)}),e.jsxs("span",{className:t.itemCount,children:[n.length," item",n.length!==1?"s":""]})]}),e.jsxs("table",{className:t.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:t.pos,children:"#"}),e.jsx("th",{children:"Prompt"}),e.jsx("th",{children:"Added"}),e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:n.map((r,I)=>e.jsxs("tr",{children:[e.jsx("td",{className:t.pos,children:I+1}),e.jsx("td",{className:t.text,children:r.text}),e.jsx("td",{className:t.date,children:J(r.createdAt)}),e.jsxs("td",{children:[e.jsxs("div",{style:{display:"flex",gap:"4px"},children:[e.jsx("button",{className:`${a.queueActionBtn} ${a.queueMove}`,onClick:()=>f(i?.itemId===r.id?null:{itemId:r.id,fromSessionId:s}),children:"MOVE"}),e.jsx("button",{className:`${a.queueActionBtn} ${a.queueDelete} ${t.deleteBtn}`,onClick:()=>w(s,r.id),children:"DEL"})]}),i?.itemId===r.id&&e.jsx("div",{style:{position:"absolute",zIndex:10,background:"var(--surface-card, #12122a)",border:"1px solid var(--border-subtle, rgba(255,255,255,0.08))",borderRadius:"4px",padding:"4px",maxHeight:"160px",overflowY:"auto",minWidth:"180px"},children:j.filter(([u])=>u!==s).map(([u,_])=>e.jsxs("button",{onClick:()=>A(u),style:{display:"block",width:"100%",padding:"4px 8px",background:"transparent",border:"none",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"10px",textAlign:"left",cursor:"pointer",borderRadius:"3px"},onMouseEnter:v=>{v.target.style.background="rgba(0,229,255,0.1)"},onMouseLeave:v=>{v.target.style.background="transparent"},children:[_.projectName||u.slice(0,8),_.title?` — ${_.title}`:""]},u))})]})]},r.id))})]})]},s)})})]})}export{Z as default};
1
+ import{q as x,v as $,h as d,l as S,k as e,w as a,o as D}from"./index-B1i4xmXp.js";const B="_controls_uyjqd_6",E="_title_uyjqd_11",M="_stats_uyjqd_13",T="_statsSep_uyjqd_17",H="_content_uyjqd_19",P="_viewGroup_uyjqd_21",z="_groupHeader_uyjqd_22",G="_sessionName_uyjqd_23",R="_label_uyjqd_24",U="_sid_uyjqd_25",K="_itemCount_uyjqd_26",L="_table_uyjqd_28",O="_pos_uyjqd_34",Q="_text_uyjqd_36",V="_date_uyjqd_37",W="_deleteBtn_uyjqd_38",t={controls:B,title:E,stats:M,statsSep:T,content:H,viewGroup:P,groupHeader:z,sessionName:G,label:R,sid:U,itemCount:K,table:L,pos:O,text:Q,date:V,deleteBtn:W};let F=Date.now();function Y(){return F++}function J(o){return new Date(o).toLocaleTimeString("en-US",{hour12:!1})}function Z(){const o=x(s=>s.queues),y=x(s=>s.add),w=x(s=>s.remove),b=x(s=>s.moveToSession),h=$(s=>s.sessions),[l,k]=d.useState(""),[m,g]=d.useState(""),[i,f]=d.useState(null),p=Array.from(new Set([...o.keys(),...h.keys()])).filter(s=>{const n=o.get(s);return n&&n.length>0}),q=Array.from(o.values()).reduce((s,n)=>s+n.length,0),N=d.useCallback(()=>{const s=m.trim();if(!s||!l)return;const n=o.get(l)??[],c={id:Y(),sessionId:l,text:s,position:n.length,createdAt:Date.now()};y(l,c),g(""),S("Prompt added to queue","info",2e3)},[m,l,o,y]),A=d.useCallback(s=>{i&&(b([i.itemId],i.fromSessionId,s),f(null),S("Prompt moved","info",2e3))},[i,b]),j=Array.from(h.entries()),C=d.useMemo(()=>[{value:"",label:"Select session..."},...j.map(([s,n])=>({value:s,label:`${n.projectName||s.slice(0,8)}${n.title?` — ${n.title}`:""}`}))],[j]);return e.jsxs("div",{"data-testid":"queue-view",style:{height:"100%",overflow:"auto"},children:[e.jsx("div",{className:t.controls,children:e.jsx("h2",{className:t.title,children:"PROMPT QUEUE"})}),e.jsxs("div",{className:t.stats,children:[e.jsxs("span",{children:[q," queued prompt",q!==1?"s":""]}),e.jsx("span",{className:t.statsSep,children:"|"}),e.jsxs("span",{children:[p.length," session",p.length!==1?"s":""]})]}),e.jsx("div",{style:{padding:"0 24px 16px"},children:e.jsxs("div",{className:a.queueCompose,children:[e.jsx(D,{value:l,onChange:k,options:C,placeholder:"Select session...",style:{minWidth:"180px",fontSize:"11px"}}),e.jsx("textarea",{className:a.queueTextarea,placeholder:"Add a prompt to the queue...",rows:2,value:m,onChange:s=>g(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),N())}}),e.jsx("button",{className:`${a.toolbarBtn} ${a.queueAddBtn}`,onClick:N,disabled:!m.trim()||!l,children:"ADD"})]})}),e.jsx("div",{className:t.content,children:p.length===0?e.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:"var(--text-dim)",fontSize:"13px"},children:"No prompts in queue. Add prompts from session detail panels or above."}):p.map(s=>{const n=o.get(s)??[],c=h.get(s);return e.jsxs("div",{className:t.viewGroup,children:[e.jsxs("div",{className:t.groupHeader,children:[e.jsx("span",{className:t.sessionName,children:c?.projectName||"Unknown"}),c?.label&&e.jsx("span",{className:t.label,children:c.label}),e.jsx("span",{className:t.sid,children:s.slice(0,8)}),e.jsxs("span",{className:t.itemCount,children:[n.length," item",n.length!==1?"s":""]})]}),e.jsxs("table",{className:t.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:t.pos,children:"#"}),e.jsx("th",{children:"Prompt"}),e.jsx("th",{children:"Added"}),e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:n.map((r,I)=>e.jsxs("tr",{children:[e.jsx("td",{className:t.pos,children:I+1}),e.jsx("td",{className:t.text,children:r.text}),e.jsx("td",{className:t.date,children:J(r.createdAt)}),e.jsxs("td",{children:[e.jsxs("div",{style:{display:"flex",gap:"4px"},children:[e.jsx("button",{className:`${a.queueActionBtn} ${a.queueMove}`,onClick:()=>f(i?.itemId===r.id?null:{itemId:r.id,fromSessionId:s}),children:"MOVE"}),e.jsx("button",{className:`${a.queueActionBtn} ${a.queueDelete} ${t.deleteBtn}`,onClick:()=>w(s,r.id),children:"DEL"})]}),i?.itemId===r.id&&e.jsx("div",{style:{position:"absolute",zIndex:10,background:"var(--surface-card, #12122a)",border:"1px solid var(--border-subtle, rgba(255,255,255,0.08))",borderRadius:"4px",padding:"4px",maxHeight:"160px",overflowY:"auto",minWidth:"180px"},children:j.filter(([u])=>u!==s).map(([u,_])=>e.jsxs("button",{onClick:()=>A(u),style:{display:"block",width:"100%",padding:"4px 8px",background:"transparent",border:"none",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"10px",textAlign:"left",cursor:"pointer",borderRadius:"3px"},onMouseEnter:v=>{v.target.style.background="rgba(0,229,255,0.1)"},onMouseLeave:v=>{v.target.style.background="transparent"},children:[_.projectName||u.slice(0,8),_.title?` — ${_.title}`:""]},u))})]})]},r.id))})]})]},s)})})]})}export{Z as default};