spec-cat 0.1.42 → 0.1.44
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{C5VmlmOK.js → B56DSSfp.js} +1 -1
- package/.output/public/_nuxt/{DIEyni0K.js → BFFThwWz.js} +1 -1
- package/.output/public/_nuxt/{CUhpW37J.js → BOLrA7H8.js} +1 -1
- package/.output/public/_nuxt/{wserZ5KO.js → B_IFBYSw.js} +2 -2
- package/.output/public/_nuxt/{CPsvWw1J.js → Ba3Pcgcf.js} +1 -1
- package/.output/public/_nuxt/{BjExtU_8.js → BqaOje-o.js} +1 -1
- package/.output/public/_nuxt/{D_05ko21.js → CDdYT-E3.js} +1 -1
- package/.output/public/_nuxt/{lyWV44Wc.js → CaIUTuUU.js} +1 -1
- package/.output/public/_nuxt/{BdnBYIQg.js → CwqI8l6M.js} +48 -48
- package/.output/public/_nuxt/{DFgtAR95.js → DLJ2xGMS.js} +1 -1
- package/.output/public/_nuxt/DXbMXlyj.js +1 -0
- package/.output/public/_nuxt/{-2tR8Cph.js → D_ZXiRDu.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/d88c9434-84d1-435a-9c24-03139ecee860.json +1 -0
- package/.output/public/_nuxt/{BBA9sqLe.js → xK5F_xjP.js} +1 -1
- package/.output/server/chunks/_/baseBranch.mjs +23 -4
- package/.output/server/chunks/_/baseBranch.mjs.map +1 -1
- package/.output/server/chunks/_/conversationStore.mjs +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +619 -626
- package/.output/server/chunks/routes/_ws.mjs +1 -1
- package/.output/server/chunks/routes/api/chat/finalize.post.mjs +10 -19
- package/.output/server/chunks/routes/api/chat/finalize.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/chat/rebase.post.mjs +16 -17
- package/.output/server/chunks/routes/api/chat/rebase.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/chat/worktree.post.mjs +1 -1
- package/.output/server/chunks/routes/api/conversations/archives/_archiveId/restore.post.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post2.mjs +1 -1
- package/.output/server/chunks/routes/api/rebase/continue.post.mjs +10 -19
- package/.output/server/chunks/routes/api/rebase/continue.post.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +3 -2
- package/.output/public/_nuxt/DphOOigU.js +0 -1
- package/.output/public/_nuxt/builds/meta/895802c5-82ab-4327-bd99-cd838c28ba34.json +0 -1
- package/.output/public/_nuxt/builds/meta/dev.json +0 -1
package/.output/nitro.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as i,z as s,A as n,_ as a}from"./
|
|
1
|
+
import{y as i,z as s,A as n,_ as a}from"./B_IFBYSw.js";function l(r,e){return i(),s("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})])}function h(r,e){return i(),s("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})])}function w(r,e){return i(),s("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})])}function k(r,e){return i(),s("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})])}const u=a("worktree",{state:()=>({worktrees:[],currentBranch:"",mainWorktree:"",workingDirectory:"",loading:!1,error:null}),getters:{activeWorktree:r=>r.worktrees.find(e=>e.isCurrent),featureWorktrees:r=>r.worktrees.filter(e=>!e.isMain),mainWorktreeInfo:r=>r.worktrees.find(e=>e.isMain),hasWorktrees:r=>r.worktrees.length>1,dirtyWorktrees:r=>r.worktrees.filter(e=>e.status==="dirty")},actions:{async initialize(){if(!this.workingDirectory)try{const{cwd:r}=await $fetch("/api/cwd");this.workingDirectory=r}catch(r){console.error("Failed to get working directory:",r),this.workingDirectory=""}},async fetchWorktrees(){await this.initialize(),this.loading=!0,this.error=null;try{const r=await $fetch("/api/worktrees",{query:{workingDirectory:this.workingDirectory}});this.worktrees=r.worktrees,this.currentBranch=r.currentBranch,this.mainWorktree=r.mainWorktree}catch(r){this.error=r instanceof Error?r.message:"Failed to fetch worktrees",console.error("Failed to fetch worktrees:",r)}finally{this.loading=!1}},async createWorktree(r){await this.initialize(),this.loading=!0,this.error=null;try{const e=await $fetch("/api/worktrees",{method:"POST",query:{workingDirectory:this.workingDirectory},body:r});return e.success&&e.worktree?this.worktrees.push(e.worktree):e.error&&(this.error=e.error),e}catch(e){const t=e instanceof Error?e.message:"Failed to create worktree";return this.error=t,{success:!1,error:t}}finally{this.loading=!1}},async deleteWorktree(r,e=!1){await this.initialize(),this.loading=!0,this.error=null;try{const t=await $fetch(`/api/worktrees/${r}`,{method:"DELETE",query:{workingDirectory:this.workingDirectory,deleteBranch:e.toString()}});return t.success?this.worktrees=this.worktrees.filter(o=>o.name!==r):t.error&&(this.error=t.error),t}catch(t){const o=t instanceof Error?t.message:"Failed to delete worktree";return this.error=o,{success:!1,error:o}}finally{this.loading=!1}},async switchWorktree(r){await this.initialize(),this.loading=!0,this.error=null;try{const e=await $fetch(`/api/worktrees/${r}/switch`,{method:"POST",query:{workingDirectory:this.workingDirectory}});return e.success?(this.worktrees=this.worktrees.map(t=>({...t,isCurrent:t.name===r})),this.currentBranch=r):e.error&&(this.error=e.error),e}catch(e){const t=e instanceof Error?e.message:"Failed to switch worktree";return this.error=t,{success:!1,error:t}}finally{this.loading=!1}},clearError(){this.error=null}}});export{l as a,h as b,w as c,k as r,u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as C,y as s,z as a,L as g,G as o,B as u,k as B,M as D,N as j,H as M,T as E,C as b,O as T,D as F,P as k,A as t,K as c,E as $,Q as W,R as w,S,g as v,o as L,I as R,J as z}from"./
|
|
1
|
+
import{d as C,y as s,z as a,L as g,G as o,B as u,k as B,M as D,N as j,H as M,T as E,C as b,O as T,D as F,P as k,A as t,K as c,E as $,Q as W,R as w,S,g as v,o as L,I as R,J as z}from"./B_IFBYSw.js";import{u as N,r as A,a as V,b as P,c as U}from"./B56DSSfp.js";const H=C({__name:"WorktreeStatusBadge",props:{status:{}},setup(h){const r=h,i=B(()=>({clean:{label:"clean",color:"text-retro-green bg-retro-green/20"},dirty:{label:"dirty",color:"text-retro-yellow bg-retro-yellow/20"},ahead:{label:"ahead",color:"text-retro-cyan bg-retro-cyan/20"},behind:{label:"behind",color:"text-retro-orange bg-retro-orange/20"},diverged:{label:"diverged",color:"text-retro-red bg-retro-red/20"}})[r.status]);return(n,p)=>(s(),a("span",{class:g(["px-1.5 py-0.5 text-[10px] font-mono uppercase rounded",o(i).color])},u(o(i).label),3))}}),K={class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},O={class:"flex items-center justify-between px-4 py-3 border-b border-retro-border"},q={key:0,class:"p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},G=["disabled"],I=["disabled"],J={class:"flex justify-end gap-2 pt-2"},Q=["disabled"],X=["disabled"],Y=C({__name:"WorktreeCreateModal",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:["update:modelValue"],setup(h){const r=D(h,"modelValue"),i=N(),n=v(""),p=v(""),m=v(!1),x=v(""),f=async()=>{if(!n.value.trim()){x.value="Description is required";return}m.value=!0,x.value="";try{const d=await i.createWorktree({description:n.value.trim(),shortName:p.value.trim()||void 0});d.success?(n.value="",p.value="",r.value=!1):x.value=d.error||"Failed to create worktree"}catch(d){x.value=d instanceof Error?d.message:"Failed to create worktree"}finally{m.value=!1}},l=()=>{r.value=!1,n.value="",p.value="",x.value=""},_=d=>{d.key==="Escape"&&l()};return j(r,d=>{d?document.addEventListener("keydown",_):document.removeEventListener("keydown",_)}),(d,e)=>(s(),M(E,{to:"body"},[b(T,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:F(()=>[r.value?(s(),a("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:k(l,["self"])},[t("div",K,[t("div",O,[e[2]||(e[2]=t("h3",{class:"text-sm font-mono text-retro-text"},"Create Worktree",-1)),t("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",onClick:l},[b(o(A),{class:"h-4 w-4"})])]),t("form",{class:"p-4 space-y-4",onSubmit:k(f,["prevent"])},[o(x)?(s(),a("div",q,u(o(x)),1)):c("",!0),t("div",null,[e[3]||(e[3]=t("label",{class:"block text-xs font-mono text-retro-muted mb-1"},[$(" Feature Description "),t("span",{class:"text-retro-red"},"*")],-1)),W(t("input",{"onUpdate:modelValue":e[0]||(e[0]=y=>w(n)?n.value=y:null),type:"text",placeholder:"e.g., Add user authentication",class:"w-full px-3 py-2 text-sm font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan",disabled:o(m)},null,8,G),[[S,o(n)]]),e[4]||(e[4]=t("p",{class:"mt-1 text-[10px] font-mono text-retro-subtle"}," A brief description of what this feature does ",-1))]),t("div",null,[e[5]||(e[5]=t("label",{class:"block text-xs font-mono text-retro-muted mb-1"},[$(" Short Name "),t("span",{class:"text-retro-subtle"},"(optional)")],-1)),W(t("input",{"onUpdate:modelValue":e[1]||(e[1]=y=>w(p)?p.value=y:null),type:"text",placeholder:"e.g., auth",class:"w-full px-3 py-2 text-sm font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan",disabled:o(m)},null,8,I),[[S,o(p)]]),e[6]||(e[6]=t("p",{class:"mt-1 text-[10px] font-mono text-retro-subtle"}," Override the auto-generated branch name (e.g., 001-auth instead of 001-add-user-authentication) ",-1))]),t("div",J,[t("button",{type:"button",class:"px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-text bg-retro-panel hover:bg-retro-border rounded transition-colors",disabled:o(m),onClick:l}," Cancel ",8,Q),t("button",{type:"submit",class:"px-3 py-1.5 text-xs font-mono text-retro-black bg-retro-cyan hover:bg-retro-cyan/80 rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:o(m)||!o(n).trim()},u(o(m)?"Creating...":"Create"),9,X)])],32)])])):c("",!0)]),_:1})]))}}),Z={class:"h-full flex flex-col bg-retro-black"},ee={class:"flex-shrink-0 h-12 flex items-center justify-between px-4 border-b border-retro-border bg-retro-dark"},te={class:"flex items-center gap-2"},oe={key:0,class:"px-4 py-2 bg-retro-red/20 border-b border-retro-red/50"},re={class:"text-xs font-mono text-retro-red"},se={class:"flex-1 overflow-y-auto p-2 space-y-1"},ne={class:"flex items-start justify-between gap-2"},ae={class:"flex-1 min-w-0"},le={class:"flex items-center gap-2"},de={key:0,class:"px-1.5 py-0.5 text-[10px] font-mono uppercase bg-retro-yellow/20 text-retro-yellow rounded"},ie={key:1,class:"px-1.5 py-0.5 text-[10px] font-mono uppercase bg-retro-cyan/20 text-retro-cyan rounded"},ce={key:0,class:"mt-1 text-xs font-mono text-retro-muted truncate"},ue={class:"text-retro-subtle"},pe={class:"mt-1 text-[10px] font-mono text-retro-subtle truncate"},me={class:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity"},xe=["onClick"],be=["onClick"],fe={key:0,class:"mt-2 text-[10px] font-mono text-retro-green"},he={key:0,class:"flex flex-col items-center justify-center py-8 text-center"},ye=C({__name:"WorktreePanel",setup(h){const r=N(),i=v(!1);L(()=>{r.fetchWorktrees()});const n=()=>{r.fetchWorktrees()},p=()=>{i.value=!0},m=async f=>{await r.switchWorktree(f)},x=async f=>{confirm(`Delete worktree "${f}"? This will remove the worktree directory.`)&&await r.deleteWorktree(f,!1)};return(f,l)=>{const _=H,d=Y;return s(),a("div",Z,[t("div",ee,[l[1]||(l[1]=t("h2",{class:"text-sm font-mono text-retro-text"},"Worktrees",-1)),t("div",te,[t("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Refresh",onClick:n},[b(o(V),{class:g(["h-4 w-4",{"animate-spin":o(r).loading}])},null,8,["class"])]),t("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-green hover:bg-retro-panel transition-colors",title:"Create worktree",onClick:p},[b(o(P),{class:"h-4 w-4"})])])]),o(r).error?(s(),a("div",oe,[t("p",re,u(o(r).error),1)])):c("",!0),t("div",se,[(s(!0),a(R,null,z(o(r).worktrees,e=>(s(),a("div",{key:e.name,class:g(["group p-3 rounded-md border transition-colors",[e.isCurrent?"bg-retro-cyan/10 border-retro-cyan":"bg-retro-panel border-retro-border hover:border-retro-muted"]])},[t("div",ne,[t("div",ae,[t("div",le,[t("span",{class:g(["font-mono text-sm truncate",e.isCurrent?"text-retro-cyan":"text-retro-text"])},u(e.name),3),b(_,{status:e.status},null,8,["status"]),e.isMain?(s(),a("span",de," main ")):c("",!0),e.isCurrent?(s(),a("span",ie," current ")):c("",!0)]),e.lastCommit?(s(),a("div",ce,[t("span",ue,u(e.lastCommit.shortHash),1),l[2]||(l[2]=t("span",{class:"mx-1"},"·",-1)),t("span",null,u(e.lastCommit.message),1)])):c("",!0),t("div",pe,u(e.path),1)]),t("div",me,[!e.isCurrent&&!e.isMain?(s(),a("button",{key:0,type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-dark transition-colors",title:"Switch to this worktree",onClick:k(y=>m(e.name),["stop"])},[b(o(V),{class:"h-3.5 w-3.5"})],8,xe)):c("",!0),e.isMain?c("",!0):(s(),a("button",{key:1,type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-red hover:bg-retro-dark transition-colors",title:"Delete worktree",onClick:k(y=>x(e.name),["stop"])},[b(o(U),{class:"h-3.5 w-3.5"})],8,be))])]),e.commitCount>0?(s(),a("div",fe,u(e.commitCount)+" commit"+u(e.commitCount>1?"s":"")+" ahead ",1)):c("",!0)],2))),128)),!o(r).loading&&o(r).worktrees.length===0?(s(),a("div",he,[...l[3]||(l[3]=[t("p",{class:"text-sm font-mono text-retro-muted"},"No worktrees found",-1),t("p",{class:"mt-1 text-xs font-mono text-retro-subtle"},"Create a new worktree to start working on a feature",-1)])])):c("",!0)]),b(d,{modelValue:o(i),"onUpdate:modelValue":l[0]||(l[0]=e=>w(i)?i.value=e:null)},null,8,["modelValue"])])}}}),ge=C({__name:"index",setup(h){return(r,i)=>{const n=ye;return s(),M(n)}}});export{ge as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{y as h,z as m,A as d,d as xe,L as ne,P as _e,Q as lr,S as cr,U as wn,B as E,K as C,C as we,G as c,g as Ne,k as y,H as re,I as he,J as Oe,N as Ht,E as Ze,V as ur}from"./wserZ5KO.js";import{a as pr,m as hr,u as dr}from"./D_05ko21.js";import{_ as fr}from"./DlAUqK2U.js";function mr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function gr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Gt(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function Pn(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function yn(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})])}function kr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function xr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})])}function br(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})])}function ci(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})])}function wr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"})])}function ui(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})])}function yr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})])}function vn(t){if(typeof document>"u"||!document.body)throw new Error("Clipboard is unavailable in this environment");const e=document.createElement("textarea"),n=document.activeElement instanceof HTMLElement?document.activeElement:null;e.value=t,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.top="0",e.style.left="-9999px",e.style.opacity="0",document.body.appendChild(e);try{if(e.focus(),e.select(),e.setSelectionRange(0,e.value.length),!(typeof document.execCommand=="function"&&document.execCommand("copy")))throw new Error("Failed to copy to clipboard")}finally{document.body.removeChild(e),n?.focus()}}async function vr(t){if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{vn(t);return}vn(t)}const Tr={class:"flex items-start justify-between gap-2"},_r={class:"flex-1 min-w-0"},Ar={key:1,class:"flex items-center gap-2"},Sr={class:"text-sm font-mono text-retro-text truncate"},Er={key:0,class:"text-xs font-mono text-retro-green bg-retro-green/10 px-1.5 py-0.5 rounded flex-shrink-0"},Rr={key:2,class:"text-xs font-mono text-retro-cyan bg-retro-cyan/10 px-1.5 py-0.5 rounded border border-retro-cyan/30 flex-shrink-0"},Cr={class:"text-xs text-retro-muted mt-1 truncate"},Lr={class:"text-xs text-retro-muted/60 mt-1"},$r={class:"truncate"},Ir={class:"truncate"},Mr={class:"truncate"},Dr=xe({__name:"ConversationItem",props:{conversation:{},isActive:{type:Boolean},isStreaming:{type:Boolean},isPreviewing:{type:Boolean}},emits:["select","archive","rename"],setup(t,{emit:e}){const n=t,s=e,r=Ne(!1),i=Ne("");function a(){i.value=n.conversation.title,r.value=!0}function l(){const A=i.value.trim();A&&A!==n.conversation.title&&s("rename",A),r.value=!1}function f(){r.value=!1}const u=pr();async function T(A){try{await vr(A),u.success("Copied to clipboard",1500)}catch{u.error("Failed to copy")}}const S=y(()=>{const A=n.conversation.messages;if(!A.length)return"No messages";const x=A[A.length-1],$=x.content.slice(0,60);return $.length<x.content.length?$+"...":$}),_=y(()=>{const A=new Date(n.conversation.updatedAt),$=new Date().getTime()-A.getTime(),ee=Math.floor($/(1e3*60*60*24));return ee===0?A.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):ee===1?"Yesterday":ee<7?`${ee} days ago`:A.toLocaleDateString()});return(A,x)=>(h(),m("div",{class:ne(["p-3 rounded border cursor-pointer transition-colors",[t.isPreviewing&&t.isActive?"border-retro-magenta bg-retro-magenta/15 ring-1 ring-retro-magenta/40":t.isPreviewing?"border-retro-magenta/40 bg-retro-magenta/5":t.isActive?"border-retro-cyan/80 bg-retro-cyan/8":"border-retro-border hover:border-retro-cyan/40",t.isStreaming&&t.isPreviewing&&t.isActive?"streaming-preview-active-border":t.isStreaming&&t.isPreviewing?"streaming-preview-border":t.isStreaming&&t.isActive?"streaming-active-border":t.isStreaming?"streaming-border":"",t.conversation.finalized?"opacity-50":""]]),onClick:x[8]||(x[8]=$=>s("select"))},[d("div",Tr,[d("div",_r,[r.value?(h(),m("div",{key:0,class:"flex gap-2",onClick:x[1]||(x[1]=_e(()=>{},["stop"]))},[lr(d("input",{"onUpdate:modelValue":x[0]||(x[0]=$=>i.value=$),onKeyup:[wn(l,["enter"]),wn(f,["escape"])],onBlur:l,class:"flex-1 px-2 py-1 text-sm font-mono bg-retro-black border border-retro-cyan rounded text-retro-text focus:outline-none focus:ring-1 focus:ring-retro-cyan",autofocus:""},null,544),[[cr,i.value]])])):(h(),m("div",Ar,[d("h3",Sr,E(t.conversation.title),1),t.conversation.finalized?(h(),m("span",Er," finalized ")):t.isPreviewing?(h(),m("span",{key:1,class:ne(["text-xs font-mono px-1.5 py-0.5 rounded border border-retro-magenta/30 flex-shrink-0",t.isActive?"text-retro-magenta bg-retro-magenta/15":"text-retro-magenta/80 bg-retro-magenta/5"])}," previewing ",2)):C("",!0),t.isStreaming?(h(),m("span",Rr," streaming ")):C("",!0)])),d("p",Cr,E(S.value),1),d("p",Lr,E(_.value),1),t.conversation.worktreeBranch||t.conversation.baseBranch?(h(),m("div",{key:2,class:"mt-1.5 flex flex-wrap gap-1",onClick:x[5]||(x[5]=_e(()=>{},["stop"]))},[t.conversation.baseBranch?(h(),m("button",{key:0,onClick:x[2]||(x[2]=$=>T(t.conversation.baseBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-cyan/30 text-retro-cyan hover:border-retro-cyan hover:bg-retro-cyan/10 transition-colors max-w-full",title:"Click to copy base branch"},[we(c(yn),{class:"w-3 h-3 flex-shrink-0"}),d("span",$r,"base: "+E(t.conversation.baseBranch),1)])):C("",!0),d("button",{onClick:x[3]||(x[3]=$=>T(t.conversation.worktreeBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-green/30 text-retro-green hover:border-retro-green hover:bg-retro-green/10 transition-colors max-w-full",title:"Click to copy branch"},[we(c(yn),{class:"w-3 h-3 flex-shrink-0"}),d("span",Ir,E(t.conversation.worktreeBranch),1)]),t.conversation.worktreePath?(h(),m("button",{key:1,onClick:x[4]||(x[4]=$=>T(t.conversation.worktreePath)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-muted/30 text-retro-muted hover:border-retro-muted hover:bg-retro-muted/10 transition-colors max-w-full",title:"Click to copy path"},[we(c(br),{class:"w-3 h-3 flex-shrink-0"}),d("span",Mr,E(t.conversation.worktreePath),1)])):C("",!0)])):C("",!0)]),d("div",{class:"flex gap-1 flex-shrink-0",onClick:x[7]||(x[7]=_e(()=>{},["stop"]))},[d("button",{onClick:a,class:"p-1 hover:bg-retro-panel rounded transition-colors",title:"Rename conversation"},[we(c(wr),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})]),d("button",{onClick:x[6]||(x[6]=$=>s("archive")),class:"p-1 hover:bg-retro-cyan/20 rounded transition-colors",title:"Archive conversation"},[we(c(mr),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})])])])],2))}}),pi=fr(Dr,[["__scopeId","data-v-64e8df74"]]),Or={key:0,class:"h-3 w-3 flex-shrink-0 rounded-full border-2 border-retro-yellow border-t-transparent animate-spin"},Nr={key:2,class:"h-2 w-2 flex-shrink-0 rounded-full bg-retro-muted/70"},Pr={class:"text-retro-muted"},zr={class:"truncate text-retro-muted"},Br={key:3,class:"hidden flex-shrink-0 text-retro-muted/70 sm:inline"},Ur={key:0,class:"space-y-1 border-t border-retro-border/20 px-3 pb-2 pt-2"},Fr={class:"min-w-14 flex-shrink-0"},Hr={class:"flex-shrink-0 text-retro-cyan"},Gr={class:"break-all"},Wr=xe({__name:"ChatToolGroupSummary",props:{tools:{}},setup(t){const e=t,n=Ne(!1),s=y(()=>e.tools.filter(S=>S.status==="running").length),r=y(()=>e.tools.filter(S=>S.status==="pending").length),i=y(()=>e.tools.filter(S=>S.status==="complete").length),a=y(()=>[...e.tools].reverse().find(S=>S.status!=="complete")??e.tools[e.tools.length-1]);function l(S){const _=S.inputSummary.trim();return _?`${S.name} ${_}`:S.name}const f=y(()=>{const S=a.value;if(!S)return"Tools";const _=l(S);return e.tools.length===1?_:s.value>0||r.value>0?`${e.tools.length} tools · latest ${_}`:`${e.tools.length} tools · ${_}`}),u=y(()=>s.value>0?"[RUN]":r.value>0?"[WAIT]":"[TOOLS]"),T=y(()=>s.value>0||r.value>0);return(S,_)=>(h(),m("div",{class:ne(["my-2 rounded border",c(T)?"border-retro-border/40 bg-retro-dark/30":"border-retro-border/20 bg-retro-panel/20"]),"data-testid":"tool-group-summary"},[d("button",{class:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-mono transition-colors hover:bg-retro-dark/30",onClick:_[0]||(_[0]=A=>n.value=!c(n))},[c(s)>0?(h(),m("span",Or)):c(r)>0?(h(),re(c(Pn),{key:1,class:"h-3.5 w-3.5 flex-shrink-0 animate-pulse text-retro-muted"})):(h(),m("span",Nr)),d("span",Pr,E(c(u)),1),_[1]||(_[1]=d("span",{class:"font-bold text-retro-cyan"},"Tools",-1)),d("span",zr,E(c(f)),1),c(T)&&c(i)>0?(h(),m("span",Br," · "+E(c(i))+" done ",1)):C("",!0),we(c(Gt),{class:ne(["ml-auto h-3 w-3 flex-shrink-0 text-retro-muted transition-transform",{"rotate-90":c(n)}])},null,8,["class"])]),c(n)?(h(),m("div",Ur,[(h(!0),m(he,null,Oe(t.tools,A=>(h(),m("div",{key:A.id,class:"flex items-start gap-2 text-xs font-mono text-retro-muted"},[d("span",Fr,E(A.status==="running"?"[RUN]":A.status==="pending"?"[WAIT]":"[OK]"),1),d("span",Hr,E(A.name),1),d("span",Gr,E(A.inputSummary||"No summary available"),1)]))),128))])):C("",!0)],2))}});function Wt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Se=Wt();function zn(t){Se=t}var Ye={exec:()=>null};function I(t,e=""){let n=typeof t=="string"?t:t.source;const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(X.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}var X={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},jr=/^(?:[ \t]*(?:\n|$))+/,qr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ve=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jt=/(?:[*+-]|\d{1,9}[.)])/,Bn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Un=I(Bn).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vr=I(Bn).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xr=/^[^\n]+/,Zt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Qr=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Kr=I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jt).getRegex(),ft="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jr=I("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Yt).replace("tag",ft).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fn=I(qt).replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex(),es=I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fn).getRegex(),Vt={blockquote:es,code:qr,def:Qr,fences:Zr,heading:Yr,hr:Ve,html:Jr,lheading:Un,list:Kr,newline:jr,paragraph:Fn,table:Ye,text:Xr},Tn=I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex(),ts={...Vt,lheading:Vr,table:Tn,paragraph:I(qt).replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Tn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex()},ns={...Vt,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ye,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(qt).replace("hr",Ve).replace("heading",` *#{1,6} *[^
|
|
1
|
+
import{y as h,z as m,A as d,d as xe,L as ne,P as _e,Q as lr,S as cr,U as wn,B as E,K as C,C as we,G as c,g as Ne,k as y,H as re,I as he,J as Oe,N as Ht,E as Ze,V as ur}from"./B_IFBYSw.js";import{a as pr,m as hr,u as dr}from"./CDdYT-E3.js";import{_ as fr}from"./DlAUqK2U.js";function mr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function gr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Gt(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function Pn(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function yn(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})])}function kr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function xr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})])}function br(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})])}function ci(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})])}function wr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"})])}function ui(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})])}function yr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})])}function vn(t){if(typeof document>"u"||!document.body)throw new Error("Clipboard is unavailable in this environment");const e=document.createElement("textarea"),n=document.activeElement instanceof HTMLElement?document.activeElement:null;e.value=t,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.top="0",e.style.left="-9999px",e.style.opacity="0",document.body.appendChild(e);try{if(e.focus(),e.select(),e.setSelectionRange(0,e.value.length),!(typeof document.execCommand=="function"&&document.execCommand("copy")))throw new Error("Failed to copy to clipboard")}finally{document.body.removeChild(e),n?.focus()}}async function vr(t){if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{vn(t);return}vn(t)}const Tr={class:"flex items-start justify-between gap-2"},_r={class:"flex-1 min-w-0"},Ar={key:1,class:"flex items-center gap-2"},Sr={class:"text-sm font-mono text-retro-text truncate"},Er={key:0,class:"text-xs font-mono text-retro-green bg-retro-green/10 px-1.5 py-0.5 rounded flex-shrink-0"},Rr={key:2,class:"text-xs font-mono text-retro-cyan bg-retro-cyan/10 px-1.5 py-0.5 rounded border border-retro-cyan/30 flex-shrink-0"},Cr={class:"text-xs text-retro-muted mt-1 truncate"},Lr={class:"text-xs text-retro-muted/60 mt-1"},$r={class:"truncate"},Ir={class:"truncate"},Mr={class:"truncate"},Dr=xe({__name:"ConversationItem",props:{conversation:{},isActive:{type:Boolean},isStreaming:{type:Boolean},isPreviewing:{type:Boolean}},emits:["select","archive","rename"],setup(t,{emit:e}){const n=t,s=e,r=Ne(!1),i=Ne("");function a(){i.value=n.conversation.title,r.value=!0}function l(){const A=i.value.trim();A&&A!==n.conversation.title&&s("rename",A),r.value=!1}function f(){r.value=!1}const u=pr();async function T(A){try{await vr(A),u.success("Copied to clipboard",1500)}catch{u.error("Failed to copy")}}const S=y(()=>{const A=n.conversation.messages;if(!A.length)return"No messages";const x=A[A.length-1],$=x.content.slice(0,60);return $.length<x.content.length?$+"...":$}),_=y(()=>{const A=new Date(n.conversation.updatedAt),$=new Date().getTime()-A.getTime(),ee=Math.floor($/(1e3*60*60*24));return ee===0?A.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):ee===1?"Yesterday":ee<7?`${ee} days ago`:A.toLocaleDateString()});return(A,x)=>(h(),m("div",{class:ne(["p-3 rounded border cursor-pointer transition-colors",[t.isPreviewing&&t.isActive?"border-retro-magenta bg-retro-magenta/15 ring-1 ring-retro-magenta/40":t.isPreviewing?"border-retro-magenta/40 bg-retro-magenta/5":t.isActive?"border-retro-cyan/80 bg-retro-cyan/8":"border-retro-border hover:border-retro-cyan/40",t.isStreaming&&t.isPreviewing&&t.isActive?"streaming-preview-active-border":t.isStreaming&&t.isPreviewing?"streaming-preview-border":t.isStreaming&&t.isActive?"streaming-active-border":t.isStreaming?"streaming-border":"",t.conversation.finalized?"opacity-50":""]]),onClick:x[8]||(x[8]=$=>s("select"))},[d("div",Tr,[d("div",_r,[r.value?(h(),m("div",{key:0,class:"flex gap-2",onClick:x[1]||(x[1]=_e(()=>{},["stop"]))},[lr(d("input",{"onUpdate:modelValue":x[0]||(x[0]=$=>i.value=$),onKeyup:[wn(l,["enter"]),wn(f,["escape"])],onBlur:l,class:"flex-1 px-2 py-1 text-sm font-mono bg-retro-black border border-retro-cyan rounded text-retro-text focus:outline-none focus:ring-1 focus:ring-retro-cyan",autofocus:""},null,544),[[cr,i.value]])])):(h(),m("div",Ar,[d("h3",Sr,E(t.conversation.title),1),t.conversation.finalized?(h(),m("span",Er," finalized ")):t.isPreviewing?(h(),m("span",{key:1,class:ne(["text-xs font-mono px-1.5 py-0.5 rounded border border-retro-magenta/30 flex-shrink-0",t.isActive?"text-retro-magenta bg-retro-magenta/15":"text-retro-magenta/80 bg-retro-magenta/5"])}," previewing ",2)):C("",!0),t.isStreaming?(h(),m("span",Rr," streaming ")):C("",!0)])),d("p",Cr,E(S.value),1),d("p",Lr,E(_.value),1),t.conversation.worktreeBranch||t.conversation.baseBranch?(h(),m("div",{key:2,class:"mt-1.5 flex flex-wrap gap-1",onClick:x[5]||(x[5]=_e(()=>{},["stop"]))},[t.conversation.baseBranch?(h(),m("button",{key:0,onClick:x[2]||(x[2]=$=>T(t.conversation.baseBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-cyan/30 text-retro-cyan hover:border-retro-cyan hover:bg-retro-cyan/10 transition-colors max-w-full",title:"Click to copy base branch"},[we(c(yn),{class:"w-3 h-3 flex-shrink-0"}),d("span",$r,"base: "+E(t.conversation.baseBranch),1)])):C("",!0),d("button",{onClick:x[3]||(x[3]=$=>T(t.conversation.worktreeBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-green/30 text-retro-green hover:border-retro-green hover:bg-retro-green/10 transition-colors max-w-full",title:"Click to copy branch"},[we(c(yn),{class:"w-3 h-3 flex-shrink-0"}),d("span",Ir,E(t.conversation.worktreeBranch),1)]),t.conversation.worktreePath?(h(),m("button",{key:1,onClick:x[4]||(x[4]=$=>T(t.conversation.worktreePath)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-muted/30 text-retro-muted hover:border-retro-muted hover:bg-retro-muted/10 transition-colors max-w-full",title:"Click to copy path"},[we(c(br),{class:"w-3 h-3 flex-shrink-0"}),d("span",Mr,E(t.conversation.worktreePath),1)])):C("",!0)])):C("",!0)]),d("div",{class:"flex gap-1 flex-shrink-0",onClick:x[7]||(x[7]=_e(()=>{},["stop"]))},[d("button",{onClick:a,class:"p-1 hover:bg-retro-panel rounded transition-colors",title:"Rename conversation"},[we(c(wr),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})]),d("button",{onClick:x[6]||(x[6]=$=>s("archive")),class:"p-1 hover:bg-retro-cyan/20 rounded transition-colors",title:"Archive conversation"},[we(c(mr),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})])])])],2))}}),pi=fr(Dr,[["__scopeId","data-v-64e8df74"]]),Or={key:0,class:"h-3 w-3 flex-shrink-0 rounded-full border-2 border-retro-yellow border-t-transparent animate-spin"},Nr={key:2,class:"h-2 w-2 flex-shrink-0 rounded-full bg-retro-muted/70"},Pr={class:"text-retro-muted"},zr={class:"truncate text-retro-muted"},Br={key:3,class:"hidden flex-shrink-0 text-retro-muted/70 sm:inline"},Ur={key:0,class:"space-y-1 border-t border-retro-border/20 px-3 pb-2 pt-2"},Fr={class:"min-w-14 flex-shrink-0"},Hr={class:"flex-shrink-0 text-retro-cyan"},Gr={class:"break-all"},Wr=xe({__name:"ChatToolGroupSummary",props:{tools:{}},setup(t){const e=t,n=Ne(!1),s=y(()=>e.tools.filter(S=>S.status==="running").length),r=y(()=>e.tools.filter(S=>S.status==="pending").length),i=y(()=>e.tools.filter(S=>S.status==="complete").length),a=y(()=>[...e.tools].reverse().find(S=>S.status!=="complete")??e.tools[e.tools.length-1]);function l(S){const _=S.inputSummary.trim();return _?`${S.name} ${_}`:S.name}const f=y(()=>{const S=a.value;if(!S)return"Tools";const _=l(S);return e.tools.length===1?_:s.value>0||r.value>0?`${e.tools.length} tools · latest ${_}`:`${e.tools.length} tools · ${_}`}),u=y(()=>s.value>0?"[RUN]":r.value>0?"[WAIT]":"[TOOLS]"),T=y(()=>s.value>0||r.value>0);return(S,_)=>(h(),m("div",{class:ne(["my-2 rounded border",c(T)?"border-retro-border/40 bg-retro-dark/30":"border-retro-border/20 bg-retro-panel/20"]),"data-testid":"tool-group-summary"},[d("button",{class:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-mono transition-colors hover:bg-retro-dark/30",onClick:_[0]||(_[0]=A=>n.value=!c(n))},[c(s)>0?(h(),m("span",Or)):c(r)>0?(h(),re(c(Pn),{key:1,class:"h-3.5 w-3.5 flex-shrink-0 animate-pulse text-retro-muted"})):(h(),m("span",Nr)),d("span",Pr,E(c(u)),1),_[1]||(_[1]=d("span",{class:"font-bold text-retro-cyan"},"Tools",-1)),d("span",zr,E(c(f)),1),c(T)&&c(i)>0?(h(),m("span",Br," · "+E(c(i))+" done ",1)):C("",!0),we(c(Gt),{class:ne(["ml-auto h-3 w-3 flex-shrink-0 text-retro-muted transition-transform",{"rotate-90":c(n)}])},null,8,["class"])]),c(n)?(h(),m("div",Ur,[(h(!0),m(he,null,Oe(t.tools,A=>(h(),m("div",{key:A.id,class:"flex items-start gap-2 text-xs font-mono text-retro-muted"},[d("span",Fr,E(A.status==="running"?"[RUN]":A.status==="pending"?"[WAIT]":"[OK]"),1),d("span",Hr,E(A.name),1),d("span",Gr,E(A.inputSummary||"No summary available"),1)]))),128))])):C("",!0)],2))}});function Wt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Se=Wt();function zn(t){Se=t}var Ye={exec:()=>null};function I(t,e=""){let n=typeof t=="string"?t:t.source;const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(X.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}var X={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},jr=/^(?:[ \t]*(?:\n|$))+/,qr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ve=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jt=/(?:[*+-]|\d{1,9}[.)])/,Bn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Un=I(Bn).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vr=I(Bn).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xr=/^[^\n]+/,Zt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Qr=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Kr=I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jt).getRegex(),ft="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jr=I("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Yt).replace("tag",ft).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fn=I(qt).replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex(),es=I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fn).getRegex(),Vt={blockquote:es,code:qr,def:Qr,fences:Zr,heading:Yr,hr:Ve,html:Jr,lheading:Un,list:Kr,newline:jr,paragraph:Fn,table:Ye,text:Xr},Tn=I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex(),ts={...Vt,lheading:Vr,table:Tn,paragraph:I(qt).replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Tn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex()},ns={...Vt,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ye,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(qt).replace("hr",Ve).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",Un).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ss=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Hn=/^( {2,}|\\)\n(?!\s*$)/,os=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,mt=/[\p{P}\p{S}]/u,Xt=/[\s\p{P}\p{S}]/u,Gn=/[^\s\p{P}\p{S}]/u,is=I(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xt).getRegex(),Wn=/(?!~)[\p{P}\p{S}]/u,as=/(?!~)[\s\p{P}\p{S}]/u,ls=/(?:[^\s\p{P}\p{S}]|~)/u,cs=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,jn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,us=I(jn,"u").replace(/punct/g,mt).getRegex(),ps=I(jn,"u").replace(/punct/g,Wn).getRegex(),qn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",hs=I(qn,"gu").replace(/notPunctSpace/g,Gn).replace(/punctSpace/g,Xt).replace(/punct/g,mt).getRegex(),ds=I(qn,"gu").replace(/notPunctSpace/g,ls).replace(/punctSpace/g,as).replace(/punct/g,Wn).getRegex(),fs=I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Gn).replace(/punctSpace/g,Xt).replace(/punct/g,mt).getRegex(),ms=I(/\\(punct)/,"gu").replace(/punct/g,mt).getRegex(),gs=I(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ks=I(Yt).replace("(?:-->|$)","-->").getRegex(),xs=I("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ks).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,bs=I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",pt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Zn=I(/^!?\[(label)\]\[(ref)\]/).replace("label",pt).replace("ref",Zt).getRegex(),Yn=I(/^!?\[(ref)\](?:\[\])?/).replace("ref",Zt).getRegex(),ws=I("reflink|nolink(?!\\()","g").replace("reflink",Zn).replace("nolink",Yn).getRegex(),Qt={_backpedal:Ye,anyPunctuation:ms,autolink:gs,blockSkip:cs,br:Hn,code:ss,del:Ye,emStrongLDelim:us,emStrongRDelimAst:hs,emStrongRDelimUnd:fs,escape:rs,link:bs,nolink:Yn,punctuation:is,reflink:Zn,reflinkSearch:ws,tag:xs,text:os,url:Ye},ys={...Qt,link:I(/^!?\[(label)\]\((.*?)\)/).replace("label",pt).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",pt).getRegex()},Nt={...Qt,emStrongRDelimAst:ds,emStrongLDelim:ps,url:I(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},vs={...Nt,br:I(Hn).replace("{2,}","*").getRegex(),text:I(Nt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},it={normal:Vt,gfm:ts,pedantic:ns},Ue={normal:Qt,gfm:Nt,breaks:vs,pedantic:ys},Ts={"&":"&","<":"<",">":">",'"':""","'":"'"},_n=t=>Ts[t];function ue(t,e){if(e){if(X.escapeTest.test(t))return t.replace(X.escapeReplace,_n)}else if(X.escapeTestNoEncode.test(t))return t.replace(X.escapeReplaceNoEncode,_n);return t}function An(t){try{t=encodeURI(t).replace(X.percentDecode,"%")}catch{return null}return t}function Sn(t,e){const n=t.replace(X.findPipe,(i,a,l)=>{let f=!1,u=a;for(;--u>=0&&l[u]==="\\";)f=!f;return f?"|":" |"}),s=n.split(X.splitPipe);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(X.slashPipe,"|");return s}function Fe(t,e,n){const s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function _s(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function En(t,e,n,s,r){const i=e.href,a=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;const f={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,f}function As(t,e,n){const s=t.match(n.other.indentCodeCompensation);if(s===null)return e;const r=s[1];return e.split(`
|
|
3
3
|
`).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[l]=a;return l.length>=r.length?i.slice(r.length):i}).join(`
|
|
4
4
|
`)}var ht=class{options;rules;lexer;constructor(t){this.options=t||Se}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Fe(n,`
|