spec-cat 0.1.23 → 0.1.25
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/8_4qvbip.js +36 -0
- package/.output/public/_nuxt/B2xLiDuD.js +1 -0
- package/.output/public/_nuxt/{-EMqkm_u.js → BPrZX-_J.js} +1 -1
- package/.output/public/_nuxt/Bze5ywup.js +1 -0
- package/.output/public/_nuxt/{FbKhJXKu.js → BzfYDrv2.js} +2 -2
- package/.output/public/_nuxt/CiXy_SW9.js +64 -0
- package/.output/public/_nuxt/{BDd_kh9e.js → DIlI3WTI.js} +1 -1
- package/.output/public/_nuxt/{CYVeOpC3.js → Drn_WUL3.js} +1 -1
- package/.output/public/_nuxt/{DgiJut-o.js → O3PivLp-.js} +1 -1
- package/.output/public/_nuxt/UOLai9rz.js +93 -0
- package/.output/public/_nuxt/{CDLI67Cr.js → _ZoYWOkW.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/392a3a4f-4bcd-4eb0-ba33-8b058c4668bf.json +1 -0
- package/.output/public/_nuxt/{default.eSO6fRPf.css → default.D3bZ26KV.css} +1 -1
- package/.output/public/_nuxt/entry.mJra9RkV.css +1 -0
- package/.output/public/_nuxt/oZhDUS0h.js +1 -0
- package/.output/public/_nuxt/{Bk4uZfKR.js → ovAaTTn7.js} +1 -1
- package/.output/public/_nuxt/useTheme.CYTdpguX.css +1 -0
- package/.output/server/chunks/_/eventBus.mjs +52 -0
- package/.output/server/chunks/_/eventBus.mjs.map +1 -0
- package/.output/server/chunks/_/geminiProvider.mjs +99 -25
- package/.output/server/chunks/_/geminiProvider.mjs.map +1 -1
- package/.output/server/chunks/_/jobPersister.mjs +4 -3
- package/.output/server/chunks/_/jobPersister.mjs.map +1 -1
- package/.output/server/chunks/_/jobQueue.mjs +14 -54
- package/.output/server/chunks/_/jobQueue.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 +643 -643
- package/.output/server/chunks/routes/_ws.mjs +6 -2
- package/.output/server/chunks/routes/_ws.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations/_conversationId/archive.post.mjs +6 -0
- package/.output/server/chunks/routes/api/conversations/_conversationId/archive.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +1 -0
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +1 -0
- package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/jobs/_id/cancel.post.mjs +1 -0
- package/.output/server/chunks/routes/api/jobs/_id/cancel.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/jobs/_id_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/jobs/_id_.get.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/bin/spec-cat.js +15 -0
- package/package.json +1 -1
- package/.output/public/_nuxt/BJKzOiTU.js +0 -1
- package/.output/public/_nuxt/C9Qk2Hno.js +0 -1
- package/.output/public/_nuxt/CLPz4Oer.js +0 -1
- package/.output/public/_nuxt/CZbP5QXb.js +0 -1
- package/.output/public/_nuxt/DQtVbA-s.js +0 -150
- package/.output/public/_nuxt/DXWMFGmi.js +0 -1
- package/.output/public/_nuxt/builds/meta/53b5c409-86a8-4624-8a0f-5bf31ab82deb.json +0 -1
- package/.output/public/_nuxt/entry.BtencOYX.css +0 -1
- package/.output/public/_nuxt/useTheme.Dp77PlfC.css +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import{y as h,z as g,A as m,d as ke,L as ne,P as ye,Q as ir,S as ar,U as bn,B as _,K as $,C as we,G as u,g as qe,k as y,N as ht,H as re,I as ge,J as Ge,E as We,V as lr}from"./BzfYDrv2.js";import{a as cr,m as ur,u as pr}from"./Bze5ywup.js";import{_ as hr}from"./DlAUqK2U.js";function fr(t,e){return h(),g("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"},[m("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 dr(t,e){return h(),g("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"},[m("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 On(t,e){return h(),g("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"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function mr(t,e){return h(),g("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"},[m("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 wn(t,e){return h(),g("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"},[m("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 gr(t,e){return h(),g("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"},[m("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 kr(t,e){return h(),g("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"},[m("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 xr(t,e){return h(),g("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"},[m("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 Qo(t,e){return h(),g("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"},[m("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 br(t,e){return h(),g("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"},[m("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 Ko(t,e){return h(),g("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"},[m("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 wr(t,e){return h(),g("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"},[m("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"})])}const yr={class:"flex items-start justify-between gap-2"},vr={class:"flex-1 min-w-0"},Tr={key:1,class:"flex items-center gap-2"},_r={class:"text-sm font-mono text-retro-text truncate"},Ar={key:0,class:"text-xs font-mono text-retro-green bg-retro-green/10 px-1.5 py-0.5 rounded flex-shrink-0"},Sr={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"},Er={class:"text-xs text-retro-muted mt-1 truncate"},Rr={class:"text-xs text-retro-muted/60 mt-1"},Cr={class:"truncate"},Lr={class:"truncate"},$r={class:"truncate"},Ir=ke({__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=qe(!1),i=qe("");function a(){i.value=n.conversation.title,r.value=!0}function l(){const S=i.value.trim();S&&S!==n.conversation.title&&s("rename",S),r.value=!1}function d(){r.value=!1}const c=cr();async function v(S){try{await navigator.clipboard.writeText(S),c.success("Copied to clipboard",1500)}catch{c.error("Failed to copy")}}const L=y(()=>{const S=n.conversation.messages;if(!S.length)return"No messages";const b=S[S.length-1],E=b.content.slice(0,60);return E.length<b.content.length?E+"...":E}),A=y(()=>{const S=new Date(n.conversation.updatedAt),E=new Date().getTime()-S.getTime(),z=Math.floor(E/(1e3*60*60*24));return z===0?S.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):z===1?"Yesterday":z<7?`${z} days ago`:S.toLocaleDateString()});return(S,b)=>(h(),g("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:b[8]||(b[8]=E=>s("select"))},[m("div",yr,[m("div",vr,[r.value?(h(),g("div",{key:0,class:"flex gap-2",onClick:b[1]||(b[1]=ye(()=>{},["stop"]))},[ir(m("input",{"onUpdate:modelValue":b[0]||(b[0]=E=>i.value=E),onKeyup:[bn(l,["enter"]),bn(d,["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),[[ar,i.value]])])):(h(),g("div",Tr,[m("h3",_r,_(t.conversation.title),1),t.conversation.finalized?(h(),g("span",Ar," finalized ")):t.isPreviewing?(h(),g("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)):$("",!0),t.isStreaming?(h(),g("span",Sr," streaming ")):$("",!0)])),m("p",Er,_(L.value),1),m("p",Rr,_(A.value),1),t.conversation.worktreeBranch||t.conversation.baseBranch?(h(),g("div",{key:2,class:"mt-1.5 flex flex-wrap gap-1",onClick:b[5]||(b[5]=ye(()=>{},["stop"]))},[t.conversation.baseBranch?(h(),g("button",{key:0,onClick:b[2]||(b[2]=E=>v(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(u(wn),{class:"w-3 h-3 flex-shrink-0"}),m("span",Cr,"base: "+_(t.conversation.baseBranch),1)])):$("",!0),m("button",{onClick:b[3]||(b[3]=E=>v(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(u(wn),{class:"w-3 h-3 flex-shrink-0"}),m("span",Lr,_(t.conversation.worktreeBranch),1)]),t.conversation.worktreePath?(h(),g("button",{key:1,onClick:b[4]||(b[4]=E=>v(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(u(xr),{class:"w-3 h-3 flex-shrink-0"}),m("span",$r,_(t.conversation.worktreePath),1)])):$("",!0)])):$("",!0)]),m("div",{class:"flex gap-1 flex-shrink-0",onClick:b[7]||(b[7]=ye(()=>{},["stop"]))},[m("button",{onClick:a,class:"p-1 hover:bg-retro-panel rounded transition-colors",title:"Rename conversation"},[we(u(br),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})]),m("button",{onClick:b[6]||(b[6]=E=>s("archive")),class:"p-1 hover:bg-retro-cyan/20 rounded transition-colors",title:"Archive conversation"},[we(u(fr),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})])])])],2))}}),Jo=hr(Ir,[["__scopeId","data-v-4d7fd350"]]);function Gt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Te=Gt();function Nn(t){Te=t}var je={exec:()=>null};function M(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(Y.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}var Y={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")},Mr=/^(?:[ \t]*(?:\n|$))+/,Dr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Or=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ze=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Nr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Wt=/(?:[*+-]|\d{1,9}[.)])/,Pn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zn=M(Pn).replace(/bull/g,Wt).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(),Pr=M(Pn).replace(/bull/g,Wt).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(),jt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zr=/^[^\n]+/,qt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Br=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ur=M(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Wt).getRegex(),gt="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",Zt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Fr=M("^ {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",Zt).replace("tag",gt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bn=M(jt).replace("hr",Ze).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",gt).getRegex(),Hr=M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bn).getRegex(),Yt={blockquote:Hr,code:Dr,def:Br,fences:Or,heading:Nr,hr:Ze,html:Fr,lheading:zn,list:Ur,newline:Mr,paragraph:Bn,table:je,text:zr},yn=M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ze).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",gt).getRegex(),Gr={...Yt,lheading:Pr,table:yn,paragraph:M(jt).replace("hr",Ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yn).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",gt).getRegex()},Wr={...Yt,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zt).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:je,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(jt).replace("hr",Ze).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",zn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Un=/^( {2,}|\\)\n(?!\s*$)/,Zr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,kt=/[\p{P}\p{S}]/u,Vt=/[\s\p{P}\p{S}]/u,Fn=/[^\s\p{P}\p{S}]/u,Yr=M(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vt).getRegex(),Hn=/(?!~)[\p{P}\p{S}]/u,Vr=/(?!~)[\s\p{P}\p{S}]/u,Xr=/(?:[^\s\p{P}\p{S}]|~)/u,Qr=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Gn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Kr=M(Gn,"u").replace(/punct/g,kt).getRegex(),Jr=M(Gn,"u").replace(/punct/g,Hn).getRegex(),Wn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",es=M(Wn,"gu").replace(/notPunctSpace/g,Fn).replace(/punctSpace/g,Vt).replace(/punct/g,kt).getRegex(),ts=M(Wn,"gu").replace(/notPunctSpace/g,Xr).replace(/punctSpace/g,Vr).replace(/punct/g,Hn).getRegex(),ns=M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Fn).replace(/punctSpace/g,Vt).replace(/punct/g,kt).getRegex(),rs=M(/\\(punct)/,"gu").replace(/punct/g,kt).getRegex(),ss=M(/^<(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(),os=M(Zt).replace("(?:-->|$)","-->").getRegex(),is=M("^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",os).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ft=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,as=M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ft).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),jn=M(/^!?\[(label)\]\[(ref)\]/).replace("label",ft).replace("ref",qt).getRegex(),qn=M(/^!?\[(ref)\](?:\[\])?/).replace("ref",qt).getRegex(),ls=M("reflink|nolink(?!\\()","g").replace("reflink",jn).replace("nolink",qn).getRegex(),Xt={_backpedal:je,anyPunctuation:rs,autolink:ss,blockSkip:Qr,br:Un,code:qr,del:je,emStrongLDelim:Kr,emStrongRDelimAst:es,emStrongRDelimUnd:ns,escape:jr,link:as,nolink:qn,punctuation:Yr,reflink:jn,reflinkSearch:ls,tag:is,text:Zr,url:je},cs={...Xt,link:M(/^!?\[(label)\]\((.*?)\)/).replace("label",ft).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ft).getRegex()},Pt={...Xt,emStrongRDelimAst:ts,emStrongLDelim:Jr,url:M(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},us={...Pt,br:M(Un).replace("{2,}","*").getRegex(),text:M(Pt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},at={normal:Yt,gfm:Gr,pedantic:Wr},Ne={normal:Xt,gfm:Pt,breaks:us,pedantic:cs},ps={"&":"&","<":"<",">":">",'"':""","'":"'"},vn=t=>ps[t];function ae(t,e){if(e){if(Y.escapeTest.test(t))return t.replace(Y.escapeReplace,vn)}else if(Y.escapeTestNoEncode.test(t))return t.replace(Y.escapeReplaceNoEncode,vn);return t}function Tn(t){try{t=encodeURI(t).replace(Y.percentDecode,"%")}catch{return null}return t}function _n(t,e){const n=t.replace(Y.findPipe,(i,a,l)=>{let d=!1,c=a;for(;--c>=0&&l[c]==="\\";)d=!d;return d?"|":" |"}),s=n.split(Y.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(Y.slashPipe,"|");return s}function Pe(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 hs(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 An(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 d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,d}function fs(t,e,n){const s=t.match(n.other.indentCodeCompensation);if(s===null)return e;const r=s[1];return e.split(`
|
|
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
|
+
`)}var dt=class{options;rules;lexer;constructor(t){this.options=t||Te}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:Pe(n,`
|
|
5
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],s=fs(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const s=Pe(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Pe(e[0],`
|
|
6
|
+
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=Pe(e[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),s="",r="";const i=[];for(;n.length>0;){let a=!1;const l=[];let d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))l.push(n[d]),a=!0;else if(!a)l.push(n[d]);else break;n=n.slice(d);const c=l.join(`
|
|
9
|
+
`),v=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
11
|
+
${c}`:c,r=r?`${r}
|
|
12
|
+
${v}`:v;const L=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(v,i,!0),this.lexer.state.top=L,n.length===0)break;const A=i.at(-1);if(A?.type==="code")break;if(A?.type==="blockquote"){const S=A,b=S.raw+`
|
|
13
|
+
`+n.join(`
|
|
14
|
+
`),E=this.blockquote(b);i[i.length-1]=E,s=s.substring(0,s.length-S.raw.length)+E.raw,r=r.substring(0,r.length-S.text.length)+E.text;break}else if(A?.type==="list"){const S=A,b=S.raw+`
|
|
15
|
+
`+n.join(`
|
|
16
|
+
`),E=this.list(b);i[i.length-1]=E,s=s.substring(0,s.length-A.raw.length)+E.raw,r=r.substring(0,r.length-S.raw.length)+E.raw,n=b.substring(i.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;t;){let d=!1,c="",v="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let L=e[2].split(`
|
|
18
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,H=>" ".repeat(3*H.length)),A=t.split(`
|
|
19
|
+
`,1)[0],S=!L.trim(),b=0;if(this.options.pedantic?(b=2,v=L.trimStart()):S?b=e[1].length+1:(b=e[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,v=L.slice(b),b+=e[1].length),S&&this.rules.other.blankLine.test(A)&&(c+=A+`
|
|
20
|
+
`,t=t.substring(A.length+1),d=!0),!d){const H=this.rules.other.nextBulletRegex(b),I=this.rules.other.hrRegex(b),j=this.rules.other.fencesBeginRegex(b),N=this.rules.other.headingBeginRegex(b),K=this.rules.other.htmlBeginRegex(b);for(;t;){const ee=t.split(`
|
|
21
|
+
`,1)[0];let ce;if(A=ee,this.options.pedantic?(A=A.replace(this.rules.other.listReplaceNesting," "),ce=A):ce=A.replace(this.rules.other.tabCharGlobal," "),j.test(A)||N.test(A)||K.test(A)||H.test(A)||I.test(A))break;if(ce.search(this.rules.other.nonSpaceChar)>=b||!A.trim())v+=`
|
|
22
|
+
`+ce.slice(b);else{if(S||L.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||j.test(L)||N.test(L)||I.test(L))break;v+=`
|
|
23
|
+
`+A}!S&&!A.trim()&&(S=!0),c+=ee+`
|
|
24
|
+
`,t=t.substring(ee.length+1),L=ce.slice(b)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let E=null,z;this.options.gfm&&(E=this.rules.other.listIsTask.exec(v),E&&(z=E[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:c,task:!!E,checked:z,loose:!1,text:v,tokens:[]}),r.raw+=c}const l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let d=0;d<r.items.length;d++)if(this.lexer.state.top=!1,r.items[d].tokens=this.lexer.blockTokens(r.items[d].text,[]),!r.loose){const c=r.items[d].tokens.filter(L=>L.type==="space"),v=c.length>0&&c.some(L=>this.rules.other.anyLine.test(L.raw));r.loose=v}if(r.loose)for(let d=0;d<r.items.length;d++)r.items[d].loose=!0;return r}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=_n(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(const a of r)i.rows.push(_n(a,i.header.length).map((l,d)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[d]})));return i}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Pe(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=hs(e[2],"()");if(i===-2)return;if(i>-1){const l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),An(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return An(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...s[0]].length-1;let a,l,d=i,c=0;const v=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,e=e.slice(-1*t.length+i);(s=v.exec(e))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(l=[...a].length,s[3]||s[4]){d+=l;continue}else if((s[5]||s[6])&&i%3&&!((i+l)%3)){c+=l;continue}if(d-=l,d>0)continue;l=Math.min(l,l+d+c);const L=[...s[0]][0].length,A=t.slice(0,i+s.index+L+l);if(Math.min(i,l)%2){const b=A.slice(1,-1);return{type:"em",raw:A,text:b,tokens:this.lexer.inlineTokens(b)}}const S=A.slice(2,-2);return{type:"strong",raw:A,text:S,tokens:this.lexer.inlineTokens(S)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},de=class zt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Te,this.options.tokenizer=this.options.tokenizer||new dt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:Y,block:at.normal,inline:Ne.normal};this.options.pedantic?(n.block=at.pedantic,n.inline=Ne.pedantic):this.options.gfm&&(n.block=at.gfm,this.options.breaks?n.inline=Ne.breaks:n.inline=Ne.gfm),this.tokenizer.rules=n}static get rules(){return{block:at,inline:Ne}}static lex(e,n){return new zt(n).lex(e)}static lexInline(e,n){return new zt(n).inlineTokens(e)}lex(e){e=e.replace(Y.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){for(this.options.pedantic&&(e=e.replace(Y.tabCharGlobal," ").replace(Y.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
|
|
28
|
+
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
29
|
+
`+r.raw,a.text+=`
|
|
30
|
+
`+r.text,this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
31
|
+
`+r.raw,a.text+=`
|
|
32
|
+
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0;const l=e.slice(1);let d;this.options.extensions.startBlock.forEach(c=>{d=c.call({lexer:this},l),typeof d=="number"&&d>=0&&(a=Math.min(a,d))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){const a=n.at(-1);s&&a?.type==="paragraph"?(a.raw+=`
|
|
33
|
+
`+r.raw,a.text+=`
|
|
34
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r),s=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const a=n.at(-1);a?.type==="text"?(a.raw+=`
|
|
35
|
+
`+r.raw,a.text+=`
|
|
36
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s=e,r=null;if(this.tokens.links){const l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;e;){i||(a=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);const c=n.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,s,a)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let d=e;if(this.options.extensions?.startInline){let c=1/0;const v=e.slice(1);let L;this.options.extensions.startInline.forEach(A=>{L=A.call({lexer:this},v),typeof L=="number"&&L>=0&&(c=Math.min(c,L))}),c<1/0&&c>=0&&(d=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(d)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),i=!0;const c=n.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):n.push(l);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}},mt=class{options;parser;constructor(t){this.options=t||Te}space(t){return""}code({text:t,lang:e,escaped:n}){const s=(e||"").match(Y.notSpaceStart)?.[0],r=t.replace(Y.endingNewline,"")+`
|
|
37
|
+
`;return s?'<pre><code class="language-'+ae(s)+'">'+(n?r:ae(r,!0))+`</code></pre>
|
|
38
|
+
`:"<pre><code>"+(n?r:ae(r,!0))+`</code></pre>
|
|
39
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
40
|
+
${this.parser.parse(t)}</blockquote>
|
|
41
|
+
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
42
|
+
`}hr(t){return`<hr>
|
|
43
|
+
`}list(t){const e=t.ordered,n=t.start;let s="";for(let a=0;a<t.items.length;a++){const l=t.items[a];s+=this.listitem(l)}const r=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
|
|
44
|
+
`+s+"</"+r+`>
|
|
45
|
+
`}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+ae(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
46
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
47
|
+
`}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let s="";for(let r=0;r<t.rows.length;r++){const i=t.rows[r];n="";for(let a=0;a<i.length;a++)n+=this.tablecell(i[a]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
48
|
+
<thead>
|
|
49
|
+
`+e+`</thead>
|
|
50
|
+
`+s+`</table>
|
|
51
|
+
`}tablerow({text:t}){return`<tr>
|
|
52
|
+
${t}</tr>
|
|
53
|
+
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
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>${ae(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=Tn(t);if(r===null)return s;t=r;let i='<a href="'+t+'"';return e&&(i+=' title="'+ae(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=Tn(t);if(r===null)return ae(n);t=r;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${ae(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ae(t.text)}},Qt=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""}},me=class Bt{options;renderer;textRenderer;constructor(e){this.options=e||Te,this.options.renderer=this.options.renderer||new mt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qt}static parse(e,n){return new Bt(n).parse(e)}static parseInline(e,n){return new Bt(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,d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){s+=d||"";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,d=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],d+=`
|
|
55
|
+
`+this.renderer.text(l);n?s+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):s+=d;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}},ut=class{options;block;constructor(t){this.options=t||Te}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?de.lex:de.lexInline}provideParser(){return this.block?me.parse:me.parseInline}},ds=class{defaults=Gt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=me;Renderer=mt;TextRenderer=Qt;Lexer=de;Tokenizer=dt;Hooks=ut;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 mt(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],d=r[a];r[a]=(...c)=>{let v=l.apply(r,c);return v===!1&&(v=d.apply(r,c)),v||""}}s.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new dt(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],d=r[a];r[a]=(...c)=>{let v=l.apply(r,c);return v===!1&&(v=d.apply(r,c)),v}}s.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new ut;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],d=r[a];ut.passThroughHooks.has(i)?r[a]=c=>{if(this.defaults.async)return Promise.resolve(l.call(r,c)).then(L=>d.call(r,L));const v=l.call(r,c);return d.call(r,v)}:r[a]=(...c)=>{let v=l.apply(r,c);return v===!1&&(v=d.apply(r,c)),v}}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 de.lex(t,e??this.defaults)}parser(t,e){return me.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?de.lex:de.lexInline,d=i.hooks?i.hooks.provideParser():t?me.parse:me.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(c=>l(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>d(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let c=l(n,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let v=d(c,i);return i.hooks&&(v=i.hooks.postprocess(v)),v}catch(c){return a(c)}}}onError(t,e){return n=>{if(n.message+=`
|
|
56
|
+
Please report this to https://github.com/markedjs/marked.`,t){const s="<p>An error occurred:</p><pre>"+ae(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},ve=new ds;function D(t,e){return ve.parse(t,e)}D.options=D.setOptions=function(t){return ve.setOptions(t),D.defaults=ve.defaults,Nn(D.defaults),D};D.getDefaults=Gt;D.defaults=Te;D.use=function(...t){return ve.use(...t),D.defaults=ve.defaults,Nn(D.defaults),D};D.walkTokens=function(t,e){return ve.walkTokens(t,e)};D.parseInline=ve.parseInline;D.Parser=me;D.parser=me.parse;D.Renderer=mt;D.TextRenderer=Qt;D.Lexer=de;D.lexer=de.lex;D.Tokenizer=dt;D.Hooks=ut;D.parse=D;D.options;D.setOptions;D.use;D.walkTokens;D.parseInline;me.parse;de.lex;const{entries:Zn,setPrototypeOf:Sn,isFrozen:ms,getPrototypeOf:gs,getOwnPropertyDescriptor:ks}=Object;let{freeze:V,seal:J,create:Ut}=Object,{apply:Ft,construct:Ht}=typeof Reflect<"u"&&Reflect;V||(V=function(e){return e});J||(J=function(e){return e});Ft||(Ft=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)});Ht||(Ht=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 lt=X(Array.prototype.forEach),xs=X(Array.prototype.lastIndexOf),En=X(Array.prototype.pop),ze=X(Array.prototype.push),bs=X(Array.prototype.splice),pt=X(String.prototype.toLowerCase),$t=X(String.prototype.toString),It=X(String.prototype.match),Be=X(String.prototype.replace),ws=X(String.prototype.indexOf),ys=X(String.prototype.trim),te=X(Object.prototype.hasOwnProperty),Z=X(RegExp.prototype.test),Ue=vs(TypeError);function X(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 Ft(t,e,s)}}function vs(t){return function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return Ht(t,n)}}function C(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pt;Sn&&Sn(t,null);let s=e.length;for(;s--;){let r=e[s];if(typeof r=="string"){const i=n(r);i!==r&&(ms(e)||(e[s]=i),r=i)}t[r]=!0}return t}function Ts(t){for(let e=0;e<t.length;e++)te(t,e)||(t[e]=null);return t}function le(t){const e=Ut(null);for(const[n,s]of Zn(t))te(t,n)&&(Array.isArray(s)?e[n]=Ts(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=le(s):e[n]=s);return e}function Fe(t,e){for(;t!==null;){const s=ks(t,e);if(s){if(s.get)return X(s.get);if(typeof s.value=="function")return X(s.value)}t=gs(t)}function n(){return null}return n}const Rn=V(["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"]),Mt=V(["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"]),Dt=V(["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"]),_s=V(["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"]),Ot=V(["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"]),As=V(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cn=V(["#text"]),Ln=V(["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"]),Nt=V(["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"]),$n=V(["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"]),ct=V(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ss=J(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Es=J(/<%[\w\W]*|[\w\W]*%>/gm),Rs=J(/\$\{[\w\W]*/gm),Cs=J(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ls=J(/^aria-[\-\w]+$/),Yn=J(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$s=J(/^(?:\w+script|data):/i),Is=J(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vn=J(/^html$/i),Ms=J(/^[a-z][.\w]*(-[.\w]+)+$/i);var In=Object.freeze({__proto__:null,ARIA_ATTR:Ls,ATTR_WHITESPACE:Is,CUSTOM_ELEMENT:Ms,DATA_ATTR:Cs,DOCTYPE_NAME:Vn,ERB_EXPR:Es,IS_ALLOWED_URI:Yn,IS_SCRIPT_OR_DATA:$s,MUSTACHE_EXPR:Ss,TMPLIT_EXPR:Rs});const He={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ds=function(){return typeof window>"u"?null:window},Os=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}},Mn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Xn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ds();const e=w=>Xn(w);if(e.version="3.3.1",e.removed=[],!t||!t.document||t.document.nodeType!==He.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:d,NodeFilter:c,NamedNodeMap:v=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:L,DOMParser:A,trustedTypes:S}=t,b=d.prototype,E=Fe(b,"cloneNode"),z=Fe(b,"remove"),H=Fe(b,"nextSibling"),I=Fe(b,"childNodes"),j=Fe(b,"parentNode");if(typeof a=="function"){const w=n.createElement("template");w.content&&w.content.ownerDocument&&(n=w.content.ownerDocument)}let N,K="";const{implementation:ee,createNodeIterator:ce,createDocumentFragment:xt,getElementsByTagName:Ye}=n,{importNode:Ve}=s;let O=Mn();e.isSupported=typeof Zn=="function"&&typeof j=="function"&&ee&&ee.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Me,ERB_EXPR:_e,TMPLIT_EXPR:se,DATA_ATTR:bt,ARIA_ATTR:Xe,IS_SCRIPT_OR_DATA:Qe,ATTR_WHITESPACE:Ke,CUSTOM_ELEMENT:Ae}=In;let{IS_ALLOWED_URI:Je}=In,B=null;const T=C({},[...Rn,...Mt,...Dt,...Ot,...Cn]);let f=null;const x=C({},[...Ln,...Nt,...$n,...ct]);let R=Object.seal(Ut(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}})),G=null,ue=null;const Se=Object.seal(Ut(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Kt=!0,wt=!0,Jt=!1,en=!0,Ee=!1,et=!0,xe=!1,yt=!1,vt=!1,Re=!1,tt=!1,nt=!1,tn=!0,nn=!1;const Kn="user-content-";let Tt=!0,De=!1,Ce={},oe=null;const _t=C({},["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 rn=null;const sn=C({},["audio","video","img","source","image","track"]);let At=null;const on=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",st="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml";let Le=pe,St=!1,Et=null;const Jn=C({},[rt,st,pe],$t);let ot=C({},["mi","mo","mn","ms","mtext"]),it=C({},["annotation-xml"]);const er=C({},["title","style","font","a","script"]);let Oe=null;const tr=["application/xhtml+xml","text/html"],nr="text/html";let F=null,$e=null;const rr=n.createElement("form"),an=function(o){return o instanceof RegExp||o instanceof Function},Rt=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!($e&&$e===o)){if((!o||typeof o!="object")&&(o={}),o=le(o),Oe=tr.indexOf(o.PARSER_MEDIA_TYPE)===-1?nr:o.PARSER_MEDIA_TYPE,F=Oe==="application/xhtml+xml"?$t:pt,B=te(o,"ALLOWED_TAGS")?C({},o.ALLOWED_TAGS,F):T,f=te(o,"ALLOWED_ATTR")?C({},o.ALLOWED_ATTR,F):x,Et=te(o,"ALLOWED_NAMESPACES")?C({},o.ALLOWED_NAMESPACES,$t):Jn,At=te(o,"ADD_URI_SAFE_ATTR")?C(le(on),o.ADD_URI_SAFE_ATTR,F):on,rn=te(o,"ADD_DATA_URI_TAGS")?C(le(sn),o.ADD_DATA_URI_TAGS,F):sn,oe=te(o,"FORBID_CONTENTS")?C({},o.FORBID_CONTENTS,F):_t,G=te(o,"FORBID_TAGS")?C({},o.FORBID_TAGS,F):le({}),ue=te(o,"FORBID_ATTR")?C({},o.FORBID_ATTR,F):le({}),Ce=te(o,"USE_PROFILES")?o.USE_PROFILES:!1,Kt=o.ALLOW_ARIA_ATTR!==!1,wt=o.ALLOW_DATA_ATTR!==!1,Jt=o.ALLOW_UNKNOWN_PROTOCOLS||!1,en=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=o.SAFE_FOR_TEMPLATES||!1,et=o.SAFE_FOR_XML!==!1,xe=o.WHOLE_DOCUMENT||!1,Re=o.RETURN_DOM||!1,tt=o.RETURN_DOM_FRAGMENT||!1,nt=o.RETURN_TRUSTED_TYPE||!1,vt=o.FORCE_BODY||!1,tn=o.SANITIZE_DOM!==!1,nn=o.SANITIZE_NAMED_PROPS||!1,Tt=o.KEEP_CONTENT!==!1,De=o.IN_PLACE||!1,Je=o.ALLOWED_URI_REGEXP||Yn,Le=o.NAMESPACE||pe,ot=o.MATHML_TEXT_INTEGRATION_POINTS||ot,it=o.HTML_INTEGRATION_POINTS||it,R=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&an(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(R.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&an(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(R.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(R.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(wt=!1),tt&&(Re=!0),Ce&&(B=C({},Cn),f=[],Ce.html===!0&&(C(B,Rn),C(f,Ln)),Ce.svg===!0&&(C(B,Mt),C(f,Nt),C(f,ct)),Ce.svgFilters===!0&&(C(B,Dt),C(f,Nt),C(f,ct)),Ce.mathMl===!0&&(C(B,Ot),C(f,$n),C(f,ct))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Se.tagCheck=o.ADD_TAGS:(B===T&&(B=le(B)),C(B,o.ADD_TAGS,F))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Se.attributeCheck=o.ADD_ATTR:(f===x&&(f=le(f)),C(f,o.ADD_ATTR,F))),o.ADD_URI_SAFE_ATTR&&C(At,o.ADD_URI_SAFE_ATTR,F),o.FORBID_CONTENTS&&(oe===_t&&(oe=le(oe)),C(oe,o.FORBID_CONTENTS,F)),o.ADD_FORBID_CONTENTS&&(oe===_t&&(oe=le(oe)),C(oe,o.ADD_FORBID_CONTENTS,F)),Tt&&(B["#text"]=!0),xe&&C(B,["html","head","body"]),B.table&&(C(B,["tbody"]),delete G.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ue('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ue('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=o.TRUSTED_TYPES_POLICY,K=N.createHTML("")}else N===void 0&&(N=Os(S,r)),N!==null&&typeof K=="string"&&(K=N.createHTML(""));V&&V(o),$e=o}},ln=C({},[...Mt,...Dt,..._s]),cn=C({},[...Ot,...As]),sr=function(o){let p=j(o);(!p||!p.tagName)&&(p={namespaceURI:Le,tagName:"template"});const k=pt(o.tagName),P=pt(p.tagName);return Et[o.namespaceURI]?o.namespaceURI===st?p.namespaceURI===pe?k==="svg":p.namespaceURI===rt?k==="svg"&&(P==="annotation-xml"||ot[P]):!!ln[k]:o.namespaceURI===rt?p.namespaceURI===pe?k==="math":p.namespaceURI===st?k==="math"&&it[P]:!!cn[k]:o.namespaceURI===pe?p.namespaceURI===st&&!it[P]||p.namespaceURI===rt&&!ot[P]?!1:!cn[k]&&(er[k]||!ln[k]):!!(Oe==="application/xhtml+xml"&&Et[o.namespaceURI]):!1},ie=function(o){ze(e.removed,{element:o});try{j(o).removeChild(o)}catch{z(o)}},be=function(o,p){try{ze(e.removed,{attribute:p.getAttributeNode(o),from:p})}catch{ze(e.removed,{attribute:null,from:p})}if(p.removeAttribute(o),o==="is")if(Re||tt)try{ie(p)}catch{}else try{p.setAttribute(o,"")}catch{}},un=function(o){let p=null,k=null;if(vt)o="<remove></remove>"+o;else{const U=It(o,/^[\r\n\t ]+/);k=U&&U[0]}Oe==="application/xhtml+xml"&&Le===pe&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const P=N?N.createHTML(o):o;if(Le===pe)try{p=new A().parseFromString(P,Oe)}catch{}if(!p||!p.documentElement){p=ee.createDocument(Le,"template",null);try{p.documentElement.innerHTML=St?K:P}catch{}}const q=p.body||p.documentElement;return o&&k&&q.insertBefore(n.createTextNode(k),q.childNodes[0]||null),Le===pe?Ye.call(p,xe?"html":"body")[0]:xe?p.documentElement:q},pn=function(o){return ce.call(o.ownerDocument||o,o,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ct=function(o){return o instanceof L&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof v)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},hn=function(o){return typeof l=="function"&&o instanceof l};function he(w,o,p){lt(w,k=>{k.call(e,o,p,$e)})}const fn=function(o){let p=null;if(he(O.beforeSanitizeElements,o,null),Ct(o))return ie(o),!0;const k=F(o.nodeName);if(he(O.uponSanitizeElement,o,{tagName:k,allowedTags:B}),et&&o.hasChildNodes()&&!hn(o.firstElementChild)&&Z(/<[/\w!]/g,o.innerHTML)&&Z(/<[/\w!]/g,o.textContent)||o.nodeType===He.progressingInstruction||et&&o.nodeType===He.comment&&Z(/<[/\w]/g,o.data))return ie(o),!0;if(!(Se.tagCheck instanceof Function&&Se.tagCheck(k))&&(!B[k]||G[k])){if(!G[k]&&mn(k)&&(R.tagNameCheck instanceof RegExp&&Z(R.tagNameCheck,k)||R.tagNameCheck instanceof Function&&R.tagNameCheck(k)))return!1;if(Tt&&!oe[k]){const P=j(o)||o.parentNode,q=I(o)||o.childNodes;if(q&&P){const U=q.length;for(let Q=U-1;Q>=0;--Q){const fe=E(q[Q],!0);fe.__removalCount=(o.__removalCount||0)+1,P.insertBefore(fe,H(o))}}}return ie(o),!0}return o instanceof d&&!sr(o)||(k==="noscript"||k==="noembed"||k==="noframes")&&Z(/<\/no(script|embed|frames)/i,o.innerHTML)?(ie(o),!0):(Ee&&o.nodeType===He.text&&(p=o.textContent,lt([Me,_e,se],P=>{p=Be(p,P," ")}),o.textContent!==p&&(ze(e.removed,{element:o.cloneNode()}),o.textContent=p)),he(O.afterSanitizeElements,o,null),!1)},dn=function(o,p,k){if(tn&&(p==="id"||p==="name")&&(k in n||k in rr))return!1;if(!(wt&&!ue[p]&&Z(bt,p))){if(!(Kt&&Z(Xe,p))){if(!(Se.attributeCheck instanceof Function&&Se.attributeCheck(p,o))){if(!f[p]||ue[p]){if(!(mn(o)&&(R.tagNameCheck instanceof RegExp&&Z(R.tagNameCheck,o)||R.tagNameCheck instanceof Function&&R.tagNameCheck(o))&&(R.attributeNameCheck instanceof RegExp&&Z(R.attributeNameCheck,p)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(p,o))||p==="is"&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&Z(R.tagNameCheck,k)||R.tagNameCheck instanceof Function&&R.tagNameCheck(k))))return!1}else if(!At[p]){if(!Z(Je,Be(k,Ke,""))){if(!((p==="src"||p==="xlink:href"||p==="href")&&o!=="script"&&ws(k,"data:")===0&&rn[o])){if(!(Jt&&!Z(Qe,Be(k,Ke,"")))){if(k)return!1}}}}}}}return!0},mn=function(o){return o!=="annotation-xml"&&It(o,Ae)},gn=function(o){he(O.beforeSanitizeAttributes,o,null);const{attributes:p}=o;if(!p||Ct(o))return;const k={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:f,forceKeepAttr:void 0};let P=p.length;for(;P--;){const q=p[P],{name:U,namespaceURI:Q,value:fe}=q,Ie=F(U),Lt=fe;let W=U==="value"?Lt:ys(Lt);if(k.attrName=Ie,k.attrValue=W,k.keepAttr=!0,k.forceKeepAttr=void 0,he(O.uponSanitizeAttribute,o,k),W=k.attrValue,nn&&(Ie==="id"||Ie==="name")&&(be(U,o),W=Kn+W),et&&Z(/((--!?|])>)|<\/(style|title|textarea)/i,W)){be(U,o);continue}if(Ie==="attributename"&&It(W,"href")){be(U,o);continue}if(k.forceKeepAttr)continue;if(!k.keepAttr){be(U,o);continue}if(!en&&Z(/\/>/i,W)){be(U,o);continue}Ee&<([Me,_e,se],xn=>{W=Be(W,xn," ")});const kn=F(o.nodeName);if(!dn(kn,Ie,W)){be(U,o);continue}if(N&&typeof S=="object"&&typeof S.getAttributeType=="function"&&!Q)switch(S.getAttributeType(kn,Ie)){case"TrustedHTML":{W=N.createHTML(W);break}case"TrustedScriptURL":{W=N.createScriptURL(W);break}}if(W!==Lt)try{Q?o.setAttributeNS(Q,U,W):o.setAttribute(U,W),Ct(o)?ie(o):En(e.removed)}catch{be(U,o)}}he(O.afterSanitizeAttributes,o,null)},or=function w(o){let p=null;const k=pn(o);for(he(O.beforeSanitizeShadowDOM,o,null);p=k.nextNode();)he(O.uponSanitizeShadowNode,p,null),fn(p),gn(p),p.content instanceof i&&w(p.content);he(O.afterSanitizeShadowDOM,o,null)};return e.sanitize=function(w){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,k=null,P=null,q=null;if(St=!w,St&&(w="<!-->"),typeof w!="string"&&!hn(w))if(typeof w.toString=="function"){if(w=w.toString(),typeof w!="string")throw Ue("dirty is not a string, aborting")}else throw Ue("toString is not a function");if(!e.isSupported)return w;if(yt||Rt(o),e.removed=[],typeof w=="string"&&(De=!1),De){if(w.nodeName){const fe=F(w.nodeName);if(!B[fe]||G[fe])throw Ue("root node is forbidden and cannot be sanitized in-place")}}else if(w instanceof l)p=un("<!---->"),k=p.ownerDocument.importNode(w,!0),k.nodeType===He.element&&k.nodeName==="BODY"||k.nodeName==="HTML"?p=k:p.appendChild(k);else{if(!Re&&!Ee&&!xe&&w.indexOf("<")===-1)return N&&nt?N.createHTML(w):w;if(p=un(w),!p)return Re?null:nt?K:""}p&&vt&&ie(p.firstChild);const U=pn(De?w:p);for(;P=U.nextNode();)fn(P),gn(P),P.content instanceof i&&or(P.content);if(De)return w;if(Re){if(tt)for(q=xt.call(p.ownerDocument);p.firstChild;)q.appendChild(p.firstChild);else q=p;return(f.shadowroot||f.shadowrootmode)&&(q=Ve.call(s,q,!0)),q}let Q=xe?p.outerHTML:p.innerHTML;return xe&&B["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&Z(Vn,p.ownerDocument.doctype.name)&&(Q="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
|
57
|
+
`+Q),Ee&<([Me,_e,se],fe=>{Q=Be(Q,fe," ")}),N&&nt?N.createHTML(Q):Q},e.setConfig=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rt(w),yt=!0},e.clearConfig=function(){$e=null,yt=!1},e.isValidAttribute=function(w,o,p){$e||Rt({});const k=F(w),P=F(o);return dn(k,P,p)},e.addHook=function(w,o){typeof o=="function"&&ze(O[w],o)},e.removeHook=function(w,o){if(o!==void 0){const p=xs(O[w],o);return p===-1?void 0:bs(O[w],p,1)[0]}return En(O[w])},e.removeHooks=function(w){O[w]=[]},e.removeAllHooks=function(){O=Mn()},e}var Ns=Xn();function Qn(){function t(e){const n=D.parse(e);return Ns.sanitize(n)}return{renderMarkdown:t}}const Ps=["innerHTML"],zs=ke({__name:"ChatTextBlock",props:{block:{}},setup(t){const e=t,{renderMarkdown:n}=Qn(),s=y(()=>n(e.block.text));return(r,i)=>t.block.text.trim()?(h(),g("div",{key:0,class:"text-sm font-mono text-retro-text break-words chat-markdown",innerHTML:u(s)},null,8,Ps)):$("",!0)}}),Bs={class:"my-1 border border-retro-border/30 rounded bg-retro-dark/30"},Us={key:0,class:"text-retro-muted/80 truncate min-w-0 flex-1"},Fs={class:"ml-auto flex-shrink-0 text-retro-muted/60 text-[10px]"},Hs={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"},Gs=ke({__name:"ChatThinkingBlock",props:{block:{}},setup(t){const e=t,n=qe(!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(),g("div",Bs,[m("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]=d=>n.value=!u(n))},[we(u(On),{class:ne(["w-3 h-3 transition-transform flex-shrink-0",{"rotate-90":u(n)}])},null,8,["class"]),l[1]||(l[1]=m("span",{class:"text-retro-yellow"},"Thinking",-1)),!u(n)&&u(i)?(h(),g("span",Us,_(u(i)),1)):$("",!0),m("span",Fs,_(u(s))+" lines · "+_(t.block.thinking.length)+" chars ",1)]),u(n)?(h(),g("div",Hs,_(t.block.thinking),1)):$("",!0)]))}}),Ws={class:"my-2 border border-retro-border/40 rounded bg-retro-dark/30"},js={key:0,class:"w-3 h-3 border-2 border-retro-yellow border-t-transparent rounded-full animate-spin flex-shrink-0"},qs={class:"text-retro-muted"},Zs={class:"text-retro-cyan font-bold"},Ys={class:"text-retro-muted truncate"},Vs={key:0,class:"px-3 pb-2 border-t border-retro-border/20"},Xs={key:0,class:"mt-2"},Qs={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"},Ks={class:"text-xs font-mono text-retro-muted space-y-2 mt-2"},Js={key:0,class:"flex items-start gap-2"},eo={class:"text-retro-cyan break-all"},to={key:1,class:"flex items-start gap-2"},no={class:"text-retro-cyan break-all whitespace-pre-wrap"},ro={key:2,class:"flex items-start gap-2"},so={key:1,class:"mt-2"},oo={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"},io={key:0,class:"text-[10px] text-retro-muted mt-1"},ao={class:"mt-2"},lo={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"},co={key:2,class:"mt-3"},uo={class:"space-y-2"},po={key:0,class:"text-[11px] font-mono text-retro-yellow mb-1"},ho={key:1,class:"text-xs font-mono text-retro-text whitespace-pre-wrap"},fo={key:2,class:"mt-2 space-y-1"},mo={key:0,class:"text-retro-muted/80"},go={key:1,class:"px-3 pb-2 border-t border-retro-border/20"},ko={class:"mb-1 text-[10px] text-retro-muted"},xo={class:"text-retro-green"},bo={class:"text-retro-red"},wo={class:"space-y-0.5"},yo={class:"whitespace-pre-wrap"},vo={class:"whitespace-pre-wrap"},To=ke({__name:"ChatToolBlock",props:{block:{},result:{}},setup(t){const e=t,n=qe(!1),s=qe(!1);function r(T,f){for(const x of f){const R=T[x];if(typeof R=="string"&&R.trim())return R}return""}function i(T,f){for(const x of f){const R=T[x];if(typeof R=="number"&&Number.isFinite(R))return R;if(typeof R=="string"&&R.trim()){const G=Number(R);if(Number.isFinite(G))return G}}return null}function a(T,f=14,x=1400){if(!T)return{text:"",truncated:!1};const R=T.split(`
|
|
59
|
+
`);let G=R.slice(0,f).join(`
|
|
60
|
+
`),ue=R.length>f;return G.length>x&&(G=G.slice(0,x),ue=!0),{text:G,truncated:ue}}const l=y(()=>e.block.name.toLowerCase()),d=y(()=>l.value.replace(/[^a-z0-9]/g,"")),c=y(()=>d.value==="requestuserinput"||d.value==="askuserquestion"),v=y(()=>["read","read_file","readfile"].includes(l.value)),L=y(()=>["write","write_file","writefile","create_file"].includes(l.value)),A=y(()=>["edit","multiedit","replace","edit_file","editfile"].includes(l.value)),S=y(()=>["bash","exec","execcommand","runcommand","shell","run_shell_command"].includes(l.value)),b=y(()=>e.block.status==="running"||e.block.status==="error"||L.value||A.value||c.value),E=y(()=>{if(!c.value)return[];const T=e.block.input.questions;if(Array.isArray(T))return T.map(x=>x&&typeof x=="object"?x:null).filter(x=>!!x);const f={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!f.question&&!f.prompt&&!f.message&&!f.header?[]:[f]});function z(T,f=120){const x=T.replace(/\s+/g," ").trim();return x?x.length>f?`${x.slice(0,f)}...`:x:""}const H=y(()=>{const T=E.value[0];return T?z(T.question||T.prompt||T.message||T.header||""):""}),I=y(()=>r(e.block.input,["file_path","path","file","filepath","target_file"])),j=y(()=>{const T=i(e.block.input,["offset","start_line","line"]),f=i(e.block.input,["limit","lines","line_count"]),x=i(e.block.input,["end_line"]);return T!==null&&f!==null?`from line ${T}, ${f} lines`:T!==null&&x!==null?`lines ${T}-${x}`:T!==null?`from line ${T}`:f!==null?`${f} lines`:""}),N=y(()=>r(e.block.input,["content","text","new_content"])),K=y(()=>r(e.block.input,["cmd","command","script","chars"])),ee=y(()=>a(N.value)),ce=y(()=>{if(c.value)return H.value||"Prompting user for clarification";if(v.value){if(I.value&&j.value)return`Read ${I.value} (${j.value})`;if(I.value)return`Read ${I.value}`}return L.value&&I.value?`Write ${I.value}`:A.value&&I.value?`Edit ${I.value}`:S.value&&K.value?`$ ${K.value}`:e.block.inputSummary}),xt=y(()=>{switch(e.block.status){case"running":return"[RUN]";case"pending":return"[WAIT]";case"complete":return"[OK]";case"error":return"[ERR]"}}),Ye=y(()=>Object.entries(e.block.input).filter(([f,x])=>x==null||typeof x=="string"&&(!x.trim()||x.length>90)?!1:!["content","new_content","text","old_string","new_string"].includes(f)).slice(0,6).map(([f,x])=>`${f}=${JSON.stringify(x)}`)),Ve=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"}}),O=y(()=>e.result?.content??""),Me=y(()=>e.result?.isError??!1),_e=y(()=>O.value.length),se=y(()=>O.value.split(`
|
|
61
|
+
`)),bt=y(()=>s.value?se.value:se.value.slice(0,6)),Xe=y(()=>!O.value||!/^diff --git\s|\+\+\+\s|---\s|@@\s/m.test(O.value)?!1:/^[+\- ]/.test(se.value.find(f=>f.length>0)||"")||se.value.some(f=>f.startsWith("@@"))),Qe=y(()=>{if(!Xe.value)return{added:0,removed:0};let T=0,f=0;for(const x of se.value)x.startsWith("+++")||x.startsWith("---")||(x.startsWith("+")&&(T+=1),x.startsWith("-")&&(f+=1));return{added:T,removed:f}}),Ke=y(()=>O.value?O.value.split(`
|
|
62
|
+
`).slice(0,3).join(`
|
|
63
|
+
`):""),Ae=y(()=>O.value?se.value.length>6||O.value.length>320:!1),Je=y(()=>O.value.trim().length>0);function B(T){return T.startsWith("@@")?"text-retro-cyan bg-retro-cyan/10":T.startsWith("+")&&!T.startsWith("+++")?"text-retro-green bg-retro-green/10":T.startsWith("-")&&!T.startsWith("---")?"text-retro-red bg-retro-red/10":T.startsWith("diff --git")||T.startsWith("index ")||T.startsWith("---")||T.startsWith("+++")?"text-retro-yellow":"text-retro-muted"}return ht(()=>e.block.id,()=>{n.value=b.value,s.value=!1},{immediate:!0}),ht(()=>e.block.status,T=>{(T==="running"||T==="error")&&(n.value=!0)}),(T,f)=>(h(),g("div",Ws,[m("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:f[0]||(f[0]=x=>n.value=!u(n))},[t.block.status==="running"?(h(),g("span",js)):t.block.status==="pending"?(h(),re(u(mr),{key:1,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-muted animate-pulse"})):t.block.status==="complete"?(h(),re(u(dr),{key:2,class:ne(["w-3.5 h-3.5 flex-shrink-0",u(Ve)])},null,8,["class"])):(h(),re(u(kr),{key:3,class:ne(["w-3.5 h-3.5 flex-shrink-0",u(Ve)])},null,8,["class"])),m("span",qs,_(u(xt)),1),m("span",Zs,_(t.block.name),1),m("span",Ys,_(u(ce)||t.block.inputSummary),1),we(u(On),{class:ne(["w-3 h-3 ml-auto transition-transform text-retro-muted flex-shrink-0",{"rotate-90":u(n)}])},null,8,["class"])]),u(n)?(h(),g("div",Vs,[u(Ye).length>0?(h(),g("div",Xs,[f[5]||(f[5]=m("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Args",-1)),m("pre",Qs,_(u(Ye).join(`
|
|
64
|
+
`)),1)])):$("",!0),m("div",Ks,[u(I)?(h(),g("div",Js,[f[6]||(f[6]=m("span",{class:"text-retro-muted/80 min-w-12"},"File",-1)),m("code",eo,_(u(I)),1)])):$("",!0),u(S)&&u(K)?(h(),g("div",to,[f[7]||(f[7]=m("span",{class:"text-retro-muted/80 min-w-12"},"Cmd",-1)),m("code",no,_(u(K)),1)])):$("",!0),u(v)&&u(j)?(h(),g("div",ro,[f[8]||(f[8]=m("span",{class:"text-retro-muted/80 min-w-12"},"Range",-1)),m("span",null,_(u(j)),1)])):$("",!0)]),u(L)&&u(ee).text?(h(),g("div",so,[f[9]||(f[9]=m("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"New Content",-1)),m("pre",oo,_(u(ee).text),1),u(ee).truncated?(h(),g("div",io,"Truncated preview")):$("",!0)])):$("",!0),m("details",ao,[f[10]||(f[10]=m("summary",{class:"text-[11px] font-mono text-retro-muted cursor-pointer hover:text-retro-cyan"},"Raw input JSON",-1)),m("pre",lo,_(JSON.stringify(t.block.input,null,2)),1)]),u(c)&&u(E).length>0?(h(),g("div",co,[f[11]||(f[11]=m("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Clarification Prompt",-1)),m("div",uo,[(h(!0),g(ge,null,Ge(u(E),(x,R)=>(h(),g("div",{key:`${x.id||"q"}-${R}`,class:"rounded border border-retro-border/30 bg-retro-panel/40 p-2"},[x.header?(h(),g("div",po,_(x.header),1)):$("",!0),x.question||x.prompt||x.message?(h(),g("div",ho,_(x.question||x.prompt||x.message),1)):$("",!0),Array.isArray(x.options)&&x.options.length>0?(h(),g("div",fo,[(h(!0),g(ge,null,Ge(x.options,(G,ue)=>(h(),g("div",{key:`${x.id||"q"}-opt-${ue}`,class:"text-xs font-mono text-retro-muted"},[We(_(G.label||`Option ${ue+1}`)+" ",1),G.description?(h(),g("span",mo," - "+_(G.description),1)):$("",!0)]))),128))])):$("",!0)]))),128))])])):$("",!0)])):$("",!0),u(Je)?(h(),g("div",go,[m("div",{class:ne(["text-xs font-mono rounded p-2 mt-1 overflow-y-auto scrollbar-custom border",u(Me)?"text-retro-red bg-retro-red/5 border-retro-red/40":"text-retro-muted bg-retro-panel/60 border-retro-border/30"]),style:lr(u(s)?"max-height: 20rem":"")},[u(Xe)?(h(),g(ge,{key:0},[m("div",ko,[f[12]||(f[12]=We(" Diff · ",-1)),m("span",xo,"+"+_(u(Qe).added),1),f[13]||(f[13]=We(" / ",-1)),m("span",bo,"-"+_(u(Qe).removed),1)]),m("div",wo,[(h(!0),g(ge,null,Ge(u(bt),(x,R)=>(h(),g("div",{key:`diff-${R}`,class:ne(["px-1 rounded whitespace-pre-wrap break-all",B(x)])},_(x||" "),3))),128))]),!u(s)&&u(Ae)?(h(),g("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:f[1]||(f[1]=ye(x=>s.value=!0,["stop"]))}," Show full diff ("+_(u(_e))+" chars) ",1)):u(Ae)?(h(),g("button",{key:1,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:f[2]||(f[2]=ye(x=>s.value=!1,["stop"]))}," Collapse diff ")):$("",!0)],64)):!u(s)&&u(Ae)?(h(),g(ge,{key:1},[m("pre",yo,_(u(Ke)),1),m("button",{class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:f[3]||(f[3]=ye(x=>s.value=!0,["stop"]))}," Show full ("+_(u(_e))+" chars) ",1)],64)):(h(),g(ge,{key:2},[m("pre",vo,_(u(O)),1),u(Ae)?(h(),g("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:f[4]||(f[4]=ye(x=>s.value=!1,["stop"]))}," Collapse ")):$("",!0)],64))],6)])):$("",!0)]))}}),_o={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"},Ao={class:"flex items-center gap-1"},So={class:"flex items-center gap-1"},Eo=ke({__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(),g("div",_o,[m("span",Ao,[a[0]||(a[0]=m("span",{class:"text-retro-muted/60"},"time",-1)),We(" "+_(u(n)),1)]),m("span",So,[a[1]||(a[1]=m("span",{class:"text-retro-muted/60"},"cost",-1)),We(" "+_(u(s)),1)]),m("span",null,_(u(r)),1),m("span",null,_(t.block.numTurns)+" turn"+_(t.block.numTurns!==1?"s":""),1)]))}}),Ro={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"},Co={class:"text-retro-cyan"},Lo={key:0,class:"text-retro-border"},$o={key:1},Io=ke({__name:"ChatSessionInit",props:{block:{}},setup(t){return(e,n)=>(h(),g("div",Ro,[m("span",Co,_(t.block.model),1),n[0]||(n[0]=m("span",{class:"text-retro-border"},"|",-1)),m("span",null,_(t.block.tools.length)+" tools",1),t.block.permissionMode?(h(),g("span",Lo,"|")):$("",!0),t.block.permissionMode?(h(),g("span",$o,_(t.block.permissionMode),1)):$("",!0)]))}}),Mo=ke({__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=zs,a=Gs,l=To,d=Eo,c=Io;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:u(n)},null,8,["block","result"])):t.block.type==="result_summary"?(h(),re(d,{key:3,block:t.block},null,8,["block"])):t.block.type==="session_init"?(h(),re(c,{key:4,block:t.block},null,8,["block"])):$("",!0)}}}),Do={class:"flex items-center gap-2 mb-1"},Oo={class:"text-xs font-mono text-retro-muted"},No={key:0,class:"text-xs font-mono text-retro-yellow animate-pulse"},Po={key:1,class:"text-xs font-mono text-retro-muted"},zo={key:2,class:"text-xs font-mono text-retro-red"},Bo={class:"flex-1 min-w-0 w-full"},Uo={key:1,class:"mb-2 flex flex-wrap gap-2"},Fo=["href","download"],Ho=["src","alt"],Go={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},Wo={key:2,class:"text-sm font-mono text-retro-text break-words whitespace-pre-wrap"},jo=["innerHTML"],qo={key:4,class:"text-xs font-mono text-retro-muted italic"},Zo={key:5,class:"inline-block w-2 h-4 bg-retro-cyan animate-pulse ml-0.5"},ei=ke({__name:"ChatMessage",props:{message:{}},setup(t){const e=t,{renderMarkdown:n}=Qn(),s=y(()=>e.message.role==="user"),r=y(()=>e.message.status==="streaming"),i=y(()=>e.message.status==="error"),a=y(()=>e.message.status==="stopped"),l=y(()=>ur(e.message)),d=y(()=>{const E=new Map;for(const z of e.message.contentBlocks??[])z.type==="tool_result"&&E.set(z.toolUseId,z);return E}),c=y(()=>{if(!e.message.contentBlocks)return[];const E=e.message.contentBlocks.filter(H=>H.type!=="tool_result"),z=[];for(const H of E){const I=z.length>0?z[z.length-1]:null;if(I?.type==="text"&&H.type==="text"){const j=I.text||"",N=H.text||"";I.text=`${j}${N}`;continue}if(I?.type==="thinking"&&H.type==="thinking"){const j=I.thinking||"",N=H.thinking||"";I.thinking=`${j}${N}`;continue}z.push({...H})}return z}),v=y(()=>l.value&&c.value.length>0),L=y(()=>e.message.content.trim().length>0),A=y(()=>e.message.attachments??[]),S=E=>new Date(E).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),b=y(()=>n(e.message.content));return(E,z)=>{const H=Mo;return h(),g("div",{class:ne(["flex flex-col p-3",[u(s)?"bg-retro-dark/50":"bg-transparent",u(i)?"border-l-2 border-retro-red":""]])},[m("div",Do,[m("div",{class:ne(["flex-shrink-0 w-6 h-6 rounded flex items-center justify-center",u(s)?"bg-retro-cyan/20":"bg-retro-green/20"])},[u(s)?(h(),re(u(wr),{key:0,class:"w-4 h-4 text-retro-cyan"})):(h(),re(u(gr),{key:1,class:"w-4 h-4 text-retro-green"}))],2),m("span",{class:ne(["text-xs font-mono",u(s)?"text-retro-cyan":"text-retro-green"])},_(u(s)?"You":"Assistant"),3),m("span",Oo,_(S(t.message.timestamp)),1),u(r)?(h(),g("span",No," typing... ")):$("",!0),u(a)?(h(),g("span",Po," (stopped) ")):$("",!0),u(i)?(h(),g("span",zo," (error) ")):$("",!0)]),m("div",Bo,[u(v)?(h(!0),g(ge,{key:0},Ge(u(c),I=>(h(),re(H,{key:I.id,block:I,"tool-results-by-use-id":u(d)},null,8,["block","tool-results-by-use-id"]))),128)):$("",!0),u(s)&&u(A).length>0?(h(),g("div",Uo,[(h(!0),g(ge,null,Ge(u(A),I=>(h(),g("a",{key:I.id,href:I.dataUrl,download:I.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"},[m("img",{src:I.dataUrl,alt:I.name,class:"h-20 w-full rounded object-cover"},null,8,Ho),m("div",Go,_(I.name),1)],8,Fo))),128))])):$("",!0),!u(v)&&u(L)&&u(s)?(h(),g("div",Wo,_(t.message.content),1)):$("",!0),!u(v)&&u(L)&&!u(s)?(h(),g("div",{key:3,class:"text-sm font-mono text-retro-text break-words chat-markdown",innerHTML:u(b)},null,8,jo)):$("",!0),!u(v)&&!u(L)&&!u(s)&&!u(r)?(h(),g("div",qo," (no visible response content) ")):$("",!0),u(r)?(h(),g("span",Zo)):$("",!0)])],2)}}});function Dn(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 ti(){const t=pr(),e=y(()=>t.theme),n=y(()=>t.theme==="dark");function s(){const r=t.theme==="dark"?"light":"dark";t.setTheme(r),Dn(r)}return ht(()=>t.theme,r=>{Dn(r)},{immediate:!0}),{theme:e,isDark:n,toggleTheme:s}}export{Jo as C,ei as _,Qo as a,Io as b,zs as c,Gs as d,To as e,Eo as f,kr as g,wr as h,mr as i,xr as j,On as k,br as l,D as m,wn as n,gr as o,Ns as p,Qn as q,Ko as r,fr as s,dr as t,ti as u};
|
|
@@ -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"./BzfYDrv2.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{u as f,a as g}from"./
|
|
1
|
+
import{u as f,a as g}from"./Bze5ywup.js";import{_ as x,u as S}from"./B2xLiDuD.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"./BzfYDrv2.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{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"./BzfYDrv2.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};
|