@intent-hq/web 2.383.1 → 2.383.3
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/package.json +1 -1
- package/web/app/immutable/chunks/{CxFOqPFP.js → -2V-BAm8.js} +3 -3
- package/web/app/immutable/chunks/{nbomrtth.js → -NFtmIGG.js} +1 -1
- package/web/app/immutable/chunks/{CKXQrY3X.js → 0l7ZqDIV.js} +1 -1
- package/web/app/immutable/chunks/{WVvubfLN.js → 38Vg2YF4.js} +2 -2
- package/web/app/immutable/chunks/{CrFyLBfi.js → AqAgOqAP.js} +2 -2
- package/web/app/immutable/chunks/{Dm7KqEFT.js → Ax0sJJJl.js} +13 -13
- package/web/app/immutable/chunks/{BI0hvS48.js → B1Gvj9xq.js} +3 -3
- package/web/app/immutable/chunks/{6GlvsI2m.js → B2EqH2B9.js} +1 -1
- package/web/app/immutable/chunks/{CjpxPpfy.js → B4mnoVZK.js} +1 -1
- package/web/app/immutable/chunks/{CI9sv_EP.js → B4rcpoVl.js} +1 -1
- package/web/app/immutable/chunks/{W7maz5hp.js → B7AnydIV.js} +1 -1
- package/web/app/immutable/chunks/{DwImHc9s.js → BB5q5DsO.js} +1 -1
- package/web/app/immutable/chunks/{DEI5RmgA.js → BB7BFhCP.js} +1 -1
- package/web/app/immutable/chunks/{BFgeFHTs.js → BCo0L43p.js} +1 -1
- package/web/app/immutable/chunks/{Djg1-55Y.js → BD1NjrB7.js} +1 -1
- package/web/app/immutable/chunks/{TiuNiN7j.js → BDUjjuc4.js} +1 -1
- package/web/app/immutable/chunks/{zHu1d_6X.js → BDgY7Zd8.js} +2 -2
- package/web/app/immutable/chunks/{CJO6KBmw.js → BFU4GSWL.js} +1 -1
- package/web/app/immutable/chunks/{BYP8ebQS.js → BGxmHLUr.js} +1 -1
- package/web/app/immutable/chunks/{H9IjxeQk.js → BJA4-3TS.js} +1 -1
- package/web/app/immutable/chunks/{CEOBX1Pf.js → BMiKKOoz.js} +1 -1
- package/web/app/immutable/chunks/{CeHXXIxE.js → BOYBHPRf.js} +1 -1
- package/web/app/immutable/chunks/{oOhxfFIU.js → BQ9VbGlu.js} +1 -1
- package/web/app/immutable/chunks/{T8d_aLDP.js → BT9OtIDj.js} +1 -1
- package/web/app/immutable/chunks/{MQBseMlG.js → BTTEE7GF.js} +1 -1
- package/web/app/immutable/chunks/{DPZcepbV.js → BZ1qE3sd.js} +1 -1
- package/web/app/immutable/chunks/{BwtFad5m.js → BZskJqHK.js} +2 -2
- package/web/app/immutable/chunks/{D4FXvK9L.js → BammBnda.js} +3 -3
- package/web/app/immutable/chunks/{CkmRZ_MC.js → BdgSVihu.js} +1 -1
- package/web/app/immutable/chunks/{C9h2rwKF.js → BhHscwNa.js} +1 -1
- package/web/app/immutable/chunks/{C-O59F9J.js → BkfSBkLs.js} +2 -2
- package/web/app/immutable/chunks/{x63yRqVE.js → BktdbaP2.js} +1 -1
- package/web/app/immutable/chunks/{BbvEB4jz.js → Bok48R2D.js} +1 -1
- package/web/app/immutable/chunks/{Dsf8OM9-.js → Bp3ZrlmO.js} +1 -1
- package/web/app/immutable/chunks/{7GuT70Sz.js → BthP56U0.js} +1 -1
- package/web/app/immutable/chunks/{BLyGObAP.js → BvWOwOTx.js} +3 -3
- package/web/app/immutable/chunks/{BlRYe00B.js → BwOKiDn9.js} +1 -1
- package/web/app/immutable/chunks/{Du_rNq8q.js → BwyO9iAx.js} +1 -1
- package/web/app/immutable/chunks/{DJs4vEjF.js → Byun8_as.js} +1 -1
- package/web/app/immutable/chunks/{CBkpyV7r.js → BzVtDZxE.js} +1 -1
- package/web/app/immutable/chunks/{KH7BHXXb.js → C-n5-Nyi.js} +1 -1
- package/web/app/immutable/chunks/{C6Qw0raF.js → C19Fl1wo.js} +1 -1
- package/web/app/immutable/chunks/{DjHhZWUX.js → C7cQ3lDB.js} +1 -1
- package/web/app/immutable/chunks/{CDAoSo12.js → C89qw-SN.js} +1 -1
- package/web/app/immutable/chunks/{Su2XS_Ru.js → CDXv1PW9.js} +1 -1
- package/web/app/immutable/chunks/{D3C3nNLs.js → CEAKAkFK.js} +1 -1
- package/web/app/immutable/chunks/{Di8eJPr0.js → CGslv4Qq.js} +2 -2
- package/web/app/immutable/chunks/{DaaqgDka.js → CImg9Ht4.js} +1 -1
- package/web/app/immutable/chunks/{DMlkDPxV.js → CKG0fjh3.js} +1 -1
- package/web/app/immutable/chunks/{B6qvxAO7.js → CKOijLzA.js} +1 -1
- package/web/app/immutable/chunks/{CaNxJFJ1.js → CKaMWgJQ.js} +1 -1
- package/web/app/immutable/chunks/{DUhA4bgN.js → CLeH6OyR.js} +1 -1
- package/web/app/immutable/chunks/{h06E2ICA.js → CMiAv123.js} +1 -1
- package/web/app/immutable/chunks/{BCS2G1TZ.js → CUHgqEKH.js} +1 -1
- package/web/app/immutable/chunks/{Zx9hB63s.js → CW2OkXuF.js} +1 -1
- package/web/app/immutable/chunks/{C8JlOzbF.js → CWmACcmS.js} +1 -1
- package/web/app/immutable/chunks/{DSAj_NCN.js → CXR8jfrb.js} +1 -1
- package/web/app/immutable/chunks/{Dzk9iuw9.js → C_-1gUwp.js} +3 -3
- package/web/app/immutable/chunks/{CnAbYuPp.js → C_1Oardw.js} +1 -1
- package/web/app/immutable/chunks/{Rx5mQeGT.js → CfdQaRg7.js} +4 -4
- package/web/app/immutable/chunks/{Bq_wOSEp.js → CgLuwxkV.js} +1 -1
- package/web/app/immutable/chunks/{M-TVgx-R.js → ChUo5Z7l.js} +1 -1
- package/web/app/immutable/chunks/{BlVYr5cA.js → CiNhMqq1.js} +1 -1
- package/web/app/immutable/chunks/{B8VxRkn_.js → CiieGSUV.js} +1 -1
- package/web/app/immutable/chunks/{CL-lzPGU.js → CnljYLZs.js} +1 -1
- package/web/app/immutable/chunks/{DmXAUF0G.js → CpdAeaX0.js} +1 -1
- package/web/app/immutable/chunks/{DduCxuVq.js → CpxEaO9r.js} +1 -1
- package/web/app/immutable/chunks/{DsT1iX_Q.js → CrJMkG_1.js} +2 -2
- package/web/app/immutable/chunks/{BAP-Km9w.js → CslzdKY2.js} +1 -1
- package/web/app/immutable/chunks/{CDNvYbvS.js → CtIGR2R7.js} +1 -1
- package/web/app/immutable/chunks/{yaHL2zPw.js → Cuvcpuwl.js} +1 -1
- package/web/app/immutable/chunks/{BtHTHBJp.js → CzXkTVR8.js} +1 -1
- package/web/app/immutable/chunks/{CiSIqqOJ.js → D1QHqX16.js} +1 -1
- package/web/app/immutable/chunks/{0PdeE_M-.js → D23uZeQI.js} +1 -1
- package/web/app/immutable/chunks/D3a_DhRG.js +10 -0
- package/web/app/immutable/chunks/{q6F-1__g.js → D4QkxipA.js} +1 -1
- package/web/app/immutable/chunks/{BBws4Cyt.js → D59f5vu3.js} +1 -1
- package/web/app/immutable/chunks/{CDCEiDxP.js → D6J72aTz.js} +3 -3
- package/web/app/immutable/chunks/{DPzOIlu9.js → D83rapov.js} +1 -1
- package/web/app/immutable/chunks/{DrHfN5GT.js → DCQ9cJhS.js} +1 -1
- package/web/app/immutable/chunks/{Dr0V5Z_Q.js → DCq92KiG.js} +1 -1
- package/web/app/immutable/chunks/{Ddq8SBEz.js → DD98YGoG.js} +1 -1
- package/web/app/immutable/chunks/{CHXhxB4Q.js → DEIwQ6hO.js} +1 -1
- package/web/app/immutable/chunks/{BY9RbRJy.js → DGXU2Eur.js} +1 -1
- package/web/app/immutable/chunks/{CbO3oDHw.js → DKYFDagY.js} +1 -1
- package/web/app/immutable/chunks/{BK6a0pzX.js → DLZnxjXG.js} +1 -1
- package/web/app/immutable/chunks/{469banqV.js → DLbnXb7P.js} +3 -3
- package/web/app/immutable/chunks/{CJVoHxzN.js → DPPrfCEc.js} +1 -1
- package/web/app/immutable/chunks/{KSLBBJRy.js → DQ0P5vIc.js} +1 -1
- package/web/app/immutable/chunks/{DME_6OFx.js → DR9rgOUR.js} +1 -1
- package/web/app/immutable/chunks/{D-YGlaxj.js → DUdBCfQ2.js} +1 -1
- package/web/app/immutable/chunks/{BxVnbYG1.js → DUxx6wT8.js} +1 -1
- package/web/app/immutable/chunks/{DPyomP91.js → DVnAuhkJ.js} +1 -1
- package/web/app/immutable/chunks/{azpKokvz.js → DWG0la6r.js} +1 -1
- package/web/app/immutable/chunks/{BTw9kxtg.js → DcTV3q3a.js} +1 -1
- package/web/app/immutable/chunks/{D-dukRlA.js → Dcuzm8gD.js} +1 -1
- package/web/app/immutable/chunks/{DDJ_XVek.js → Df5fc__K.js} +2 -2
- package/web/app/immutable/chunks/{BjRQQ_jq.js → DhN_Bb70.js} +4 -4
- package/web/app/immutable/chunks/{DmaEU7hb.js → Dipy9ZkR.js} +1 -1
- package/web/app/immutable/chunks/{BvPbguyx.js → Dj5oY4MN.js} +1 -1
- package/web/app/immutable/chunks/{P-T74LCo.js → Dkwg3iDV.js} +3 -3
- package/web/app/immutable/chunks/{XHPDEELd.js → DlrDVrrH.js} +1 -1
- package/web/app/immutable/chunks/{MI7EtNv0.js → DpCuuI0h.js} +1 -1
- package/web/app/immutable/chunks/{BwhjiNjC.js → DqRH8mOo.js} +1 -1
- package/web/app/immutable/chunks/{bF6PpsOD.js → JhwNDffI.js} +1 -1
- package/web/app/immutable/chunks/{BPzekfWN.js → Jmsfhy4p.js} +1 -1
- package/web/app/immutable/chunks/{DOhJfAZG.js → LFBaWgJg.js} +1 -1
- package/web/app/immutable/chunks/{Ck2X3Rvg.js → QXKw7ybW.js} +1 -1
- package/web/app/immutable/chunks/{nImP7yvb.js → SDWlqEse.js} +1 -1
- package/web/app/immutable/chunks/{BXhT5rHA.js → WAmymGEm.js} +1 -1
- package/web/app/immutable/chunks/{Cxf6ur9F.js → a6nBCKTJ.js} +1 -1
- package/web/app/immutable/chunks/{Cofxvpdb.js → bB4pIooo.js} +1 -1
- package/web/app/immutable/chunks/{Ckb6le-m.js → eBfEHUcb.js} +4 -4
- package/web/app/immutable/chunks/{BvbTU4IL.js → gRz70TuX.js} +1 -1
- package/web/app/immutable/chunks/{BkITif4J.js → hrbt6TUA.js} +1 -1
- package/web/app/immutable/chunks/{Fdd73CJo.js → m6g2qs4v.js} +1 -1
- package/web/app/immutable/chunks/{DqMqjmmT.js → mlIdQnJX.js} +2 -2
- package/web/app/immutable/chunks/{BNkpVy97.js → p-4Usjf1.js} +1 -1
- package/web/app/immutable/chunks/{BI3a2AWW.js → pf1qexdH.js} +1 -1
- package/web/app/immutable/chunks/{Dhzl8ugO.js → sjYi8iFk.js} +1 -1
- package/web/app/immutable/chunks/{CnqJXAKo.js → uA-KbK5l.js} +1 -1
- package/web/app/immutable/chunks/{Div5PXT-.js → ufC4F9mx.js} +2 -2
- package/web/app/immutable/chunks/{DOUbieNj.js → v1V9O0KC.js} +1 -1
- package/web/app/immutable/chunks/{DlEmrQXN.js → wh8BTzW1.js} +2 -2
- package/web/app/immutable/chunks/{CGIQkN5K.js → yC4xveeV.js} +1 -1
- package/web/app/immutable/chunks/{ByfS7UIX.js → yYvyTKgb.js} +1 -1
- package/web/app/immutable/chunks/{BAzzHP-D.js → zw9aQKYl.js} +1 -1
- package/web/app/immutable/entry/{app.CgYQGiwi.js → app.CeAiZV-v.js} +2 -2
- package/web/app/immutable/entry/start.DrVPJx5Z.js +1 -0
- package/web/app/immutable/nodes/{0.DOOOI3Bo.js → 0.D2I9SFzE.js} +1 -1
- package/web/app/immutable/nodes/{1.DCbWOuyY.js → 1.CHeML-3-.js} +1 -1
- package/web/app/immutable/nodes/{10.DkhUAhty.js → 10.CPMi8QX9.js} +4 -4
- package/web/app/immutable/nodes/{11.DDwWhO0Z.js → 11.DOD-sh-z.js} +1 -1
- package/web/app/immutable/nodes/{15.Dw1bH9Zl.js → 15.BXDyjjHm.js} +1 -1
- package/web/app/immutable/nodes/{19.BDZr-fpl.js → 19.BEUhM4Xw.js} +2 -2
- package/web/app/immutable/nodes/{2.BXcXLNQd.js → 2.CeC42N_5.js} +4 -4
- package/web/app/immutable/nodes/{3.DSd1hRZn.js → 3.-_yjscmj.js} +1 -1
- package/web/app/immutable/nodes/{4.BkWwx_VF.js → 4.CdQdgUhv.js} +1 -1
- package/web/app/immutable/nodes/{5.y9tMc2yb.js → 5.jUP9W-D7.js} +1 -1
- package/web/app/immutable/nodes/{6.BosoYTZK.js → 6.B0WnMraI.js} +1 -1
- package/web/app/immutable/nodes/{7.BX-dUHAQ.js → 7.DAEOmrZS.js} +1 -1
- package/web/app/immutable/nodes/{8.DUR07SoM.js → 8.D1Q1AivC.js} +1 -1
- package/web/app/immutable/nodes/{9.Cw56XQ1G.js → 9.C5Qv23W5.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/i_QPvq4q.js +0 -10
- package/web/app/immutable/entry/start.C_kFKw1E.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CjTo2K46.js","/app/immutable/chunks/tr-2J8Mf.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/6-uYidyP.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/C6mS8uZB.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/C8y9EItt.js","/app/immutable/chunks/DXBEIeJu.js","/app/immutable/chunks/BX-0SVP7.js","/app/immutable/chunks/1WR8MecL.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/PIgqsYsQ.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/
|
|
2
|
-
var F=Object.defineProperty;var $=(c,e,r)=>e in c?F(c,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):c[e]=r;var u=(c,e,r)=>$(c,typeof e!="symbol"?e+"":e,r);import{l as _}from"./ChTqQfQN.js";import{bm as b,_ as y}from"./C0QTy0Sy.js";import{Jv as k,CE as M}from"./tr-2J8Mf.js";import{h as O}from"./DCRuihKm.js";import{O as W}from"./DKHY8q_S.js";import{cO as L}from"./BtHTHBJp.js";import{v as x,b7 as U,be as j}from"./BFgeFHTs.js";import{a as z}from"./ujhgjK1k.js";const D={USE_DEFAULT_CONTEXT:{id:"use-default-context",type:"command",get label(){return b.chat_mentions_useDefaultContext_label()},get description(){return b.chat_mentions_useDefaultContext_description()},icon:"🔄",uri:"devspace://command/use-default-context"},CLEAR_CONTEXT:{id:"clear-context",type:"command",get label(){return b.chat_mentions_clearContext_label()},get description(){return b.chat_mentions_clearContext_description()},icon:"🗑️",uri:"devspace://command/clear-context"}};function ke(c){return"items"in c||"subgroups"in c}function B(c){if(!c||typeof c!="object")return!1;const e=c;return!(typeof e.id!="string"||typeof e.label!="string"||typeof e.uri!="string"||typeof e.type!="string"||e.subtitle!==void 0&&typeof e.subtitle!="string"||e.description!==void 0&&typeof e.description!="string"||e.icon!==void 0&&typeof e.icon!="string"||e.score!==void 0&&typeof e.score!="number"||e.group!==void 0&&typeof e.group!="string")}function g(c,e){if(!c||!e)return null;const r=c.toLowerCase(),s=e.toLowerCase();let t=0;for(let a=0;a<s.length&&t<r.length;a++)s[a]===r[t]&&t++;if(t!==r.length)return null;const i=K(r,s);return i?{score:V(r,s,i),matches:i}:null}function K(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;for(let a=s;a<e.length;a++)if(e[a]===i){r.push(a),s=a+1,n=!0;break}if(!n)return null}return r}function V(c,e,r){let s=0;s+=1;let t=0;for(let l=1;l<r.length;l++)r[l]===r[l-1]+1&&(t+=.1);s+=t;let i=0;for(const l of r)(l===0||J(e,l))&&(i+=.15);s+=i,r[0]===0&&(s+=.2);const a=(r[r.length-1]-r[0])/e.length*.3;return s-=a,Math.min(s/2.5,1)}function J(c,e){if(e===0)return!0;const r=c[e],s=c[e-1];return r===r.toUpperCase()&&s===s.toLowerCase()||!/[a-z0-9]/i.test(s)}function G(c,e){if(!c||!e)return null;if(!c.includes("/"))return g(c,e);const r=c.split("/").filter(n=>n.length>0),s=e.split("/").filter(n=>n.length>0);if(r.length===0||s.length===0)return null;const t=H(r,s);return t?{score:X(r,s,t),matches:[]}:null}function H(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;const a=t===c.length-1;for(let o=s;o<e.length;o++){const l=e[o];if(g(i,l)){r.push(o),s=o+1,n=!0;break}if(a){const p=l.split(".")[0],m=l.includes(".")?l.split(".").pop():"";if(m&&g(i,m)){r.push(o),s=o+1,n=!0;break}if(p&&g(i,p)){r.push(o),s=o+1,n=!0;break}}}if(!n)return null}return r}function X(c,e,r){let s=0;s+=1,s+=r.length*.2;let t=0;for(let n=1;n<r.length;n++)r[n]===r[n-1]+1&&(t+=.15);s+=t,r.length>0&&r[r.length-1]===e.length-1&&(s+=.3);for(let n=0;n<c.length&&n<r.length;n++){const a=c[n],o=e[r[n]];a.toLowerCase()===o.toLowerCase()&&(s+=.2)}return Math.min(s/3,1)}function R(c,e,r){return JSON.stringify({query:c,workspaceId:r.workspaceId,repoPath:r.repoPath,currentFile:r.currentFile,currentNote:r.currentNote,providers:e.map(s=>[s.id,s.getCacheKey?.(r)])})}const N="*",Ce=["member","note","agent","file","folder","script","terminal",N,"specialist"];function Q(c,e){if(e.length===0)return[...c].sort((t,i)=>(i.score??0)-(t.score??0));const r=new Map(e.map((t,i)=>[t,i])),s=r.get(N)??e.length;return c.map(t=>({candidate:t,rank:r.get(t.type)??s})).sort((t,i)=>t.rank-i.rank||(i.candidate.score??0)-(t.candidate.score??0)).map(({candidate:t})=>t)}function Y(c,e){const r=new Map;return c.filter(s=>{const t=r.get(s.type)??0;return r.set(s.type,t+1),t<e})}class Ie{constructor(e={}){u(this,"searchDebounceTimer",null);u(this,"currentAbortController",null);u(this,"cache",new Map);u(this,"config");u(this,"isSearching",!1);this.config={debounceMs:e.debounceMs??100,maxResults:e.maxResults??50,cacheMaxAge:e.cacheMaxAge??3e4,enableSemantic:e.enableSemantic??!1,enableLivePreview:e.enableLivePreview??!0,enableCollaboration:e.enableCollaboration??!1,typeOrder:e.typeOrder??[],maxResultsPerKind:e.maxResultsPerKind??20}}async search(e,r,s){this.cancelPendingSearch();const t=R(e,r,s),i=this.cache.get(t);if(i&&!this.isCacheExpired(i))return _.debug("[SearchService] Returning cached results for:",e),i.results;const n=new AbortController;this.currentAbortController=n;const a=n.signal;return new Promise((o,l)=>{this.isSearching=!0;let p=!1;const m=()=>{a.removeEventListener("abort",v),this.currentAbortController===n&&(this.currentAbortController=null,this.searchDebounceTimer=null,this.isSearching=!1)},w=f=>{p||(p=!0,m(),o(f))},d=f=>{p||(p=!0,m(),l(f))},v=()=>d(new DOMException("Search cancelled","AbortError"));a.addEventListener("abort",v,{once:!0});const h=async()=>{try{if(a.aborted){d(new DOMException("Search cancelled","AbortError"));return}_.debug("[SearchService] Searching with providers:",r.map(C=>C.id));const f=R(e,r,s),P=await Promise.all(r.map(C=>this.searchWithProvider(C,e,s,a)));if(a.aborted)return;if(f!==R(e,r,s)){w([]);return}const S=this.combineResults(P.flat()).filter(C=>B(C)),E=this.applyFuzzyMatching(e,S),A=Q(E,this.config.typeOrder),T=this.config.typeOrder.length>0?Y(A,this.config.maxResultsPerKind):A.slice(0,this.config.maxResults);this.cache.set(f,{results:T,timestamp:Date.now()}),_.debug(`[SearchService] Found ${T.length} results`),w(T)}catch(f){a.aborted?d(new DOMException("Search cancelled","AbortError")):(_.error("[SearchService] Search error:",f),d(f instanceof Error?f:new Error(String(f))))}};e?this.searchDebounceTimer=setTimeout(h,this.config.debounceMs):h()})}async searchWithProvider(e,r,s,t){try{const i={...s,signal:t},n=await e.search(r,i),a=e.scoreRelevance?.bind(e);return a?n.map(o=>({...o,score:a(o,s)})):n}catch(i){return t.aborted||_.error(`[SearchService] Provider ${e.id} search failed:`,i),[]}}combineResults(e){const r=new Set,s=[];for(const t of e){const i=`${t.type}:${t.uri}`;r.has(i)||(r.add(i),s.push(t))}return s}applyFuzzyMatching(e,r){if(!e||e.length===0)return r;const t=r.map(i=>{let n=0;const a=i.meta?.path||i.meta?.fullPath||(i.subtitle?`${i.subtitle}/${i.label}`:i.label);if(a){const l=G(e,a);l&&(n=Math.max(n,l.score*1.8))}const o=g(e,i.label);if(o&&(n=Math.max(n,o.score*1.5)),i.subtitle){const l=g(e,i.subtitle);l&&(n=Math.max(n,l.score))}if(i.description){const l=g(e,i.description);l&&(n=Math.max(n,l.score*.5))}return{...i,score:n>0?n:i.score??0}}).filter(i=>i.score>0);return t.length>0?t:r}cancelPendingSearch(){this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=null),this.currentAbortController&&(this.currentAbortController.abort(),this.currentAbortController=null)}isCacheExpired(e){return Date.now()-e.timestamp>this.config.cacheMaxAge}clearCache(){this.cache.clear()}isLoading(){return this.isSearching}destroy(){this.cancelPendingSearch(),this.clearCache()}}class Z{constructor(){u(this,"id","file");u(this,"triggers",["@file","@f"]);u(this,"default",!0);u(this,"supportsRanges",!0);u(this,"supportsLivePreview",!0);u(this,"recentFiles",new Set);u(this,"fileIconMap",{ts:"📘",tsx:"⚛️",js:"📜",jsx:"⚛️",svelte:"🔥",vue:"💚",py:"🐍",rs:"🦀",go:"🐹",java:"☕",cpp:"⚙️",c:"⚙️",h:"📎",md:"📝",json:"📋",yaml:"📋",yml:"📋",toml:"📋",xml:"📋",html:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sql:"🗃️",sh:"🖥️",bash:"🖥️",zsh:"🖥️",fish:"🖥️",dockerfile:"🐳",docker:"🐳",gitignore:"🚫",env:"🔐",lock:"🔒",test:"🧪",spec:"🧪"})}async search(e,r){_.debug("[FileProvider] Searching for:",{query:e,context:{workspaceId:r.workspaceId}});const s=r.workspaceId;if(!s)return[];try{const t=await O("search.fileNames",{workspaceId:s,pattern:e||"",limit:10}),n=(Array.isArray(t?.files)?t.files:[]).map(a=>{const o=a.split("/").pop()||a,l=o.split(".").pop()||"";return{id:`file-${a}`,label:o,type:"file",uri:`file:${a}`,description:a,subtitle:a,score:.5,meta:{path:a,fullPath:a,relativePath:a,extension:l,language:this.getLanguageFromExtension(l)}}});return this.deduplicateAndDistinguish(n)}catch(t){return _.error("[FileProvider] Search failed:",t),[]}}async searchRecent(e,r){if(!r.recentFiles||r.recentFiles.length===0)return[];const s=await Promise.all(r.recentFiles.filter(t=>e?g(e,t)!==null:!0).slice(0,3).map(t=>{const i=t.split("/").pop()||t,n=i.split(".").pop()||"";return this.fileToCandidate({path:t,name:i,extension:n})}));return s.forEach(t=>{this.recentFiles.add(t.uri)}),s}async searchContextual(e,r){return r.currentFile?[]:[]}async fileToCandidate(e){const r=this.getFileIcon(e.extension),s=e.path,t=this.formatPath(s);return{id:`file-${e.path}`,type:"file",label:e.name,subtitle:t,description:s,icon:r,uri:`devspace://file/${encodeURIComponent(e.path)}`,meta:{path:s,fullPath:e.path,lastModified:e.lastModified,size:e.size,language:e.language||this.getLanguageFromExtension(e.extension)}}}combineResults(...e){const r=new Set,s=[];for(const t of e)for(const i of t)r.has(i.uri)||(r.add(i.uri),s.push(i));return this.deduplicateAndDistinguish(s)}deduplicateAndDistinguish(e){const r=new Map;for(const t of e){const i=t.label;let n=r.get(i);n||(n=[],r.set(i,n)),n.push(t)}const s=[];for(const[t,i]of r.entries())if(i.length===1)s.push(i[0]);else{const n=this.distinguishDuplicates(i);s.push(...n)}return s}distinguishDuplicates(e){const r=e.map(t=>t.description||t.meta?.path||"");return e.map((t,i)=>{const n=r[i],a=r.filter((p,m)=>m!==i),o=n.split("/");let l="";for(let p=o.length;p>0;p--){const m=o.slice(-p).join("/");if(!a.some(d=>d.split("/").slice(-p).join("/")===m)||p===1){l=m;break}}return{...t,subtitle:l}})}groupResults(e){const r={recent:[],relevant:[],other:[]};for(const t of e)this.recentFiles.has(t.uri)?r.recent.push(t):(t.score??0)>.7?r.relevant.push(t):r.other.push(t);const s=[];return r.recent.length>0&&s.push(...r.recent.slice(0,3).map(t=>({...t,group:b.chat_mentions_recentFiles_group()}))),r.relevant.length>0&&s.push(...r.relevant.slice(0,5).map(t=>({...t,group:b.chat_mentions_mostRelevant_group()}))),r.other.length>0&&s.push(...r.other.slice(0,10).map(t=>({...t,group:b.chat_mentions_otherFiles_group()}))),s}scoreRelevance(e,r){let s=.5;if(this.recentFiles.has(e.uri)&&(s+=.2),r.currentFile&&e.meta?.path){const t=r.currentFile.substring(0,r.currentFile.lastIndexOf("/")),i=e.meta.path.substring(0,e.meta.path.lastIndexOf("/"));t===i&&(s+=.15)}return r.imports?.includes(e.meta?.path||"")&&(s+=.25),r.currentFile?.includes(".test.")&&e.meta?.path?.includes(".test.")&&(s+=.1),Math.min(s,1)}getGroups(){return[{id:"files-recent",label:b.chat_mentions_recentFiles_group(),icon:"🕐"},{id:"files-all",label:b.chat_mentions_allFiles_group(),icon:"📁"},{id:"files-tests",label:b.chat_mentions_testFiles_group(),icon:"🧪"}]}getFileIcon(e){return this.fileIconMap[e.toLowerCase()]||"📄"}formatPath(e){if(e.length>40){const r=e.split("/");if(r.length>2)return`.../${r.slice(-2).join("/")}`}return e}getLanguageFromExtension(e){return{ts:"typescript",tsx:"typescriptreact",js:"javascript",jsx:"javascriptreact",py:"python",rs:"rust",go:"go",java:"java",cpp:"cpp",c:"c",svelte:"svelte",vue:"vue",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"shellscript"}[e.toLowerCase()]||"plaintext"}}class q{constructor(){u(this,"id","member")}getCacheKey(e){const r=k.state;return JSON.stringify({backendId:W.select(r),ownPrincipalId:r.presence.ownPrincipalId,members:e.workspaceId?L.select(r,e.workspaceId):[]})}async search(e,r){const{workspaceId:s}=r;if(!s)return[];const t=e.replace(/^@/,"").toLowerCase();return L.select(k.state,s).filter(i=>i.login.toLowerCase().includes(t)).map(i=>({id:`member-${i.principalId}`,type:"member",label:i.login,subtitle:i.identity?`${i.identity.provider==="github"?"GitHub":"GitLab"} · ${i.identity.host}`:void 0,description:i.displayName??void 0,icon:"👤",uri:`devspace://member/${encodeURIComponent(i.principalId)}?workspaceId=${encodeURIComponent(s)}`,score:.8,meta:{workspaceId:s,principalId:i.principalId,identity:i.identity,avatarUrl:i.avatarUrl??void 0}}))}}class ee{constructor(){u(this,"id","folder");u(this,"triggers",["@folder","@dir"])}async search(e,r){const s=r.workspaceId;if(!s)return[];try{const{backendRequest:t}=await y(async()=>{const{backendRequest:o}=await import("./DCRuihKm.js").then(l=>l.j);return{backendRequest:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),i=await t("search.fileNames",{workspaceId:s,pattern:e||"",limit:200}),n=Array.isArray(i?.files)?i.files:[],a=new Set;for(const o of n){const l=o.split("/");for(let p=1;p<l.length;p++)a.add(l.slice(0,p).join("/"))}return[...a].filter(o=>e?g(e,o.split("/").pop()||o)!==null:!0).slice(0,10).map(o=>({id:`folder-${o}`,type:"folder",label:o.split("/").pop()||o,description:o,icon:"📁",uri:`devspace://folder/${encodeURIComponent(o)}`,meta:{path:o,fullPath:o,relativePath:o}}))}catch(t){return _.debug("[FolderProvider] Failed to get folders:",t),[]}}}const te=10,re=.3;function se(c){const e=c.toLowerCase().split(/\s+/).filter(Boolean);return(r,s)=>{const t=r?g(c,r):null;if(t)return 1+t.score;if(s){const i=s.toLowerCase();if(e.every(n=>i.includes(n)))return re}return 0}}class ie{constructor(){u(this,"id","note");u(this,"triggers",["@note","@n"]);u(this,"supportsRanges",!0);u(this,"cachedNotes",[]);u(this,"lastCacheUpdate",0);u(this,"cacheTimeout",5e3)}async getSiblingWorkspaces(e){if(!e)return[];try{const[{store:r},{selectWorkspaceItems:s}]=await Promise.all([y(()=>import("./CjTo2K46.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./BaujsV9k.js").then(n=>n.ee),__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url)]),t=s.select(r.state),i=t.find(n=>n.id===e);return!i||!i.repositoryPath?[]:t.filter(n=>n.id!==e&&n.repositoryPath===i.repositoryPath)}catch(r){return _.debug("[NoteProvider] Failed to get sibling workspaces:",r),[]}}async fetchNotesFromWorkspace(e,r){try{const[{store:s},{listSlimNotesRequested:t}]=await Promise.all([y(()=>import("./CjTo2K46.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./tr-2J8Mf.js").then(n=>n.MD),__vite__mapDeps([12,13,2,14,15,4,8,1,16,6,3]),import.meta.url)]);return(await s.dispatch(t(e))).map(n=>({note:n,workspaceId:e,workspaceTitle:r}))}catch(s){_.debug(`[NoteProvider] Failed to fetch notes from workspace ${e}:`,s)}return[]}async search(e,r){if(!r.workspaceId)return[];const s=e.trim(),t=s?se(s):null;try{const i=await this.fetchNotesFromWorkspace(r.workspaceId),a=(await this.getSiblingWorkspaces(r.workspaceId)).map(d=>this.fetchNotesFromWorkspace(d.id,d.title)),l=(await Promise.all(a)).flat(),p=[...i,...l],w=(t?p.map(d=>({entry:d,score:t(d.note.title,d.note.content||d.note.contentPreview)})).filter(({score:d})=>d>0).sort((d,v)=>v.score-d.score):p.map(d=>({entry:d,score:void 0}))).slice(0,te).map(({entry:{note:d,workspaceId:v,workspaceTitle:h},score:f})=>{const P=v===r.workspaceId,I=P?void 0:b.chat_mentions_fromWorkspace_subtitle({workspace:h||v}),S=d.content||d.contentPreview;return{candidate:{id:d.id,type:"note",label:d.title||d.id||b.chat_mentions_untitledNote_label(),subtitle:I,description:S?`${S.substring(0,100)}...`:"",icon:"📝",uri:`devspace://note/${d.id}`,meta:{preview:S?.substring(0,200)||"",workspaceId:v,...P?{}:{isExternalLink:!0}}},score:f}});if(this.cachedNotes=w.map(({candidate:d})=>d),this.lastCacheUpdate=Date.now(),w.length>0)return w.map(({candidate:d,score:v})=>v!==void 0?{...d,score:v}:d)}catch(i){_.debug("[NoteProvider] Failed to fetch notes:",i)}return this.cachedNotes.length>0?t?this.cachedNotes.map(i=>({...i,score:t(i.label,i.meta?.preview)})).filter(i=>i.score>0).sort((i,n)=>n.score-i.score):this.cachedNotes:[]}getCachedNotes(){return Date.now()-this.lastCacheUpdate>this.cacheTimeout?[]:this.cachedNotes}}class ne{constructor(){u(this,"id","external");u(this,"triggers",["@docs","@external"])}async search(e,r){return[{id:"react-docs",label:"React Documentation",url:"https://react.dev",description:"Official React documentation"},{id:"mdn",label:"MDN Web Docs",url:"https://developer.mozilla.org",description:"Web technology documentation"},{id:"typescript",label:"TypeScript Handbook",url:"https://www.typescriptlang.org/docs/",description:"TypeScript documentation"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`external-${t.id}`,type:"external-source",label:t.label,description:t.description,icon:"📚",uri:`devspace://external/${t.id}`,meta:{url:t.url}}))}}class oe{constructor(){u(this,"id","rule");u(this,"triggers",["@rule","@intent"])}async search(e,r){return[{path:".intent/rules/cli.md",label:"CLI Rules"},{path:".intent/rules/frontend.md",label:"Frontend Rules"},{path:".intent/rules/python.md",label:"Python Rules"},{path:".intent/rules/sidecar.md",label:"Sidecar Rules"},{path:".intent/rules/systems.md",label:"Systems Rules"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:t.path,type:"rule",label:t.label,subtitle:t.path,icon:"📚",uri:`devspace://rule/${encodeURIComponent(t.path)}`,meta:{path:t.path}}))}}class ae{constructor(){u(this,"id","task");u(this,"triggers",["@task","@todo"])}async search(e,r){return[{id:"task-1",label:"Implement authentication",status:"in_progress",assignee:"John Doe"},{id:"task-2",label:"Write tests",status:"not_started",assignee:"Jane Smith"},{id:"task-3",label:"Deploy to production",status:"completed",assignee:"Bob Johnson"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`task-${t.id}`,type:"task",label:t.label,subtitle:`${t.status} • ${t.assignee}`,icon:"📋",uri:`devspace://task/${t.id}`,meta:{taskStatus:t.status,assignee:t.assignee}}))}}class ce{constructor(){u(this,"id","personality");u(this,"triggers",["@personality","@persona"]);u(this,"personalities",[{id:"auggie-personality-agent-default",name:"Agent Auggie",description:"Default helpful AI assistant",icon:"🤖",temperature:.7,model:"default",promptToken:"auggie-personality-agent-default"},{id:"auggie-personality-prototyper",name:"Prototyper Auggie",description:"Specialized in rapid prototyping",icon:"⚡",temperature:.7,model:"default",promptToken:"auggie-personality-prototyper"},{id:"auggie-personality-brainstorm",name:"Brainstorm Auggie",description:"Creative ideation and exploration",icon:"💡",temperature:.7,model:"default",promptToken:"auggie-personality-brainstorm"},{id:"auggie-personality-reviewer",name:"Reviewer Auggie",description:"Code review and feedback",icon:"🔍",temperature:.7,model:"default",promptToken:"auggie-personality-reviewer"}])}async search(e,r){return this.personalities.filter(s=>!e||g(e,s.name)!==null).map(s=>({id:s.id,type:"personality",label:s.name,subtitle:`${s.model}`,description:s.description,icon:s.icon,uri:`devspace://personality/${s.id}`,meta:{promptToken:s.promptToken}}))}}class le{constructor(){u(this,"id","command");u(this,"triggers",["@cmd","@command"])}async search(e,r){return[D.USE_DEFAULT_CONTEXT,D.CLEAR_CONTEXT].filter(t=>!e||t.label.toLowerCase().includes(e.toLowerCase()))}}class ue{constructor(){u(this,"id","terminal");u(this,"triggers",["@terminal","@term"])}async search(e,r){try{const{terminalManager:s}=await y(async()=>{const{terminalManager:h}=await import("./6-uYidyP.js").then(f=>f.b);return{terminalManager:h}},__vite__mapDeps([27,2,1,28,29,3,4,30,31,12,13,14,15,8,16,6,0,5,7,9,10,32,24,33,34,35,36,37,38,39,40,25,41,42]),import.meta.url),{selectTerminals:t,selectTerminalDisplayName:i}=await y(async()=>{const{selectTerminals:h,selectTerminalDisplayName:f}=await import("./PIgqsYsQ.js").then(P=>P.i);return{selectTerminals:h,selectTerminalDisplayName:f}},__vite__mapDeps([41,12,13,2,14,15,4,8,1,16,6,3]),import.meta.url),a=k.state;if(!r.workspaceId)return[];const o=t.select(a,r.workspaceId),l=s.loadTerminalMetadata(r.workspaceId),p=new Set,m=[];for(const h of o)p.add(h.id),m.push({id:h.id,name:i.select(a,r.workspaceId,h.id)});for(const h of l)p.has(h.terminalId)||(p.add(h.terminalId),m.push({id:h.terminalId,name:h.title||b.terminal_quakeOverlay_terminal_fallback()}));if(m.length===0)return[];const d=e?["terminal","term"].some(h=>h.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(h)):!1;return(e&&!d?m.filter(h=>g(e,h.name)!==null):m).slice(0,10).map((h,f)=>({id:h.id,type:"terminal",label:h.name,subtitle:b.chat_mentions_terminalIndex_subtitle({index:f+1}),description:b.chat_mentions_terminalOutput_description(),icon:"💻",uri:`devspace://terminal/${encodeURIComponent(h.id)}`,meta:{workspaceId:r.workspaceId}}))}catch(s){return _.debug("[TerminalProvider] Failed to get terminals:",s),[]}}}class de{constructor(){u(this,"id","script");u(this,"triggers",["@script","@scripts"])}async search(e,r){try{const{selectScriptEntries:s}=await y(async()=>{const{selectScriptEntries:o}=await import("./M-TVgx-R.js");return{selectScriptEntries:o}},__vite__mapDeps([43,12,13,2,14,15,4,8,1,16,6,3,44,45,22,7,9,46,47,23,0,5,10,21,48,26,49,50,20,51,52,53,54,19,24,25,55,29,28,56,57,58,59,33,60,61,31]),import.meta.url);if(!r.workspaceId)return[];const t=s.select(k.state,r.workspaceId);if(t.length===0)return[];const n=e?["script","scripts"].some(o=>o.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(o)):!1;return(e&&!n?t.filter(o=>g(e,o.name)!==null||g(e,M(o))!==null):t).slice(0,10).map(o=>{const l=o.runtime.status,p=x(l)?b.chat_mentions_scriptRunning_label():l==="exited"?b.chat_mentions_scriptExited_label():b.chat_mentions_scriptIdle_label();return{id:o.id,type:"script",label:o.name,subtitle:`${p} · ${M(o)}`,description:b.chat_mentions_scriptOutput_description(),icon:"▶️",uri:`devspace://script/${encodeURIComponent(o.id)}`,meta:{workspaceId:r.workspaceId,command:o.command,status:x(l)?"ok":l==="exited"?"warning":void 0}}})}catch(s){return _.debug("[ScriptProvider] Failed to get scripts:",s),[]}}}class pe{constructor(){u(this,"id","specialist");u(this,"triggers",["@specialist","@spec"])}async search(e,r){try{const s=j.select(k.state);return!s||s.length===0?[]:s.filter(t=>e?g(e,t.name)!==null||g(e,t.id)!==null||g(e,t.description)!==null||g(e,"specialist")!==null:!0).map(t=>({id:`specialist-${t.id}`,type:"specialist",label:t.name,subtitle:t.description,description:t.description,icon:"👤",uri:`devspace://specialist/${encodeURIComponent(t.id)}`,group:"Specialists",score:.8,meta:{promptToken:`specialist/${t.id}`}})).slice(0,10)}catch(s){return _.debug("[SpecialistProvider] Failed to get specialists:",s),[]}}}class he{constructor(){u(this,"id","agent");u(this,"triggers",["@agent"])}async search(e,r){try{const{selectAllWorkspaceAgents:s}=await y(async()=>{const{selectAllWorkspaceAgents:a}=await import("./BaujsV9k.js").then(o=>o.eb);return{selectAllWorkspaceAgents:a}},__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url),t=r.workspaceId;if(!t)return[];const i=s.select(k.state,t);if(i.length===0)return[];const n=[];for(const a of i){const o=a.id,l=a.name||o,p=a.metadata?.specialist||"";let m=a.metadata?.specialistName||"";if(p&&!m){const f=U.select(k.state,p);f&&(m=f.name)}if(e){const f=g(e,l)!==null,P=g(e,"agent")!==null,I=m&&g(e,m)!==null,S=p&&g(e,p)!==null;if(!f&&!P&&!I&&!S)continue}const w=a.isStreaming?"responding":a.status||"active",d=[];m?d.push(m):d.push("Agent"),d.push(w);const v=a.messages?.length||0;v>0&&d.push(`${v} msg${v!==1?"s":""}`);const h=a.lastActivity||a.lastModified;h&&!a.isStreaming&&d.push(z(new Date(h))),n.push({id:o,type:"agent",label:l,subtitle:d.join(" · "),description:m?b.chat_mentions_specialistAgentInWorkspace_description({specialist:m}):b.chat_mentions_agentInWorkspace_description(),icon:"🤖",uri:`devspace://agent/${encodeURIComponent(o)}`,group:b.chat_mentions_agents_group(),score:.7,meta:{workspaceId:t}})}return n.slice(0,10)}catch(s){return _.debug("[AgentProvider] Failed to get agents:",s),[]}}}class me{constructor(){u(this,"providers",new Map);u(this,"defaultProviders",[]);this.register(new Z),this.register(new ee),this.register(new ie),this.register(new ne),this.register(new oe),this.register(new ae),this.register(new ce),this.register(new le),this.register(new ue),this.register(new de),this.register(new he),this.register(new pe),this.register(new q),this.defaultProviders=["file","folder","note","terminal","script","agent","specialist","member"]}register(e){this.providers.set(e.id,e),_.debug("[ProviderRegistry] Registered provider:",e.id)}unregister(e){this.providers.delete(e)}get(e){return this.providers.get(e)}getAll(){return Array.from(this.providers.values())}getDefault(){return this.defaultProviders.map(e=>this.providers.get(e)).filter(Boolean)}getByTrigger(e){return Array.from(this.providers.values()).filter(r=>r.triggers?.includes(e))}async searchAll(e,r){const s=e.startsWith("@")?this.getByTrigger(e.split(" ")[0]):this.getDefault();return(await Promise.all(s.map(i=>i.search(e,r)))).flat()}}const Te=new me;export{Ie as D,Ce as M,Q as a,ke as i,Te as p,R as s};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CjTo2K46.js","/app/immutable/chunks/tr-2J8Mf.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/6-uYidyP.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/C6mS8uZB.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/C8y9EItt.js","/app/immutable/chunks/DXBEIeJu.js","/app/immutable/chunks/BX-0SVP7.js","/app/immutable/chunks/1WR8MecL.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/PIgqsYsQ.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/ChUo5Z7l.js","/app/immutable/chunks/BCo0L43p.js","/app/immutable/chunks/BmTMWrby.js","/app/immutable/chunks/FzlZUztb.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/B4SiDSWP.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/CGslv4Qq.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DKHY8q_S.js","/app/immutable/chunks/S845NCb3.js","/app/immutable/chunks/EK6zOAHM.js","/app/immutable/chunks/DCK8dPAL.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var F=Object.defineProperty;var $=(c,e,r)=>e in c?F(c,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):c[e]=r;var u=(c,e,r)=>$(c,typeof e!="symbol"?e+"":e,r);import{l as _}from"./ChTqQfQN.js";import{bm as b,_ as y}from"./C0QTy0Sy.js";import{Jv as k,CE as M}from"./tr-2J8Mf.js";import{h as O}from"./DCRuihKm.js";import{O as W}from"./DKHY8q_S.js";import{cO as L}from"./CzXkTVR8.js";import{v as x,b7 as U,be as j}from"./BCo0L43p.js";import{a as z}from"./ujhgjK1k.js";const D={USE_DEFAULT_CONTEXT:{id:"use-default-context",type:"command",get label(){return b.chat_mentions_useDefaultContext_label()},get description(){return b.chat_mentions_useDefaultContext_description()},icon:"🔄",uri:"devspace://command/use-default-context"},CLEAR_CONTEXT:{id:"clear-context",type:"command",get label(){return b.chat_mentions_clearContext_label()},get description(){return b.chat_mentions_clearContext_description()},icon:"🗑️",uri:"devspace://command/clear-context"}};function ke(c){return"items"in c||"subgroups"in c}function B(c){if(!c||typeof c!="object")return!1;const e=c;return!(typeof e.id!="string"||typeof e.label!="string"||typeof e.uri!="string"||typeof e.type!="string"||e.subtitle!==void 0&&typeof e.subtitle!="string"||e.description!==void 0&&typeof e.description!="string"||e.icon!==void 0&&typeof e.icon!="string"||e.score!==void 0&&typeof e.score!="number"||e.group!==void 0&&typeof e.group!="string")}function g(c,e){if(!c||!e)return null;const r=c.toLowerCase(),s=e.toLowerCase();let t=0;for(let a=0;a<s.length&&t<r.length;a++)s[a]===r[t]&&t++;if(t!==r.length)return null;const i=K(r,s);return i?{score:V(r,s,i),matches:i}:null}function K(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;for(let a=s;a<e.length;a++)if(e[a]===i){r.push(a),s=a+1,n=!0;break}if(!n)return null}return r}function V(c,e,r){let s=0;s+=1;let t=0;for(let l=1;l<r.length;l++)r[l]===r[l-1]+1&&(t+=.1);s+=t;let i=0;for(const l of r)(l===0||J(e,l))&&(i+=.15);s+=i,r[0]===0&&(s+=.2);const a=(r[r.length-1]-r[0])/e.length*.3;return s-=a,Math.min(s/2.5,1)}function J(c,e){if(e===0)return!0;const r=c[e],s=c[e-1];return r===r.toUpperCase()&&s===s.toLowerCase()||!/[a-z0-9]/i.test(s)}function G(c,e){if(!c||!e)return null;if(!c.includes("/"))return g(c,e);const r=c.split("/").filter(n=>n.length>0),s=e.split("/").filter(n=>n.length>0);if(r.length===0||s.length===0)return null;const t=H(r,s);return t?{score:X(r,s,t),matches:[]}:null}function H(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;const a=t===c.length-1;for(let o=s;o<e.length;o++){const l=e[o];if(g(i,l)){r.push(o),s=o+1,n=!0;break}if(a){const p=l.split(".")[0],m=l.includes(".")?l.split(".").pop():"";if(m&&g(i,m)){r.push(o),s=o+1,n=!0;break}if(p&&g(i,p)){r.push(o),s=o+1,n=!0;break}}}if(!n)return null}return r}function X(c,e,r){let s=0;s+=1,s+=r.length*.2;let t=0;for(let n=1;n<r.length;n++)r[n]===r[n-1]+1&&(t+=.15);s+=t,r.length>0&&r[r.length-1]===e.length-1&&(s+=.3);for(let n=0;n<c.length&&n<r.length;n++){const a=c[n],o=e[r[n]];a.toLowerCase()===o.toLowerCase()&&(s+=.2)}return Math.min(s/3,1)}function R(c,e,r){return JSON.stringify({query:c,workspaceId:r.workspaceId,repoPath:r.repoPath,currentFile:r.currentFile,currentNote:r.currentNote,providers:e.map(s=>[s.id,s.getCacheKey?.(r)])})}const N="*",Ce=["member","note","agent","file","folder","script","terminal",N,"specialist"];function Q(c,e){if(e.length===0)return[...c].sort((t,i)=>(i.score??0)-(t.score??0));const r=new Map(e.map((t,i)=>[t,i])),s=r.get(N)??e.length;return c.map(t=>({candidate:t,rank:r.get(t.type)??s})).sort((t,i)=>t.rank-i.rank||(i.candidate.score??0)-(t.candidate.score??0)).map(({candidate:t})=>t)}function Y(c,e){const r=new Map;return c.filter(s=>{const t=r.get(s.type)??0;return r.set(s.type,t+1),t<e})}class Ie{constructor(e={}){u(this,"searchDebounceTimer",null);u(this,"currentAbortController",null);u(this,"cache",new Map);u(this,"config");u(this,"isSearching",!1);this.config={debounceMs:e.debounceMs??100,maxResults:e.maxResults??50,cacheMaxAge:e.cacheMaxAge??3e4,enableSemantic:e.enableSemantic??!1,enableLivePreview:e.enableLivePreview??!0,enableCollaboration:e.enableCollaboration??!1,typeOrder:e.typeOrder??[],maxResultsPerKind:e.maxResultsPerKind??20}}async search(e,r,s){this.cancelPendingSearch();const t=R(e,r,s),i=this.cache.get(t);if(i&&!this.isCacheExpired(i))return _.debug("[SearchService] Returning cached results for:",e),i.results;const n=new AbortController;this.currentAbortController=n;const a=n.signal;return new Promise((o,l)=>{this.isSearching=!0;let p=!1;const m=()=>{a.removeEventListener("abort",v),this.currentAbortController===n&&(this.currentAbortController=null,this.searchDebounceTimer=null,this.isSearching=!1)},w=f=>{p||(p=!0,m(),o(f))},d=f=>{p||(p=!0,m(),l(f))},v=()=>d(new DOMException("Search cancelled","AbortError"));a.addEventListener("abort",v,{once:!0});const h=async()=>{try{if(a.aborted){d(new DOMException("Search cancelled","AbortError"));return}_.debug("[SearchService] Searching with providers:",r.map(C=>C.id));const f=R(e,r,s),P=await Promise.all(r.map(C=>this.searchWithProvider(C,e,s,a)));if(a.aborted)return;if(f!==R(e,r,s)){w([]);return}const S=this.combineResults(P.flat()).filter(C=>B(C)),E=this.applyFuzzyMatching(e,S),A=Q(E,this.config.typeOrder),T=this.config.typeOrder.length>0?Y(A,this.config.maxResultsPerKind):A.slice(0,this.config.maxResults);this.cache.set(f,{results:T,timestamp:Date.now()}),_.debug(`[SearchService] Found ${T.length} results`),w(T)}catch(f){a.aborted?d(new DOMException("Search cancelled","AbortError")):(_.error("[SearchService] Search error:",f),d(f instanceof Error?f:new Error(String(f))))}};e?this.searchDebounceTimer=setTimeout(h,this.config.debounceMs):h()})}async searchWithProvider(e,r,s,t){try{const i={...s,signal:t},n=await e.search(r,i),a=e.scoreRelevance?.bind(e);return a?n.map(o=>({...o,score:a(o,s)})):n}catch(i){return t.aborted||_.error(`[SearchService] Provider ${e.id} search failed:`,i),[]}}combineResults(e){const r=new Set,s=[];for(const t of e){const i=`${t.type}:${t.uri}`;r.has(i)||(r.add(i),s.push(t))}return s}applyFuzzyMatching(e,r){if(!e||e.length===0)return r;const t=r.map(i=>{let n=0;const a=i.meta?.path||i.meta?.fullPath||(i.subtitle?`${i.subtitle}/${i.label}`:i.label);if(a){const l=G(e,a);l&&(n=Math.max(n,l.score*1.8))}const o=g(e,i.label);if(o&&(n=Math.max(n,o.score*1.5)),i.subtitle){const l=g(e,i.subtitle);l&&(n=Math.max(n,l.score))}if(i.description){const l=g(e,i.description);l&&(n=Math.max(n,l.score*.5))}return{...i,score:n>0?n:i.score??0}}).filter(i=>i.score>0);return t.length>0?t:r}cancelPendingSearch(){this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=null),this.currentAbortController&&(this.currentAbortController.abort(),this.currentAbortController=null)}isCacheExpired(e){return Date.now()-e.timestamp>this.config.cacheMaxAge}clearCache(){this.cache.clear()}isLoading(){return this.isSearching}destroy(){this.cancelPendingSearch(),this.clearCache()}}class Z{constructor(){u(this,"id","file");u(this,"triggers",["@file","@f"]);u(this,"default",!0);u(this,"supportsRanges",!0);u(this,"supportsLivePreview",!0);u(this,"recentFiles",new Set);u(this,"fileIconMap",{ts:"📘",tsx:"⚛️",js:"📜",jsx:"⚛️",svelte:"🔥",vue:"💚",py:"🐍",rs:"🦀",go:"🐹",java:"☕",cpp:"⚙️",c:"⚙️",h:"📎",md:"📝",json:"📋",yaml:"📋",yml:"📋",toml:"📋",xml:"📋",html:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sql:"🗃️",sh:"🖥️",bash:"🖥️",zsh:"🖥️",fish:"🖥️",dockerfile:"🐳",docker:"🐳",gitignore:"🚫",env:"🔐",lock:"🔒",test:"🧪",spec:"🧪"})}async search(e,r){_.debug("[FileProvider] Searching for:",{query:e,context:{workspaceId:r.workspaceId}});const s=r.workspaceId;if(!s)return[];try{const t=await O("search.fileNames",{workspaceId:s,pattern:e||"",limit:10}),n=(Array.isArray(t?.files)?t.files:[]).map(a=>{const o=a.split("/").pop()||a,l=o.split(".").pop()||"";return{id:`file-${a}`,label:o,type:"file",uri:`file:${a}`,description:a,subtitle:a,score:.5,meta:{path:a,fullPath:a,relativePath:a,extension:l,language:this.getLanguageFromExtension(l)}}});return this.deduplicateAndDistinguish(n)}catch(t){return _.error("[FileProvider] Search failed:",t),[]}}async searchRecent(e,r){if(!r.recentFiles||r.recentFiles.length===0)return[];const s=await Promise.all(r.recentFiles.filter(t=>e?g(e,t)!==null:!0).slice(0,3).map(t=>{const i=t.split("/").pop()||t,n=i.split(".").pop()||"";return this.fileToCandidate({path:t,name:i,extension:n})}));return s.forEach(t=>{this.recentFiles.add(t.uri)}),s}async searchContextual(e,r){return r.currentFile?[]:[]}async fileToCandidate(e){const r=this.getFileIcon(e.extension),s=e.path,t=this.formatPath(s);return{id:`file-${e.path}`,type:"file",label:e.name,subtitle:t,description:s,icon:r,uri:`devspace://file/${encodeURIComponent(e.path)}`,meta:{path:s,fullPath:e.path,lastModified:e.lastModified,size:e.size,language:e.language||this.getLanguageFromExtension(e.extension)}}}combineResults(...e){const r=new Set,s=[];for(const t of e)for(const i of t)r.has(i.uri)||(r.add(i.uri),s.push(i));return this.deduplicateAndDistinguish(s)}deduplicateAndDistinguish(e){const r=new Map;for(const t of e){const i=t.label;let n=r.get(i);n||(n=[],r.set(i,n)),n.push(t)}const s=[];for(const[t,i]of r.entries())if(i.length===1)s.push(i[0]);else{const n=this.distinguishDuplicates(i);s.push(...n)}return s}distinguishDuplicates(e){const r=e.map(t=>t.description||t.meta?.path||"");return e.map((t,i)=>{const n=r[i],a=r.filter((p,m)=>m!==i),o=n.split("/");let l="";for(let p=o.length;p>0;p--){const m=o.slice(-p).join("/");if(!a.some(d=>d.split("/").slice(-p).join("/")===m)||p===1){l=m;break}}return{...t,subtitle:l}})}groupResults(e){const r={recent:[],relevant:[],other:[]};for(const t of e)this.recentFiles.has(t.uri)?r.recent.push(t):(t.score??0)>.7?r.relevant.push(t):r.other.push(t);const s=[];return r.recent.length>0&&s.push(...r.recent.slice(0,3).map(t=>({...t,group:b.chat_mentions_recentFiles_group()}))),r.relevant.length>0&&s.push(...r.relevant.slice(0,5).map(t=>({...t,group:b.chat_mentions_mostRelevant_group()}))),r.other.length>0&&s.push(...r.other.slice(0,10).map(t=>({...t,group:b.chat_mentions_otherFiles_group()}))),s}scoreRelevance(e,r){let s=.5;if(this.recentFiles.has(e.uri)&&(s+=.2),r.currentFile&&e.meta?.path){const t=r.currentFile.substring(0,r.currentFile.lastIndexOf("/")),i=e.meta.path.substring(0,e.meta.path.lastIndexOf("/"));t===i&&(s+=.15)}return r.imports?.includes(e.meta?.path||"")&&(s+=.25),r.currentFile?.includes(".test.")&&e.meta?.path?.includes(".test.")&&(s+=.1),Math.min(s,1)}getGroups(){return[{id:"files-recent",label:b.chat_mentions_recentFiles_group(),icon:"🕐"},{id:"files-all",label:b.chat_mentions_allFiles_group(),icon:"📁"},{id:"files-tests",label:b.chat_mentions_testFiles_group(),icon:"🧪"}]}getFileIcon(e){return this.fileIconMap[e.toLowerCase()]||"📄"}formatPath(e){if(e.length>40){const r=e.split("/");if(r.length>2)return`.../${r.slice(-2).join("/")}`}return e}getLanguageFromExtension(e){return{ts:"typescript",tsx:"typescriptreact",js:"javascript",jsx:"javascriptreact",py:"python",rs:"rust",go:"go",java:"java",cpp:"cpp",c:"c",svelte:"svelte",vue:"vue",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"shellscript"}[e.toLowerCase()]||"plaintext"}}class q{constructor(){u(this,"id","member")}getCacheKey(e){const r=k.state;return JSON.stringify({backendId:W.select(r),ownPrincipalId:r.presence.ownPrincipalId,members:e.workspaceId?L.select(r,e.workspaceId):[]})}async search(e,r){const{workspaceId:s}=r;if(!s)return[];const t=e.replace(/^@/,"").toLowerCase();return L.select(k.state,s).filter(i=>i.login.toLowerCase().includes(t)).map(i=>({id:`member-${i.principalId}`,type:"member",label:i.login,subtitle:i.identity?`${i.identity.provider==="github"?"GitHub":"GitLab"} · ${i.identity.host}`:void 0,description:i.displayName??void 0,icon:"👤",uri:`devspace://member/${encodeURIComponent(i.principalId)}?workspaceId=${encodeURIComponent(s)}`,score:.8,meta:{workspaceId:s,principalId:i.principalId,identity:i.identity,avatarUrl:i.avatarUrl??void 0}}))}}class ee{constructor(){u(this,"id","folder");u(this,"triggers",["@folder","@dir"])}async search(e,r){const s=r.workspaceId;if(!s)return[];try{const{backendRequest:t}=await y(async()=>{const{backendRequest:o}=await import("./DCRuihKm.js").then(l=>l.j);return{backendRequest:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),i=await t("search.fileNames",{workspaceId:s,pattern:e||"",limit:200}),n=Array.isArray(i?.files)?i.files:[],a=new Set;for(const o of n){const l=o.split("/");for(let p=1;p<l.length;p++)a.add(l.slice(0,p).join("/"))}return[...a].filter(o=>e?g(e,o.split("/").pop()||o)!==null:!0).slice(0,10).map(o=>({id:`folder-${o}`,type:"folder",label:o.split("/").pop()||o,description:o,icon:"📁",uri:`devspace://folder/${encodeURIComponent(o)}`,meta:{path:o,fullPath:o,relativePath:o}}))}catch(t){return _.debug("[FolderProvider] Failed to get folders:",t),[]}}}const te=10,re=.3;function se(c){const e=c.toLowerCase().split(/\s+/).filter(Boolean);return(r,s)=>{const t=r?g(c,r):null;if(t)return 1+t.score;if(s){const i=s.toLowerCase();if(e.every(n=>i.includes(n)))return re}return 0}}class ie{constructor(){u(this,"id","note");u(this,"triggers",["@note","@n"]);u(this,"supportsRanges",!0);u(this,"cachedNotes",[]);u(this,"lastCacheUpdate",0);u(this,"cacheTimeout",5e3)}async getSiblingWorkspaces(e){if(!e)return[];try{const[{store:r},{selectWorkspaceItems:s}]=await Promise.all([y(()=>import("./CjTo2K46.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./BaujsV9k.js").then(n=>n.ee),__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url)]),t=s.select(r.state),i=t.find(n=>n.id===e);return!i||!i.repositoryPath?[]:t.filter(n=>n.id!==e&&n.repositoryPath===i.repositoryPath)}catch(r){return _.debug("[NoteProvider] Failed to get sibling workspaces:",r),[]}}async fetchNotesFromWorkspace(e,r){try{const[{store:s},{listSlimNotesRequested:t}]=await Promise.all([y(()=>import("./CjTo2K46.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./tr-2J8Mf.js").then(n=>n.MD),__vite__mapDeps([12,13,2,14,15,4,8,1,16,6,3]),import.meta.url)]);return(await s.dispatch(t(e))).map(n=>({note:n,workspaceId:e,workspaceTitle:r}))}catch(s){_.debug(`[NoteProvider] Failed to fetch notes from workspace ${e}:`,s)}return[]}async search(e,r){if(!r.workspaceId)return[];const s=e.trim(),t=s?se(s):null;try{const i=await this.fetchNotesFromWorkspace(r.workspaceId),a=(await this.getSiblingWorkspaces(r.workspaceId)).map(d=>this.fetchNotesFromWorkspace(d.id,d.title)),l=(await Promise.all(a)).flat(),p=[...i,...l],w=(t?p.map(d=>({entry:d,score:t(d.note.title,d.note.content||d.note.contentPreview)})).filter(({score:d})=>d>0).sort((d,v)=>v.score-d.score):p.map(d=>({entry:d,score:void 0}))).slice(0,te).map(({entry:{note:d,workspaceId:v,workspaceTitle:h},score:f})=>{const P=v===r.workspaceId,I=P?void 0:b.chat_mentions_fromWorkspace_subtitle({workspace:h||v}),S=d.content||d.contentPreview;return{candidate:{id:d.id,type:"note",label:d.title||d.id||b.chat_mentions_untitledNote_label(),subtitle:I,description:S?`${S.substring(0,100)}...`:"",icon:"📝",uri:`devspace://note/${d.id}`,meta:{preview:S?.substring(0,200)||"",workspaceId:v,...P?{}:{isExternalLink:!0}}},score:f}});if(this.cachedNotes=w.map(({candidate:d})=>d),this.lastCacheUpdate=Date.now(),w.length>0)return w.map(({candidate:d,score:v})=>v!==void 0?{...d,score:v}:d)}catch(i){_.debug("[NoteProvider] Failed to fetch notes:",i)}return this.cachedNotes.length>0?t?this.cachedNotes.map(i=>({...i,score:t(i.label,i.meta?.preview)})).filter(i=>i.score>0).sort((i,n)=>n.score-i.score):this.cachedNotes:[]}getCachedNotes(){return Date.now()-this.lastCacheUpdate>this.cacheTimeout?[]:this.cachedNotes}}class ne{constructor(){u(this,"id","external");u(this,"triggers",["@docs","@external"])}async search(e,r){return[{id:"react-docs",label:"React Documentation",url:"https://react.dev",description:"Official React documentation"},{id:"mdn",label:"MDN Web Docs",url:"https://developer.mozilla.org",description:"Web technology documentation"},{id:"typescript",label:"TypeScript Handbook",url:"https://www.typescriptlang.org/docs/",description:"TypeScript documentation"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`external-${t.id}`,type:"external-source",label:t.label,description:t.description,icon:"📚",uri:`devspace://external/${t.id}`,meta:{url:t.url}}))}}class oe{constructor(){u(this,"id","rule");u(this,"triggers",["@rule","@intent"])}async search(e,r){return[{path:".intent/rules/cli.md",label:"CLI Rules"},{path:".intent/rules/frontend.md",label:"Frontend Rules"},{path:".intent/rules/python.md",label:"Python Rules"},{path:".intent/rules/sidecar.md",label:"Sidecar Rules"},{path:".intent/rules/systems.md",label:"Systems Rules"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:t.path,type:"rule",label:t.label,subtitle:t.path,icon:"📚",uri:`devspace://rule/${encodeURIComponent(t.path)}`,meta:{path:t.path}}))}}class ae{constructor(){u(this,"id","task");u(this,"triggers",["@task","@todo"])}async search(e,r){return[{id:"task-1",label:"Implement authentication",status:"in_progress",assignee:"John Doe"},{id:"task-2",label:"Write tests",status:"not_started",assignee:"Jane Smith"},{id:"task-3",label:"Deploy to production",status:"completed",assignee:"Bob Johnson"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`task-${t.id}`,type:"task",label:t.label,subtitle:`${t.status} • ${t.assignee}`,icon:"📋",uri:`devspace://task/${t.id}`,meta:{taskStatus:t.status,assignee:t.assignee}}))}}class ce{constructor(){u(this,"id","personality");u(this,"triggers",["@personality","@persona"]);u(this,"personalities",[{id:"auggie-personality-agent-default",name:"Agent Auggie",description:"Default helpful AI assistant",icon:"🤖",temperature:.7,model:"default",promptToken:"auggie-personality-agent-default"},{id:"auggie-personality-prototyper",name:"Prototyper Auggie",description:"Specialized in rapid prototyping",icon:"⚡",temperature:.7,model:"default",promptToken:"auggie-personality-prototyper"},{id:"auggie-personality-brainstorm",name:"Brainstorm Auggie",description:"Creative ideation and exploration",icon:"💡",temperature:.7,model:"default",promptToken:"auggie-personality-brainstorm"},{id:"auggie-personality-reviewer",name:"Reviewer Auggie",description:"Code review and feedback",icon:"🔍",temperature:.7,model:"default",promptToken:"auggie-personality-reviewer"}])}async search(e,r){return this.personalities.filter(s=>!e||g(e,s.name)!==null).map(s=>({id:s.id,type:"personality",label:s.name,subtitle:`${s.model}`,description:s.description,icon:s.icon,uri:`devspace://personality/${s.id}`,meta:{promptToken:s.promptToken}}))}}class le{constructor(){u(this,"id","command");u(this,"triggers",["@cmd","@command"])}async search(e,r){return[D.USE_DEFAULT_CONTEXT,D.CLEAR_CONTEXT].filter(t=>!e||t.label.toLowerCase().includes(e.toLowerCase()))}}class ue{constructor(){u(this,"id","terminal");u(this,"triggers",["@terminal","@term"])}async search(e,r){try{const{terminalManager:s}=await y(async()=>{const{terminalManager:h}=await import("./6-uYidyP.js").then(f=>f.b);return{terminalManager:h}},__vite__mapDeps([27,2,1,28,29,3,4,30,31,12,13,14,15,8,16,6,0,5,7,9,10,32,24,33,34,35,36,37,38,39,40,25,41,42]),import.meta.url),{selectTerminals:t,selectTerminalDisplayName:i}=await y(async()=>{const{selectTerminals:h,selectTerminalDisplayName:f}=await import("./PIgqsYsQ.js").then(P=>P.i);return{selectTerminals:h,selectTerminalDisplayName:f}},__vite__mapDeps([41,12,13,2,14,15,4,8,1,16,6,3]),import.meta.url),a=k.state;if(!r.workspaceId)return[];const o=t.select(a,r.workspaceId),l=s.loadTerminalMetadata(r.workspaceId),p=new Set,m=[];for(const h of o)p.add(h.id),m.push({id:h.id,name:i.select(a,r.workspaceId,h.id)});for(const h of l)p.has(h.terminalId)||(p.add(h.terminalId),m.push({id:h.terminalId,name:h.title||b.terminal_quakeOverlay_terminal_fallback()}));if(m.length===0)return[];const d=e?["terminal","term"].some(h=>h.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(h)):!1;return(e&&!d?m.filter(h=>g(e,h.name)!==null):m).slice(0,10).map((h,f)=>({id:h.id,type:"terminal",label:h.name,subtitle:b.chat_mentions_terminalIndex_subtitle({index:f+1}),description:b.chat_mentions_terminalOutput_description(),icon:"💻",uri:`devspace://terminal/${encodeURIComponent(h.id)}`,meta:{workspaceId:r.workspaceId}}))}catch(s){return _.debug("[TerminalProvider] Failed to get terminals:",s),[]}}}class de{constructor(){u(this,"id","script");u(this,"triggers",["@script","@scripts"])}async search(e,r){try{const{selectScriptEntries:s}=await y(async()=>{const{selectScriptEntries:o}=await import("./ChUo5Z7l.js");return{selectScriptEntries:o}},__vite__mapDeps([43,12,13,2,14,15,4,8,1,16,6,3,44,45,22,7,9,46,47,23,0,5,10,21,48,26,49,50,20,51,52,53,54,19,24,25,55,29,28,56,57,58,59,33,60,61,31]),import.meta.url);if(!r.workspaceId)return[];const t=s.select(k.state,r.workspaceId);if(t.length===0)return[];const n=e?["script","scripts"].some(o=>o.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(o)):!1;return(e&&!n?t.filter(o=>g(e,o.name)!==null||g(e,M(o))!==null):t).slice(0,10).map(o=>{const l=o.runtime.status,p=x(l)?b.chat_mentions_scriptRunning_label():l==="exited"?b.chat_mentions_scriptExited_label():b.chat_mentions_scriptIdle_label();return{id:o.id,type:"script",label:o.name,subtitle:`${p} · ${M(o)}`,description:b.chat_mentions_scriptOutput_description(),icon:"▶️",uri:`devspace://script/${encodeURIComponent(o.id)}`,meta:{workspaceId:r.workspaceId,command:o.command,status:x(l)?"ok":l==="exited"?"warning":void 0}}})}catch(s){return _.debug("[ScriptProvider] Failed to get scripts:",s),[]}}}class pe{constructor(){u(this,"id","specialist");u(this,"triggers",["@specialist","@spec"])}async search(e,r){try{const s=j.select(k.state);return!s||s.length===0?[]:s.filter(t=>e?g(e,t.name)!==null||g(e,t.id)!==null||g(e,t.description)!==null||g(e,"specialist")!==null:!0).map(t=>({id:`specialist-${t.id}`,type:"specialist",label:t.name,subtitle:t.description,description:t.description,icon:"👤",uri:`devspace://specialist/${encodeURIComponent(t.id)}`,group:"Specialists",score:.8,meta:{promptToken:`specialist/${t.id}`}})).slice(0,10)}catch(s){return _.debug("[SpecialistProvider] Failed to get specialists:",s),[]}}}class he{constructor(){u(this,"id","agent");u(this,"triggers",["@agent"])}async search(e,r){try{const{selectAllWorkspaceAgents:s}=await y(async()=>{const{selectAllWorkspaceAgents:a}=await import("./BaujsV9k.js").then(o=>o.eb);return{selectAllWorkspaceAgents:a}},__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url),t=r.workspaceId;if(!t)return[];const i=s.select(k.state,t);if(i.length===0)return[];const n=[];for(const a of i){const o=a.id,l=a.name||o,p=a.metadata?.specialist||"";let m=a.metadata?.specialistName||"";if(p&&!m){const f=U.select(k.state,p);f&&(m=f.name)}if(e){const f=g(e,l)!==null,P=g(e,"agent")!==null,I=m&&g(e,m)!==null,S=p&&g(e,p)!==null;if(!f&&!P&&!I&&!S)continue}const w=a.isStreaming?"responding":a.status||"active",d=[];m?d.push(m):d.push("Agent"),d.push(w);const v=a.messages?.length||0;v>0&&d.push(`${v} msg${v!==1?"s":""}`);const h=a.lastActivity||a.lastModified;h&&!a.isStreaming&&d.push(z(new Date(h))),n.push({id:o,type:"agent",label:l,subtitle:d.join(" · "),description:m?b.chat_mentions_specialistAgentInWorkspace_description({specialist:m}):b.chat_mentions_agentInWorkspace_description(),icon:"🤖",uri:`devspace://agent/${encodeURIComponent(o)}`,group:b.chat_mentions_agents_group(),score:.7,meta:{workspaceId:t}})}return n.slice(0,10)}catch(s){return _.debug("[AgentProvider] Failed to get agents:",s),[]}}}class me{constructor(){u(this,"providers",new Map);u(this,"defaultProviders",[]);this.register(new Z),this.register(new ee),this.register(new ie),this.register(new ne),this.register(new oe),this.register(new ae),this.register(new ce),this.register(new le),this.register(new ue),this.register(new de),this.register(new he),this.register(new pe),this.register(new q),this.defaultProviders=["file","folder","note","terminal","script","agent","specialist","member"]}register(e){this.providers.set(e.id,e),_.debug("[ProviderRegistry] Registered provider:",e.id)}unregister(e){this.providers.delete(e)}get(e){return this.providers.get(e)}getAll(){return Array.from(this.providers.values())}getDefault(){return this.defaultProviders.map(e=>this.providers.get(e)).filter(Boolean)}getByTrigger(e){return Array.from(this.providers.values()).filter(r=>r.triggers?.includes(e))}async searchAll(e,r){const s=e.startsWith("@")?this.getByTrigger(e.split(" ")[0]):this.getDefault();return(await Promise.all(s.map(i=>i.search(e,r)))).flat()}}const Te=new me;export{Ie as D,Ce as M,Q as a,ke as i,Te as p,R as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as W}from"./
|
|
1
|
+
import{I as W}from"./DVnAuhkJ.js";import{p as X}from"./BD1NjrB7.js";import{b0 as z,a_ as G,aZ as Y,Y as P,U as F,V as Z,b as g,q as N,ay as A,aX as q,B as U,W as E,r as j,aV as J,a0 as K,O as Q,aO as ee}from"./eBfEHUcb.js";import{p as te}from"./BFeEPayU.js";var L=/[─━│┃└┗├┣]/,D=/[└┗├┣]/,ne=/[─━]/,V=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,$=/^\s*%%/,re=" ";function _(n){return n.some(t=>L.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=D.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(`
|
|
2
2
|
`),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p<t.length;p++){const c=t[p];c.trim()===""||$.test(c)||T.test(c)||V.test(c)||s.push(c.replace(/\t/g," "))}if(!_(s))return{text:n,lineMap:e};const i=M(s),o=[];let a=0;for(let p=0;p<=r;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=r+1;p<t.length;p++){const c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if($.test(c)){o.push(c),a++,e.set(a,h);continue}if(T.test(c)){o.push(c),a++,e.set(a,h);continue}if(V.test(c))continue;const l=c.replace(/\t/g," "),w=D.exec(l);if(w?.index!==void 0){const f=w.index,m=Math.round(f/i)+1;let u=f+1;for(;u<l.length&&ne.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;const v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node — expected a filename or directory name after the box-drawing prefix`);const O=re.repeat(m);o.push(O+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(L.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
|
|
3
3
|
`),lineMap:e}}g(R,"preprocessBoxDrawing");var x=new W(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),j()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:Z,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:z},I=de,he=g(n=>{X(n,I);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;I.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=S(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function C(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(C,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return C(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return C(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),k=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;k(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;k(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram
|
|
4
4
|
`+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=q(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),U(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ce=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ie,n);return`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Jv as l,s0 as u,J8 as v}from"./tr-2J8Mf.js";import{at as b}from"./DKHY8q_S.js";import{bJ as m}from"./BaujsV9k.js";import{be as S,ba as P}from"./
|
|
1
|
+
import{Jv as l,s0 as u,J8 as v}from"./tr-2J8Mf.js";import{at as b}from"./DKHY8q_S.js";import{bJ as m}from"./BaujsV9k.js";import{be as S,ba as P}from"./BCo0L43p.js";import{K as M}from"./DCK8dPAL.js";import{bm as s}from"./C0QTy0Sy.js";import{l as E}from"./CE7dsja4.js";const D=l.createSelector(t=>t.backgroundAgentSettings.defaultModel),O=l.createSelector(t=>t.backgroundAgentSettings.typeOverrides),j=l.createSelector(t=>t.backgroundAgentSettings.defaultReasoningEffort),H=l.createSelector(t=>t.backgroundAgentSettings.typeReasoningEffortOverrides),w=l.createSelector(t=>t.backgroundAgentSettings),A=l.createSelector(t=>{const a=new Map,o=(e,i)=>{const n=a.get(e)??new Set;n.add(i),a.set(e,n)},f=m.select(t),d=M.select(t),g=b.select(t)[d];g&&d&&o(d,s.settings_providers_inUseDefaultModel_label({model:g})),u(d)&&!g&&o(d,s.settings_providers_inUseDefaultProvider_label());const p=t.backgroundAgentSettings?.providerId;p&&u(p)&&o(p,s.settings_providers_inUseQuickActions_label());for(const e of S.select(t)){const i=P.select(t,e.id),n=e.source?{project:s.settings_providers_pinSourceProject_label(),user:s.settings_providers_pinSourceUser_label(),bundled:s.settings_providers_pinSourceBundled_label(),builtin:s.settings_providers_pinSourceBuiltin_label(),"electron-store":s.settings_providers_pinSourceLegacy_label()}[e.source]:void 0,c=r=>n&&i?s.settings_providers_inUseSourcePath_label({reason:r,source:n,path:i}):n?s.settings_providers_inUseSource_label({reason:r,source:n}):i?s.settings_providers_inUsePath_label({reason:r,path:i}):r;if(e.codingAgent&&o(e.codingAgent,c(s.settings_providers_inUseSpecialistAgent_label({name:e.name}))),e.modelOptions?.forEach((r,_)=>{r.provider&&u(r.provider)&&o(r.provider,c(s.settings_providers_inUseSpecialistModelOption_label({name:e.name,position:E(_+1)})))}),e.defaultModel)if(e.defaultModel.includes(":")){const r=v(e.defaultModel).providerId??f;o(r,c(s.settings_providers_inUseSpecialistModel_label({name:e.name,model:e.defaultModel})))}else e.codingAgent||o(f,c(s.settings_providers_inUseSpecialistModel_label({name:e.name,model:e.defaultModel})))}return Object.fromEntries([...a].map(([e,i])=>[e,[...i].join(`
|
|
2
2
|
`)]))});l.createSelector((t,a)=>A.select(t)[a]??null);const h=[{id:"dracula",label:"Dracula"},{id:"nord",label:"Nord"},{id:"rose-pine",label:"Rosé Pine"},{id:"tokyo-night",label:"Tokyo Night"},{id:"solarized",label:"Solarized"},{id:"github",label:"GitHub"},{id:"high-contrast",label:"High Contrast"}],J=h.map(({id:t})=>t);export{J as T,h as a,j as b,w as c,O as d,H as e,A as f,D as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ut}from"./B6qvxAO7.js";import{s as Kt}from"./BxVnbYG1.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./Ckb6le-m.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
|
|
1
|
+
import{g as Ut}from"./CKOijLzA.js";import{s as Kt}from"./DUxx6wT8.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./eBfEHUcb.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:mt,expected:ut})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(T[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(T[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,mt=m.yylloc;break;case 2:if(R=this.productions_[T[1]][1],U.$=_[_.length-R],U._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(U,[e,Dt,lt,Y.yy,T[1],_,t].concat(Yt)),typeof Et<"u")return Et;R&&(d=d.slice(0,-1*R*2),_=_.slice(0,-1*R),t=t.slice(0,-1*R)),d.push(this.productions_[T[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(l,d){if(this.yy.parser)this.yy.parser.parseError(l,d);else throw new Error(l)},"parseError"),setInput:f(function(n,l){return this.yy=l||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var l=n.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:f(function(n){var l=n.length,d=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(n){this.unput(this.match.slice(n))},"less"),pastInput:f(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var n=this.pastInput(),l=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as Ke,bo as k,bm as Ce,bw as Ve,b as Je,q as ur,n as vr,r as gr,o as fr,p as hr,s as mr,bs as ht,bq as pr,f as _r,l as xr,g as br,e as wr,d as kr,m as yr,j as $r,i as Sr,h as Cr,k as Nr}from"./C0QTy0Sy.js";import{bs as Ue,ca as Xe,aD as e,ay as be,a5 as o,bH as L,bS as n,a7 as Pt,W as i,be as st,b$ as et,b_ as M,bO as C,bA as s,bl as O,bn as qe,bV as we,aA as y,c9 as _,aB as x,br as mt}from"./3SdAC2_C.js";import{nZ as Rr,Jv as ct,n4 as Tt,em as Mr,eJ as Pr,eK as Lr}from"./tr-2J8Mf.js";import{i as H}from"./bhKPSdq4.js";import{n as We,j as Oe,h as at}from"./DLwWVKiF.js";import{dH as Ir,bt as Ar}from"./BaujsV9k.js";import{a9 as jt}from"./
|
|
1
|
+
import{t as Ke,bo as k,bm as Ce,bw as Ve,b as Je,q as ur,n as vr,r as gr,o as fr,p as hr,s as mr,bs as ht,bq as pr,f as _r,l as xr,g as br,e as wr,d as kr,m as yr,j as $r,i as Sr,h as Cr,k as Nr}from"./C0QTy0Sy.js";import{bs as Ue,ca as Xe,aD as e,ay as be,a5 as o,bH as L,bS as n,a7 as Pt,W as i,be as st,b$ as et,b_ as M,bO as C,bA as s,bl as O,bn as qe,bV as we,aA as y,c9 as _,aB as x,br as mt}from"./3SdAC2_C.js";import{nZ as Rr,Jv as ct,n4 as Tt,em as Mr,eJ as Pr,eK as Lr}from"./tr-2J8Mf.js";import{i as H}from"./bhKPSdq4.js";import{n as We,j as Oe,h as at}from"./DLwWVKiF.js";import{dH as Ir,bt as Ar}from"./BaujsV9k.js";import{a9 as jt}from"./Dkwg3iDV.js";import{I as it,g as Ge,i as Lt}from"./B6S6VNu7.js";import{f as xe}from"./FzlZUztb.js";import"./DCRuihKm.js";import{f as He,s as Er}from"./7UPrdiE9.js";import"./CrD0jtXE.js";import{F as fe,a2 as Hr,cR as zr,aw as ot,ax as pt,c2 as Wr,aV as Dr,bN as Tr,bH as jr,b9 as Fr,cW as Br,cn as Gr,b6 as St,c$ as Rt,cr as _t,bo as Or,cF as Kr,au as Vr}from"./U9jJmfYa.js";import{i as Jr}from"./Ax0sJJJl.js";import{h as Ft}from"./BKD7o1lQ.js";import{H as Bt}from"./CcNhqKh5.js";import{I as Jt}from"./BAKPnd3w.js";import"./A9niI_uA.js";import{q as Ur}from"./CE7dsja4.js";import{M as Mt}from"./BvWOwOTx.js";import{B as qr}from"./B8-Q1tED.js";import{S as Ct}from"./fiz8N_zQ.js";const Qr=[/^diff --git /,/^index\s/,/^---\s/,/^\+\+\+\s/,/^\/];function Yr($){const r=[];if(!$)return r;const d=$.split(`
|
|
2
2
|
`);let m=null,b=0,u=0;const T=P=>{const h=P.match(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),U=h?parseInt(h[1],10):0,K=h&&h[2]?parseInt(h[2],10):null,pe=h?parseInt(h[3],10):0,q=h&&h[4]?parseInt(h[4],10):null;m={header:P,oldStart:U,oldLines:K,newStart:pe,newLines:q,lines:[]},r.push(m),b=U,u=pe};for(const P of d){if(P.startsWith("@@")){T(P);continue}if(!m)continue;const h=m;P.startsWith("+")?h.lines.push({type:"addition",content:P.slice(1),oldNum:null,newNum:u++,raw:P}):P.startsWith("-")?h.lines.push({type:"deletion",content:P.slice(1),oldNum:b++,newNum:null,raw:P}):P.startsWith(" ")?h.lines.push({type:"context",content:P.slice(1),oldNum:b++,newNum:u++,raw:P}):Qr.some(U=>U.test(P))||P.trim()===""&&h.lines.push({type:"context",content:"",oldNum:b++,newNum:u++,raw:P})}return r}var Zr=x('<div><!> <!> <!></div> <p class="text-ui text-subtle mt-1"> </p>',1);function Ut($,r){if(new.target)return Ke({component:Ut,...$});Ue(r,!0);let d=k(r,"lineNumber",7,0),m=k(r,"fileName",7,""),b=k(r,"onSend",7),u=k(r,"onClose",7),T=k(r,"isSending",7,!1),P=k(r,"class",7,""),h=we(""),U=we(null);Xe(()=>{e(U)&&e(U).focus()});function K(){!e(h).trim()||T()||(b()?.(e(h).trim(),d(),m()),L(h,""))}function pe(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),K()),I.key==="Escape"&&u()?.()}var q={get lineNumber(){return d()},set lineNumber(I=0){d(I),y()},get fileName(){return m()},set fileName(I=""){m(I),y()},get onSend(){return b()},set onSend(I){b(I),y()},get onClose(){return u()},set onClose(I){u(I),y()},get isSending(){return T()},set isSending(I=!1){T(I),y()},get class(){return P()},set class(I=""){P(I),y()},$set:Ve,$on:(I,he)=>Je(r,I,he)},w=Zr(),z=be(w),de=o(z);{let I=_(()=>Ce.codeReview_inlineComment_askLine_placeholder());Jt(de,{onkeydown:pe,get placeholder(){return e(I)},get disabled(){return T()},class:"flex-1 h-8 rounded-md border border-border bg-background px-3 text-sm placeholder:text-muted-foreground disabled:opacity-50",get ref(){return e(U)},set ref(he){L(U,he,!0)},get value(){return e(h)},set value(he){L(h,he,!0)}})}var ce=n(de,2);{let I=_(()=>!e(h).trim()||T());xe(ce,{type:"button",variant:"primary",onclick:K,get disabled(){return e(I)},class:"h-8 w-8 p-0",children:(he,Ne)=>{var _e=Pt(),S=be(_e);{var E=me=>{it(me,{size:14})},Ie=me=>{fe(me,{get icon(){return Hr},class:"h-3.5 w-3.5"})};H(S,me=>{T()?me(E):me(Ie,-1)})}i(he,_e)},$$slots:{default:!0}})}var ae=n(ce,2);xe(ae,{type:"button",variant:"ghost",onclick:()=>u()?.(),class:"h-8 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:(I,he)=>{st();var Ne=et();M(_e=>C(Ne,_e),[()=>Ce.codeReview_inlineComment_cancel_label()]),i(I,Ne)},$$slots:{default:!0}}),s(z);var te=n(z,2),ke=O(te,!0);return M(I=>{He(z,1,`walkthrough-inline-comment flex items-center gap-2 ${P()??""}`),C(ke,I)},[()=>Ce.codeReview_inlineComment_inputHint_label()]),i($,w),qe(q)}var Xr=x('<div class="text-xs text-slate-400 dark:text-slate-500 mt-1"> </div>'),en=x('<span class="font-medium"> </span> <!>',1),tn=x('<div class="flex items-start gap-3 py-2"><div><!></div> <div class="flex-1 min-w-0"><div class="text-sm leading-relaxed text-slate-700 dark:text-slate-300"><!></div></div></div>'),rn=x('<div class="px-4 pb-3 divide-y divide-border"></div>'),nn=x('<div class="border-t border-border"><!> <!></div>'),an=x('<div class="flex items-center gap-2 px-4 py-2 text-xs text-slate-500 dark:text-slate-400 border-t border-border"><!> <span> </span></div>'),sn=x('<div class="flex items-center gap-2"><!> <!> <!></div> <p class="text-ui text-slate-400 dark:text-slate-500 mt-1"> </p>',1),on=x("<!> <span> </span>",1),ln=x('<div><div class="flex items-start gap-3 px-4 py-3"><div class="shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><div class="text-sm text-slate-800 dark:text-slate-200 leading-relaxed"><!></div> <!></div> <!></div> <!> <!> <div class="border-t border-border px-4 py-2"><!></div></div>');function qt($,r){if(new.target)return Ke({component:qt,...$});Ue(r,!0);let d=k(r,"annotation",7),m=k(r,"lineNumber",7),b=k(r,"fileName",7),u=k(r,"messages",23,()=>[]),T=k(r,"onSendMessage",7),P=k(r,"onClose",7),h=k(r,"isSending",7,!1),U=k(r,"isAgentResponding",7,!1),K=k(r,"timestamp",7),pe=k(r,"class",7,""),q=we(""),w=we(!1),z=we(!1),de=we(null);Xe(()=>{e(w)&&e(de)&&e(de).focus()});function ce(){!e(q).trim()||h()||(T()?.(e(q).trim(),m(),b()),L(q,""))}function ae(a){a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),ce()),a.key==="Escape"&&(e(q)?L(q,""):L(w,!1))}function te(a){switch(a){case"highlight":return Fr;case"context":return jr;case"explanation":default:return Tr}}function ke(a){switch(a){case"highlight":return"text-orange-500";case"context":return"text-blue-500";case"explanation":default:return"text-warning-ink"}}function I(a){return a?Ur(a):""}const he=_(()=>u().length>0);var Ne={get annotation(){return d()},set annotation(a){d(a),y()},get lineNumber(){return m()},set lineNumber(a){m(a),y()},get fileName(){return b()},set fileName(a){b(a),y()},get messages(){return u()},set messages(a=[]){u(a),y()},get onSendMessage(){return T()},set onSendMessage(a){T(a),y()},get onClose(){return P()},set onClose(a){P(a),y()},get isSending(){return h()},set isSending(a=!1){h(a),y()},get isAgentResponding(){return U()},set isAgentResponding(a=!1){U(a),y()},get timestamp(){return K()},set timestamp(a){K(a),y()},get class(){return pe()},set class(a=""){pe(a),y()},$set:Ve,$on:(a,D)=>Je(r,a,D)},_e=ln(),S=o(_e),E=o(S),Ie=o(E);{let a=_(()=>te(d().type)),D=_(()=>ke(d().type));fe(Ie,{get icon(){return e(a)},get class(){return`h-4 w-4 ${e(D)??""}`}})}s(E);var me=n(E,2),v=o(me),R=o(v);Mt(R,{get content(){return d().message},className:"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"}),s(v);var A=n(v,2);{var Z=a=>{var D=Xr(),X=O(D,!0);M(ee=>C(X,ee),[()=>I(K())]),i(a,D)};H(A,a=>{K()&&a(Z)})}s(me);var ie=n(me,2);{var $e=a=>{{let D=_(()=>Ce.codeReview_commentThread_dismiss_tooltip());xe(a,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,get onclick(){return P()},class:"shrink-0 text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300 transition-colors",get title(){return e(D)},children:(X,ee)=>{fe(X,{get icon(){return zr}})},$$slots:{default:!0}})}};H(ie,a=>{P()&&a($e)})}s(S);var Se=n(S,2);{var ye=a=>{var D=nn(),X=o(D);xe(X,{type:"button",variant:"ghost",onclick:()=>L(z,!e(z)),class:"w-full flex items-center justify-between px-4 py-2 text-sm text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors",children:(Q,se)=>{var Y=en(),c=be(Y),p=O(c,!0),B=n(c,2);{let ue=_(()=>e(z)?ot:pt);fe(B,{get icon(){return e(ue)},class:"h-3 w-3"})}M(ue=>C(p,ue),[()=>Ce.codeReview_commentThread_suggestedChanges_label()]),i(Q,Y)},$$slots:{default:!0}});var ee=n(X,2);{var re=Q=>{var se=rn();Ge(se,21,u,Y=>Y.id,(Y,c)=>{var p=tn(),B=o(p),ue=o(B);{let g=_(()=>e(c).type==="user"?Br:Gr),N=_(()=>e(c).type==="user"?"text-blue-600 dark:text-blue-400":"text-purple-600 dark:text-purple-400");fe(ue,{get icon(){return e(g)},get class(){return`h-2.5 w-2.5 ${e(N)??""}`}})}s(B);var Re=n(B,2),t=o(Re),l=o(t);Mt(l,{get content(){return e(c).content},className:"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"}),s(t),s(Re),s(p),M(()=>He(B,1,`shrink-0 flex h-5 w-5 items-center justify-center rounded-full ${e(c).type==="user"?"bg-blue-100 dark:bg-blue-900/50":"bg-purple-100 dark:bg-purple-900/50"}`)),We(3,p,()=>at,()=>({axis:"y",distance:4,tier:"moderate"})),i(Y,p)}),s(se),We(3,se,()=>Oe,()=>({tier:"moderate"})),i(Q,se)};H(ee,Q=>{e(z)&&Q(re)})}s(D),i(a,D)};H(Se,a=>{e(he)&&a(ye)})}var V=n(Se,2);{var j=a=>{var D=an(),X=o(D);it(X,{size:12});var ee=n(X,2),re=O(ee,!0);s(D),M(Q=>C(re,Q),[()=>Ce.codeReview_commentThread_agentResponding_label()]),i(a,D)};H(V,a=>{U()&&a(j)})}var f=n(V,2),W=o(f);{var F=a=>{var D=sn(),X=be(D),ee=o(X);{let c=_(()=>Ce.codeReview_commentThread_followUp_placeholder());Jt(ee,{onkeydown:ae,get placeholder(){return e(c)},get disabled(){return h()},class:"flex-1 h-8 rounded-md border border-border bg-white dark:bg-slate-800 px-3 text-sm placeholder:text-slate-400 disabled:opacity-50",get ref(){return e(de)},set ref(p){L(de,p,!0)},get value(){return e(q)},set value(p){L(q,p,!0)}})}var re=n(ee,2);{let c=_(()=>!e(q).trim()||h());xe(re,{type:"button",variant:"primary",onclick:ce,get disabled(){return e(c)},class:"h-8 w-8 p-0",children:(p,B)=>{var ue=Pt(),Re=be(ue);{var t=g=>{it(g,{size:14})},l=g=>{fe(g,{get icon(){return Wr},class:"h-3 w-3"})};H(Re,g=>{h()?g(t):g(l,-1)})}i(p,ue)},$$slots:{default:!0}})}var Q=n(re,2);xe(Q,{type:"button",variant:"ghost",onclick:()=>{L(w,!1),L(q,"")},class:"h-8 px-2 text-xs text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 transition-colors",children:(c,p)=>{st();var B=et();M(ue=>C(B,ue),[()=>Ce.codeReview_commentThread_cancel_label()]),i(c,B)},$$slots:{default:!0}}),s(X);var se=n(X,2),Y=O(se,!0);M(c=>C(Y,c),[()=>Ce.codeReview_commentThread_inputHint_label()]),We(3,X,()=>Oe,()=>({tier:"fast"})),i(a,D)},le=a=>{xe(a,{type:"button",variant:"ghost",onclick:()=>L(w,!0),class:"flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 transition-colors",children:(D,X)=>{var ee=on(),re=be(ee);fe(re,{get icon(){return Dr},class:"h-3 w-3"});var Q=n(re,2),se=O(Q,!0);M(Y=>C(se,Y),[()=>Ce.codeReview_commentThread_askQuestion_label()]),i(D,ee)},$$slots:{default:!0}})};H(W,a=>{e(w)?a(F):a(le,-1)})}return s(f),s(_e),M(()=>He(_e,1,`walkthrough-comment-thread relative flex w-full flex-col bg-white shadow-sm dark:bg-slate-900 ${pe()??""}`)),We(3,_e,()=>Oe,()=>({tier:"moderate"})),i($,_e),qe(Ne)}var dn=x('<span class="text-emerald-600 dark:text-emerald-400 font-medium"> </span>'),cn=x('<!> <svg class="h-4 w-4 text-ghost shrink-0" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12zm2 0v12h6v-12H5.5z"></path></svg> <div class="flex items-baseline gap-2 flex-1 min-w-0"><span class="text-sm font-medium text-foreground truncate"> </span> <span class="text-xs text-subtle truncate hidden sm:inline"> </span></div> <div class="flex items-center gap-1 text-xs shrink-0"><!></div>',1),un=x('<div class="px-4 pb-3 -mt-1"><p class="text-sm text-subtle"> </p></div>'),vn=x('<div><div><span class="w-12 px-2 text-right text-ui text-subtle tabular-nums"> </span></div> <span> </span> <pre class="flex-1 px-1 whitespace-pre overflow-hidden text-ellipsis"><code class="hljs"></code></pre></div>'),gn=x('<div class="border-t border-border"><div class="font-mono text-xs leading-relaxed text-muted-foreground"><!> <!></div></div>'),fn=x('<span class="text-subtle">·</span> <!>',1),hn=x('<div class="flex items-center justify-end gap-2 px-3 py-1.5 bg-muted/20 border-b border-border text-xs"><!> <!></div>'),Gt=x("<!> <span> </span> <!>",1),mn=x('<div class="ml-20"><!></div>'),pn=x('<div class="ml-20 border-l-2 border-primary-ink/50 bg-muted/20"><div class="p-3"><!></div></div>'),_n=x('<div><div><span class="w-10 px-2 text-right text-ui text-subtle tabular-nums"> </span> <span class="w-10 px-2 text-right text-ui text-subtle tabular-nums"> </span></div> <span> </span> <div class="flex-1 flex items-center min-w-0 pr-2"><pre class="flex-1 px-1 whitespace-pre overflow-x-auto"><code class="hljs"></code></pre> <!></div></div> <!> <!> <!>',1),xn=x("<!> <!>",1),bn=x('<div class="relative"><!> <div class="overflow-x-auto"><div class="font-mono text-xs leading-relaxed min-w-full"></div></div></div>'),wn=x('<div><div class="flex flex-col border-b border-border"><!> <!></div> <!> <!></div>');function It($,r){if(new.target)return Ke({component:It,...$});Ue(r,!0);let d=k(r,"fileName",7),m=k(r,"patch",7),b=k(r,"annotations",23,()=>[]),u=k(r,"initialCollapsed",7,!1),T=k(r,"contextLines",7,3),P=k(r,"onSendMessage",7),h=k(r,"isSending",7,!1),U=k(r,"additions",7,0),K=k(r,"deletions",7,0),pe=k(r,"fileDescription",7,""),q=k(r,"class",7,"");const w=_(()=>Yr(m())),z=_(()=>Rr(d())),de=_(()=>{const t=new Map;return!e(z)||e(z)==="text"||e(z)==="plaintext"||!Bt.getLanguage(e(z))||e(w).forEach(l=>{const g=[];if(l.lines.forEach(N=>{const G=N.content||"",J=`${N.oldNum}-${N.newNum}`;g.push({content:G,key:J})}),g.length!==0)try{const N=g.map(ne=>ne.content).join(`
|
|
3
3
|
`),J=Bt.highlight(N,{language:e(z)}).value.split(`
|
|
4
4
|
`);g.forEach((ne,oe)=>{oe<J.length&&t.set(ne.key,J[oe])})}catch(N){console.warn("Failed to highlight hunk:",N)}}),t});let ce=we(mt(u())),ae=we(mt(new Set)),te=we(null);const ke=_(()=>{const t=new Map;for(const l of b()){const g=t.get(l.line)||[];g.push(l),t.set(l.line,g)}return t}),I=_(()=>new Set(b().map(t=>t.line)));function he(t){if(t.type==="deletion")return[];const l=t.newNum;return l==null?[]:e(ke).get(l)||[]}function Ne(t,l,g){if(g.type==="addition"||g.type==="deletion")return!0;const N=g.newNum??g.oldNum;if(N!==null&&e(I).has(N))return!0;const G=e(w)[t];if(!G)return!1;for(let J=Math.max(0,l-T());J<=Math.min(G.lines.length-1,l+T());J++){const ne=G.lines[J];if(ne.type==="addition"||ne.type==="deletion")return!0;const oe=ne.newNum??ne.oldNum;if(oe!==null&&e(I).has(oe))return!0}for(const J of e(ae)){const[ne,oe,ve]=J.split("-").map(Number);if(ne===t&&l>=oe&&l<=ve)return!0}return!1}function _e(t){const l=e(w)[t];if(!l)return[];const g=[];let N=null;for(let G=0;G<l.lines.length;G++){const J=Ne(t,G,l.lines[G]);!J&&N===null?N=G:J&&N!==null&&(g.push({startIndex:N,endIndex:G-1,count:G-N}),N=null)}return N!==null&&g.push({startIndex:N,endIndex:l.lines.length-1,count:l.lines.length-N}),g}function S(t,l,g){const N=`${t}-${l}-${g}`;e(ae).add(N),L(ae,new Set(e(ae)),!0)}function E(){for(let t=0;t<e(w).length;t++){const l=e(w)[t];S(t,0,l.lines.length-1)}}function Ie(){L(ae,new Set,!0)}function me(t){const l=`${t.oldNum}-${t.newNum}`,g=e(de).get(l);return g!==void 0?g:v(t.content||"")}function v(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function R(t){switch(t.type){case"addition":return"bg-emerald-500/5 dark:bg-emerald-500/10";case"deletion":return"bg-red-500/5 dark:bg-red-500/10";default:return""}}function A(t){switch(t.type){case"addition":return"text-emerald-600 dark:text-emerald-400 font-medium";case"deletion":return"text-red-600 dark:text-red-400 font-medium";default:return"text-transparent"}}function Z(t){switch(t.type){case"addition":return"+";case"deletion":return"-";default:return" "}}function ie(t){switch(t.type){case"addition":return"bg-emerald-500/10 dark:bg-emerald-500/15";case"deletion":return"bg-red-500/10 dark:bg-red-500/15";default:return"bg-muted/30"}}function $e(){L(ce,!e(ce))}function Se(t){L(te,t,!0)}function ye(){L(te,null)}function V(t,l,g){P()?.(t,l,g),L(te,null)}const j=_(()=>()=>{const t=d().split("/");return t[t.length-1]}),f=_(()=>()=>{const t=d().split("/");return t.length<=1?"":t.slice(0,-1).join("/")}),W=_(()=>{for(let t=0;t<e(w).length;t++)if(_e(t).length>0)return!0;return!1}),F=_(()=>{const l=[];for(let g=0;g<e(w).length&&l.length<3;g++){const N=e(w)[g];for(let G=0;G<N.lines.length&&l.length<3;G++){const J=N.lines[G];(J.type==="addition"||J.type==="deletion")&&l.push({line:J,hunkIndex:g,lineIndex:G})}}return l}),le=_(()=>{let t=0;for(const l of e(w))for(const g of l.lines)(g.type==="addition"||g.type==="deletion")&&t++;return t});let a=we(mt(new Map));function D(t){return`${t.file}:${t.line}:${t.type}`}function X(t){return e(a).get(D(t))||[]}var ee={get fileName(){return d()},set fileName(t){d(t),y()},get patch(){return m()},set patch(t){m(t),y()},get annotations(){return b()},set annotations(t=[]){b(t),y()},get initialCollapsed(){return u()},set initialCollapsed(t=!1){u(t),y()},get contextLines(){return T()},set contextLines(t=3){T(t),y()},get onSendMessage(){return P()},set onSendMessage(t){P(t),y()},get isSending(){return h()},set isSending(t=!1){h(t),y()},get additions(){return U()},set additions(t=0){U(t),y()},get deletions(){return K()},set deletions(t=0){K(t),y()},get fileDescription(){return pe()},set fileDescription(t=""){pe(t),y()},get class(){return q()},set class(t=""){q(t),y()},$set:Ve,$on:(t,l)=>Je(r,t,l)},re=wn(),Q=o(re),se=o(Q);xe(se,{type:"button",variant:"ghost",class:"w-full flex items-center gap-2 px-4 py-3 hover:bg-muted/30 transition-colors text-left group",onclick:$e,children:(t,l)=>{var g=cn(),N=be(g);{let Le=_(()=>e(ce)?pt:ot);fe(N,{get icon(){return e(Le)},class:"h-3 w-3 text-ghost shrink-0"})}var G=n(N,4),J=o(G),ne=O(J,!0),oe=n(J,2),ve=O(oe,!0);s(G);var Me=n(G,2),Ae=o(Me);{var De=Le=>{var Ee=dn(),Fe=O(Ee);M(()=>C(Fe,`+${U()+K()}`)),i(Le,Ee)};H(Ae,Le=>{(U()>0||K()>0)&&Le(De)})}s(Me),M((Le,Ee)=>{C(ne,Le),C(ve,Ee)},[()=>e(j)(),()=>e(f)()]),i(t,g)},$$slots:{default:!0}});var Y=n(se,2);{var c=t=>{var l=un(),g=o(l),N=O(g,!0);s(l),M(()=>C(N,pe())),i(t,l)};H(Y,t=>{pe()&&t(c)})}s(Q);var p=n(Q,2);{var B=t=>{var l=gn(),g=o(l),N=o(g);Ge(N,17,()=>e(F),({line:ne,hunkIndex:oe,lineIndex:ve})=>`preview-${oe}-${ve}`,(ne,oe)=>{let ve=()=>e(oe).line;var Me=vn(),Ae=o(Me),De=o(Ae),Le=O(De,!0);s(Ae);var Ee=n(Ae,2),Fe=O(Ee,!0),Te=n(Ee,2),ge=o(Te);Ft(ge,()=>me(ve()),!0),s(ge),s(Te),s(Me),M((Qe,Ye,Ze,tt)=>{He(Me,1,`flex ${Qe??""}`),He(Ae,1,`w-12 shrink-0 flex select-none ${Ye??""} border-r border-border`),C(Le,ve().newNum??ve().oldNum??""),He(Ee,1,`w-5 shrink-0 text-center select-none ${Ze??""}`),C(Fe,tt)},[()=>R(ve()),()=>ie(ve()),()=>A(ve()),()=>Z(ve())]),i(ne,Me)});var G=n(N,2);{var J=ne=>{xe(ne,{type:"button",variant:"ghost",class:"w-full py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors text-center",onclick:$e,children:(oe,ve)=>{st();var Me=et();M(Ae=>C(Me,Ae),[()=>Ce.codeReview_fileDiff_moreLines_label({count:e(le)-e(F).length})]),i(oe,Me)},$$slots:{default:!0}})};H(G,ne=>{e(le)>e(F).length&&ne(J)})}s(g),s(l),We(3,l,()=>Oe,()=>({tier:"moderate"})),i(t,l)};H(p,t=>{e(ce)&&e(F).length>0&&t(B)})}var ue=n(p,2);{var Re=t=>{var l=bn(),g=o(l);{var N=ne=>{var oe=hn(),ve=o(oe);xe(ve,{type:"button",variant:"ghost",class:"text-muted-foreground hover:text-foreground transition-colors",onclick:E,children:(De,Le)=>{st();var Ee=et();M(Fe=>C(Ee,Fe),[()=>Ce.codeReview_fileDiff_expandAll_label()]),i(De,Ee)},$$slots:{default:!0}});var Me=n(ve,2);{var Ae=De=>{var Le=fn(),Ee=n(be(Le),2);xe(Ee,{type:"button",variant:"ghost",class:"text-muted-foreground hover:text-foreground transition-colors",onclick:Ie,children:(Fe,Te)=>{st();var ge=et();M(Qe=>C(ge,Qe),[()=>Ce.codeReview_fileDiff_collapse_label()]),i(Fe,ge)},$$slots:{default:!0}}),i(De,Le)};H(Me,De=>{e(ae).size>0&&De(Ae)})}s(oe),i(ne,oe)};H(g,ne=>{e(W)&&ne(N)})}var G=n(g,2),J=o(G);Ge(J,21,()=>e(w),Lt,(ne,oe,ve)=>{const Me=_(()=>_e(ve)),Ae=_(()=>e(Me).find(Te=>Te.startIndex===0));var De=xn(),Le=be(De);{var Ee=Te=>{xe(Te,{type:"button",variant:"ghost",class:"w-full flex items-center justify-center gap-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors border-b border-border",onclick:()=>S(ve,e(Ae).startIndex,e(Ae).endIndex),children:(ge,Qe)=>{var Ye=Gt(),Ze=be(Ye);fe(Ze,{get icon(){return ot},class:"h-2.5 w-2.5"});var tt=n(Ze,2),xt=O(tt,!0),rt=n(tt,2);fe(rt,{get icon(){return ot},class:"h-2.5 w-2.5"}),M(ut=>C(xt,ut),[()=>Ce.codeReview_fileDiff_showHidden_label({count:e(Ae).count})]),i(ge,Ye)},$$slots:{default:!0}})};H(Le,Te=>{e(Ae)&&Te(Ee)})}var Fe=n(Le,2);Ge(Fe,19,()=>e(oe).lines,(Te,ge)=>`${ve}-${ge}`,(Te,ge,Qe)=>{const Ye=_(()=>`${e(ge).oldNum}-${e(ge).newNum}`),Ze=_(()=>he(e(ge))),tt=_(()=>e(te)===e(Ye)),xt=_(()=>Ne(ve,e(Qe),e(ge))),rt=_(()=>e(Me).find(lt=>lt.startIndex===e(Qe)+1));var ut=Pt(),er=be(ut);{var tr=lt=>{var At=_n(),vt=be(At),gt=o(vt),Et=o(gt),rr=O(Et,!0),nr=n(Et,2),ar=O(nr,!0);s(gt);var bt=n(gt,2),sr=O(bt,!0),Ht=n(bt,2),wt=o(Ht),zt=o(wt);Ft(zt,()=>me(e(ge)),!0),s(zt),s(wt);var or=n(wt,2);{var ir=Pe=>{{let ze=_(()=>Ce.codeReview_fileDiff_askLine_tooltip());xe(Pe,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,class:"size-5 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-primary-ink transition-all shrink-0",onclick:()=>Se(e(Ye)),get title(){return e(ze)},children:(je,Be)=>{fe(je,{get icon(){return St}})},$$slots:{default:!0}})}};H(or,Pe=>{P()&&Pe(ir)})}s(Ht),s(vt);var Wt=n(vt,2);Ge(Wt,19,()=>e(Ze),(Pe,ze)=>`${Pe.line}-${ze}`,(Pe,ze)=>{var je=mn(),Be=o(je);{let nt=_(()=>e(ge).newNum??e(ge).oldNum??0),ft=_(()=>X(e(ze)));qt(Be,{get annotation(){return e(ze)},get lineNumber(){return e(nt)},get fileName(){return d()},get messages(){return e(ft)},onSendMessage:(kt,yt,$t)=>V(kt,yt,$t),get isSending(){return h()}})}s(je),We(3,je,()=>Oe,()=>({tier:"moderate"})),i(Pe,je)});var Dt=n(Wt,2);{var lr=Pe=>{var ze=pn(),je=o(ze),Be=o(je);{let nt=_(()=>e(ge).newNum??e(ge).oldNum??0);Ut(Be,{get lineNumber(){return e(nt)},get fileName(){return d()},onSend:V,onClose:ye,get isSending(){return h()}})}s(je),s(ze),i(Pe,ze)};H(Dt,Pe=>{e(tt)&&e(Ze).length===0&&Pe(lr)})}var dr=n(Dt,2);{var cr=Pe=>{xe(Pe,{type:"button",variant:"ghost",class:"w-full flex items-center justify-center gap-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors border-y border-border bg-muted/10",onclick:()=>S(ve,e(rt).startIndex,e(rt).endIndex),children:(ze,je)=>{var Be=Gt(),nt=be(Be);fe(nt,{get icon(){return St},class:"h-2.5 w-2.5"});var ft=n(nt,2),kt=O(ft,!0),yt=n(ft,2);fe(yt,{get icon(){return St},class:"h-2.5 w-2.5"}),M($t=>C(kt,$t),[()=>Ce.codeReview_fileDiff_showHidden_label({count:e(rt).count})]),i(ze,Be)},$$slots:{default:!0}})};H(dr,Pe=>{e(rt)&&Pe(cr)})}M((Pe,ze,je,Be)=>{He(vt,1,`group flex ${Pe??""} hover:bg-accent/30 transition-colors`),He(gt,1,`w-20 shrink-0 flex select-none ${ze??""} border-r border-border`),C(rr,e(ge).oldNum??""),C(ar,e(ge).newNum??""),He(bt,1,`w-5 shrink-0 text-center select-none ${je??""}`),C(sr,Be)},[()=>R(e(ge)),()=>ie(e(ge)),()=>A(e(ge)),()=>Z(e(ge))]),i(lt,At)};H(er,lt=>{e(xt)&<(tr)})}i(Te,ut)}),i(ne,De)}),s(J),s(G),s(l),We(3,l,()=>Oe,()=>({tier:"moderate"})),i(t,l)};H(ue,t=>{e(ce)||t(Re)})}return s(re),M(()=>He(re,1,`walkthrough-file-diff overflow-hidden bg-card ${q()??""}`)),i($,re),qe(ee)}var kn=x('<div class="flex items-start gap-3"><div class="shrink-0 mt-0.5"><svg viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1H8a3 3 0 00-3 3v1.5a1.5 1.5 0 01-3 0V6z" clip-rule="evenodd"></path><path d="M6 12a2 2 0 012-2h8a2 2 0 012 2v2a2 2 0 01-2 2H2h2a2 2 0 002-2v-2z"></path></svg></div> <div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-foreground line-clamp-2"> </h4> <p class="text-xs text-subtle mt-1 line-clamp-2"> </p> <div class="flex items-center gap-1 mt-2 text-xs text-subtle"><svg class="h-3.5 w-3.5" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12z"></path></svg> <span> </span></div></div></div>'),yn=x('<div><div class="mb-4"><h3 class="text-sm font-medium text-subtle"> </h3></div> <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"></div></div>');function Qt($,r){if(new.target)return Ke({component:Qt,...$});Ue(r,!0);let d=k(r,"categories",7),m=k(r,"onCategoryClick",7),b=k(r,"class",7,"");function u(w){const z=["bg-blue-500/10 border-blue-500/30 hover:border-blue-500/50","bg-purple-500/10 border-purple-500/30 hover:border-purple-500/50","bg-emerald-500/10 border-emerald-500/30 hover:border-emerald-500/50","bg-warning/10 border-warning/30 hover:border-warning/30","bg-rose-500/10 border-rose-500/30 hover:border-rose-500/50","bg-cyan-500/10 border-cyan-500/30 hover:border-cyan-500/50"];return z[w%z.length]}function T(w){const z=["text-blue-500","text-purple-500","text-emerald-500","text-warning-ink","text-rose-500","text-cyan-500"];return z[w%z.length]}var P={get categories(){return d()},set categories(w){d(w),y()},get onCategoryClick(){return m()},set onCategoryClick(w){m(w),y()},get class(){return b()},set class(w=""){b(w),y()},$set:Ve,$on:(w,z)=>Je(r,w,z)},h=yn(),U=o(h),K=o(U),pe=O(K,!0);s(U);var q=n(U,2);return Ge(q,21,d,Lt,(w,z,de)=>{{let ce=_(()=>u(de));xe(w,{type:"button",variant:"ghost",get class(){return`text-left p-4 rounded-lg border transition-all duration-spring-moderate ease-spring-moderate motion-reduce:transition-none ${e(ce)??""}`},onclick:()=>m()?.(de),children:(ae,te)=>{var ke=kn(),I=o(ke),he=O(I),Ne=n(I,2),_e=o(Ne),S=O(_e,!0),E=n(_e,2),Ie=O(E,!0),me=n(E,2),v=n(o(me),2),R=O(v,!0);s(me),s(Ne),s(ke),M((A,Z)=>{He(he,0,`h-5 w-5 ${A??""}`),C(S,e(z).title),C(Ie,e(z).description),C(R,Z)},[()=>T(de),()=>e(z).files.length===1?Ce.codeReview_categoriesGrid_fileCount_one({count:e(z).files.length}):Ce.codeReview_categoriesGrid_fileCount_many({count:e(z).files.length})]),i(ae,ke)},$$slots:{default:!0}})}}),s(q),s(h),M(w=>{He(h,1,`walkthrough-categories-grid ${b()??""}`),C(pe,w)},[()=>Ce.codeReview_categoriesGrid_whatChanged_title()]),i($,h),qe(P)}var $n=x('<div class="w-0.5 flex-1 bg-border min-h-5"></div>'),Sn=x('<p class="text-sm text-subtle mt-2"> </p>'),Cn=x('<div class="rounded-lg border border-border bg-card p-4"><div class="flex items-center gap-2"><svg class="h-4 w-4 text-ghost" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12z"></path></svg> <span class="text-sm font-medium text-foreground"> </span></div> <!></div>'),Nn=x('<div class="flex gap-4"><div class="relative flex flex-col items-center w-3"><div></div> <div class="absolute top-4 w-2 h-2 rounded-full bg-muted-foreground/30 ring-2 ring-background"></div></div> <div class="flex-1 min-w-0 pb-4"><!></div></div>'),Rn=x('<div><div class="flex items-start gap-4 mb-4"><div class="relative flex flex-col items-center"><div></div> <!></div> <div class="flex-1 min-w-0 -mt-0.5"><h3 class="text-base font-semibold text-foreground"> </h3> <p class="text-sm text-subtle mt-1"> </p></div></div> <div class="relative"></div></div>');function Yt($,r){if(new.target)return Ke({component:Yt,...$});Ue(r,!0);let d=k(r,"category",7),m=k(r,"categoryIndex",7),b=k(r,"filePatchMap",7),u=k(r,"isLast",7,!1),T=k(r,"onSendMessage",7),P=k(r,"isSending",7,!1),h=k(r,"class",7,"");function U(S){const E=["bg-blue-500","bg-purple-500","bg-emerald-500","bg-warning","bg-rose-500","bg-cyan-500"];return E[S%E.length]}const K=_(()=>d().files.map(S=>{const E=b().get(S.path);return{...S,patch:E?.patch,additions:E?.additions??0,deletions:E?.deletions??0}}));var pe={get category(){return d()},set category(S){d(S),y()},get categoryIndex(){return m()},set categoryIndex(S){m(S),y()},get filePatchMap(){return b()},set filePatchMap(S){b(S),y()},get isLast(){return u()},set isLast(S=!1){u(S),y()},get onSendMessage(){return T()},set onSendMessage(S){T(S),y()},get isSending(){return P()},set isSending(S=!1){P(S),y()},get class(){return h()},set class(S=""){h(S),y()},$set:Ve,$on:(S,E)=>Je(r,S,E)},q=Rn(),w=o(q),z=o(w),de=o(z),ce=n(de,2);{var ae=S=>{var E=$n();i(S,E)};H(ce,S=>{(!u()||e(K).length>0)&&S(ae)})}s(z);var te=n(z,2),ke=o(te),I=O(ke,!0),he=n(ke,2),Ne=O(he,!0);s(te),s(w);var _e=n(w,2);return Ge(_e,23,()=>e(K),(S,E)=>`${m()}-${E}`,(S,E,Ie)=>{var me=Nn(),v=o(me),R=o(v);st(2),s(v);var A=n(v,2),Z=o(A);{var ie=Se=>{It(Se,{get fileName(){return e(E).path},get patch(){return e(E).patch},get annotations(){return e(E).annotations},get additions(){return e(E).additions},get deletions(){return e(E).deletions},get fileDescription(){return e(E).summary},get onSendMessage(){return T()},get isSending(){return P()},class:"rounded-lg border border-border overflow-hidden"})},$e=Se=>{var ye=Cn(),V=o(ye),j=n(o(V),2),f=O(j,!0);s(V);var W=n(V,2);{var F=le=>{var a=Sn(),D=O(a,!0);M(()=>C(D,e(E).summary)),i(le,a)};H(W,le=>{e(E).summary&&le(F)})}s(ye),M(()=>C(f,e(E).path)),i(Se,ye)};H(Z,Se=>{e(E).patch?Se(ie):Se($e,-1)})}s(A),s(me),M(()=>He(R,1,`w-0.5 flex-1 bg-border ${e(Ie)===e(K).length-1&&u()?"h-1/2":""}`)),i(S,me)}),s(_e),s(q),M(S=>{He(q,1,`walkthrough-category-section ${h()??""}`),Er(q,"id",`category-${m()??""}`),He(de,1,`w-3 h-3 rounded-full ${S??""} ring-4 ring-background shrink-0`),C(I,d().title),C(Ne,d().description)},[()=>U(m())]),i($,q),qe(pe)}var Mn=x('<!> <!> <span class="text-sm font-medium"> </span> <!>',1),Pn=x('<div class="flex items-center gap-2 text-sm text-subtle py-2"><!> <span> </span></div>'),Ot=x("<!> ",1),Ln=x('<div class="rounded-lg bg-danger-background/10 border border-danger/20 p-4"><p class="text-sm text-danger"> </p> <!></div>'),In=x('<h2 class="text-lg font-semibold text-foreground"> </h2>'),An=x('<p class="text-sm text-subtle italic"> </p>'),Kt=x("<div><!></div>"),En=x('<div class="space-y-8 pt-4"></div>'),Hn=x('<!> <!> <span class="text-sm font-medium text-subtle"> </span>',1),zn=x('<div class="space-y-3 pt-2"></div>'),Wn=x('<div class="pt-4 border-t border-border"><!> <!></div>'),Dn=x('<div class="flex justify-end pt-2"><!></div>'),Tn=x('<div class="space-y-6"><!> <!> <!> <!> <!> <!></div>'),jn=x('<div class="px-4 pb-4"><!> <!> <!></div>'),Fn=x('<div class="border-t border-border"><!> <!></div>');function Zt($,r){if(new.target)return Ke({component:Zt,...$});Ue(r,!0);let d=k(r,"walkthrough",7),m=k(r,"status",7),b=k(r,"workspaceId",7),u=k(r,"error",7,""),T=k(r,"workspacePath",7),P=k(r,"changes",23,()=>[]),h=k(r,"onSendMessage",7),U=k(r,"isSending",7,!1),K=k(r,"onRegenerate",7),pe=k(r,"showCategoriesGrid",7,!0);const q=_(()=>m()==="running"),w=_(()=>m()==="complete"),z=_(()=>!!u());let de=we(!0),ce=we(!1),ae=we(mt(new Map));const te=_(()=>{if(d()?.categories&&d().categories.length>0)return d().categories;if(d()?.annotations&&d().annotations.length>0){const v=new Map;for(const R of d().annotations){const A=v.get(R.file)||[];A.push(R),v.set(R.file,A)}return[{title:d().title,description:d().overview,files:Array.from(v.entries()).map(([R,A])=>({path:R,annotations:A.sort((Z,ie)=>Z.line-ie.line)}))}]}return[]}),ke=_(()=>{if(!d()?.annotations)return new Map;const v=new Map;for(const R of d().annotations){const A=v.get(R.file)||[];A.push(R),v.set(R.file,A)}for(const[R,A]of v)v.set(R,A.sort((Z,ie)=>Z.line-ie.line));return v}),I=_(()=>{const v=new Set;for(const R of e(te))for(const A of R.files)v.add(A.path);for(const R of e(ke).keys())v.add(R);return v}),he=_(()=>P().filter(v=>!e(I).has(v.relativePath)));Xe(()=>{if(!d()||!T())return;const v=new Set([...e(I),...e(he).map(R=>R.relativePath)]);for(const R of v)e(ae).has(R)||Jr(b(),!0,R).then(A=>{if(A&&A.oldContent!==void 0&&A.newContent!==void 0){const Z=Ne(R,A.oldContent,A.newContent);if(Z){const ie=P().find($e=>$e.relativePath===R);e(ae).set(R,{patch:Z,additions:ie?.stats?.additions??0,deletions:ie?.stats?.deletions??0}),L(ae,new Map(e(ae)),!0)}}}).catch(A=>{console.warn(`Failed to load diff for ${R}:`,A)})});function Ne(v,R,A){const Z=R.split(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{t as Ue,bo as x,bw as ze,b as Be,bm as Le,_ as Tt}from"./C0QTy0Sy.js";import{bs as Ne,ca as vt,aD as a,bH as y,ay as ie,bS as Z,W,bn as Oe,bV as z,aA as F,c9 as R,aB as j,a5 as q,bA as V,b_ as te,a7 as Re,bl as He,aw as ke,aC as Lt,c3 as be,bb as Pe,bO as Ze,ai as Pt,aF as St,br as Rt,bj as Ht,aj as ee}from"./3SdAC2_C.js";import{i as X}from"./bhKPSdq4.js";import{e as _e,g as Wt,i as Ut}from"./B6S6VNu7.js";import{h as tt}from"./BKD7o1lQ.js";import{g as Xe,s as rt,f as le}from"./7UPrdiE9.js";import{b as Te}from"./Dn334wJv.js";import{d2 as Me,d1 as nt,ao as zt,d4 as ht,a7 as We,aF as kt,aX as Bt,aw as Nt,a5 as at,r as Ot,aO as Vt,aT as Dt,E as qt}from"./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DCQ9cJhS.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/eBfEHUcb.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/CzXkTVR8.js","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/tr-2J8Mf.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/BCo0L43p.js","/app/immutable/chunks/BmTMWrby.js","/app/immutable/chunks/FzlZUztb.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/B4SiDSWP.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/CGslv4Qq.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DKHY8q_S.js","/app/immutable/chunks/S845NCb3.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/EK6zOAHM.js","/app/immutable/chunks/DCK8dPAL.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/C6mS8uZB.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/BKD7o1lQ.js","/app/immutable/chunks/BzVtDZxE.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/fiz8N_zQ.js","/app/immutable/chunks/CAvYeStH.js","/app/immutable/chunks/BAKPnd3w.js","/app/immutable/chunks/A9niI_uA.js","/app/immutable/chunks/Co4vj0dC.js","/app/immutable/chunks/QeBH-DWE.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/lJeex2Gh.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/CJ4Z96pe.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/c5QZsH9t.js","/app/immutable/chunks/Bsh6nUhU.js","/app/immutable/chunks/CDjpuJh0.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/CHLX1QZz.js","/app/immutable/assets/slider.kL-wkHnx.css","/app/immutable/chunks/CU5jKGma.js","/app/immutable/chunks/BZskJqHK.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js","/app/immutable/chunks/BbIcudMY.js","/app/immutable/chunks/BFEzojY2.js","/app/immutable/chunks/Cf4fmkfL.js","/app/immutable/assets/DiagramPresentation.C2GLYoBN.css","/app/immutable/chunks/CKaMWgJQ.js","/app/immutable/assets/StreamingDiagramRenderer.BShsSvPz.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as Ue,bo as x,bw as ze,b as Be,bm as Le,_ as Tt}from"./C0QTy0Sy.js";import{bs as Ne,ca as vt,aD as a,bH as y,ay as ie,bS as Z,W,bn as Oe,bV as z,aA as F,c9 as R,aB as j,a5 as q,bA as V,b_ as te,a7 as Re,bl as He,aw as ke,aC as Lt,c3 as be,bb as Pe,bO as Ze,ai as Pt,aF as St,br as Rt,bj as Ht,aj as ee}from"./3SdAC2_C.js";import{i as X}from"./bhKPSdq4.js";import{e as _e,g as Wt,i as Ut}from"./B6S6VNu7.js";import{h as tt}from"./BKD7o1lQ.js";import{g as Xe,s as rt,f as le}from"./7UPrdiE9.js";import{b as Te}from"./Dn334wJv.js";import{d2 as Me,d1 as nt,ao as zt,d4 as ht,a7 as We,aF as kt,aX as Bt,aw as Nt,a5 as at,r as Ot,aO as Vt,aT as Dt,E as qt}from"./CzXkTVR8.js";import{m as jt,bq as ot,Jv as Ke,vI as Kt,tj as Gt,vK as Jt}from"./tr-2J8Mf.js";import{K as Zt,a9 as Xt}from"./BaujsV9k.js";import{l as Se}from"./ChTqQfQN.js";import{h as st}from"./BZskJqHK.js";import{a as Qt,c as bt,b as Qe,V as Ye,p as Fe,f as wt,I as Yt,r as $t,s as er}from"./BzVtDZxE.js";import{g as it}from"./OFhgRaUm.js";import{t as tr}from"./CrD0jtXE.js";import{f as rr}from"./FzlZUztb.js";import{F as Ge}from"./DCRuihKm.js";import{p as lt}from"./C6mS8uZB.js";import{F as nr,bF as ar}from"./U9jJmfYa.js";import{t as or}from"./DAsc1V4f.js";function xe(r,o){return o||/^(?:https?:|data:|blob:|workspace-asset:)/i.test(r.trim())}function sr(r,o){if(o||!r)return r;const n=document.createElement("template");n.innerHTML=r;for(const l of n.content.querySelectorAll("img, video")){const c=l.getAttribute("src")||l.getAttribute("data-media-src")||"",u=[...l.querySelectorAll("source")];if(!xe(c,!1)||u.some(f=>!xe(f.getAttribute("src")||"",!1))){const f=document.createElement("img");f.setAttribute("alt",l.getAttribute("alt")||l.getAttribute("data-name")||""),f.setAttribute("data-media-unavailable","node-owned"),l.replaceWith(f);continue}l.removeAttribute("srcset");const s=l.getAttribute("poster");s&&!xe(s,!1)&&l.removeAttribute("poster")}return n.innerHTML}const ir=[/(^|[^\\])\$(?!\$)(?=\S)(?:\\.|[^\\$\n])+?\$(?!\$)/,/(^|[^\\])\\\((?:\\.|[^\\\n])*?\\\)/,/^(?: {0,3})(?:\$\$|\\\[)/m,/^\s*[-*]\s*\[[ x]\]/m,/```/,/`[^`]+`/,/\|.*\|/,/\[.*\]\(.*\)/,/!\[.*\]\(.*\)/,/<[a-z][\s\S]*>/i,/^#{1,6}\s/m,/^\s*>\s/m,/\*\*[^*]+\*\*/,/\*[^*]+\*/,/_[^_]+_/,/~~[^~]+~~/,/^[-*_]{3,}\s*$/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m];function lr(r){return r&&(ir.some(o=>o.test(r))||Zt(r,"markdown"))?"static":"simple"}var cr=j("<!> <!>",1);function It(r,o){if(new.target)return Ue({component:It,...r});Ne(o,!0);let n=x(o,"workspaceId",7),l=x(o,"canUseMedia",7),c=z(null),u=z(null),s=z(!1),f=z(!1);function _(m){y(c,{url:m.getAttribute("src")||"",name:m.getAttribute("alt")||void 0,opener:m},!0),y(s,!0)}function I(m){const h=nt(m.getAttribute("href")||"",n());return h&&l()(h)?(y(c,{url:h,name:m.textContent?.trim()||void 0,opener:m,assetLink:!0},!0),y(s,!0),!0):p(m)}function p(m){const h=Me(m.getAttribute("href")||"",n());return!h||!l()(h.url)?!1:(y(u,{url:h.url,mimeType:h.mimeType,name:m.textContent?.trim()||void 0,opener:m},!0),y(f,!0),!0)}vt(()=>{a(u)&&!Me(a(u).url,n())&&(y(f,!1),y(u,null)),a(c)?.assetLink&&!nt(a(c).url,n())&&(y(s,!1),y(c,null))});var k={openImage:_,openAsset:I,get workspaceId(){return n()},set workspaceId(m){n(m),F()},get canUseMedia(){return l()},set canUseMedia(m){l(m),F()},$set:ze,$on:(m,h)=>Be(o,m,h)},v=cr(),w=ie(v);{var M=m=>{Qt(m,{get imageUrl(){return a(c).url},get imageName(){return a(c).name},get openerElement(){return a(c).opener},showActionsMenu:!0,get open(){return a(s)},set open(h){y(s,h,!0)}})},T=R(()=>a(c)&&l()(a(c).url));X(w,m=>{a(T)&&m(M)})}var C=Z(w,2);{var t=m=>{bt(m,{get videoUrl(){return a(u).url},get videoName(){return a(u).name},get mimeType(){return a(u).mimeType},sourceKind:"workspace",get openerElement(){return a(u).opener},get open(){return a(f)},set open(h){y(f,h,!0)}})},d=R(()=>a(u)&&Me(a(u).url,n())&&l()(a(u).url));X(C,m=>{a(d)&&m(t)})}return W(r,v),Oe(k)}var dr=j('<div class="flex items-center gap-2"><!> <!></div>'),ur=Lt('<svg viewBox="0 0 24 24" class="size-10" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect><path d="m10 9 5 3-5 3V9Z" fill="currentColor"></path></svg>'),fr=j('<div class="absolute inset-0 flex items-center justify-center bg-muted text-muted-foreground" aria-hidden="true"><!></div> <video preload="metadata" playsinline="" tabindex="-1" aria-hidden="true"></video> <span class="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20 motion-reduce:transition-none forced-colors:bg-transparent" aria-hidden="true"><span><svg viewBox="0 0 20 20" fill="currentColor"><path d="m7 5 7 5-7 5V5Z"></path></svg></span></span>',3),mr=j("<div><!> <!></div>"),pr=j('<div class="my-2 min-w-0 max-w-2xl" data-chat-video=""><!></div> <!>',1);function yt(r,o){if(new.target)return Ue({component:yt,...r});Ne(o,!0);let n=x(o,"source",7),l=x(o,"name",23,()=>Le.chat_videoBlock_fromAgent_label()),c=x(o,"poster",7),u=x(o,"allowFileMedia",7,!0),s=x(o,"canOpenFile",7),f=x(o,"fluid",7,!1),_=x(o,"compact",7,!1),I=x(o,"compactPreview",7),p=z(!1),k=z(!1),v=z(!1),w=z(null);const M=R(()=>n().kind==="inline"?`data:${n().mimeType};base64,${n().data}`:n().url);function T(g){return xe(g,u()&&s()?.()!==!1)}const C=R(()=>!T(a(M))),t=R(()=>Fe(a(M))),d=R(()=>{if(!(!c()||!T(c()))){if(/^data:image\/(?:gif|jpeg|png|webp);base64,[a-z0-9+/=]+$/i.test(c()))return c();try{const g=new URL(c());return(g.protocol==="https:"||g.protocol==="workspace-file:")&&!g.username&&!g.password?c():void 0}catch{return}}});function m(){y(k,!0),y(v,!1)}var h={get source(){return n()},set source(g){n(g),F()},get name(){return l()},set name(g=Le.chat_videoBlock_fromAgent_label()){l(g),F()},get poster(){return c()},set poster(g){c(g),F()},get allowFileMedia(){return u()},set allowFileMedia(g=!0){u(g),F()},get canOpenFile(){return s()},set canOpenFile(g){s(g),F()},get fluid(){return f()},set fluid(g=!1){f(g),F()},get compact(){return _()},set compact(g=!1){_(g),F()},get compactPreview(){return I()},set compactPreview(g){I(g),F()},$set:ze,$on:(g,H)=>Be(o,g,H)},E=pr(),U=ie(E);let O;var ve=q(U);{var D=g=>{Qe(g,{get name(){return l()},reason:"load-failed"})},ae=g=>{var H=dr(),ce=q(H);{let Q=R(()=>a(t)?.path),re=R(()=>a(t)?.workspaceId);Qe(ce,{get name(){return l()},reason:"load-failed",get path(){return a(Q)},get workspaceId(){return a(re)}})}var se=Z(ce,2);Ye(se,{get videoUrl(){return a(M)},get videoName(){return l()},get sourceKind(){return n().kind},get mimeType(){return n().mimeType}}),V(H),W(g,H)},K=g=>{var H=mr();let ce;var se=q(H);{let de=R(()=>Le.chat_videoBlock_play_ariaLabel({name:l()}));rr(se,{wrapContent:!1,type:"button",variant:"ghost",size:"default",class:"relative block size-full cursor-pointer overflow-hidden rounded-lg border border-border bg-muted/40 p-0 shadow-(--elevation-raised) focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 forced-colors:border",get"aria-label"(){return a(de)},"data-testid":"chat-video-snapshot",onclick:()=>{T(a(M))&&y(p,!0)},get ref(){return a(w)},set ref(he){y(w,he,!0)},children:(he,De)=>{var ue=Re(),B=ie(ue);{var we=Y=>{var G=Re(),J=ie(G);tr(J,I),W(Y,G)},fe=Y=>{var G=fr(),J=ie(G),Ce=q(J);{var Ee=pe=>{var qe=ur();W(pe,qe)};X(Ce,pe=>{f()||pe(Ee)})}V(J);var $=Z(J,2);$.muted=!0;var me=Z($,2),Ie=q(me),ye=He(Ie);V(me),te(()=>{rt($,"src",a(M)),rt($,"poster",a(d)),le($,1,`pointer-events-none absolute inset-0 size-full object-contain transition-opacity motion-reduce:transition-none ${a(d)||a(k)&&!a(v)?"opacity-100":"opacity-0"}`),le(Ie,1,`flex ${_()?"size-6":"size-11"} shrink-0 aspect-square items-center justify-center rounded-full border border-white/70 bg-black/60 text-white shadow-(--elevation-raised) forced-colors:border forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]`),le(ye,0,`ml-0.5 ${_()?"size-3":"size-5"}`)}),ke("loadeddata",$,m),ke("error",$,()=>y(v,!0)),W(Y,G)};X(B,Y=>{I()?Y(we):Y(fe,-1)})}W(he,ue)},$$slots:{default:!0}})}var Q=Z(se,2);{var re=de=>{Ye(de,{get videoUrl(){return a(M)},get videoName(){return l()},get sourceKind(){return n().kind},get mimeType(){return n().mimeType},triggerClass:"absolute right-1.5 top-1.5 opacity-0 transition-opacity focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"})};X(Q,de=>{I()||de(re)})}V(H),te(()=>{le(H,1,`group relative aspect-video w-full max-w-2xl ${f()?"max-h-72":"max-h-40"}`),ce=Xe(H,"",ce,{height:I()?"100%":void 0,width:f()?"min(100%, calc(18rem * 16 / 9))":"min(100%, calc(10rem * 16 / 9))"})}),W(g,H)};X(ve,g=>{a(C)?g(D):a(v)?g(ae,1):g(K,-1)})}V(U);var oe=Z(U,2);{var Ve=g=>{bt(g,{get videoUrl(){return a(M)},get videoName(){return l()},get poster(){return a(d)},get sourceKind(){return n().kind},get mimeType(){return n().mimeType},get openerElement(){return a(w)},get open(){return a(p)},set open(H){y(p,H,!0)}})};X(oe,g=>{!a(v)&&!a(C)&&g(Ve)})}return te(()=>O=Xe(U,"",O,{height:I()?"100%":void 0})),W(r,E),Oe(h)}const gr=/^\s*!\[([^\]\n]*)\]\((?:<)?((?:intent:\/\/local\/|workspace-file:\/\/|workspace-asset:\/\/)[^)\s>]+)(?:>)?\)\s*$/,vr=/^ {0,3}(`{3,}|~{3,})(.*)$/;function ct(r,o){if(typeof r!="string"||!r||r!==r.trim())return null;if(r.startsWith("workspace-asset://"))return Me(r,o);if(r.startsWith("workspace-file://")){const l=Fe(r);if(!l||l.workspaceId!==o)return null;const c=ht(r);return c?lt(c,o):null}const n=r.startsWith("intent://")?r:`intent://local/file/${r}`;return lt(n,o)}function hr(r,o){if(r.startsWith("workspace-file://")){const n=Fe(r);if(!n||n.workspaceId!==o)return!1;const l=ht(r);return!!l&&!!We(l,o)}return!!We(r,o,{readOnly:!0})}function kr(r,o){return(o===0||!r[o-1].trim())&&(o===r.length-1||!r[o+1].trim())}function br(r,o,n){const l=n[0];return r.findIndex((c,u)=>{if(u<=o)return!1;const s=c.trim();return s.length>=n.length&&s.split("").every(f=>f===l)})}function wr(r,o){const n=r.split(`
|
|
3
3
|
`),l=[];let c=[];const u=()=>{const s=c.join(`
|
|
4
4
|
`);s.trim()&&l.push({type:"markdown",content:s}),c=[]};for(let s=0;s<n.length;s+=1){const f=n[s].match(vr);if(f){const w=br(n,s,f[1]);if(w>s){const M=n.slice(s,w+1);if(f[2].trim()==="ws-block:video")try{const T=JSON.parse(n.slice(s+1,w).join(`
|
|
5
|
-
`)),C=ct(T?.path,o);if(C){u(),l.push({type:"video",source:C,name:typeof T.path=="string"?T.path:void 0,poster:typeof T.poster=="string"?T.poster:void 0}),s=w;continue}}catch{}c.push(...M),s=w;continue}c.push(...n.slice(s));break}const I=!/^(?: {4}|\t)/.test(n[s])&&kr(n,s)?n[s].match(gr):null;if(!I){c.push(n[s]);continue}const[,p,k]=I,v=ct(k,o);v?(u(),l.push({type:"video",source:v,name:p||void 0})):k.startsWith("workspace-asset://")&&!zt(k)||hr(k,o)?c.push(n[s]):c.push(`[${p}](${k})`)}return u(),l}function Ae(r){return wt(r.getAttribute("src")||"")}function Je(r){return r instanceof HTMLImageElement?r:r instanceof HTMLAnchorElement?r.querySelector("img"):null}function Ir(r,o){const n=r.getBoundingClientRect(),l=o.getBoundingClientRect();return{top:n.top-l.top+6,right:l.right-n.right+6}}function dt(r,o){const n=document.activeElement;return!!(n&&(n===r||n===r?.closest("a")||o?.contains(n)))}function yr(r,o){const n=r.getAttribute("src")||"",l=Fe(n)?.path??kt(n,o)?.path;if(l)return l;if(n.startsWith("workspace-asset://")){const c=n.split(/[?#]/)[0].split("/").pop();if(c)return c}if(n&&!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith("//"))try{return decodeURI(n)}catch{return n}return r.getAttribute("alt")||void 0}const _t="data-image-sized",ut=r=>typeof r=="number"&&Number.isInteger(r)&&r>0;function _r(r){try{return encodeURI(r).replace(/%25/g,"%")}catch{return null}}function Ar(r){return r.startsWith("workspace-file://")?r.split(/[?#]/)[0]:r}function Mr(r,o,n){const l=new Map;for(const[c,u]of Object.entries(r)){if(!u||!ut(u.width)||!ut(u.height))continue;const s={width:u.width,height:u.height},f=new Set([c]),_=_r(c);_&&f.add(_);for(const I of[...f]){const p=We(I,o);if(p&&f.add(p),n!==void 0){const k=Bt(I,n);if(k){const v=We(`intent://local/file/${k.split("/").map(encodeURIComponent).join("/")}`,o);v&&f.add(v)}}}for(const I of f)l.has(I)||l.set(I,s)}return l}function xr(r,o,n,l){if(!o||!r.includes("<img"))return r;const c=Mr(o,n,l);return c.size===0?r:r.replace(/<img\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,u=>{if(/\s(?:width|height)="/i.test(u))return u;const s=/\ssrc="([^"]*)"/i.exec(u);if(!s)return u;const f=Ar(s[1].replace(/&/g,"&")),_=c.get(f);return _?u.replace(/\s*\/?>$/,` width="${_.width}" height="${_.height}" ${_t}="">`):u})}function ft(r,o){let n=o,l,c=!1,u=!1;const s=new Map;function f(){for(const[p,{component:k,source:v}]of s)be(k),r.contains(p)&&p.replaceWith(v);s.clear()}function _(){if(!u){for(const[p,{component:k}]of s)r.contains(p)||(be(k),s.delete(p));if(n.enabled)for(const p of r.querySelectorAll("pre > code")){if(p.closest("[data-markdown-diagram]"))continue;const k=[...p.classList].find(C=>C.startsWith("language-"))?.slice(9);let v;if(k==="mermaid")v="mermaid";else if(k==="diagram"||k==="ws-block:diagram")v="diagram";else if(k==="ws-block")try{if(JSON.parse(p.textContent??"").type!=="diagram")continue;v="diagram"}catch{continue}else continue;const w=p.parentElement;if(!w)continue;if(!l){c||(c=!0,Tt(()=>import("./DrHfN5GT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80]),import.meta.url).then(C=>{l=C.default,c=!1,_()}).catch(C=>{c=!1,Se.error("Failed to load the Markdown diagram renderer",{error:C})}));return}const M=document.createElement("div");M.dataset.markdownDiagram=v,w.replaceWith(M);const T=Pe(l,{target:M,context:n.context,props:{kind:v,source:p.textContent??"",workspaceId:n.workspaceId}});s.set(M,{component:T,source:w})}}}const I=new MutationObserver(_);return I.observe(r,{childList:!0,subtree:!0}),queueMicrotask(_),{update(p){(n.enabled!==p.enabled||n.workspaceId!==p.workspaceId)&&f(),n=p,_()},destroy(){u=!0,I.disconnect(),f()}}}var Fr=j('<span class="min-w-0 max-w-full truncate"> </span>'),Cr=j('<span class="type-caption flex min-w-0 max-w-full items-start gap-2 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-loading-placeholder"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="flex min-w-0 flex-wrap items-baseline gap-x-1.5"><span> </span> <!></span></span>');function At(r,o){if(new.target)return Ue({component:At,...r});Ne(o,!0);let n=x(o,"name",7);var l={get name(){return n()},set name(v){n(v),F()},$set:ze,$on:(v,w)=>Be(o,v,w)},c=Cr(),u=q(c),s=q(u);nr(s,{get icon(){return ar},class:"size-3.5"}),V(u);var f=Z(u,2),_=q(f),I=He(_,!0),p=Z(_,2);{var k=v=>{var w=Fr(),M=He(w,!0);_e(w,(T,C)=>or?.(T,C),n),te(()=>Ze(M,n())),W(v,w)};X(p,v=>{n()&&v(k)})}return V(f),V(c),te(v=>Ze(I,v),[()=>Le.ui_mediaLoadingPlaceholder_title_label()]),W(r,c),Oe(l)}const mt="markdown-image-frame";function Er(r,o){const n=new Map,l=new Map,c=new Map,u=[300,1e3];let s=!1;function f(t){let d=l.get(t);return d||(d={source:t.getAttribute("src")||"",workspaceId:o.getWorkspaceId(),retries:0,failureHandled:!1},l.set(t,d)),d}function _(t){const d=f(t);return!s&&r.contains(d.fallbackHost??t)&&d.workspaceId===o.getWorkspaceId()&&o.canUseMedia(d.source)&&!t.hasAttribute("data-media-unavailable")&&!t.hasAttribute("data-media-unsupported")&&at(d.source)!==null}function I(t,d=!1){if(!_(t))return;const m=f(t),h=at(m.source);if(!h)return;const E=m.fallbackHost,U=E?.contains(document.activeElement)??!1;if(m.failureHandled=!1,m.fallbackHost=void 0,d&&(m.retries=0),t.removeAttribute("src"),t.setAttribute("src",h),E){const O=n.get(E);O&&be(O),n.delete(E),E.replaceWith(t),M(),U&&r.contains(t)&&t.focus()}}function p(t){const d=f(t);s||!r.contains(t)||d.failureHandled||(d.failureHandled=!0,_(t)&&d.retries<u.length?d.timer=setTimeout(()=>{d.timer=void 0,I(t)},u[d.retries++]):w(t,"load-failed"))}function k(t){const d=t.parentElement;return d?.classList.contains(mt)?d:null}function v(t){const d=Number(t.getAttribute("width")),m=Number(t.getAttribute("height"));if(!(d>0&&m>0))return;const h=document.createElement("span");h.className=mt,h.style.aspectRatio=`${d} / ${m}`,h.style.setProperty("--image-aspect-ratio",`${d} / ${m}`),h.style.setProperty("--image-width",`${d}px`),h.dataset.loaded="false",t.replaceWith(h),h.appendChild(t);const E=h.appendChild(document.createElement("span"));E.className="markdown-image-frame-placeholder",n.set(E,Pe(At,{target:E,props:{name:yr(t,o.getWorkspaceId())}}));const U=()=>{if(c.delete(t),s||!r.contains(h))return;h.dataset.loaded="true";const O=n.get(E);O&&(be(O),n.delete(E)),E.remove()};t.complete&&t.naturalWidth>0?U():(c.set(t,U),t.addEventListener("load",U,{once:!0}))}function w(t,d){const m=t.getAttribute("src")||t.getAttribute("data-media-src")||"",h=Fe(m),E=kt(m,o.getWorkspaceId()),U=h?.path??E?.path,O=h?.workspaceId??E?.workspaceId,ve=t.getAttribute("data-name")||t.getAttribute("alt")||U?.split("/").pop()||void 0,D=document.createElement(t instanceof HTMLVideoElement?"div":"span");D.className="media-unavailable-host",(k(t)??t).replaceWith(D),o.onMediaRemoved(t);let ae;if(t instanceof HTMLImageElement&&d==="load-failed"){const oe=f(t);oe.fallbackHost=D,_(t)&&(ae=()=>I(t,!0))}const K=Pe(Qe,{target:D,props:{name:ve,reason:d,path:U,workspaceId:O,onRetry:ae}});if(n.set(D,K),t instanceof HTMLVideoElement){D.classList.add("flex","items-center","gap-2");const oe=D.appendChild(document.createElement("span"));n.set(oe,Pe(Ye,{target:oe,props:{videoUrl:m,videoName:ve,sourceKind:"workspace",mimeType:Me(m,o.getWorkspaceId())?.mimeType}}))}}function M(){if(!s){for(const t of r.querySelectorAll("img"))Ae(t)&&!t.closest("a")&&(t.tabIndex=0,t.setAttribute("role","button")),!(t.hasAttribute("data-media-unsupported")||t.hasAttribute("data-media-unavailable"))&&(f(t),t.hasAttribute(_t)&&!k(t)&&v(t),t.getAttribute("src")&&t.complete&&t.naturalWidth===0&&p(t));for(const t of r.querySelectorAll("[data-media-unsupported]"))w(t,"unsupported");for(const t of r.querySelectorAll("[data-media-unavailable]"))w(t,Nt(t));for(const[t,d]of l)r.contains(d.fallbackHost??t)||(d.timer!==void 0&&clearTimeout(d.timer),l.delete(t));for(const[t,d]of c)r.contains(t)||(t.removeEventListener("load",d),c.delete(t));for(const[t,d]of n)r.contains(t)||(be(d),n.delete(t))}}function T(t){const d=t.target;(d instanceof HTMLImageElement||d instanceof HTMLVideoElement)&&(d instanceof HTMLImageElement?p(d):w(d,"load-failed"))}const C=new MutationObserver(M);return C.observe(r,{childList:!0,subtree:!0}),r.addEventListener("error",T,!0),queueMicrotask(M),{destroy(){s=!0,C.disconnect();for(const t of l.values())t.timer!==void 0&&clearTimeout(t.timer);l.clear();for(const[t,d]of c)t.removeEventListener("load",d);c.clear(),r.removeEventListener("error",T,!0);for(const t of n.values())be(t);n.clear()}}}var Tr=j('<div class="image-actions-overlay absolute z-10 svelte-nzvuq5" data-testid="markdown-image-actions-overlay"><!></div>'),Lr=j("<div></div>"),pt=j('<div role="group"><!> <!></div>'),Pr=j('<div><p class="whitespace-pre-wrap svelte-nzvuq5"> </p></div>'),Sr=j("<!> <!>",1);function gt(r,o){if(new.target)return Ue({component:gt,...r});Ne(o,!0);const n=e=>{var i=Re(),A=ie(i);{var b=P=>{var S=Tr(),ne=q(S);{let N=R(()=>a(B).getAttribute("src")||""),ge=R(()=>a(B).getAttribute("alt")||void 0);Te(Yt(ne,{get imageUrl(){return a(N)},get imageName(){return a(ge)},get open(){return a(fe)},set open(je){y(fe,je,!0)}}),je=>y(Y,je,!0),()=>a(Y))}V(S),Te(S,N=>y(G,N),()=>a(G)),te(()=>Xe(S,`top: ${a(we).top??""}px; right: ${a(we).right??""}px;`)),W(P,S)},L=R(()=>a(B)&&K(a(B).getAttribute("src")||""));X(A,P=>{a(L)&&P(b)})}W(e,i)};let l=x(o,"content",7),c=x(o,"isStreaming",7,!1),u=x(o,"className",7,""),s=x(o,"workspaceId",23,()=>it()?.workspaceId??void 0),f=x(o,"relativeMediaBase",7),_=x(o,"onCodeBlockAction",7),I=x(o,"onFileClick",7),p=x(o,"canOpenFile",7),k=x(o,"allowFileMedia",7,!0),v=x(o,"taskBlockRenderMode",7,"placeholder"),w=x(o,"chatImageThumbnails",7,!1),M=x(o,"forceExternalLinks",7,!1),T=x(o,"renderRichFencesAsCode",7,!1),C=x(o,"renderDiagrams",7,!1),t=x(o,"allowSanitizedHtml",7,!1),d=x(o,"media",7);const m=Ot(),h=St(),E=R(()=>wr(l(),s())),U=R(()=>a(E).some(e=>e.type==="video")),O=R(()=>!a(U)&&a(E).length===1&&a(E)[0].type==="markdown"?a(E)[0].content:l()),ve=R(()=>lr(a(O)));let D=z(null),ae=z("");function K(e){return xe(e,k()&&p()?.()!==!1)}const oe=R(()=>sr(a(ae),k()&&p()?.()!==!1)),Ve=R(()=>$t(a(oe),s(),er)),g=R(()=>`<div class="markdown-content">${a(Ve)}</div>`);let H=0;const ce=150;let se=-1/0,Q=null,re=null;async function de(e,i,A,b){try{const L=await Vt(e,{...i,readOnly:!0});if(b!==H)return;y(ae,xr(L,A,i?.workspaceId,i?.relativeMediaBase),!0)}catch(L){if(b!==H)return;Se.error("Failed to process markdown:",L);const P=e.replace(/[&<>"']/g,S=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[S]||S);y(ae,`<p>${P}</p>`)}}function he(){if(!re)return;const e=ce-(performance.now()-se);if(e>0){Q=setTimeout(()=>{Q=null,he()},e);return}const i=re;re=null,se=performance.now(),i()}function De(){Q!==null&&(clearTimeout(Q),Q=null),re=null,se=-1/0}vt(()=>{const e=a(O),i={allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!0,taskBlockRenderMode:v(),workspaceId:s(),relativeMediaBase:f()??(s()&&s()!==jt?"":void 0),renderRichFencesAsCode:T()||C(),processPrimitives:!C(),allowSanitizedHtml:t(),renderMath:!c(),workspaceFileVersion:m},A=d(),b=++H,L=()=>void de(e,i,A,b);c()?(re=L,Q===null&&he()):(De(),L())});let ue=z(void 0),B=z(null),we=z(Rt({top:0,right:0})),fe=z(!1),Y=z(void 0),G=z(null);function J(e){if(e.type==="mouseover"&&dt(a(B),a(G)))return;const i=e.target,A=Je(i);if(A&&Ae(A)&&K(A.getAttribute("src")||"")){if(a(B)===A)return;y(B,A,!0),y(we,Ir(A,e.currentTarget),!0)}else if(a(B)&&!a(fe)){if(i instanceof Node&&a(G)?.contains(i))return;y(B,null)}}function Ce(){!a(fe)&&!dt(a(B),a(G))&&y(B,null)}function Ee(e){const i=Je(e.target);!i||!Ae(i)||!K(i.getAttribute("src")||"")||(e.preventDefault(),e.stopPropagation(),J(e),y(fe,!0))}function $(e){return Er(e,{getWorkspaceId:()=>s(),canUseMedia:K,onMediaRemoved:i=>{a(B)===i&&y(B,null)}})}function me(e){const i=e.target,A=i.closest("a");if(!A&&i instanceof HTMLImageElement){const L=i.getAttribute("src")||"";if(wt(L)&&K(L)){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a(ue)?.openImage(i);return}}if(A?.href){if(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a(ue)?.openAsset(A))return;const L=pe(e),P=s()?ot(s()):void 0;st(A.href,{workspaceId:P,canOpenFile:p(),sourcePanelId:L,event:e,rawHref:A.getAttribute("href")??void 0,...M()?{forceExternal:!0}:{}});return}const b=Dt(i.closest("[data-mention]"));if(b){const{type:L,meta:P}=b;if(L==="file"&&b.filePath){if(p()?.()===!1)return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const S=b.filePath;Se.debug("[MarkdownViewer] File mention clicked",{filePath:S,meta:P});const ne=pe(e),N=Ge({event:e});if(I())I()(S,{line:b.line,openInAdjacentPanel:N,sourcePanelId:ne});else{const ge=s();ge&&Ke.dispatch(Kt(ge,S,{line:b.line,openInAdjacentPanel:N,sourcePanelId:ne}))}}else if(b.folderPath!==void 0){if(p()?.()===!1||!s())return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),Ke.dispatch(Gt(s(),qt(b.folderPath)))}else if(L==="note"&&b.note){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const S=b.note.id;Se.debug("[MarkdownViewer] Note mention clicked",{noteId:S,meta:P});const ne=pe(e),N=Ge({event:e});if(b.note.workspaceId&&b.note.workspaceId!==s()){st(Xt(S,b.note.workspaceId),{workspaceId:s()?ot(s()):void 0,sourcePanelId:ne,event:e});return}const ge=s();ge&&Ke.dispatch(Jt(ge,S,{openInAdjacentPanel:N,sourcePanelId:ne}))}}}function Ie(e){if(ye(e),!e.defaultPrevented){if(e.target instanceof HTMLImageElement&&Ae(e.target)&&(e.key==="Enter"||e.key===" ")){me(e);return}e.key!=="Enter"||!Ge({event:e})||me(e)}}function ye(e){const i=Je(e.target);!i||!Ae(i)||!K(i.getAttribute("src")||"")||a(Y)?.handleCopy(e,i.getAttribute("src")||"")}function pe(e){const i=e.target;if(i instanceof HTMLElement)return i.closest("[data-panel-id]")?.dataset.panelId}Ht(()=>{H+=1,De()});var qe={get content(){return l()},set content(e){l(e),F()},get isStreaming(){return c()},set isStreaming(e=!1){c(e),F()},get className(){return u()},set className(e=""){u(e),F()},get workspaceId(){return s()},set workspaceId(e=it()?.workspaceId??void 0){s(e),F()},get relativeMediaBase(){return f()},set relativeMediaBase(e){f(e),F()},get onCodeBlockAction(){return _()},set onCodeBlockAction(e){_(e),F()},get onFileClick(){return I()},set onFileClick(e){I(e),F()},get canOpenFile(){return p()},set canOpenFile(e){p(e),F()},get allowFileMedia(){return k()},set allowFileMedia(e=!0){k(e),F()},get taskBlockRenderMode(){return v()},set taskBlockRenderMode(e="placeholder"){v(e),F()},get chatImageThumbnails(){return w()},set chatImageThumbnails(e=!1){w(e),F()},get forceExternalLinks(){return M()},set forceExternalLinks(e=!1){M(e),F()},get renderRichFencesAsCode(){return T()},set renderRichFencesAsCode(e=!1){T(e),F()},get renderDiagrams(){return C()},set renderDiagrams(e=!1){C(e),F()},get allowSanitizedHtml(){return t()},set allowSanitizedHtml(e=!1){t(e),F()},get media(){return d()},set media(e){d(e),F()},$set:ze,$on:(e,i)=>Be(o,e,i)},$e=Sr(),et=ie($e);{var Mt=e=>{var i=Lr();Wt(i,21,()=>a(E),Ut,(A,b)=>{var L=Re(),P=ie(L);{var S=N=>{yt(N,{get allowFileMedia(){return k()},get canOpenFile(){return p()},get source(){return a(b).source},get name(){return a(b).name},get poster(){return a(b).poster}})},ne=N=>{gt(N,{get content(){return a(b).content},get isStreaming(){return c()},get workspaceId(){return s()},get relativeMediaBase(){return f()},get onCodeBlockAction(){return _()},get onFileClick(){return I()},get canOpenFile(){return p()},get allowFileMedia(){return k()},get taskBlockRenderMode(){return v()},get chatImageThumbnails(){return w()},get forceExternalLinks(){return M()},get renderRichFencesAsCode(){return T()},get renderDiagrams(){return C()},get allowSanitizedHtml(){return t()},get media(){return d()}})};X(P,N=>{a(b).type==="video"?N(S):N(ne,-1)})}W(A,L)}),V(i),te(()=>le(i,1,`markdown-video-segments ${u()??""}`,"svelte-nzvuq5")),W(e,i)},xt=e=>{var i=pt();let A;var b=q(i);tt(b,()=>a(g));var L=Z(b,2);n(L),V(i),_e(i,P=>$?.(P)),_e(i,(P,S)=>ft?.(P,S),()=>({enabled:C(),workspaceId:s(),context:h})),te(()=>A=le(i,1,`markdown-viewer streaming-content ${u()??""}`,"svelte-nzvuq5",A,{"chat-image-thumbnails":w()})),ee("click",i,me),ee("keydown",i,Ie),ke("copy",i,ye),ee("contextmenu",i,Ee),ee("mouseover",i,J),ee("focusin",i,J),ke("mouseleave",i,Ce),W(e,i)},Ft=e=>{var i=Pr(),A=q(i),b=He(A,!0);V(i),te(()=>{le(i,1,`markdown-viewer simple-content ${u()??""}`,"svelte-nzvuq5"),Ze(b,a(O))}),W(e,i)},Ct=e=>{var i=pt();let A;var b=q(i);tt(b,()=>a(g));var L=Z(b,2);n(L),V(i),Te(i,P=>y(D,P),()=>a(D)),_e(i,P=>$?.(P)),_e(i,(P,S)=>ft?.(P,S),()=>({enabled:C(),workspaceId:s(),context:h})),te(()=>A=le(i,1,`markdown-viewer static-content ${u()??""}`,"svelte-nzvuq5",A,{"chat-image-thumbnails":w()})),ee("click",i,me),ee("keydown",i,Ie),ke("copy",i,ye),ee("contextmenu",i,Ee),ee("mouseover",i,J),ee("focusin",i,J),ke("mouseleave",i,Ce),W(e,i)};X(et,e=>{a(U)?e(Mt):c()?e(xt,1):a(ve)==="simple"&&!t()?e(Ft,2):e(Ct,-1)})}var Et=Z(et,2);return Te(It(Et,{get workspaceId(){return s()},canUseMedia:K}),e=>y(ue,e,!0),()=>a(ue)),W(r,$e),Oe(qe)}Pt(["click","keydown","contextmenu","mouseover","focusin"]);export{yt as C,gt as M,At as a,wr as s};
|
|
5
|
+
`)),C=ct(T?.path,o);if(C){u(),l.push({type:"video",source:C,name:typeof T.path=="string"?T.path:void 0,poster:typeof T.poster=="string"?T.poster:void 0}),s=w;continue}}catch{}c.push(...M),s=w;continue}c.push(...n.slice(s));break}const I=!/^(?: {4}|\t)/.test(n[s])&&kr(n,s)?n[s].match(gr):null;if(!I){c.push(n[s]);continue}const[,p,k]=I,v=ct(k,o);v?(u(),l.push({type:"video",source:v,name:p||void 0})):k.startsWith("workspace-asset://")&&!zt(k)||hr(k,o)?c.push(n[s]):c.push(`[${p}](${k})`)}return u(),l}function Ae(r){return wt(r.getAttribute("src")||"")}function Je(r){return r instanceof HTMLImageElement?r:r instanceof HTMLAnchorElement?r.querySelector("img"):null}function Ir(r,o){const n=r.getBoundingClientRect(),l=o.getBoundingClientRect();return{top:n.top-l.top+6,right:l.right-n.right+6}}function dt(r,o){const n=document.activeElement;return!!(n&&(n===r||n===r?.closest("a")||o?.contains(n)))}function yr(r,o){const n=r.getAttribute("src")||"",l=Fe(n)?.path??kt(n,o)?.path;if(l)return l;if(n.startsWith("workspace-asset://")){const c=n.split(/[?#]/)[0].split("/").pop();if(c)return c}if(n&&!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith("//"))try{return decodeURI(n)}catch{return n}return r.getAttribute("alt")||void 0}const _t="data-image-sized",ut=r=>typeof r=="number"&&Number.isInteger(r)&&r>0;function _r(r){try{return encodeURI(r).replace(/%25/g,"%")}catch{return null}}function Ar(r){return r.startsWith("workspace-file://")?r.split(/[?#]/)[0]:r}function Mr(r,o,n){const l=new Map;for(const[c,u]of Object.entries(r)){if(!u||!ut(u.width)||!ut(u.height))continue;const s={width:u.width,height:u.height},f=new Set([c]),_=_r(c);_&&f.add(_);for(const I of[...f]){const p=We(I,o);if(p&&f.add(p),n!==void 0){const k=Bt(I,n);if(k){const v=We(`intent://local/file/${k.split("/").map(encodeURIComponent).join("/")}`,o);v&&f.add(v)}}}for(const I of f)l.has(I)||l.set(I,s)}return l}function xr(r,o,n,l){if(!o||!r.includes("<img"))return r;const c=Mr(o,n,l);return c.size===0?r:r.replace(/<img\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,u=>{if(/\s(?:width|height)="/i.test(u))return u;const s=/\ssrc="([^"]*)"/i.exec(u);if(!s)return u;const f=Ar(s[1].replace(/&/g,"&")),_=c.get(f);return _?u.replace(/\s*\/?>$/,` width="${_.width}" height="${_.height}" ${_t}="">`):u})}function ft(r,o){let n=o,l,c=!1,u=!1;const s=new Map;function f(){for(const[p,{component:k,source:v}]of s)be(k),r.contains(p)&&p.replaceWith(v);s.clear()}function _(){if(!u){for(const[p,{component:k}]of s)r.contains(p)||(be(k),s.delete(p));if(n.enabled)for(const p of r.querySelectorAll("pre > code")){if(p.closest("[data-markdown-diagram]"))continue;const k=[...p.classList].find(C=>C.startsWith("language-"))?.slice(9);let v;if(k==="mermaid")v="mermaid";else if(k==="diagram"||k==="ws-block:diagram")v="diagram";else if(k==="ws-block")try{if(JSON.parse(p.textContent??"").type!=="diagram")continue;v="diagram"}catch{continue}else continue;const w=p.parentElement;if(!w)continue;if(!l){c||(c=!0,Tt(()=>import("./DCQ9cJhS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80]),import.meta.url).then(C=>{l=C.default,c=!1,_()}).catch(C=>{c=!1,Se.error("Failed to load the Markdown diagram renderer",{error:C})}));return}const M=document.createElement("div");M.dataset.markdownDiagram=v,w.replaceWith(M);const T=Pe(l,{target:M,context:n.context,props:{kind:v,source:p.textContent??"",workspaceId:n.workspaceId}});s.set(M,{component:T,source:w})}}}const I=new MutationObserver(_);return I.observe(r,{childList:!0,subtree:!0}),queueMicrotask(_),{update(p){(n.enabled!==p.enabled||n.workspaceId!==p.workspaceId)&&f(),n=p,_()},destroy(){u=!0,I.disconnect(),f()}}}var Fr=j('<span class="min-w-0 max-w-full truncate"> </span>'),Cr=j('<span class="type-caption flex min-w-0 max-w-full items-start gap-2 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-loading-placeholder"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="flex min-w-0 flex-wrap items-baseline gap-x-1.5"><span> </span> <!></span></span>');function At(r,o){if(new.target)return Ue({component:At,...r});Ne(o,!0);let n=x(o,"name",7);var l={get name(){return n()},set name(v){n(v),F()},$set:ze,$on:(v,w)=>Be(o,v,w)},c=Cr(),u=q(c),s=q(u);nr(s,{get icon(){return ar},class:"size-3.5"}),V(u);var f=Z(u,2),_=q(f),I=He(_,!0),p=Z(_,2);{var k=v=>{var w=Fr(),M=He(w,!0);_e(w,(T,C)=>or?.(T,C),n),te(()=>Ze(M,n())),W(v,w)};X(p,v=>{n()&&v(k)})}return V(f),V(c),te(v=>Ze(I,v),[()=>Le.ui_mediaLoadingPlaceholder_title_label()]),W(r,c),Oe(l)}const mt="markdown-image-frame";function Er(r,o){const n=new Map,l=new Map,c=new Map,u=[300,1e3];let s=!1;function f(t){let d=l.get(t);return d||(d={source:t.getAttribute("src")||"",workspaceId:o.getWorkspaceId(),retries:0,failureHandled:!1},l.set(t,d)),d}function _(t){const d=f(t);return!s&&r.contains(d.fallbackHost??t)&&d.workspaceId===o.getWorkspaceId()&&o.canUseMedia(d.source)&&!t.hasAttribute("data-media-unavailable")&&!t.hasAttribute("data-media-unsupported")&&at(d.source)!==null}function I(t,d=!1){if(!_(t))return;const m=f(t),h=at(m.source);if(!h)return;const E=m.fallbackHost,U=E?.contains(document.activeElement)??!1;if(m.failureHandled=!1,m.fallbackHost=void 0,d&&(m.retries=0),t.removeAttribute("src"),t.setAttribute("src",h),E){const O=n.get(E);O&&be(O),n.delete(E),E.replaceWith(t),M(),U&&r.contains(t)&&t.focus()}}function p(t){const d=f(t);s||!r.contains(t)||d.failureHandled||(d.failureHandled=!0,_(t)&&d.retries<u.length?d.timer=setTimeout(()=>{d.timer=void 0,I(t)},u[d.retries++]):w(t,"load-failed"))}function k(t){const d=t.parentElement;return d?.classList.contains(mt)?d:null}function v(t){const d=Number(t.getAttribute("width")),m=Number(t.getAttribute("height"));if(!(d>0&&m>0))return;const h=document.createElement("span");h.className=mt,h.style.aspectRatio=`${d} / ${m}`,h.style.setProperty("--image-aspect-ratio",`${d} / ${m}`),h.style.setProperty("--image-width",`${d}px`),h.dataset.loaded="false",t.replaceWith(h),h.appendChild(t);const E=h.appendChild(document.createElement("span"));E.className="markdown-image-frame-placeholder",n.set(E,Pe(At,{target:E,props:{name:yr(t,o.getWorkspaceId())}}));const U=()=>{if(c.delete(t),s||!r.contains(h))return;h.dataset.loaded="true";const O=n.get(E);O&&(be(O),n.delete(E)),E.remove()};t.complete&&t.naturalWidth>0?U():(c.set(t,U),t.addEventListener("load",U,{once:!0}))}function w(t,d){const m=t.getAttribute("src")||t.getAttribute("data-media-src")||"",h=Fe(m),E=kt(m,o.getWorkspaceId()),U=h?.path??E?.path,O=h?.workspaceId??E?.workspaceId,ve=t.getAttribute("data-name")||t.getAttribute("alt")||U?.split("/").pop()||void 0,D=document.createElement(t instanceof HTMLVideoElement?"div":"span");D.className="media-unavailable-host",(k(t)??t).replaceWith(D),o.onMediaRemoved(t);let ae;if(t instanceof HTMLImageElement&&d==="load-failed"){const oe=f(t);oe.fallbackHost=D,_(t)&&(ae=()=>I(t,!0))}const K=Pe(Qe,{target:D,props:{name:ve,reason:d,path:U,workspaceId:O,onRetry:ae}});if(n.set(D,K),t instanceof HTMLVideoElement){D.classList.add("flex","items-center","gap-2");const oe=D.appendChild(document.createElement("span"));n.set(oe,Pe(Ye,{target:oe,props:{videoUrl:m,videoName:ve,sourceKind:"workspace",mimeType:Me(m,o.getWorkspaceId())?.mimeType}}))}}function M(){if(!s){for(const t of r.querySelectorAll("img"))Ae(t)&&!t.closest("a")&&(t.tabIndex=0,t.setAttribute("role","button")),!(t.hasAttribute("data-media-unsupported")||t.hasAttribute("data-media-unavailable"))&&(f(t),t.hasAttribute(_t)&&!k(t)&&v(t),t.getAttribute("src")&&t.complete&&t.naturalWidth===0&&p(t));for(const t of r.querySelectorAll("[data-media-unsupported]"))w(t,"unsupported");for(const t of r.querySelectorAll("[data-media-unavailable]"))w(t,Nt(t));for(const[t,d]of l)r.contains(d.fallbackHost??t)||(d.timer!==void 0&&clearTimeout(d.timer),l.delete(t));for(const[t,d]of c)r.contains(t)||(t.removeEventListener("load",d),c.delete(t));for(const[t,d]of n)r.contains(t)||(be(d),n.delete(t))}}function T(t){const d=t.target;(d instanceof HTMLImageElement||d instanceof HTMLVideoElement)&&(d instanceof HTMLImageElement?p(d):w(d,"load-failed"))}const C=new MutationObserver(M);return C.observe(r,{childList:!0,subtree:!0}),r.addEventListener("error",T,!0),queueMicrotask(M),{destroy(){s=!0,C.disconnect();for(const t of l.values())t.timer!==void 0&&clearTimeout(t.timer);l.clear();for(const[t,d]of c)t.removeEventListener("load",d);c.clear(),r.removeEventListener("error",T,!0);for(const t of n.values())be(t);n.clear()}}}var Tr=j('<div class="image-actions-overlay absolute z-10 svelte-nzvuq5" data-testid="markdown-image-actions-overlay"><!></div>'),Lr=j("<div></div>"),pt=j('<div role="group"><!> <!></div>'),Pr=j('<div><p class="whitespace-pre-wrap svelte-nzvuq5"> </p></div>'),Sr=j("<!> <!>",1);function gt(r,o){if(new.target)return Ue({component:gt,...r});Ne(o,!0);const n=e=>{var i=Re(),A=ie(i);{var b=P=>{var S=Tr(),ne=q(S);{let N=R(()=>a(B).getAttribute("src")||""),ge=R(()=>a(B).getAttribute("alt")||void 0);Te(Yt(ne,{get imageUrl(){return a(N)},get imageName(){return a(ge)},get open(){return a(fe)},set open(je){y(fe,je,!0)}}),je=>y(Y,je,!0),()=>a(Y))}V(S),Te(S,N=>y(G,N),()=>a(G)),te(()=>Xe(S,`top: ${a(we).top??""}px; right: ${a(we).right??""}px;`)),W(P,S)},L=R(()=>a(B)&&K(a(B).getAttribute("src")||""));X(A,P=>{a(L)&&P(b)})}W(e,i)};let l=x(o,"content",7),c=x(o,"isStreaming",7,!1),u=x(o,"className",7,""),s=x(o,"workspaceId",23,()=>it()?.workspaceId??void 0),f=x(o,"relativeMediaBase",7),_=x(o,"onCodeBlockAction",7),I=x(o,"onFileClick",7),p=x(o,"canOpenFile",7),k=x(o,"allowFileMedia",7,!0),v=x(o,"taskBlockRenderMode",7,"placeholder"),w=x(o,"chatImageThumbnails",7,!1),M=x(o,"forceExternalLinks",7,!1),T=x(o,"renderRichFencesAsCode",7,!1),C=x(o,"renderDiagrams",7,!1),t=x(o,"allowSanitizedHtml",7,!1),d=x(o,"media",7);const m=Ot(),h=St(),E=R(()=>wr(l(),s())),U=R(()=>a(E).some(e=>e.type==="video")),O=R(()=>!a(U)&&a(E).length===1&&a(E)[0].type==="markdown"?a(E)[0].content:l()),ve=R(()=>lr(a(O)));let D=z(null),ae=z("");function K(e){return xe(e,k()&&p()?.()!==!1)}const oe=R(()=>sr(a(ae),k()&&p()?.()!==!1)),Ve=R(()=>$t(a(oe),s(),er)),g=R(()=>`<div class="markdown-content">${a(Ve)}</div>`);let H=0;const ce=150;let se=-1/0,Q=null,re=null;async function de(e,i,A,b){try{const L=await Vt(e,{...i,readOnly:!0});if(b!==H)return;y(ae,xr(L,A,i?.workspaceId,i?.relativeMediaBase),!0)}catch(L){if(b!==H)return;Se.error("Failed to process markdown:",L);const P=e.replace(/[&<>"']/g,S=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[S]||S);y(ae,`<p>${P}</p>`)}}function he(){if(!re)return;const e=ce-(performance.now()-se);if(e>0){Q=setTimeout(()=>{Q=null,he()},e);return}const i=re;re=null,se=performance.now(),i()}function De(){Q!==null&&(clearTimeout(Q),Q=null),re=null,se=-1/0}vt(()=>{const e=a(O),i={allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!0,taskBlockRenderMode:v(),workspaceId:s(),relativeMediaBase:f()??(s()&&s()!==jt?"":void 0),renderRichFencesAsCode:T()||C(),processPrimitives:!C(),allowSanitizedHtml:t(),renderMath:!c(),workspaceFileVersion:m},A=d(),b=++H,L=()=>void de(e,i,A,b);c()?(re=L,Q===null&&he()):(De(),L())});let ue=z(void 0),B=z(null),we=z(Rt({top:0,right:0})),fe=z(!1),Y=z(void 0),G=z(null);function J(e){if(e.type==="mouseover"&&dt(a(B),a(G)))return;const i=e.target,A=Je(i);if(A&&Ae(A)&&K(A.getAttribute("src")||"")){if(a(B)===A)return;y(B,A,!0),y(we,Ir(A,e.currentTarget),!0)}else if(a(B)&&!a(fe)){if(i instanceof Node&&a(G)?.contains(i))return;y(B,null)}}function Ce(){!a(fe)&&!dt(a(B),a(G))&&y(B,null)}function Ee(e){const i=Je(e.target);!i||!Ae(i)||!K(i.getAttribute("src")||"")||(e.preventDefault(),e.stopPropagation(),J(e),y(fe,!0))}function $(e){return Er(e,{getWorkspaceId:()=>s(),canUseMedia:K,onMediaRemoved:i=>{a(B)===i&&y(B,null)}})}function me(e){const i=e.target,A=i.closest("a");if(!A&&i instanceof HTMLImageElement){const L=i.getAttribute("src")||"";if(wt(L)&&K(L)){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a(ue)?.openImage(i);return}}if(A?.href){if(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a(ue)?.openAsset(A))return;const L=pe(e),P=s()?ot(s()):void 0;st(A.href,{workspaceId:P,canOpenFile:p(),sourcePanelId:L,event:e,rawHref:A.getAttribute("href")??void 0,...M()?{forceExternal:!0}:{}});return}const b=Dt(i.closest("[data-mention]"));if(b){const{type:L,meta:P}=b;if(L==="file"&&b.filePath){if(p()?.()===!1)return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const S=b.filePath;Se.debug("[MarkdownViewer] File mention clicked",{filePath:S,meta:P});const ne=pe(e),N=Ge({event:e});if(I())I()(S,{line:b.line,openInAdjacentPanel:N,sourcePanelId:ne});else{const ge=s();ge&&Ke.dispatch(Kt(ge,S,{line:b.line,openInAdjacentPanel:N,sourcePanelId:ne}))}}else if(b.folderPath!==void 0){if(p()?.()===!1||!s())return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),Ke.dispatch(Gt(s(),qt(b.folderPath)))}else if(L==="note"&&b.note){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const S=b.note.id;Se.debug("[MarkdownViewer] Note mention clicked",{noteId:S,meta:P});const ne=pe(e),N=Ge({event:e});if(b.note.workspaceId&&b.note.workspaceId!==s()){st(Xt(S,b.note.workspaceId),{workspaceId:s()?ot(s()):void 0,sourcePanelId:ne,event:e});return}const ge=s();ge&&Ke.dispatch(Jt(ge,S,{openInAdjacentPanel:N,sourcePanelId:ne}))}}}function Ie(e){if(ye(e),!e.defaultPrevented){if(e.target instanceof HTMLImageElement&&Ae(e.target)&&(e.key==="Enter"||e.key===" ")){me(e);return}e.key!=="Enter"||!Ge({event:e})||me(e)}}function ye(e){const i=Je(e.target);!i||!Ae(i)||!K(i.getAttribute("src")||"")||a(Y)?.handleCopy(e,i.getAttribute("src")||"")}function pe(e){const i=e.target;if(i instanceof HTMLElement)return i.closest("[data-panel-id]")?.dataset.panelId}Ht(()=>{H+=1,De()});var qe={get content(){return l()},set content(e){l(e),F()},get isStreaming(){return c()},set isStreaming(e=!1){c(e),F()},get className(){return u()},set className(e=""){u(e),F()},get workspaceId(){return s()},set workspaceId(e=it()?.workspaceId??void 0){s(e),F()},get relativeMediaBase(){return f()},set relativeMediaBase(e){f(e),F()},get onCodeBlockAction(){return _()},set onCodeBlockAction(e){_(e),F()},get onFileClick(){return I()},set onFileClick(e){I(e),F()},get canOpenFile(){return p()},set canOpenFile(e){p(e),F()},get allowFileMedia(){return k()},set allowFileMedia(e=!0){k(e),F()},get taskBlockRenderMode(){return v()},set taskBlockRenderMode(e="placeholder"){v(e),F()},get chatImageThumbnails(){return w()},set chatImageThumbnails(e=!1){w(e),F()},get forceExternalLinks(){return M()},set forceExternalLinks(e=!1){M(e),F()},get renderRichFencesAsCode(){return T()},set renderRichFencesAsCode(e=!1){T(e),F()},get renderDiagrams(){return C()},set renderDiagrams(e=!1){C(e),F()},get allowSanitizedHtml(){return t()},set allowSanitizedHtml(e=!1){t(e),F()},get media(){return d()},set media(e){d(e),F()},$set:ze,$on:(e,i)=>Be(o,e,i)},$e=Sr(),et=ie($e);{var Mt=e=>{var i=Lr();Wt(i,21,()=>a(E),Ut,(A,b)=>{var L=Re(),P=ie(L);{var S=N=>{yt(N,{get allowFileMedia(){return k()},get canOpenFile(){return p()},get source(){return a(b).source},get name(){return a(b).name},get poster(){return a(b).poster}})},ne=N=>{gt(N,{get content(){return a(b).content},get isStreaming(){return c()},get workspaceId(){return s()},get relativeMediaBase(){return f()},get onCodeBlockAction(){return _()},get onFileClick(){return I()},get canOpenFile(){return p()},get allowFileMedia(){return k()},get taskBlockRenderMode(){return v()},get chatImageThumbnails(){return w()},get forceExternalLinks(){return M()},get renderRichFencesAsCode(){return T()},get renderDiagrams(){return C()},get allowSanitizedHtml(){return t()},get media(){return d()}})};X(P,N=>{a(b).type==="video"?N(S):N(ne,-1)})}W(A,L)}),V(i),te(()=>le(i,1,`markdown-video-segments ${u()??""}`,"svelte-nzvuq5")),W(e,i)},xt=e=>{var i=pt();let A;var b=q(i);tt(b,()=>a(g));var L=Z(b,2);n(L),V(i),_e(i,P=>$?.(P)),_e(i,(P,S)=>ft?.(P,S),()=>({enabled:C(),workspaceId:s(),context:h})),te(()=>A=le(i,1,`markdown-viewer streaming-content ${u()??""}`,"svelte-nzvuq5",A,{"chat-image-thumbnails":w()})),ee("click",i,me),ee("keydown",i,Ie),ke("copy",i,ye),ee("contextmenu",i,Ee),ee("mouseover",i,J),ee("focusin",i,J),ke("mouseleave",i,Ce),W(e,i)},Ft=e=>{var i=Pr(),A=q(i),b=He(A,!0);V(i),te(()=>{le(i,1,`markdown-viewer simple-content ${u()??""}`,"svelte-nzvuq5"),Ze(b,a(O))}),W(e,i)},Ct=e=>{var i=pt();let A;var b=q(i);tt(b,()=>a(g));var L=Z(b,2);n(L),V(i),Te(i,P=>y(D,P),()=>a(D)),_e(i,P=>$?.(P)),_e(i,(P,S)=>ft?.(P,S),()=>({enabled:C(),workspaceId:s(),context:h})),te(()=>A=le(i,1,`markdown-viewer static-content ${u()??""}`,"svelte-nzvuq5",A,{"chat-image-thumbnails":w()})),ee("click",i,me),ee("keydown",i,Ie),ke("copy",i,ye),ee("contextmenu",i,Ee),ee("mouseover",i,J),ee("focusin",i,J),ke("mouseleave",i,Ce),W(e,i)};X(et,e=>{a(U)?e(Mt):c()?e(xt,1):a(ve)==="simple"&&!t()?e(Ft,2):e(Ct,-1)})}var Et=Z(et,2);return Te(It(Et,{get workspaceId(){return s()},canUseMedia:K}),e=>y(ue,e,!0),()=>a(ue)),W(r,$e),Oe(qe)}Pt(["click","keydown","contextmenu","mouseover","focusin"]);export{yt as C,gt as M,At as a,wr as s};
|