spec-cat 0.1.35 → 0.1.36
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/{CAqXi7E0.js → -2tR8Cph.js} +1 -1
- package/.output/public/_nuxt/{BouwExBZ.js → BBA9sqLe.js} +1 -1
- package/.output/public/_nuxt/{dbPDc6Lb.js → BdnBYIQg.js} +6 -6
- package/.output/public/_nuxt/{BLiXDnUt.js → BjExtU_8.js} +1 -1
- package/.output/public/_nuxt/{CE6PQN7h.js → C5VmlmOK.js} +1 -1
- package/.output/public/_nuxt/{BKZAxZcC.js → CPsvWw1J.js} +1 -1
- package/.output/public/_nuxt/{2XXwAFmK.js → CUhpW37J.js} +4 -4
- package/.output/public/_nuxt/{BzX5dxvd.js → DFgtAR95.js} +1 -1
- package/.output/public/_nuxt/{DTJSvQUl.js → DIEyni0K.js} +1 -1
- package/.output/public/_nuxt/{CFoLn9L9.js → D_05ko21.js} +1 -1
- package/.output/public/_nuxt/DphOOigU.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/7a0d0443-5ff4-47d0-b629-668dc37b3124.json +1 -0
- package/.output/public/_nuxt/{entry.DWv01Nib.css → entry.DJNhqbsn.css} +1 -1
- package/.output/public/_nuxt/{D1PodrLU.js → lyWV44Wc.js} +1 -1
- package/.output/public/_nuxt/wserZ5KO.js +4 -0
- package/.output/server/chunks/_/error-500.mjs.map +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 +626 -626
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/Bai8qLnn.js +0 -1
- package/.output/public/_nuxt/CxPW3eha.js +0 -4
- package/.output/public/_nuxt/builds/meta/e3e6b956-26c4-4882-9c99-a78efcb98231.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as j,u as N,a as L,o as T,b as B,r as E,c as O,e as H,h as R,f as q,p as I,s as U,g as V,i as A,j as D,n as F,k as g,l as M,m as z,q as $,w as W,t as G,v as K,x as Q,y as J,z as X,A as S,B as _,C as Y,D as Z,E as ee}from"./
|
|
1
|
+
import{d as j,u as N,a as L,o as T,b as B,r as E,c as O,e as H,h as R,f as q,p as I,s as U,g as V,i as A,j as D,n as F,k as g,l as M,m as z,q as $,w as W,t as G,v as K,x as Q,y as J,z as X,A as S,B as _,C as Y,D as Z,E as ee}from"./wserZ5KO.js";import{_ as te}from"./DlAUqK2U.js";const re=(...t)=>t.find(o=>o!==void 0);function ne(t){const o=t.componentName||"NuxtLink";function f(e){return typeof e=="string"&&e.startsWith("#")}function b(e,l,d){const n=d??t.trailingSlash;if(!e||n!=="append"&&n!=="remove")return e;if(typeof e=="string")return C(e,n);const i="path"in e&&e.path!==void 0?e.path:l(e).path;return{...e,name:void 0,path:C(i,n)}}function w(e){const l=N(),d=$(),n=g(()=>!!e.target&&e.target!=="_self"),i=g(()=>{const s=e.to||e.href||"";return typeof s=="string"&&z(s,{acceptRelative:!0})}),y=q("RouterLink"),h=typeof y!="string"?y.useLink:void 0,c=g(()=>{if(e.external)return!0;const s=e.to||e.href||"";return typeof s=="object"?!1:s===""||i.value}),a=g(()=>{const s=e.to||e.href||"";return c.value?s:b(s,l.resolve,e.trailingSlash)}),p=c.value?void 0:h?.({...e,to:a}),m=g(()=>{const s=e.trailingSlash??t.trailingSlash;if(!a.value||i.value||f(a.value))return a.value;if(c.value){const x=typeof a.value=="object"&&"path"in a.value?A(a.value):a.value,k=typeof x=="object"?l.resolve(x).href:x;return C(k,s)}return typeof a.value=="object"?l.resolve(a.value)?.href??null:C(M(d.app.baseURL,a.value),s)});return{to:a,hasTarget:n,isAbsoluteUrl:i,isExternal:c,href:m,isActive:p?.isActive??g(()=>a.value===l.currentRoute.value.path),isExactActive:p?.isExactActive??g(()=>a.value===l.currentRoute.value.path),route:p?.route??g(()=>l.resolve(a.value)),async navigate(s){await F(m.value,{replace:e.replace,external:c.value||n.value})}}}return j({name:o,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:w,setup(e,{slots:l}){const d=N(),{to:n,href:i,navigate:y,isExternal:h,hasTarget:c,isAbsoluteUrl:a}=w(e),p=U(!1),m=V(null),s=u=>{m.value=e.custom?u?.$el?.nextElementSibling:u?.$el};function x(u){return!p.value&&(typeof e.prefetchOn=="string"?e.prefetchOn===u:e.prefetchOn?.[u]??t.prefetchOn?.[u])&&(e.prefetch??t.prefetch)!==!1&&e.noPrefetch!==!0&&e.target!=="_blank"&&!le()}async function k(u=L()){if(p.value)return;p.value=!0;const v=typeof n.value=="string"?n.value:h.value?A(n.value):d.resolve(n.value).fullPath,r=h.value?new URL(v,window.location.href).href:v;await Promise.all([u.hooks.callHook("link:prefetch",r).catch(()=>{}),!h.value&&!c.value&&D(n.value,d).catch(()=>{})])}if(x("visibility")){const u=L();let v,r=null;T(()=>{const P=ie();B(()=>{v=E(()=>{m?.value?.tagName&&(r=P.observe(m.value,async()=>{r?.(),r=null,await k(u)}))})})}),O(()=>{v&&H(v),r?.(),r=null})}return()=>{if(!h.value&&!c.value&&!f(n.value)){const r={ref:s,to:n.value,activeClass:e.activeClass||t.activeClass,exactActiveClass:e.exactActiveClass||t.exactActiveClass,replace:e.replace,ariaCurrentValue:e.ariaCurrentValue,custom:e.custom};return e.custom||(x("interaction")&&(r.onPointerenter=k.bind(null,void 0),r.onFocus=k.bind(null,void 0)),p.value&&(r.class=e.prefetchedClass||t.prefetchedClass),r.rel=e.rel||void 0),R(q("RouterLink"),r,l.default)}const u=e.target||null,v=re(e.noRel?"":e.rel,t.externalRelAttribute,a.value||c.value?"noopener noreferrer":"")||null;return e.custom?l.default?l.default({href:i.value,navigate:y,prefetch:k,get route(){if(!i.value)return;const r=new URL(i.value,window.location.href);return{path:r.pathname,fullPath:r.pathname,get query(){return I(r.search)},hash:r.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:i.value}},rel:v,target:u,isExternal:h.value||c.value,isActive:!1,isExactActive:!1}):null:R("a",{ref:m,href:i.value||null,rel:v,target:u,onClick:r=>{if(!(h.value||c.value))return r.preventDefault(),e.replace?d.replace(i.value):d.push(i.value)}},l.default?.())}}})}const ae=ne(K);function C(t,o){const f=o==="append"?W:G;return z(t)&&!t.startsWith("http")?t:f(t,!0)}function ie(){const t=L();if(t._observer)return t._observer;let o=null;const f=new Map,b=(e,l)=>(o||=new IntersectionObserver(d=>{for(const n of d){const i=f.get(n.target);(n.isIntersecting||n.intersectionRatio>0)&&i&&i()}}),f.set(e,l),o.observe(e),()=>{f.delete(e),o?.unobserve(e),f.size===0&&(o?.disconnect(),o=null)});return t._observer={observe:b}}const oe=/2g/;function le(){const t=navigator.connection;return!!(t&&(t.saveData||oe.test(t.effectiveType)))}const se={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},ue={class:"max-w-520px text-center z-20"},ce=["textContent"],fe=["textContent"],de={class:"flex items-center justify-center w-full"},ve={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},status:{type:Number,default:404},statusText:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const o=t;return Q({title:`${o.status} - ${o.statusText} | ${o.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(f,b)=>{const w=ae;return J(),X("div",se,[b[0]||(b[0]=S("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),S("div",ue,[S("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:_(t.status)},null,8,ce),S("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:_(t.description)},null,8,fe),S("div",de,[Y(w,{to:"/",class:"cursor-pointer gradient-border px-4 py-2 sm:px-6 sm:py-3 sm:text-xl text-md"},{default:Z(()=>[ee(_(t.backHome),1)]),_:1})])])])}}},ge=te(ve,[["__scopeId","data-v-5b1d1387"]]);export{ge as default};
|
|
@@ -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"./wserZ5KO.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,4 +1,4 @@
|
|
|
1
|
-
import{u as Y,r as j,a as Q,C as q,_ as i,b as X,c as _,d as w,e as n,f as Z}from"./
|
|
1
|
+
import{u as Y,r as j,a as Q,C as q,_ as i,b as X,c as _,d as w,e as n,f as Z}from"./CUhpW37J.js";import{u as ee}from"./D_05ko21.js";import{d as te,o as se,z as a,A as t,G as c,H as S,I as A,J as I,C as o,K as oe,g as re,k as ne,y as r,L as ae,B as T}from"./wserZ5KO.js";import"./DlAUqK2U.js";const ie={class:"h-screen flex flex-col bg-retro-black text-retro-text font-mono overflow-hidden"},le={class:"h-14 shrink-0 border-b border-retro-border bg-retro-panel/50 px-8 flex items-center justify-between"},de={class:"shrink-0 flex border-b border-retro-border bg-retro-panel/30"},pe=["onClick"],ce={class:"flex-1 min-h-0 overflow-y-auto"},ue={key:0,class:"p-8"},me={class:"grid grid-cols-2 gap-4"},be={class:"px-2 py-0.5 bg-retro-panel border border-retro-border text-[10px] text-retro-muted font-bold rounded uppercase tracking-tight"},ge={key:1,class:"p-8 space-y-6 max-w-2xl mx-auto"},ke={class:"space-y-2"},xe={class:"space-y-2"},he={class:"space-y-2"},ye={class:"space-y-2"},fe={class:"space-y-2"},ve={class:"space-y-2"},_e={key:2,class:"p-8 space-y-8 max-w-2xl mx-auto"},we={class:"space-y-2"},Se={class:"space-y-2"},Ae={class:"space-y-2"},Ie={class:"space-y-2"},Te={class:"space-y-2"},Be={class:"space-y-2"},$e={class:"space-y-2"},Ue={class:"space-y-2"},Ce={class:"space-y-2"},Ee={class:"space-y-2"},Re={class:"space-y-2"},Me={class:"space-y-2"},De={class:"space-y-2"},Pe=te({__name:"design-guide",setup(Oe){const{isDark:B,toggleTheme:m}=Y(),$=ee();se(async()=>{await $.hydrate()});const b=[{id:"m1",role:"user",content:"Design System Validation Message",timestamp:new Date().toISOString()}],g={id:"blk-session-1",type:"session_init",model:"claude-sonnet-4-6",tools:["Read","Write","Edit","Bash","Glob","Grep","Agent"],permissionMode:"auto",cwd:"/Users/red/src/brick"},l={id:"blk-text-1",type:"text",text:"Here is a simple text response from the assistant."},k={id:"blk-text-2",type:"text",text:`## Markdown Rendering
|
|
2
2
|
|
|
3
3
|
This block demonstrates **bold**, *italic*, \`inline code\`, and:
|
|
4
4
|
|
|
@@ -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"./CxPW3eha.js";import{a as pr,m as hr,u as dr}from"./CFoLn9L9.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"./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} *[^
|
|
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,`
|
|
@@ -54,11 +54,11 @@ ${t}</tr>
|
|
|
54
54
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ue(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n),r=An(t);if(r===null)return s;t=r;let i='<a href="'+t+'"';return e&&(i+=' title="'+ue(e)+'"'),i+=">"+s+"</a>",i}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));const r=An(t);if(r===null)return ue(n);t=r;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${ue(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ue(t.text)}},Kt=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},ke=class zt{options;renderer;textRenderer;constructor(e){this.options=e||Se,this.options.renderer=this.options.renderer||new dt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Kt}static parse(e,n){return new zt(n).parse(e)}static parseInline(e,n){return new zt(n).parseInline(e)}parse(e,n=!0){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions?.renderers?.[i.type]){const l=i,f=this.options.extensions.renderers[l.type].call({parser:this},l);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){s+=f||"";continue}}const a=i;switch(a.type){case"space":{s+=this.renderer.space(a);continue}case"hr":{s+=this.renderer.hr(a);continue}case"heading":{s+=this.renderer.heading(a);continue}case"code":{s+=this.renderer.code(a);continue}case"table":{s+=this.renderer.table(a);continue}case"blockquote":{s+=this.renderer.blockquote(a);continue}case"list":{s+=this.renderer.list(a);continue}case"html":{s+=this.renderer.html(a);continue}case"paragraph":{s+=this.renderer.paragraph(a);continue}case"text":{let l=a,f=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],f+=`
|
|
55
55
|
`+this.renderer.text(l);n?s+=this.renderer.paragraph({type:"paragraph",raw:f,text:f,tokens:[{type:"text",raw:f,text:f,escaped:!0}]}):s+=f;continue}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}parseInline(e,n=this.renderer){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions?.renderers?.[i.type]){const l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}const a=i;switch(a.type){case"escape":{s+=n.text(a);break}case"html":{s+=n.html(a);break}case"link":{s+=n.link(a);break}case"image":{s+=n.image(a);break}case"strong":{s+=n.strong(a);break}case"em":{s+=n.em(a);break}case"codespan":{s+=n.codespan(a);break}case"br":{s+=n.br(a);break}case"del":{s+=n.del(a);break}case"text":{s+=n.text(a);break}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},ct=class{options;block;constructor(t){this.options=t||Se}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?ge.lex:ge.lexInline}provideParser(){return this.block?ke.parse:ke.parseInline}},Ss=class{defaults=Wt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ke;Renderer=dt;TextRenderer=Kt;Lexer=ge;Tokenizer=ht;Hooks=ct;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{const r=s;for(const i of r.header)n=n.concat(this.walkTokens(i.tokens,e));for(const i of r.rows)for(const a of i)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{const r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{const r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{const a=r[i].flat(1/0);n=n.concat(this.walkTokens(a,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const i=e.renderers[r.name];i?e.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){const r=this.defaults.renderer||new dt(this.defaults);for(const i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,l=n.renderer[a],f=r[a];r[a]=(...u)=>{let T=l.apply(r,u);return T===!1&&(T=f.apply(r,u)),T||""}}s.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new ht(this.defaults);for(const i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,l=n.tokenizer[a],f=r[a];r[a]=(...u)=>{let T=l.apply(r,u);return T===!1&&(T=f.apply(r,u)),T}}s.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new ct;for(const i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,l=n.hooks[a],f=r[a];ct.passThroughHooks.has(i)?r[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(r,u)).then(S=>f.call(r,S));const T=l.call(r,u);return f.call(r,T)}:r[a]=(...u)=>{let T=l.apply(r,u);return T===!1&&(T=f.apply(r,u)),T}}s.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ge.lex(t,e??this.defaults)}parser(t,e){return ke.parse(t,e??this.defaults)}parseMarkdown(t){return(n,s)=>{const r={...s},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const l=i.hooks?i.hooks.provideLexer():t?ge.lex:ge.lexInline,f=i.hooks?i.hooks.provideParser():t?ke.parse:ke.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(u=>l(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>f(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let u=l(n,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let T=f(u,i);return i.hooks&&(T=i.hooks.postprocess(T)),T}catch(u){return a(u)}}}onError(t,e){return n=>{if(n.message+=`
|
|
56
56
|
Please report this to https://github.com/markedjs/marked.`,t){const s="<p>An error occurred:</p><pre>"+ue(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ae=new Ss;function D(t,e){return Ae.parse(t,e)}D.options=D.setOptions=function(t){return Ae.setOptions(t),D.defaults=Ae.defaults,zn(D.defaults),D};D.getDefaults=Wt;D.defaults=Se;D.use=function(...t){return Ae.use(...t),D.defaults=Ae.defaults,zn(D.defaults),D};D.walkTokens=function(t,e){return Ae.walkTokens(t,e)};D.parseInline=Ae.parseInline;D.Parser=ke;D.parser=ke.parse;D.Renderer=dt;D.TextRenderer=Kt;D.Lexer=ge;D.lexer=ge.lex;D.Tokenizer=ht;D.Hooks=ct;D.parse=D;D.options;D.setOptions;D.use;D.walkTokens;D.parseInline;ke.parse;ge.lex;const{entries:Vn,setPrototypeOf:Rn,isFrozen:Es,getPrototypeOf:Rs,getOwnPropertyDescriptor:Cs}=Object;let{freeze:Q,seal:se,create:Bt}=Object,{apply:Ut,construct:Ft}=typeof Reflect<"u"&&Reflect;Q||(Q=function(e){return e});se||(se=function(e){return e});Ut||(Ut=function(e,n){for(var s=arguments.length,r=new Array(s>2?s-2:0),i=2;i<s;i++)r[i-2]=arguments[i];return e.apply(n,r)});Ft||(Ft=function(e){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return new e(...s)});const at=K(Array.prototype.forEach),Ls=K(Array.prototype.lastIndexOf),Cn=K(Array.prototype.pop),He=K(Array.prototype.push),$s=K(Array.prototype.splice),ut=K(String.prototype.toLowerCase),Lt=K(String.prototype.toString),$t=K(String.prototype.match),Ge=K(String.prototype.replace),Is=K(String.prototype.indexOf),Ms=K(String.prototype.trim),ie=K(Object.prototype.hasOwnProperty),V=K(RegExp.prototype.test),We=Ds(TypeError);function K(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return Ut(t,e,s)}}function Ds(t){return function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return Ft(t,n)}}function R(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ut;Rn&&Rn(t,null);let s=e.length;for(;s--;){let r=e[s];if(typeof r=="string"){const i=n(r);i!==r&&(Es(e)||(e[s]=i),r=i)}t[r]=!0}return t}function Os(t){for(let e=0;e<t.length;e++)ie(t,e)||(t[e]=null);return t}function pe(t){const e=Bt(null);for(const[n,s]of Vn(t))ie(t,n)&&(Array.isArray(s)?e[n]=Os(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=pe(s):e[n]=s);return e}function je(t,e){for(;t!==null;){const s=Cs(t,e);if(s){if(s.get)return K(s.get);if(typeof s.value=="function")return K(s.value)}t=Rs(t)}function n(){return null}return n}const Ln=Q(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),It=Q(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mt=Q(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ns=Q(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dt=Q(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ps=Q(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$n=Q(["#text"]),In=Q(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ot=Q(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Mn=Q(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),lt=Q(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zs=se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Bs=se(/<%[\w\W]*|[\w\W]*%>/gm),Us=se(/\$\{[\w\W]*/gm),Fs=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hs=se(/^aria-[\-\w]+$/),Xn=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gs=se(/^(?:\w+script|data):/i),Ws=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qn=se(/^html$/i),js=se(/^[a-z][.\w]*(-[.\w]+)+$/i);var Dn=Object.freeze({__proto__:null,ARIA_ATTR:Hs,ATTR_WHITESPACE:Ws,CUSTOM_ELEMENT:js,DATA_ATTR:Fs,DOCTYPE_NAME:Qn,ERB_EXPR:Bs,IS_ALLOWED_URI:Xn,IS_SCRIPT_OR_DATA:Gs,MUSTACHE_EXPR:zs,TMPLIT_EXPR:Us});const qe={element:1,text:3,progressingInstruction:7,comment:8,document:9},qs=function(){return typeof window>"u"?null:window},Zs=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(s=n.getAttribute(r));const i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},On=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qs();const e=v=>Kn(v);if(e.version="3.3.1",e.removed=[],!t||!t.document||t.document.nodeType!==qe.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const s=n,r=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:l,Element:f,NodeFilter:u,NamedNodeMap:T=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:S,DOMParser:_,trustedTypes:A}=t,x=f.prototype,$=je(x,"cloneNode"),ee=je(x,"remove"),W=je(x,"nextSibling"),B=je(x,"childNodes"),P=je(x,"parentNode");if(typeof a=="function"){const v=n.createElement("template");v.content&&v.content.ownerDocument&&(n=v.content.ownerDocument)}let M,H="";const{implementation:O,createNodeIterator:z,createDocumentFragment:te,getElementsByTagName:be}=n,{importNode:Z}=s;let j=On();e.isSupported=typeof Vn=="function"&&typeof P=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ee,ERB_EXPR:ae,TMPLIT_EXPR:Pe,DATA_ATTR:Xe,ARIA_ATTR:Qe,IS_SCRIPT_OR_DATA:gt,ATTR_WHITESPACE:ye,CUSTOM_ELEMENT:kt}=Dn;let{IS_ALLOWED_URI:Ke}=Dn,w=null;const k=R({},[...Ln,...It,...Mt,...Dt,...$n]);let g=null;const U=R({},[...In,...Ot,...Mn,...lt]);let L=Object.seal(Bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,xt=null;const Re=Object.seal(Bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Jt=!0,bt=!0,en=!1,tn=!0,Ce=!1,Je=!0,ve=!1,wt=!1,yt=!1,Le=!1,et=!1,tt=!1,nn=!0,rn=!1;const er="user-content-";let vt=!0,ze=!1,$e={},le=null;const Tt=R({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let sn=null;const on=R({},["audio","video","img","source","image","track"]);let _t=null;const an=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",de="http://www.w3.org/1999/xhtml";let Ie=de,At=!1,St=null;const tr=R({},[nt,rt,de],Lt);let st=R({},["mi","mo","mn","ms","mtext"]),ot=R({},["annotation-xml"]);const nr=R({},["title","style","font","a","script"]);let Be=null;const rr=["application/xhtml+xml","text/html"],sr="text/html";let G=null,Me=null;const or=n.createElement("form"),ln=function(o){return o instanceof RegExp||o instanceof Function},Et=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Me&&Me===o)){if((!o||typeof o!="object")&&(o={}),o=pe(o),Be=rr.indexOf(o.PARSER_MEDIA_TYPE)===-1?sr:o.PARSER_MEDIA_TYPE,G=Be==="application/xhtml+xml"?Lt:ut,w=ie(o,"ALLOWED_TAGS")?R({},o.ALLOWED_TAGS,G):k,g=ie(o,"ALLOWED_ATTR")?R({},o.ALLOWED_ATTR,G):U,St=ie(o,"ALLOWED_NAMESPACES")?R({},o.ALLOWED_NAMESPACES,Lt):tr,_t=ie(o,"ADD_URI_SAFE_ATTR")?R(pe(an),o.ADD_URI_SAFE_ATTR,G):an,sn=ie(o,"ADD_DATA_URI_TAGS")?R(pe(on),o.ADD_DATA_URI_TAGS,G):on,le=ie(o,"FORBID_CONTENTS")?R({},o.FORBID_CONTENTS,G):Tt,oe=ie(o,"FORBID_TAGS")?R({},o.FORBID_TAGS,G):pe({}),xt=ie(o,"FORBID_ATTR")?R({},o.FORBID_ATTR,G):pe({}),$e=ie(o,"USE_PROFILES")?o.USE_PROFILES:!1,Jt=o.ALLOW_ARIA_ATTR!==!1,bt=o.ALLOW_DATA_ATTR!==!1,en=o.ALLOW_UNKNOWN_PROTOCOLS||!1,tn=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=o.SAFE_FOR_TEMPLATES||!1,Je=o.SAFE_FOR_XML!==!1,ve=o.WHOLE_DOCUMENT||!1,Le=o.RETURN_DOM||!1,et=o.RETURN_DOM_FRAGMENT||!1,tt=o.RETURN_TRUSTED_TYPE||!1,yt=o.FORCE_BODY||!1,nn=o.SANITIZE_DOM!==!1,rn=o.SANITIZE_NAMED_PROPS||!1,vt=o.KEEP_CONTENT!==!1,ze=o.IN_PLACE||!1,Ke=o.ALLOWED_URI_REGEXP||Xn,Ie=o.NAMESPACE||de,st=o.MATHML_TEXT_INTEGRATION_POINTS||st,ot=o.HTML_INTEGRATION_POINTS||ot,L=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&ln(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&ln(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ce&&(bt=!1),et&&(Le=!0),$e&&(w=R({},$n),g=[],$e.html===!0&&(R(w,Ln),R(g,In)),$e.svg===!0&&(R(w,It),R(g,Ot),R(g,lt)),$e.svgFilters===!0&&(R(w,Mt),R(g,Ot),R(g,lt)),$e.mathMl===!0&&(R(w,Dt),R(g,Mn),R(g,lt))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Re.tagCheck=o.ADD_TAGS:(w===k&&(w=pe(w)),R(w,o.ADD_TAGS,G))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Re.attributeCheck=o.ADD_ATTR:(g===U&&(g=pe(g)),R(g,o.ADD_ATTR,G))),o.ADD_URI_SAFE_ATTR&&R(_t,o.ADD_URI_SAFE_ATTR,G),o.FORBID_CONTENTS&&(le===Tt&&(le=pe(le)),R(le,o.FORBID_CONTENTS,G)),o.ADD_FORBID_CONTENTS&&(le===Tt&&(le=pe(le)),R(le,o.ADD_FORBID_CONTENTS,G)),vt&&(w["#text"]=!0),ve&&R(w,["html","head","body"]),w.table&&(R(w,["tbody"]),delete oe.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw We('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw We('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=o.TRUSTED_TYPES_POLICY,H=M.createHTML("")}else M===void 0&&(M=Zs(A,r)),M!==null&&typeof H=="string"&&(H=M.createHTML(""));Q&&Q(o),Me=o}},cn=R({},[...It,...Mt,...Ns]),un=R({},[...Dt,...Ps]),ir=function(o){let p=P(o);(!p||!p.tagName)&&(p={namespaceURI:Ie,tagName:"template"});const b=ut(o.tagName),N=ut(p.tagName);return St[o.namespaceURI]?o.namespaceURI===rt?p.namespaceURI===de?b==="svg":p.namespaceURI===nt?b==="svg"&&(N==="annotation-xml"||st[N]):!!cn[b]:o.namespaceURI===nt?p.namespaceURI===de?b==="math":p.namespaceURI===rt?b==="math"&&ot[N]:!!un[b]:o.namespaceURI===de?p.namespaceURI===rt&&!ot[N]||p.namespaceURI===nt&&!st[N]?!1:!un[b]&&(nr[b]||!cn[b]):!!(Be==="application/xhtml+xml"&&St[o.namespaceURI]):!1},ce=function(o){He(e.removed,{element:o});try{P(o).removeChild(o)}catch{ee(o)}},Te=function(o,p){try{He(e.removed,{attribute:p.getAttributeNode(o),from:p})}catch{He(e.removed,{attribute:null,from:p})}if(p.removeAttribute(o),o==="is")if(Le||et)try{ce(p)}catch{}else try{p.setAttribute(o,"")}catch{}},pn=function(o){let p=null,b=null;if(yt)o="<remove></remove>"+o;else{const F=$t(o,/^[\r\n\t ]+/);b=F&&F[0]}Be==="application/xhtml+xml"&&Ie===de&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const N=M?M.createHTML(o):o;if(Ie===de)try{p=new _().parseFromString(N,Be)}catch{}if(!p||!p.documentElement){p=O.createDocument(Ie,"template",null);try{p.documentElement.innerHTML=At?H:N}catch{}}const Y=p.body||p.documentElement;return o&&b&&Y.insertBefore(n.createTextNode(b),Y.childNodes[0]||null),Ie===de?be.call(p,ve?"html":"body")[0]:ve?p.documentElement:Y},hn=function(o){return z.call(o.ownerDocument||o,o,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Rt=function(o){return o instanceof S&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof T)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},dn=function(o){return typeof l=="function"&&o instanceof l};function fe(v,o,p){at(v,b=>{b.call(e,o,p,Me)})}const fn=function(o){let p=null;if(fe(j.beforeSanitizeElements,o,null),Rt(o))return ce(o),!0;const b=G(o.nodeName);if(fe(j.uponSanitizeElement,o,{tagName:b,allowedTags:w}),Je&&o.hasChildNodes()&&!dn(o.firstElementChild)&&V(/<[/\w!]/g,o.innerHTML)&&V(/<[/\w!]/g,o.textContent)||o.nodeType===qe.progressingInstruction||Je&&o.nodeType===qe.comment&&V(/<[/\w]/g,o.data))return ce(o),!0;if(!(Re.tagCheck instanceof Function&&Re.tagCheck(b))&&(!w[b]||oe[b])){if(!oe[b]&&gn(b)&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b)))return!1;if(vt&&!le[b]){const N=P(o)||o.parentNode,Y=B(o)||o.childNodes;if(Y&&N){const F=Y.length;for(let J=F-1;J>=0;--J){const me=$(Y[J],!0);me.__removalCount=(o.__removalCount||0)+1,N.insertBefore(me,W(o))}}}return ce(o),!0}return o instanceof f&&!ir(o)||(b==="noscript"||b==="noembed"||b==="noframes")&&V(/<\/no(script|embed|frames)/i,o.innerHTML)?(ce(o),!0):(Ce&&o.nodeType===qe.text&&(p=o.textContent,at([Ee,ae,Pe],N=>{p=Ge(p,N," ")}),o.textContent!==p&&(He(e.removed,{element:o.cloneNode()}),o.textContent=p)),fe(j.afterSanitizeElements,o,null),!1)},mn=function(o,p,b){if(nn&&(p==="id"||p==="name")&&(b in n||b in or))return!1;if(!(bt&&!xt[p]&&V(Xe,p))){if(!(Jt&&V(Qe,p))){if(!(Re.attributeCheck instanceof Function&&Re.attributeCheck(p,o))){if(!g[p]||xt[p]){if(!(gn(o)&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,o)||L.tagNameCheck instanceof Function&&L.tagNameCheck(o))&&(L.attributeNameCheck instanceof RegExp&&V(L.attributeNameCheck,p)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(p,o))||p==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b))))return!1}else if(!_t[p]){if(!V(Ke,Ge(b,ye,""))){if(!((p==="src"||p==="xlink:href"||p==="href")&&o!=="script"&&Is(b,"data:")===0&&sn[o])){if(!(en&&!V(gt,Ge(b,ye,"")))){if(b)return!1}}}}}}}return!0},gn=function(o){return o!=="annotation-xml"&&$t(o,kt)},kn=function(o){fe(j.beforeSanitizeAttributes,o,null);const{attributes:p}=o;if(!p||Rt(o))return;const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:g,forceKeepAttr:void 0};let N=p.length;for(;N--;){const Y=p[N],{name:F,namespaceURI:J,value:me}=Y,De=G(F),Ct=me;let q=F==="value"?Ct:Ms(Ct);if(b.attrName=De,b.attrValue=q,b.keepAttr=!0,b.forceKeepAttr=void 0,fe(j.uponSanitizeAttribute,o,b),q=b.attrValue,rn&&(De==="id"||De==="name")&&(Te(F,o),q=er+q),Je&&V(/((--!?|])>)|<\/(style|title|textarea)/i,q)){Te(F,o);continue}if(De==="attributename"&&$t(q,"href")){Te(F,o);continue}if(b.forceKeepAttr)continue;if(!b.keepAttr){Te(F,o);continue}if(!tn&&V(/\/>/i,q)){Te(F,o);continue}Ce&&at([Ee,ae,Pe],bn=>{q=Ge(q,bn," ")});const xn=G(o.nodeName);if(!mn(xn,De,q)){Te(F,o);continue}if(M&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!J)switch(A.getAttributeType(xn,De)){case"TrustedHTML":{q=M.createHTML(q);break}case"TrustedScriptURL":{q=M.createScriptURL(q);break}}if(q!==Ct)try{J?o.setAttributeNS(J,F,q):o.setAttribute(F,q),Rt(o)?ce(o):Cn(e.removed)}catch{Te(F,o)}}fe(j.afterSanitizeAttributes,o,null)},ar=function v(o){let p=null;const b=hn(o);for(fe(j.beforeSanitizeShadowDOM,o,null);p=b.nextNode();)fe(j.uponSanitizeShadowNode,p,null),fn(p),kn(p),p.content instanceof i&&v(p.content);fe(j.afterSanitizeShadowDOM,o,null)};return e.sanitize=function(v){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,b=null,N=null,Y=null;if(At=!v,At&&(v="<!-->"),typeof v!="string"&&!dn(v))if(typeof v.toString=="function"){if(v=v.toString(),typeof v!="string")throw We("dirty is not a string, aborting")}else throw We("toString is not a function");if(!e.isSupported)return v;if(wt||Et(o),e.removed=[],typeof v=="string"&&(ze=!1),ze){if(v.nodeName){const me=G(v.nodeName);if(!w[me]||oe[me])throw We("root node is forbidden and cannot be sanitized in-place")}}else if(v instanceof l)p=pn("<!---->"),b=p.ownerDocument.importNode(v,!0),b.nodeType===qe.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?p=b:p.appendChild(b);else{if(!Le&&!Ce&&!ve&&v.indexOf("<")===-1)return M&&tt?M.createHTML(v):v;if(p=pn(v),!p)return Le?null:tt?H:""}p&&yt&&ce(p.firstChild);const F=hn(ze?v:p);for(;N=F.nextNode();)fn(N),kn(N),N.content instanceof i&&ar(N.content);if(ze)return v;if(Le){if(et)for(Y=te.call(p.ownerDocument);p.firstChild;)Y.appendChild(p.firstChild);else Y=p;return(g.shadowroot||g.shadowrootmode)&&(Y=Z.call(s,Y,!0)),Y}let J=ve?p.outerHTML:p.innerHTML;return ve&&w["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&V(Qn,p.ownerDocument.doctype.name)&&(J="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
|
57
|
-
`+J),Ce&&at([Ee,ae,Pe],me=>{J=Ge(J,me," ")}),M&&tt?M.createHTML(J):J},e.setConfig=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Et(v),wt=!0},e.clearConfig=function(){Me=null,wt=!1},e.isValidAttribute=function(v,o,p){Me||Et({});const b=G(v),N=G(o);return mn(b,N,p)},e.addHook=function(v,o){typeof o=="function"&&He(j[v],o)},e.removeHook=function(v,o){if(o!==void 0){const p=Ls(j[v],o);return p===-1?void 0:$s(j[v],p,1)[0]}return Cn(j[v])},e.removeHooks=function(v){j[v]=[]},e.removeAllHooks=function(){j=On()},e}var Ys=Kn();function Jn(){function t(e){const n=D.parse(e);return Ys.sanitize(n)}return{renderMarkdown:t}}const Vs=["innerHTML"],Xs=xe({__name:"ChatTextBlock",props:{block:{}},setup(t){const e=t,{renderMarkdown:n}=Jn(),s=y(()=>n(e.block.text));return(r,i)=>t.block.text.trim()?(h(),m("div",{key:0,class:"text-sm font-mono text-retro-text break-words chat-markdown
|
|
58
|
-
`).length),r=y(()=>e.block.thinking.length>0&&e.block.thinking.length<=240&&s.value<=6),i=y(()=>{const a=e.block.thinking.replace(/\s+/g," ").trim();return a?a.length>140?`${a.slice(0,140)}...`:a:""});return Ht(()=>e.block.id,()=>{n.value=r.value},{immediate:!0}),(a,l)=>(h(),m("div",Qs,[d("button",{class:"flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-yellow transition-colors",onClick:l[0]||(l[0]=f=>n.value=!c(n))},[we(c(Gt),{class:ne(["w-3 h-3 transition-transform flex-shrink-0",{"rotate-90":c(n)}])},null,8,["class"]),l[1]||(l[1]=d("span",{class:"text-retro-yellow"},"Thinking",-1)),!c(n)&&c(i)?(h(),m("span",Ks,E(c(i)),1)):C("",!0),d("span",Js,E(c(s))+" lines · "+E(t.block.thinking.length)+" chars ",1)]),c(n)?(h(),m("div",eo,E(t.block.thinking),1)):C("",!0)]))}}),no={class:"my-2 border border-retro-border/40 rounded bg-retro-dark/30"},ro={key:0,class:"w-3 h-3 border-2 border-retro-yellow border-t-transparent rounded-full animate-spin flex-shrink-0"},so={class:"text-retro-muted"},oo={class:"text-retro-cyan font-bold"},io={class:"text-retro-muted truncate"},ao={key:0,class:"px-3 pb-2 border-t border-retro-border/20"},lo={key:0,class:"mt-2"},co={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-36 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},uo={class:"text-xs font-mono text-retro-muted space-y-2 mt-2"},po={key:0,class:"flex items-start gap-2"},ho={class:"text-retro-cyan break-all"},fo={key:1,class:"flex items-start gap-2"},mo={class:"text-retro-cyan break-all whitespace-pre-wrap"},go={key:2,class:"flex items-start gap-2"},ko={key:1,class:"mt-2"},xo={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-52 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},bo={key:0,class:"text-[10px] text-retro-muted mt-1"},wo={class:"mt-2"},yo={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom"},vo={key:2,class:"mt-3"},To={class:"space-y-2"},_o={key:0,class:"text-[11px] font-mono text-retro-yellow mb-1"},Ao={key:1,class:"text-xs font-mono text-retro-text whitespace-pre-wrap"},So={key:2,class:"mt-2 space-y-1"},Eo={key:0,class:"text-retro-muted/80"},Ro={key:3,class:"mt-3 border-t border-retro-border/20 pt-2"},Co={class:"mb-1 text-[10px] text-retro-muted"},Lo={class:"text-retro-green"},$o={class:"text-retro-red"},Io={class:"space-y-0.5"},Mo={class:"whitespace-pre-wrap"},Do={class:"whitespace-pre-wrap"},Oo=xe({__name:"ChatToolBlock",props:{block:{},result:{}},setup(t){const e=t,n=Ne(!1),s=Ne(!1);function r(w,k){for(const g of k){const U=w[g];if(typeof U=="string"&&U.trim())return U}return""}function i(w,k){for(const g of k){const U=w[g];if(typeof U=="number"&&Number.isFinite(U))return U;if(typeof U=="string"&&U.trim()){const L=Number(U);if(Number.isFinite(L))return L}}return null}function a(w,k=14,g=1400){if(!w)return{text:"",truncated:!1};const U=w.split(`
|
|
57
|
+
`+J),Ce&&at([Ee,ae,Pe],me=>{J=Ge(J,me," ")}),M&&tt?M.createHTML(J):J},e.setConfig=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Et(v),wt=!0},e.clearConfig=function(){Me=null,wt=!1},e.isValidAttribute=function(v,o,p){Me||Et({});const b=G(v),N=G(o);return mn(b,N,p)},e.addHook=function(v,o){typeof o=="function"&&He(j[v],o)},e.removeHook=function(v,o){if(o!==void 0){const p=Ls(j[v],o);return p===-1?void 0:$s(j[v],p,1)[0]}return Cn(j[v])},e.removeHooks=function(v){j[v]=[]},e.removeAllHooks=function(){j=On()},e}var Ys=Kn();function Jn(){function t(e){const n=D.parse(e);return Ys.sanitize(n)}return{renderMarkdown:t}}const Vs=["innerHTML"],Xs=xe({__name:"ChatTextBlock",props:{block:{}},setup(t){const e=t,{renderMarkdown:n}=Jn(),s=y(()=>n(e.block.text));return(r,i)=>t.block.text.trim()?(h(),m("div",{key:0,class:"text-sm font-mono text-retro-text break-words chat-markdown px-1",innerHTML:c(s)},null,8,Vs)):C("",!0)}}),Qs={class:"my-1 border border-retro-border/30 rounded bg-retro-dark/30"},Ks={key:0,class:"text-retro-muted/80 truncate min-w-0 flex-1"},Js={class:"ml-auto flex-shrink-0 text-retro-muted/60 text-[10px]"},eo={key:0,class:"px-3 pb-2 text-xs font-mono text-retro-muted whitespace-pre-wrap max-h-60 overflow-y-auto scrollbar-custom border-t border-retro-border/20"},to=xe({__name:"ChatThinkingBlock",props:{block:{}},setup(t){const e=t,n=Ne(!1),s=y(()=>e.block.thinking.split(`
|
|
58
|
+
`).length),r=y(()=>e.block.thinking.length>0&&e.block.thinking.length<=240&&s.value<=6),i=y(()=>{const a=e.block.thinking.replace(/\s+/g," ").trim();return a?a.length>140?`${a.slice(0,140)}...`:a:""});return Ht(()=>e.block.id,()=>{n.value=r.value},{immediate:!0}),(a,l)=>(h(),m("div",Qs,[d("button",{class:"flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-yellow transition-colors",onClick:l[0]||(l[0]=f=>n.value=!c(n))},[we(c(Gt),{class:ne(["w-3 h-3 transition-transform flex-shrink-0",{"rotate-90":c(n)}])},null,8,["class"]),l[1]||(l[1]=d("span",{class:"text-retro-yellow"},"Thinking",-1)),!c(n)&&c(i)?(h(),m("span",Ks,E(c(i)),1)):C("",!0),d("span",Js,E(c(s))+" lines · "+E(t.block.thinking.length)+" chars ",1)]),c(n)?(h(),m("div",eo,E(t.block.thinking),1)):C("",!0)]))}}),no={class:"my-2 border border-retro-border/40 rounded bg-retro-dark/30"},ro={key:0,class:"w-3 h-3 border-2 border-retro-yellow border-t-transparent rounded-full animate-spin flex-shrink-0"},so={class:"text-retro-muted"},oo={class:"text-retro-cyan font-bold"},io={class:"text-retro-muted truncate"},ao={key:0,class:"px-3 pb-2 border-t border-retro-border/20"},lo={key:0,class:"mt-2"},co={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-36 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},uo={class:"text-xs font-mono text-retro-muted space-y-2 mt-2"},po={key:0,class:"flex items-start gap-2"},ho={class:"text-retro-cyan break-all"},fo={key:1,class:"flex items-start gap-2"},mo={class:"text-retro-cyan break-all whitespace-pre-wrap"},go={key:2,class:"flex items-start gap-2"},ko={key:1,class:"mt-2"},xo={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-52 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},bo={key:0,class:"text-[10px] text-retro-muted mt-1"},wo={class:"mt-2"},yo={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom"},vo={key:2,class:"mt-3"},To={class:"space-y-2"},_o={key:0,class:"text-[11px] font-mono text-retro-yellow mb-1"},Ao={key:1,class:"text-xs font-mono text-retro-text whitespace-pre-wrap"},So={key:2,class:"mt-2 space-y-1"},Eo={key:0,class:"text-retro-muted/80"},Ro={key:3,class:"mt-3 border-t border-retro-border/20 pt-2"},Co={class:"mb-1 text-[10px] text-retro-muted"},Lo={class:"text-retro-green"},$o={class:"text-retro-red"},Io={class:"space-y-0.5"},Mo={class:"whitespace-pre-wrap pl-1"},Do={class:"whitespace-pre-wrap pl-1"},Oo=xe({__name:"ChatToolBlock",props:{block:{},result:{}},setup(t){const e=t,n=Ne(!1),s=Ne(!1);function r(w,k){for(const g of k){const U=w[g];if(typeof U=="string"&&U.trim())return U}return""}function i(w,k){for(const g of k){const U=w[g];if(typeof U=="number"&&Number.isFinite(U))return U;if(typeof U=="string"&&U.trim()){const L=Number(U);if(Number.isFinite(L))return L}}return null}function a(w,k=14,g=1400){if(!w)return{text:"",truncated:!1};const U=w.split(`
|
|
59
59
|
`);let L=U.slice(0,k).join(`
|
|
60
60
|
`),oe=U.length>k;return L.length>g&&(L=L.slice(0,g),oe=!0),{text:L,truncated:oe}}const l=y(()=>e.block.name.toLowerCase()),f=y(()=>l.value.replace(/[^a-z0-9]/g,"")),u=y(()=>f.value==="requestuserinput"||f.value==="askuserquestion"),T=y(()=>["read","read_file","readfile"].includes(l.value)),S=y(()=>["write","write_file","writefile","create_file"].includes(l.value)),_=y(()=>["edit","multiedit","replace","edit_file","editfile"].includes(l.value)),A=y(()=>["bash","exec","execcommand","runcommand","shell","run_shell_command"].includes(l.value)),x=y(()=>{if(!u.value)return[];const w=e.block.input.questions;if(Array.isArray(w))return w.map(g=>g&&typeof g=="object"?g:null).filter(g=>!!g);const k={header:r(e.block.input,["header","title"]),id:r(e.block.input,["id"]),question:r(e.block.input,["question"]),prompt:r(e.block.input,["prompt"]),message:r(e.block.input,["message","text","description"]),options:Array.isArray(e.block.input.options)?e.block.input.options:void 0};return!k.question&&!k.prompt&&!k.message&&!k.header?[]:[k]});function $(w,k=120){const g=w.replace(/\s+/g," ").trim();return g?g.length>k?`${g.slice(0,k)}...`:g:""}const ee=y(()=>{const w=x.value[0];return w?$(w.question||w.prompt||w.message||w.header||""):""}),W=y(()=>r(e.block.input,["file_path","path","file","filepath","target_file"])),B=y(()=>{const w=i(e.block.input,["offset","start_line","line"]),k=i(e.block.input,["limit","lines","line_count"]),g=i(e.block.input,["end_line"]);return w!==null&&k!==null?`from line ${w}, ${k} lines`:w!==null&&g!==null?`lines ${w}-${g}`:w!==null?`from line ${w}`:k!==null?`${k} lines`:""}),P=y(()=>r(e.block.input,["content","text","new_content"])),M=y(()=>r(e.block.input,["cmd","command","script","chars"])),H=y(()=>a(P.value)),O=y(()=>{if(u.value)return ee.value||"Prompting user for clarification";if(T.value){if(W.value&&B.value)return`Read ${W.value} (${B.value})`;if(W.value)return`Read ${W.value}`}return S.value&&W.value?`Write ${W.value}`:_.value&&W.value?`Edit ${W.value}`:A.value&&M.value?`$ ${M.value}`:e.block.inputSummary}),z=y(()=>{switch(e.block.status){case"running":return"[RUN]";case"pending":return"[WAIT]";case"complete":return"[OK]";case"error":return"[ERR]"}}),te=y(()=>Object.entries(e.block.input).filter(([k,g])=>g==null||typeof g=="string"&&(!g.trim()||g.length>90)?!1:!["content","new_content","text","old_string","new_string"].includes(k)).slice(0,6).map(([k,g])=>`${k}=${JSON.stringify(g)}`)),be=y(()=>{switch(e.block.status){case"running":return"text-retro-yellow";case"pending":return"text-retro-muted";case"complete":return"text-retro-green";case"error":return"text-retro-red"}}),Z=y(()=>e.result?.content??""),j=y(()=>e.result?.isError??!1),Ee=y(()=>Z.value.length),ae=y(()=>Z.value.split(`
|
|
61
61
|
`)),Pe=y(()=>s.value?ae.value:ae.value.slice(0,6)),Xe=y(()=>!Z.value||!/^diff --git\s|\+\+\+\s|---\s|@@\s/m.test(Z.value)?!1:/^[+\- ]/.test(ae.value.find(k=>k.length>0)||"")||ae.value.some(k=>k.startsWith("@@"))),Qe=y(()=>{if(!Xe.value)return{added:0,removed:0};let w=0,k=0;for(const g of ae.value)g.startsWith("+++")||g.startsWith("---")||(g.startsWith("+")&&(w+=1),g.startsWith("-")&&(k+=1));return{added:w,removed:k}}),gt=y(()=>Z.value?Z.value.split(`
|
|
62
62
|
`).slice(0,3).join(`
|
|
63
63
|
`):""),ye=y(()=>Z.value?ae.value.length>6||Z.value.length>320:!1),kt=y(()=>Z.value.trim().length>0);function Ke(w){return w.startsWith("@@")?"text-retro-cyan bg-retro-cyan/10":w.startsWith("+")&&!w.startsWith("+++")?"text-retro-green bg-retro-green/10":w.startsWith("-")&&!w.startsWith("---")?"text-retro-red bg-retro-red/10":w.startsWith("diff --git")||w.startsWith("index ")||w.startsWith("---")||w.startsWith("+++")?"text-retro-yellow":"text-retro-muted"}return Ht(()=>e.block.id,()=>{n.value=!1,s.value=!1},{immediate:!0}),(w,k)=>(h(),m("div",no,[d("button",{class:"flex items-center gap-2 w-full px-3 py-2 text-xs font-mono hover:bg-retro-dark/40 transition-colors text-left",onClick:k[0]||(k[0]=g=>n.value=!c(n))},[t.block.status==="running"?(h(),m("span",ro)):t.block.status==="pending"?(h(),re(c(Pn),{key:1,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-muted animate-pulse"})):t.block.status==="complete"?(h(),re(c(gr),{key:2,class:ne(["w-3.5 h-3.5 flex-shrink-0",c(be)])},null,8,["class"])):(h(),re(c(xr),{key:3,class:ne(["w-3.5 h-3.5 flex-shrink-0",c(be)])},null,8,["class"])),d("span",so,E(c(z)),1),d("span",oo,E(t.block.name),1),d("span",io,E(c(O)||t.block.inputSummary),1),we(c(Gt),{class:ne(["w-3 h-3 ml-auto transition-transform text-retro-muted flex-shrink-0",{"rotate-90":c(n)}])},null,8,["class"])]),c(n)?(h(),m("div",ao,[c(te).length>0?(h(),m("div",lo,[k[5]||(k[5]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Args",-1)),d("pre",co,E(c(te).join(`
|
|
64
|
-
`)),1)])):C("",!0),d("div",uo,[c(W)?(h(),m("div",po,[k[6]||(k[6]=d("span",{class:"text-retro-muted/80 min-w-12"},"File",-1)),d("code",ho,E(c(W)),1)])):C("",!0),c(A)&&c(M)?(h(),m("div",fo,[k[7]||(k[7]=d("span",{class:"text-retro-muted/80 min-w-12"},"Cmd",-1)),d("code",mo,E(c(M)),1)])):C("",!0),c(T)&&c(B)?(h(),m("div",go,[k[8]||(k[8]=d("span",{class:"text-retro-muted/80 min-w-12"},"Range",-1)),d("span",null,E(c(B)),1)])):C("",!0)]),c(S)&&c(H).text?(h(),m("div",ko,[k[9]||(k[9]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"New Content",-1)),d("pre",xo,E(c(H).text),1),c(H).truncated?(h(),m("div",bo,"Truncated preview")):C("",!0)])):C("",!0),d("details",wo,[k[10]||(k[10]=d("summary",{class:"text-[11px] font-mono text-retro-muted cursor-pointer hover:text-retro-cyan"},"Raw input JSON",-1)),d("pre",yo,E(JSON.stringify(t.block.input,null,2)),1)]),c(u)&&c(x).length>0?(h(),m("div",vo,[k[11]||(k[11]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Clarification Prompt",-1)),d("div",To,[(h(!0),m(he,null,Oe(c(x),(g,U)=>(h(),m("div",{key:`${g.id||"q"}-${U}`,class:"rounded border border-retro-border/30 bg-retro-panel/40 p-2"},[g.header?(h(),m("div",_o,E(g.header),1)):C("",!0),g.question||g.prompt||g.message?(h(),m("div",Ao,E(g.question||g.prompt||g.message),1)):C("",!0),Array.isArray(g.options)&&g.options.length>0?(h(),m("div",So,[(h(!0),m(he,null,Oe(g.options,(L,oe)=>(h(),m("div",{key:`${g.id||"q"}-opt-${oe}`,class:"text-xs font-mono text-retro-muted"},[Ze(E(L.label||`Option ${oe+1}`)+" ",1),L.description?(h(),m("span",Eo," - "+E(L.description),1)):C("",!0)]))),128))])):C("",!0)]))),128))])])):C("",!0),c(kt)?(h(),m("div",Ro,[d("div",{class:ne(["text-xs font-mono rounded p-2 mt-1 overflow-y-auto scrollbar-custom border",c(j)?"text-retro-red bg-retro-red/5 border-retro-red/40":"text-retro-muted bg-retro-panel/60 border-retro-border/30"]),style:ur(c(s)?"max-height: 20rem":"")},[c(Xe)?(h(),m(he,{key:0},[d("div",Co,[k[12]||(k[12]=Ze(" Diff · ",-1)),d("span",Lo,"+"+E(c(Qe).added),1),k[13]||(k[13]=Ze(" / ",-1)),d("span",$o,"-"+E(c(Qe).removed),1)]),d("div",Io,[(h(!0),m(he,null,Oe(c(Pe),(g,U)=>(h(),m("div",{key:`diff-${U}`,class:ne(["px-
|
|
64
|
+
`)),1)])):C("",!0),d("div",uo,[c(W)?(h(),m("div",po,[k[6]||(k[6]=d("span",{class:"text-retro-muted/80 min-w-12"},"File",-1)),d("code",ho,E(c(W)),1)])):C("",!0),c(A)&&c(M)?(h(),m("div",fo,[k[7]||(k[7]=d("span",{class:"text-retro-muted/80 min-w-12"},"Cmd",-1)),d("code",mo,E(c(M)),1)])):C("",!0),c(T)&&c(B)?(h(),m("div",go,[k[8]||(k[8]=d("span",{class:"text-retro-muted/80 min-w-12"},"Range",-1)),d("span",null,E(c(B)),1)])):C("",!0)]),c(S)&&c(H).text?(h(),m("div",ko,[k[9]||(k[9]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"New Content",-1)),d("pre",xo,E(c(H).text),1),c(H).truncated?(h(),m("div",bo,"Truncated preview")):C("",!0)])):C("",!0),d("details",wo,[k[10]||(k[10]=d("summary",{class:"text-[11px] font-mono text-retro-muted cursor-pointer hover:text-retro-cyan"},"Raw input JSON",-1)),d("pre",yo,E(JSON.stringify(t.block.input,null,2)),1)]),c(u)&&c(x).length>0?(h(),m("div",vo,[k[11]||(k[11]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Clarification Prompt",-1)),d("div",To,[(h(!0),m(he,null,Oe(c(x),(g,U)=>(h(),m("div",{key:`${g.id||"q"}-${U}`,class:"rounded border border-retro-border/30 bg-retro-panel/40 p-2"},[g.header?(h(),m("div",_o,E(g.header),1)):C("",!0),g.question||g.prompt||g.message?(h(),m("div",Ao,E(g.question||g.prompt||g.message),1)):C("",!0),Array.isArray(g.options)&&g.options.length>0?(h(),m("div",So,[(h(!0),m(he,null,Oe(g.options,(L,oe)=>(h(),m("div",{key:`${g.id||"q"}-opt-${oe}`,class:"text-xs font-mono text-retro-muted"},[Ze(E(L.label||`Option ${oe+1}`)+" ",1),L.description?(h(),m("span",Eo," - "+E(L.description),1)):C("",!0)]))),128))])):C("",!0)]))),128))])])):C("",!0),c(kt)?(h(),m("div",Ro,[d("div",{class:ne(["text-xs font-mono rounded p-2 mt-1 overflow-y-auto scrollbar-custom border",c(j)?"text-retro-red bg-retro-red/5 border-retro-red/40":"text-retro-muted bg-retro-panel/60 border-retro-border/30"]),style:ur(c(s)?"max-height: 20rem":"")},[c(Xe)?(h(),m(he,{key:0},[d("div",Co,[k[12]||(k[12]=Ze(" Diff · ",-1)),d("span",Lo,"+"+E(c(Qe).added),1),k[13]||(k[13]=Ze(" / ",-1)),d("span",$o,"-"+E(c(Qe).removed),1)]),d("div",Io,[(h(!0),m(he,null,Oe(c(Pe),(g,U)=>(h(),m("div",{key:`diff-${U}`,class:ne(["px-2 rounded whitespace-pre-wrap break-all",Ke(g)])},E(g||" "),3))),128))]),!c(s)&&c(ye)?(h(),m("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:k[1]||(k[1]=_e(g=>s.value=!0,["stop"]))}," Show full diff ("+E(c(Ee))+" chars) ",1)):c(ye)?(h(),m("button",{key:1,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:k[2]||(k[2]=_e(g=>s.value=!1,["stop"]))}," Collapse diff ")):C("",!0)],64)):!c(s)&&c(ye)?(h(),m(he,{key:1},[d("pre",Mo,E(c(gt)),1),d("button",{class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:k[3]||(k[3]=_e(g=>s.value=!0,["stop"]))}," Show full ("+E(c(Ee))+" chars) ",1)],64)):(h(),m(he,{key:2},[d("pre",Do,E(c(Z)),1),c(ye)?(h(),m("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:k[4]||(k[4]=_e(g=>s.value=!1,["stop"]))}," Collapse ")):C("",!0)],64))],6)])):C("",!0)])):C("",!0)]))}}),No={class:"mt-2 pt-2 border-t border-retro-border/20 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] font-mono text-retro-muted"},Po={class:"flex items-center gap-1"},zo={class:"flex items-center gap-1"},Bo=xe({__name:"ChatResultSummary",props:{block:{}},setup(t){const e=t,n=y(()=>{const i=Math.round(e.block.durationMs/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}),s=y(()=>`$${e.block.totalCostUsd.toFixed(4)}`),r=y(()=>{const{inputTokens:i,outputTokens:a}=e.block.usage;return`${i.toLocaleString()} in / ${a.toLocaleString()} out`});return(i,a)=>(h(),m("div",No,[d("span",Po,[a[0]||(a[0]=d("span",{class:"text-retro-muted/60"},"time",-1)),Ze(" "+E(c(n)),1)]),d("span",zo,[a[1]||(a[1]=d("span",{class:"text-retro-muted/60"},"cost",-1)),Ze(" "+E(c(s)),1)]),d("span",null,E(c(r)),1),d("span",null,E(t.block.numTurns)+" turn"+E(t.block.numTurns!==1?"s":""),1)]))}}),Uo={class:"px-2 py-1 text-[10px] font-mono text-retro-muted border-b border-retro-border/20 mb-1 flex items-center gap-2"},Fo={class:"text-retro-cyan"},Ho={key:0,class:"text-retro-border"},Go={key:1},Wo=xe({__name:"ChatSessionInit",props:{block:{}},setup(t){return(e,n)=>(h(),m("div",Uo,[d("span",Fo,E(t.block.model),1),n[0]||(n[0]=d("span",{class:"text-retro-border"},"|",-1)),d("span",null,E(t.block.tools.length)+" tools",1),t.block.permissionMode?(h(),m("span",Ho,"|")):C("",!0),t.block.permissionMode?(h(),m("span",Go,E(t.block.permissionMode),1)):C("",!0)]))}}),jo=xe({__name:"ChatContentBlock",props:{block:{},toolResultsByUseId:{}},setup(t){const e=t,n=y(()=>{if(e.block.type==="tool_use")return e.toolResultsByUseId.get(e.block.toolUseId)});return(s,r)=>{const i=Xs,a=to,l=Oo,f=Bo,u=Wo;return t.block.type==="text"?(h(),re(i,{key:0,block:t.block},null,8,["block"])):t.block.type==="thinking"?(h(),re(a,{key:1,block:t.block},null,8,["block"])):t.block.type==="tool_use"?(h(),re(l,{key:2,block:t.block,result:c(n)},null,8,["block","result"])):t.block.type==="result_summary"?(h(),re(f,{key:3,block:t.block},null,8,["block"])):t.block.type==="session_init"?(h(),re(u,{key:4,block:t.block},null,8,["block"])):C("",!0)}}}),qo={class:"flex items-center gap-2 mb-1"},Zo={class:"text-xs font-mono text-retro-muted"},Yo={key:0,class:"text-xs font-mono text-retro-yellow animate-pulse"},Vo={key:1,class:"text-xs font-mono text-retro-muted"},Xo={key:2,class:"text-xs font-mono text-retro-red"},Qo={class:"flex-1 min-w-0 w-full"},Ko={key:1,class:"mb-2 flex flex-wrap gap-2"},Jo=["href","download"],ei=["src","alt"],ti={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},ni={key:2,class:"text-sm font-mono text-retro-text break-words whitespace-pre-wrap pl-[3px] pt-[5px]"},ri=["innerHTML"],si={key:4,class:"text-xs font-mono text-retro-muted italic"},oi={key:5,class:"inline-block w-2 h-4 bg-retro-cyan animate-pulse ml-0.5"},hi=xe({__name:"ChatMessage",props:{message:{}},setup(t){const e=t,{renderMarkdown:n}=Jn(),s=new Set(["read","readfile","view","glob","rg","grep","ls","list","listdir","listdirectory","listfiles","findfiles","searchfiles","searchcode","readbash","listbash"]);function r(B){return B.toLowerCase().replace(/[^a-z0-9]/g,"")}function i(B,P){return B.status==="error"||P?.isError?!1:s.has(r(B.name))}const a=y(()=>e.message.role==="user"),l=y(()=>e.message.status==="streaming"),f=y(()=>e.message.status==="error"),u=y(()=>e.message.status==="stopped"),T=y(()=>hr(e.message)),S=y(()=>{const B=new Map;for(const P of e.message.contentBlocks??[])P.type==="tool_result"&&B.set(P.toolUseId,P);return B}),_=y(()=>{if(!e.message.contentBlocks)return[];const B=e.message.contentBlocks.filter(z=>z.type!=="tool_result"),P=[];for(const z of B){const te=P.length>0?P[P.length-1]:null;if(te?.type==="text"&&z.type==="text"){const be=te.text||"",Z=z.text||"";te.text=`${be}${Z}`;continue}if(te?.type==="thinking"&&z.type==="thinking"){const be=te.thinking||"",Z=z.thinking||"";te.thinking=`${be}${Z}`;continue}P.push({...z})}const M=[];let H=[];const O=()=>{H.length!==0&&(M.push({id:`tool-group-${H[0].id}`,type:"tool_group_summary",tools:[...H]}),H=[])};for(const z of P){if(z.type==="tool_use"){const te=S.value.get(z.toolUseId);if(i(z,te)){H.push(z);continue}}O(),M.push(z)}return O(),M}),A=y(()=>T.value&&_.value.length>0),x=y(()=>e.message.content.trim().length>0),$=y(()=>e.message.attachments??[]),ee=B=>new Date(B).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),W=y(()=>n(e.message.content));return(B,P)=>{const M=Wr,H=jo;return h(),m("div",{class:ne(["flex flex-col p-3",[c(a)?"bg-retro-dark/50":"bg-transparent",c(f)?"border-l-2 border-retro-red":""]])},[d("div",qo,[d("div",{class:ne(["flex-shrink-0 w-6 h-6 rounded flex items-center justify-center",c(a)?"bg-retro-cyan/20":"bg-retro-green/20"])},[c(a)?(h(),re(c(yr),{key:0,class:"w-4 h-4 text-retro-cyan"})):(h(),re(c(kr),{key:1,class:"w-4 h-4 text-retro-green"}))],2),d("span",{class:ne(["text-xs font-mono",c(a)?"text-retro-cyan":"text-retro-green"])},E(c(a)?"You":"Assistant"),3),d("span",Zo,E(ee(t.message.timestamp)),1),c(l)?(h(),m("span",Yo," typing... ")):C("",!0),c(u)?(h(),m("span",Vo," (stopped) ")):C("",!0),c(f)?(h(),m("span",Xo," (error) ")):C("",!0)]),d("div",Qo,[c(A)?(h(!0),m(he,{key:0},Oe(c(_),O=>(h(),m(he,{key:O.id},[O.type==="tool_group_summary"?(h(),re(M,{key:0,tools:O.tools},null,8,["tools"])):(h(),re(H,{key:1,block:O,"tool-results-by-use-id":c(S)},null,8,["block","tool-results-by-use-id"]))],64))),128)):C("",!0),c(a)&&c($).length>0?(h(),m("div",Ko,[(h(!0),m(he,null,Oe(c($),O=>(h(),m("a",{key:O.id,href:O.dataUrl,download:O.name,target:"_blank",rel:"noopener noreferrer",class:"w-28 rounded border border-retro-border/70 bg-retro-black/70 p-1 hover:border-retro-cyan/60"},[d("img",{src:O.dataUrl,alt:O.name,class:"h-20 w-full rounded object-cover"},null,8,ei),d("div",ti,E(O.name),1)],8,Jo))),128))])):C("",!0),!c(A)&&c(x)&&c(a)?(h(),m("div",ni,E(t.message.content),1)):C("",!0),!c(A)&&c(x)&&!c(a)?(h(),m("div",{key:3,class:"text-sm font-mono text-retro-text break-words chat-markdown px-1",innerHTML:c(W)},null,8,ri)):C("",!0),!c(A)&&!c(x)&&!c(a)&&!c(l)?(h(),m("div",si," (no visible response content) ")):C("",!0),c(l)?(h(),m("span",oi)):C("",!0)])],2)}}});function Nn(t){typeof document>"u"||(t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),document.cookie=`spec-cat-theme=${t};path=/;SameSite=Lax`)}function di(){const t=dr(),e=y(()=>t.theme),n=y(()=>t.theme==="dark");function s(){const r=t.theme==="dark"?"light":"dark";t.setTheme(r),Nn(r)}return Ht(()=>t.theme,r=>{Nn(r)},{immediate:!0}),{theme:e,isDark:n,toggleTheme:s}}export{pi as C,hi as _,ci as a,Wo as b,Xs as c,to as d,Oo as e,Bo as f,xr as g,yr as h,Pn as i,br as j,Gt as k,wr as l,D as m,yn as n,kr as o,Ys as p,Jn as q,ui as r,mr as s,gr as t,di as u,vr as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as f,a as g}from"./
|
|
1
|
+
import{u as f,a as g}from"./D_05ko21.js";import{_ as x,u as S}from"./lyWV44Wc.js";import{d as _,o as y,F as M,y as w,z as C,A as s,C as h,G as n,k as i}from"./wserZ5KO.js";const A={class:"p-6 max-w-2xl"},E={class:"mt-8 space-y-8"},D=_({__name:"settings",async setup(P){let r,a;const o=f(),d=g();y(()=>{o.hydrate()});const{data:p,pending:l,error:c}=([r,a]=M(()=>S("ai-providers",()=>$fetch("/api/ai/providers"))),r=await r,a(),r),m=i(()=>p.value?.providers??[]),u=i(()=>{const t=c.value;return t?t instanceof Error?t.message:String(t):null}),v=t=>{o.setProviderSelection(t),d.success("Settings saved")};return(t,e)=>(w(),C("div",A,[e[2]||(e[2]=s("h1",{class:"text-2xl font-bold text-retro-cyan font-mono"},"Settings",-1)),e[3]||(e[3]=s("p",{class:"mt-2 text-retro-muted"},"Configure your Spec Cat preferences.",-1)),s("div",E,[s("section",null,[e[0]||(e[0]=s("h2",{class:"text-lg font-mono text-retro-text mb-4"},"AI Provider",-1)),e[1]||(e[1]=s("p",{class:"text-sm text-retro-muted mb-4"}," Select the provider and model that should power new conversations. ",-1)),h(x,{providers:m.value,selected:n(o).providerSelection,permissionMode:n(o).permissionMode,pending:n(l),errorMessage:u.value,onSelect:v},null,8,["providers","selected","permissionMode","pending","errorMessage"])])])]))}});export{D as default};
|
|
@@ -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"./wserZ5KO.js";import{u as N,r as A,a as V,b as P,c as U}from"./C5VmlmOK.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 +1 @@
|
|
|
1
|
-
import{_ as f,$ as h,g as m}from"./
|
|
1
|
+
import{_ as f,$ as h,g as m}from"./wserZ5KO.js";const p="claude",l="sonnet",g=[{value:"sonnet",label:"Sonnet",description:"Balanced performance and cost"},{value:"opus",label:"Opus",description:"Most capable, higher cost"},{value:"haiku",label:"Haiku",description:"Fast and cost-effective"}];function M(e){if(!e)return{};const t={},s=typeof e.claudeModel=="string"&&g.some(n=>n.value===e.claudeModel)?e.claudeModel:void 0;typeof e.providerId=="string"?(t.providerId=e.providerId,typeof e.providerModelKey=="string"&&e.providerModelKey.length>0?t.providerModelKey=e.providerModelKey:s?t.providerModelKey=s:t.providerModelKey=l):s&&(t.providerId="claude",t.providerModelKey=s),(e.theme==="dark"||e.theme==="light")&&(t.theme=e.theme);const r=e.permissionMode;return r&&["plan","ask","auto","bypass"].includes(String(r))&&(t.permissionMode=r),typeof e.autoGenerateCommitMessages=="boolean"&&(t.autoGenerateCommitMessages=e.autoGenerateCommitMessages),t}const y=f("settings",{state:()=>({providerId:p,providerModelKey:l,theme:"dark",permissionMode:"ask",autoGenerateCommitMessages:!1,_hydrated:!1}),getters:{providerSelection:e=>({providerId:e.providerId,modelKey:e.providerModelKey})},actions:{async hydrate(){if(!this._hydrated)try{const e=await $fetch("/api/settings"),t=M(e);t.providerId!==void 0&&(this.providerId=t.providerId),t.providerModelKey!==void 0&&(this.providerModelKey=t.providerModelKey),t.theme!==void 0&&(this.theme=t.theme),t.permissionMode!==void 0&&(this.permissionMode=t.permissionMode),t.autoGenerateCommitMessages!==void 0&&(this.autoGenerateCommitMessages=t.autoGenerateCommitMessages),this._hydrated=!0}catch(e){console.error("Failed to load settings:",e)}},setTheme(e){this.theme=e,this._saveToServer()},setProviderSelection(e){this.providerId=e.providerId,this.providerModelKey=typeof e.modelKey=="string"&&e.modelKey.length>0?e.modelKey:l,this._saveToServer(!0)},setPermissionMode(e){this.permissionMode=e,this._saveToServer()},setAutoGenerateCommitMessages(e){this.autoGenerateCommitMessages=e,this._saveToServer()},resetToDefaults(){this.providerId=p,this.providerModelKey=l,this.theme="dark",this.permissionMode="ask",this.autoGenerateCommitMessages=!1,this._saveToServer()},_saveToServer(e=!1){const t={providerId:this.providerId,providerModelKey:this.providerModelKey,claudeModel:this.providerId==="claude"?this.providerModelKey:void 0,theme:this.theme,permissionMode:this.permissionMode,autoGenerateCommitMessages:this.autoGenerateCommitMessages};$fetch("/api/settings",{method:"POST",body:t}).then(s=>{if(!e||!s?.settings)return;const r=s.settings.providerId,n=s.settings.providerModelKey;typeof r=="string"&&(this.providerId=r),typeof n=="string"&&n.length>0&&(this.providerModelKey=n)}).catch(s=>{console.error("Failed to save settings:",s)})}}}),I=Object.freeze(Object.defineProperty({__proto__:null,useSettingsStore:y},Symbol.toStringTag,{value:"Module"})),d=m([]);function S(){const e=(i,o="info",a=3e3)=>{const c=`toast-${Date.now()}-${Math.random().toString(36).slice(2)}`,v={id:c,message:i,type:o,duration:a};return d.value.push(v),a>0&&setTimeout(()=>{t(c)},a),c},t=i=>{const o=d.value.findIndex(a=>a.id===i);o!==-1&&d.value.splice(o,1)},s=(i,o)=>e(i,"success",o),r=(i,o)=>e(i,"error",o),n=(i,o)=>e(i,"info",o),u=(i,o)=>e(i,"warning",o);return{toasts:h(d),add:e,remove:t,success:s,error:r,info:n,warning:u}}const A=Object.freeze(Object.defineProperty({__proto__:null,useToast:S},Symbol.toStringTag,{value:"Module"}));function T(){return`blk-${Date.now()}-${Math.random().toString(36).substring(2,6)}`}function E(e){return Array.isArray(e.contentBlocks)&&e.contentBlocks.length>0}const K={plan:"Plan Mode",ask:"Ask Before",auto:"Auto Edit",bypass:"Bypass"},C={plan:"The assistant will create a plan before making changes",ask:"The assistant will ask before each action",auto:"The assistant can read and edit files automatically",bypass:"Skip all permission checks (dangerous)"},k=300,O=600,D=400;function b(){return`msg-${Date.now()}-${Math.random().toString(36).substring(2,8)}`}const G=2,N=100,L=80;function P(){return`conv-${Math.random().toString(36).slice(2,12)}`}function R(e){const s=e.trim().replace(/\n/g," ");return s.length<=50?s:s.slice(0,50).trim()+"..."}function $(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.cwd=="string"}function H(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.sourceConversationId=="string"&&typeof t.title=="string"&&Array.isArray(t.messages)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.archivedAt=="string"&&typeof t.cwd=="string"}export{l as D,N as M,D as P,G as S,L as W,S as a,H as b,k as c,O as d,P as e,p as f,b as g,R as h,$ as i,T as j,K as k,C as l,E as m,A as n,I as s,y as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./DlAUqK2U.js";import{z as r,y as c}from"./wserZ5KO.js";const o={};function t(n,s){return c(),r("div")}const f=e(o,[["render",t]]);export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"7a0d0443-5ff4-47d0-b629-668dc37b3124","timestamp":1776768287174}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"7a0d0443-5ff4-47d0-b629-668dc37b3124","timestamp":1776768287174,"prerendered":[]}
|