@futdevpro/ccap 1.1.3013 → 1.1.3017
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/client-dist/{agent-instances.module-SZDIKSIR.js → agent-instances.module-GXI5C7RC.js} +2 -2
- package/client-dist/{ca.module-JYSD4TBY.js → ca.module-7MSOXU4H.js} +2 -2
- package/client-dist/{cc-usage-dashboard.component-O4VDGFYY.js → cc-usage-dashboard.component-WAKL4P64.js} +2 -2
- package/client-dist/{cc.module-HHIOLYUZ.js → cc.module-NKLHEB6W.js} +2 -2
- package/client-dist/{chunk-THHGTIDJ.js → chunk-2W6RW3QK.js} +2 -2
- package/client-dist/{chunk-PBI4ECTK.js → chunk-3CQJJOVQ.js} +2 -2
- package/client-dist/{chunk-DC4EFEQU.js → chunk-45CD3DPM.js} +2 -2
- package/client-dist/{chunk-2V2O2JAL.js → chunk-4LTURLV4.js} +2 -2
- package/client-dist/{chunk-A6TWPSUA.js → chunk-4LZT5VNB.js} +2 -2
- package/client-dist/{chunk-3KB6O77F.js → chunk-7J4Y4RRY.js} +2 -2
- package/client-dist/{chunk-G5CYHOH4.js → chunk-7LZ73Q2C.js} +2 -2
- package/client-dist/{chunk-NLYXP47X.js → chunk-AUFQ5CVV.js} +2 -2
- package/client-dist/{chunk-BKR6H3SJ.js → chunk-C3OAUZP4.js} +2 -2
- package/client-dist/{chunk-BWW75POL.js → chunk-CL6KKUAZ.js} +2 -2
- package/client-dist/{chunk-KM4V4ZQZ.js → chunk-CSFYWCWX.js} +2 -2
- package/client-dist/{chunk-KYW5YFHW.js → chunk-CZ3UBPTJ.js} +2 -2
- package/client-dist/{chunk-APYQ4B27.js → chunk-DPP6QLQX.js} +2 -2
- package/client-dist/{chunk-FD6QRJ7H.js → chunk-DUZIRE6Y.js} +2 -2
- package/client-dist/{chunk-QFD5FURA.js → chunk-FEPP5JND.js} +2 -2
- package/client-dist/{chunk-AVH4FZ6Z.js → chunk-FLTTEKSN.js} +2 -2
- package/client-dist/{chunk-2BZ4R623.js → chunk-FQ7VQRGH.js} +2 -2
- package/client-dist/{chunk-KB4N3NQJ.js → chunk-GCFDSLMG.js} +2 -2
- package/client-dist/{chunk-5UADYWSA.js → chunk-GUKJSZAY.js} +2 -2
- package/client-dist/{chunk-5Z43LN5U.js → chunk-HENK43DJ.js} +2 -2
- package/client-dist/{chunk-YR6NTERF.js → chunk-I7BQNGDL.js} +2 -2
- package/client-dist/{chunk-5ATMD4SY.js → chunk-IH7DUL5D.js} +2 -2
- package/client-dist/{chunk-GPAB3FYW.js → chunk-INL4UDD6.js} +2 -2
- package/client-dist/{chunk-ZTXRLQE6.js → chunk-IOI6MXZ6.js} +2 -2
- package/client-dist/{chunk-NGFX2IRI.js → chunk-IQ2IHF4M.js} +2 -2
- package/client-dist/{chunk-GB5ESWPG.js → chunk-IRELUJYN.js} +2 -2
- package/client-dist/{chunk-LUJCXLWT.js → chunk-JKHAXZVP.js} +2 -2
- package/client-dist/{chunk-GWFZKTPN.js → chunk-KQKTJVOB.js} +2 -2
- package/client-dist/{chunk-NH77DCAE.js → chunk-LDTWJ7F2.js} +2 -2
- package/client-dist/{chunk-EVREGV4D.js → chunk-LWYOOBW7.js} +2 -2
- package/client-dist/{chunk-5GTIJO5T.js → chunk-MD4SAL4G.js} +2 -2
- package/client-dist/{chunk-7FGU7NN2.js → chunk-MJ4CF3KE.js} +2 -2
- package/client-dist/{chunk-X2RTRMJW.js → chunk-MJ5UWAPM.js} +2 -2
- package/client-dist/{chunk-P3IBAIKH.js → chunk-MWLTXVGI.js} +2 -2
- package/client-dist/{chunk-6JLLWGQF.js → chunk-N2WZOE4Z.js} +2 -2
- package/client-dist/{chunk-HK42XXL4.js → chunk-OP47TTX7.js} +2 -2
- package/client-dist/{chunk-B24YBK2I.js → chunk-P3RUGFGI.js} +2 -2
- package/client-dist/{chunk-GKKG77XM.js → chunk-PXM26PIY.js} +2 -2
- package/client-dist/{chunk-NEGX5HML.js → chunk-QFRQP5FE.js} +2 -2
- package/client-dist/{chunk-RKWECXJW.js → chunk-QSDKJ7SH.js} +2 -2
- package/client-dist/{chunk-QGUF3JAC.js → chunk-QYTLOX6L.js} +2 -2
- package/client-dist/{chunk-6HMRYXOI.js → chunk-S6QKTKFK.js} +2 -2
- package/client-dist/{chunk-WI4NEQOH.js → chunk-SFFDZ5GE.js} +2 -2
- package/client-dist/{chunk-M5ZAOY2Y.js → chunk-SQQ3IEKB.js} +2 -2
- package/client-dist/{chunk-HHHXXHAW.js → chunk-THJC2TOK.js} +2 -2
- package/client-dist/{chunk-HHHXXHAW.js.map → chunk-THJC2TOK.js.map} +1 -1
- package/client-dist/{chunk-4ZEPJMCK.js → chunk-U4VT4P2X.js} +2 -2
- package/client-dist/{chunk-GHUVIUFQ.js → chunk-VHFWT6YD.js} +2 -2
- package/client-dist/{chunk-X4RAIC74.js → chunk-VQMWZUNT.js} +2 -2
- package/client-dist/{chunk-EEOSB2P7.js → chunk-W2QIDL6G.js} +2 -2
- package/client-dist/{chunk-BGD62M7R.js → chunk-WXY4G6D6.js} +2 -2
- package/client-dist/{chunk-MJJNEYN2.js → chunk-WY6NC7W6.js} +2 -2
- package/client-dist/{chunk-72Z4K7WC.js → chunk-X7QMURF5.js} +2 -2
- package/client-dist/{chunk-GERQQL7M.js → chunk-XCXROW7M.js} +2 -2
- package/client-dist/{chunk-XJDLUP33.js → chunk-XFNHCEJC.js} +2 -2
- package/client-dist/{chunk-QF6DLZ66.js → chunk-XODBV7IE.js} +2 -2
- package/client-dist/{chunk-TZIBF6RE.js → chunk-YUERPBPZ.js} +2 -2
- package/client-dist/{consultant.module-UR6QVGHX.js → consultant.module-H4WF4E4O.js} +2 -2
- package/client-dist/{crd.module-VBL7AIQU.js → crd.module-L6ILT7UL.js} +2 -2
- package/client-dist/{dashboard.module-NM4D5NW3.js → dashboard.module-PYRHFUGW.js} +2 -2
- package/client-dist/{do.module-IILFMQ4A.js → do.module-AW6MCJ4R.js} +2 -2
- package/client-dist/{document-library.module-2DB3MQAW.js → document-library.module-7E5SYEQL.js} +2 -2
- package/client-dist/{embedding-eval.module-WSWE67IJ.js → embedding-eval.module-7MAQ5LOD.js} +2 -2
- package/client-dist/{embedding-registry.module-SG3ZJKPN.js → embedding-registry.module-ONTM3T6J.js} +2 -2
- package/client-dist/{err.module-ALQB32AB.js → err.module-LHHTM2VD.js} +2 -2
- package/client-dist/{feedback.module-Y2YSFOAJ.js → feedback.module-AXNU7RQB.js} +2 -2
- package/client-dist/{host-runtime-mcp.module-YZ6D6IOC.js → host-runtime-mcp.module-URNURR3F.js} +2 -2
- package/client-dist/index.html +1 -1
- package/client-dist/{live-dev-pipeline.module-2IEAOW5B.js → live-dev-pipeline.module-UM3CQWZT.js} +2 -2
- package/client-dist/{logs.module-6654WNYH.js → logs.module-WFXYGGAR.js} +2 -2
- package/client-dist/{main-P264JJGJ.js → main-3I7QQ2I2.js} +3 -3
- package/client-dist/{master-control-remote-poc.module-CKHW6KMI.js → master-control-remote-poc.module-PUREWYTC.js} +2 -2
- package/client-dist/{mobile-app.module-LLBTOC54.js → mobile-app.module-PKGY4LSW.js} +2 -2
- package/client-dist/{model-registry.module-MLQXILLQ.js → model-registry.module-JUX6TJBT.js} +2 -2
- package/client-dist/{oc.module-IBQUD7B7.js → oc.module-ERDTFNSS.js} +2 -2
- package/client-dist/{orc.module-EHJZJMOJ.js → orc.module-4CJ2K4LA.js} +2 -2
- package/client-dist/{project-management.module-QW2OUHID.js → project-management.module-CRAHUYJW.js} +2 -2
- package/client-dist/project-source-routed.module-FWN55D6I.js +2 -0
- package/client-dist/{scheduler.module-3ZZRNJUV.js → scheduler.module-QDNZ5N2B.js} +2 -2
- package/client-dist/{session.module-N6ITSDGW.js → session.module-IXGG4RUI.js} +2 -2
- package/client-dist/{set.module-DQOBFJCH.js → set.module-4LXYJXP3.js} +2 -2
- package/client-dist/{setup.module-R2TZA42H.js → setup.module-FRYK4ZYA.js} +2 -2
- package/client-dist/{terminals.module-4NZBPA65.js → terminals.module-IPW7LB62.js} +2 -2
- package/client-dist/{voice-notes-poc.module-UZUWDFZD.js → voice-notes-poc.module-NWWC6IZS.js} +2 -2
- package/client-dist/{wfs.module-4GKFJ5LB.js → wfs.module-B4JX7EVH.js} +2 -2
- package/package.json +1 -1
- package/client-dist/project-source-routed.module-ZRIGHKPE.js +0 -2
- /package/client-dist/{agent-instances.module-SZDIKSIR.js.map → agent-instances.module-GXI5C7RC.js.map} +0 -0
- /package/client-dist/{ca.module-JYSD4TBY.js.map → ca.module-7MSOXU4H.js.map} +0 -0
- /package/client-dist/{cc-usage-dashboard.component-O4VDGFYY.js.map → cc-usage-dashboard.component-WAKL4P64.js.map} +0 -0
- /package/client-dist/{cc.module-HHIOLYUZ.js.map → cc.module-NKLHEB6W.js.map} +0 -0
- /package/client-dist/{chunk-THHGTIDJ.js.map → chunk-2W6RW3QK.js.map} +0 -0
- /package/client-dist/{chunk-PBI4ECTK.js.map → chunk-3CQJJOVQ.js.map} +0 -0
- /package/client-dist/{chunk-DC4EFEQU.js.map → chunk-45CD3DPM.js.map} +0 -0
- /package/client-dist/{chunk-2V2O2JAL.js.map → chunk-4LTURLV4.js.map} +0 -0
- /package/client-dist/{chunk-A6TWPSUA.js.map → chunk-4LZT5VNB.js.map} +0 -0
- /package/client-dist/{chunk-3KB6O77F.js.map → chunk-7J4Y4RRY.js.map} +0 -0
- /package/client-dist/{chunk-G5CYHOH4.js.map → chunk-7LZ73Q2C.js.map} +0 -0
- /package/client-dist/{chunk-NLYXP47X.js.map → chunk-AUFQ5CVV.js.map} +0 -0
- /package/client-dist/{chunk-BKR6H3SJ.js.map → chunk-C3OAUZP4.js.map} +0 -0
- /package/client-dist/{chunk-BWW75POL.js.map → chunk-CL6KKUAZ.js.map} +0 -0
- /package/client-dist/{chunk-KM4V4ZQZ.js.map → chunk-CSFYWCWX.js.map} +0 -0
- /package/client-dist/{chunk-KYW5YFHW.js.map → chunk-CZ3UBPTJ.js.map} +0 -0
- /package/client-dist/{chunk-APYQ4B27.js.map → chunk-DPP6QLQX.js.map} +0 -0
- /package/client-dist/{chunk-FD6QRJ7H.js.map → chunk-DUZIRE6Y.js.map} +0 -0
- /package/client-dist/{chunk-QFD5FURA.js.map → chunk-FEPP5JND.js.map} +0 -0
- /package/client-dist/{chunk-AVH4FZ6Z.js.map → chunk-FLTTEKSN.js.map} +0 -0
- /package/client-dist/{chunk-2BZ4R623.js.map → chunk-FQ7VQRGH.js.map} +0 -0
- /package/client-dist/{chunk-KB4N3NQJ.js.map → chunk-GCFDSLMG.js.map} +0 -0
- /package/client-dist/{chunk-5UADYWSA.js.map → chunk-GUKJSZAY.js.map} +0 -0
- /package/client-dist/{chunk-5Z43LN5U.js.map → chunk-HENK43DJ.js.map} +0 -0
- /package/client-dist/{chunk-YR6NTERF.js.map → chunk-I7BQNGDL.js.map} +0 -0
- /package/client-dist/{chunk-5ATMD4SY.js.map → chunk-IH7DUL5D.js.map} +0 -0
- /package/client-dist/{chunk-GPAB3FYW.js.map → chunk-INL4UDD6.js.map} +0 -0
- /package/client-dist/{chunk-ZTXRLQE6.js.map → chunk-IOI6MXZ6.js.map} +0 -0
- /package/client-dist/{chunk-NGFX2IRI.js.map → chunk-IQ2IHF4M.js.map} +0 -0
- /package/client-dist/{chunk-GB5ESWPG.js.map → chunk-IRELUJYN.js.map} +0 -0
- /package/client-dist/{chunk-LUJCXLWT.js.map → chunk-JKHAXZVP.js.map} +0 -0
- /package/client-dist/{chunk-GWFZKTPN.js.map → chunk-KQKTJVOB.js.map} +0 -0
- /package/client-dist/{chunk-NH77DCAE.js.map → chunk-LDTWJ7F2.js.map} +0 -0
- /package/client-dist/{chunk-EVREGV4D.js.map → chunk-LWYOOBW7.js.map} +0 -0
- /package/client-dist/{chunk-5GTIJO5T.js.map → chunk-MD4SAL4G.js.map} +0 -0
- /package/client-dist/{chunk-7FGU7NN2.js.map → chunk-MJ4CF3KE.js.map} +0 -0
- /package/client-dist/{chunk-X2RTRMJW.js.map → chunk-MJ5UWAPM.js.map} +0 -0
- /package/client-dist/{chunk-P3IBAIKH.js.map → chunk-MWLTXVGI.js.map} +0 -0
- /package/client-dist/{chunk-6JLLWGQF.js.map → chunk-N2WZOE4Z.js.map} +0 -0
- /package/client-dist/{chunk-HK42XXL4.js.map → chunk-OP47TTX7.js.map} +0 -0
- /package/client-dist/{chunk-B24YBK2I.js.map → chunk-P3RUGFGI.js.map} +0 -0
- /package/client-dist/{chunk-GKKG77XM.js.map → chunk-PXM26PIY.js.map} +0 -0
- /package/client-dist/{chunk-NEGX5HML.js.map → chunk-QFRQP5FE.js.map} +0 -0
- /package/client-dist/{chunk-RKWECXJW.js.map → chunk-QSDKJ7SH.js.map} +0 -0
- /package/client-dist/{chunk-QGUF3JAC.js.map → chunk-QYTLOX6L.js.map} +0 -0
- /package/client-dist/{chunk-6HMRYXOI.js.map → chunk-S6QKTKFK.js.map} +0 -0
- /package/client-dist/{chunk-WI4NEQOH.js.map → chunk-SFFDZ5GE.js.map} +0 -0
- /package/client-dist/{chunk-M5ZAOY2Y.js.map → chunk-SQQ3IEKB.js.map} +0 -0
- /package/client-dist/{chunk-4ZEPJMCK.js.map → chunk-U4VT4P2X.js.map} +0 -0
- /package/client-dist/{chunk-GHUVIUFQ.js.map → chunk-VHFWT6YD.js.map} +0 -0
- /package/client-dist/{chunk-X4RAIC74.js.map → chunk-VQMWZUNT.js.map} +0 -0
- /package/client-dist/{chunk-EEOSB2P7.js.map → chunk-W2QIDL6G.js.map} +0 -0
- /package/client-dist/{chunk-BGD62M7R.js.map → chunk-WXY4G6D6.js.map} +0 -0
- /package/client-dist/{chunk-MJJNEYN2.js.map → chunk-WY6NC7W6.js.map} +0 -0
- /package/client-dist/{chunk-72Z4K7WC.js.map → chunk-X7QMURF5.js.map} +0 -0
- /package/client-dist/{chunk-GERQQL7M.js.map → chunk-XCXROW7M.js.map} +0 -0
- /package/client-dist/{chunk-XJDLUP33.js.map → chunk-XFNHCEJC.js.map} +0 -0
- /package/client-dist/{chunk-QF6DLZ66.js.map → chunk-XODBV7IE.js.map} +0 -0
- /package/client-dist/{chunk-TZIBF6RE.js.map → chunk-YUERPBPZ.js.map} +0 -0
- /package/client-dist/{consultant.module-UR6QVGHX.js.map → consultant.module-H4WF4E4O.js.map} +0 -0
- /package/client-dist/{crd.module-VBL7AIQU.js.map → crd.module-L6ILT7UL.js.map} +0 -0
- /package/client-dist/{dashboard.module-NM4D5NW3.js.map → dashboard.module-PYRHFUGW.js.map} +0 -0
- /package/client-dist/{do.module-IILFMQ4A.js.map → do.module-AW6MCJ4R.js.map} +0 -0
- /package/client-dist/{document-library.module-2DB3MQAW.js.map → document-library.module-7E5SYEQL.js.map} +0 -0
- /package/client-dist/{embedding-eval.module-WSWE67IJ.js.map → embedding-eval.module-7MAQ5LOD.js.map} +0 -0
- /package/client-dist/{embedding-registry.module-SG3ZJKPN.js.map → embedding-registry.module-ONTM3T6J.js.map} +0 -0
- /package/client-dist/{err.module-ALQB32AB.js.map → err.module-LHHTM2VD.js.map} +0 -0
- /package/client-dist/{feedback.module-Y2YSFOAJ.js.map → feedback.module-AXNU7RQB.js.map} +0 -0
- /package/client-dist/{host-runtime-mcp.module-YZ6D6IOC.js.map → host-runtime-mcp.module-URNURR3F.js.map} +0 -0
- /package/client-dist/{live-dev-pipeline.module-2IEAOW5B.js.map → live-dev-pipeline.module-UM3CQWZT.js.map} +0 -0
- /package/client-dist/{logs.module-6654WNYH.js.map → logs.module-WFXYGGAR.js.map} +0 -0
- /package/client-dist/{main-P264JJGJ.js.map → main-3I7QQ2I2.js.map} +0 -0
- /package/client-dist/{master-control-remote-poc.module-CKHW6KMI.js.map → master-control-remote-poc.module-PUREWYTC.js.map} +0 -0
- /package/client-dist/{mobile-app.module-LLBTOC54.js.map → mobile-app.module-PKGY4LSW.js.map} +0 -0
- /package/client-dist/{model-registry.module-MLQXILLQ.js.map → model-registry.module-JUX6TJBT.js.map} +0 -0
- /package/client-dist/{oc.module-IBQUD7B7.js.map → oc.module-ERDTFNSS.js.map} +0 -0
- /package/client-dist/{orc.module-EHJZJMOJ.js.map → orc.module-4CJ2K4LA.js.map} +0 -0
- /package/client-dist/{project-management.module-QW2OUHID.js.map → project-management.module-CRAHUYJW.js.map} +0 -0
- /package/client-dist/{project-source-routed.module-ZRIGHKPE.js.map → project-source-routed.module-FWN55D6I.js.map} +0 -0
- /package/client-dist/{scheduler.module-3ZZRNJUV.js.map → scheduler.module-QDNZ5N2B.js.map} +0 -0
- /package/client-dist/{session.module-N6ITSDGW.js.map → session.module-IXGG4RUI.js.map} +0 -0
- /package/client-dist/{set.module-DQOBFJCH.js.map → set.module-4LXYJXP3.js.map} +0 -0
- /package/client-dist/{setup.module-R2TZA42H.js.map → setup.module-FRYK4ZYA.js.map} +0 -0
- /package/client-dist/{terminals.module-4NZBPA65.js.map → terminals.module-IPW7LB62.js.map} +0 -0
- /package/client-dist/{voice-notes-poc.module-UZUWDFZD.js.map → voice-notes-poc.module-NWWC6IZS.js.map} +0 -0
- /package/client-dist/{wfs.module-4GKFJ5LB.js.map → wfs.module-B4JX7EVH.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ne}from"./chunk-Q2PKIGLB.js";import{g as fe}from"./chunk-A6TWPSUA.js";import{a as ue}from"./chunk-7JUIBZEE.js";import{a as me}from"./chunk-C7XPBJTG.js";import{a as te}from"./chunk-YR6NTERF.js";import{o as B,p as L,v as ce}from"./chunk-EO4DNTT4.js";import{f as _e}from"./chunk-X2RTRMJW.js";import{a as R}from"./chunk-5UPNU54P.js";import{I as pe}from"./chunk-HHHXXHAW.js";import{$a as X,C as v,D as y,E as oe,Fa as s,Ga as h,Ha as x,I as re,Ia as V,J as D,Ja as le,K as w,Kb as de,L as E,M as j,Z as l,a as J,aa as u,b as K,bb as Q,da as _,ga as C,ha as H,hb as Z,ia as O,ja as k,k as I,la as c,na as U,oa as b,p as F,pa as P,qa as i,ra as o,sa as m,sb as ee,ua as M,ub as ae,va as S,wa as p,xb as se,y as Y,z as ie}from"./chunk-TBMJSIBB.js";var A="ccap-projectSource",T=class{static savePanelWidth(a,e){R.writeNumber(`${A}:panelWidth:${a}`,e)}static loadPanelWidth(a,e){return R.readNumber(`${A}:panelWidth:${a}`,e)}static savePanelOpen(a,e){R.writeBoolean(`${A}:panelOpen:${a}`,e)}static loadPanelOpen(a,e){return R.readBoolean(`${A}:panelOpen:${a}`,e)}static saveSelectedProjectId(a){R.writeString(`${A}:selectedProjectId`,a)}static loadSelectedProjectId(){return R.readString(`${A}:selectedProjectId`)??""}static saveExpandedFolders(a){R.writeJson(`${A}:expandedFolders`,a)}static loadExpandedFolders(){let a=R.readJson(`${A}:expandedFolders`,[]);return Array.isArray(a)?a:[]}static saveOpenTabIds(a){R.writeJson(`${A}:openTabIds`,a)}static loadOpenTabIds(){let a=R.readJson(`${A}:openTabIds`,[]);return Array.isArray(a)?a:[]}static saveActiveTabId(a){R.writeString(`${A}:activeTabId`,a)}static loadActiveTabId(){return R.readString(`${A}:activeTabId`)??""}};var he=(()=>{class t{baseUrl=`${pe.api.baseUrl}/project-source`;http=v(se);startIngestion(e){return this.http.post(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/ingest`,{mode:e.mode})}listIngestionRuns(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/ingestion-runs`)}getIngestionStatus(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/ingestion-status`)}listFiles(e){let n=new URLSearchParams;e.sourceType&&n.set("sourceType",e.sourceType),e.projectPart&&n.set("projectPart",e.projectPart),e.moduleName&&n.set("moduleName",e.moduleName),e.fileRole&&n.set("fileRole",e.fileRole),e.requirementCode&&n.set("requirementCode",e.requirementCode),e.search&&n.set("search",e.search);let r=n.toString(),d=`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/files${r?"?"+r:""}`;return this.http.get(d)}getFileDetail(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/files/${encodeURIComponent(e.fileId)}`)}getRequirementCodes(e){let n=e.codePrefix?`?codePrefix=${encodeURIComponent(e.codePrefix)}`:"";return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/requirement-codes${n}`)}getStats(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/stats`)}getModules(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/modules`)}deleteProjectData(e){return this.http.delete(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}`)}startEmbedding(e){return this.http.post(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/embed`,{registryEntryId:e.registryEntryId})}getEmbeddingStatus(e){let n=`?registryEntryId=${encodeURIComponent(e.registryEntryId)}`;return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/embedding-status${n}`)}search(e){return this.http.post(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/search`,{registryEntryId:e.registryEntryId,query:e.query,topK:e.topK??10,metric:e.metric??"cosine",filters:e.filters})}listRelations(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/relations`)}getRelationsForFile(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/files/${encodeURIComponent(e.fileId)}/relations`)}listRunFlows(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/run-flows`)}listDataFlows(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/data-flows`)}listDescriptions(e){let n=e.elementType?`?elementType=${encodeURIComponent(e.elementType)}`:"";return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/descriptions${n}`)}updateDescription(e){return this.http.put(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/descriptions/${encodeURIComponent(e.descId)}`,{description:e.description})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var G=class t{static buildFileTree(a){let e=new Map,n=[];for(let r of a.files){let d=r.relativePath.split("/"),f=n,$="";for(let W=0;W<d.length-1;W++){$=$?$+"/"+d[W]:d[W];let z=e.get($);z||(z={path:$,name:d[W],isFolder:!0,children:[],file:null,fileCount:0},e.set($,z),f.push(z)),f=z.children}let q=d[d.length-1];f.push({path:r.relativePath,name:q,isFolder:!1,children:[],file:r,fileCount:0})}return t.sortAndCount({nodes:n}),n}static filterTreeBySearch(a){if(!a.query.trim())return a.nodes;let e=te.normalizeForSearch(a.query);return t.filterNodes({nodes:a.nodes,normalizedQuery:e})}static sortAndCount(a){let e=0;a.nodes.sort((n,r)=>n.isFolder&&!r.isFolder?-1:!n.isFolder&&r.isFolder?1:n.name.localeCompare(r.name));for(let n of a.nodes)n.isFolder?(n.fileCount=t.sortAndCount({nodes:n.children}),e+=n.fileCount):e++;return e}static filterNodes(a){let e=[];for(let n of a.nodes){let r=te.normalizeForSearch(n.name).includes(a.normalizedQuery);if(n.isFolder){let d=t.filterNodes({nodes:n.children,normalizedQuery:a.normalizedQuery});(d.length>0||r)&&e.push(K(J({},n),{children:d.length>0?d:n.children,fileCount:d.reduce((f,$)=>f+($.isFolder?$.fileCount:1),0)}))}else r&&e.push(n)}return e}};var g=(()=>{class t{selectedProjectId_$=u(null);projects_$=u([]);stats_$=u(null);latestRun_$=u(null);isIngesting_$=u(!1);files_$=u([]);filesTotal_$=u(0);fileTree_$=u([]);expandedFolders_$=u(new Set);treeSearchQuery_$=u("");openTabs_$=u([]);activeTabId_$=u(null);tabFileCache=new Map;selectedFile_$=u(null);selectedFileChunks_$=u([]);selectedChunkIndex_$=u(null);requirementCodes_$=u([]);availableModules_$=u([]);filterSourceType_$=u("");filterProjectPart_$=u("");filterModule_$=u("");filterFileRole_$=u("");filterReqCode_$=u("");filterSearch_$=u("");isFileTreeOpen_$=u(!0);isInfoPanelOpen_$=u(!0);isEmbedded_$=u(!1);isSearchPanelOpen_$=u(!1);embeddingStatus_$=u(null);isEmbedding_$=u(!1);searchQuery_$=u("");searchResults_$=u([]);isSearching_$=u(!1);selectedRegistryEntryId_$=u(null);relations_$=u([]);runFlows_$=u([]);dataFlows_$=u([]);descriptions_$=u([]);searchMetric_$=u("cosine");isLoading_$=u(!1);error_$=u(null);ps_AS=v(he);pm_AS=v(_e);statusPollTimer=null;loadProjects(){return I(this,null,function*(){try{let n=((yield this.pm_AS.listProjects()).projects??[]).filter(r=>r.localPath&&r.isActive).map(r=>({id:r._id??"",name:r.name??"",localPath:r.localPath??""}));this.projects_$.set(n)}catch(e){this.error_$.set(e instanceof Error?e.message:"Projekt lista bet\xF6lt\xE9se sikertelen.")}})}selectProject(e){return I(this,null,function*(){let n=this.selectedProjectId_$()===e.projectId;n&&this.files_$().length>0||(this.selectedProjectId_$.set(e.projectId),this.error_$.set(null),T.saveSelectedProjectId(e.projectId),n||(this.openTabs_$.set([]),this.activeTabId_$.set(null),this.tabFileCache.clear(),this.selectedFile_$.set(null),this.selectedFileChunks_$.set([]),this.selectedChunkIndex_$.set(null)),yield Promise.all([this.loadStats(),this.loadIngestionStatus(),this.loadModules(),this.loadFilesAndBuildTree(),this.loadRequirementCodes(),this.loadDescriptions()]))})}startIngestion(e){return I(this,null,function*(){let n=this.selectedProjectId_$();if(n){this.isIngesting_$.set(!0),this.error_$.set(null);try{yield F(this.ps_AS.startIngestion({projectId:n,mode:e.mode})),this.startStatusPolling()}catch(r){this.error_$.set(r instanceof Error?r.message:"Ingestion ind\xEDt\xE1s sikertelen."),this.isIngesting_$.set(!1)}}})}loadIngestionStatus(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.getIngestionStatus({projectId:e})),r=this.latestRun_$();if((n.run?.status!==r?.status||n.run?.totalChunksCreated!==r?.totalChunksCreated||n.run?.completedAt!==r?.completedAt)&&this.latestRun_$.set(n.run),n.run?.status==="running")this.isIngesting_$.set(!0);else{let f=this.isIngesting_$();this.isIngesting_$.set(!1),this.stopStatusPolling(),f&&(this.loadFilesAndBuildTree(),this.loadStats(),this.loadRequirementCodes())}}catch(n){this.error_$.set(n instanceof Error?n.message:"Ingestion st\xE1tusz bet\xF6lt\xE9se sikertelen.")}})}loadFilesAndBuildTree(){return I(this,null,function*(){yield this.loadFiles(),this.rebuildTree()})}loadFiles(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e){this.isLoading_$.set(!0),this.error_$.set(null);try{let n=yield F(this.ps_AS.listFiles({projectId:e,sourceType:this.filterSourceType_$()||void 0,projectPart:this.filterProjectPart_$()||void 0,moduleName:this.filterModule_$()||void 0,fileRole:this.filterFileRole_$()||void 0,requirementCode:this.filterReqCode_$()||void 0,search:this.filterSearch_$()||void 0}));this.files_$.set(n.items),this.filesTotal_$.set(n.total)}catch(n){this.error_$.set(n instanceof Error?n.message:"F\xE1jl lista bet\xF6lt\xE9se sikertelen.")}finally{this.isLoading_$.set(!1)}}})}rebuildTree(){let e=G.buildFileTree({files:this.files_$()});this.fileTree_$.set(e)}toggleFolder(e){this.expandedFolders_$.update(n=>{let r=new Set(n);return r.has(e.folderPath)?r.delete(e.folderPath):r.add(e.folderPath),T.saveExpandedFolders(Array.from(r)),r})}openFileInTab(e){let n=e.file.id,r=this.openTabs_$();if(r.some($=>$.fileId===n)){this.setActiveTab({fileId:n});return}let f={fileId:n,fileName:e.file.fileName,relativePath:e.file.relativePath,isLoading:!1};this.openTabs_$.set([...r,f]),this.setActiveTab({fileId:n}),this.persistTabs(),this.tabFileCache.has(n)||this.loadFileForTab({fileId:n})}closeTab(e){let n=this.openTabs_$(),r=n.findIndex(f=>f.fileId===e.fileId);if(r===-1)return;let d=n.filter(f=>f.fileId!==e.fileId);if(this.openTabs_$.set(d),this.tabFileCache.delete(e.fileId),this.activeTabId_$()===e.fileId)if(d.length>0){let f=Math.min(r,d.length-1);this.setActiveTab({fileId:d[f].fileId})}else this.activeTabId_$.set(null),this.selectedFile_$.set(null),this.selectedFileChunks_$.set([]),this.selectedChunkIndex_$.set(null);this.persistTabs()}setActiveTab(e){this.activeTabId_$.set(e.fileId),this.selectedChunkIndex_$.set(null),T.saveActiveTabId(e.fileId);let n=this.tabFileCache.get(e.fileId);n?(this.selectedFile_$.set(n.file),this.selectedFileChunks_$.set(n.chunks),this.loadRelationsForFile({fileId:e.fileId})):(this.selectedFile_$.set(null),this.selectedFileChunks_$.set([]),this.loadFileForTab({fileId:e.fileId}))}selectChunk(e){let n=this.selectedChunkIndex_$();this.selectedChunkIndex_$.set(n===e.chunkIndex?null:e.chunkIndex)}loadStats(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.getStats({projectId:e}));this.stats_$.set(n.stats)}catch(n){this.error_$.set(n instanceof Error?n.message:"Statisztik\xE1k bet\xF6lt\xE9se sikertelen.")}})}loadRequirementCodes(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.getRequirementCodes({projectId:e}));this.requirementCodes_$.set(n.items)}catch(n){this.error_$.set(n instanceof Error?n.message:"Requirement k\xF3dok bet\xF6lt\xE9se sikertelen.")}})}loadModules(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.getModules({projectId:e}));this.availableModules_$.set(n.modules)}catch(n){this.error_$.set(n instanceof Error?n.message:"Modul lista bet\xF6lt\xE9se sikertelen.")}})}toggleFileTree(){let e=!this.isFileTreeOpen_$();this.isFileTreeOpen_$.set(e),T.savePanelOpen("fileTree",e)}toggleInfoPanel(){let e=!this.isInfoPanelOpen_$();this.isInfoPanelOpen_$.set(e),T.savePanelOpen("infoPanel",e)}toggleSearchPanel(){this.isSearchPanelOpen_$.set(!this.isSearchPanelOpen_$())}loadEmbeddingStatus(){return I(this,null,function*(){let e=this.selectedProjectId_$(),n=this.selectedRegistryEntryId_$();if(!(!e||!n))try{let r=yield F(this.ps_AS.getEmbeddingStatus({projectId:e,registryEntryId:n}));this.embeddingStatus_$.set(r)}catch(r){this.error_$.set(r instanceof Error?r.message:"Embedding st\xE1tusz bet\xF6lt\xE9se sikertelen.")}})}startEmbedding(){return I(this,null,function*(){let e=this.selectedProjectId_$(),n=this.selectedRegistryEntryId_$();if(!(!e||!n)){this.isEmbedding_$.set(!0),this.error_$.set(null);try{yield F(this.ps_AS.startEmbedding({projectId:e,registryEntryId:n})),this.startEmbeddingPolling()}catch(r){this.error_$.set(r instanceof Error?r.message:"Embedding ind\xEDt\xE1s sikertelen."),this.isEmbedding_$.set(!1)}}})}search(e){return I(this,null,function*(){let n=this.selectedProjectId_$(),r=this.selectedRegistryEntryId_$();if(!(!n||!r||!e.query.trim())){this.isSearching_$.set(!0),this.error_$.set(null);try{let d=yield F(this.ps_AS.search({projectId:n,registryEntryId:r,query:e.query,metric:this.searchMetric_$()}));this.searchResults_$.set(d.results)}catch(d){this.error_$.set(d instanceof Error?d.message:"Keres\xE9s sikertelen.")}finally{this.isSearching_$.set(!1)}}})}navigateToSearchResult(e){let n=this.files_$().find(r=>r.relativePath===e.result.file.relativePath);n&&(this.openFileInTab({file:n}),this.isSearchPanelOpen_$.set(!1))}loadRelationsForFile(e){return I(this,null,function*(){let n=this.selectedProjectId_$();if(n)try{let r=yield F(this.ps_AS.getRelationsForFile({projectId:n,fileId:e.fileId}));this.relations_$.set([...r.outgoing,...r.incoming])}catch{}})}loadRunFlows(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.listRunFlows({projectId:e}));this.runFlows_$.set(n.items)}catch{}})}loadDataFlows(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.listDataFlows({projectId:e}));this.dataFlows_$.set(n.items)}catch{}})}loadDescriptions(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.listDescriptions({projectId:e}));this.descriptions_$.set(n.items)}catch{}})}updateDescription(e){return I(this,null,function*(){let n=this.selectedProjectId_$();if(n)try{yield F(this.ps_AS.updateDescription({projectId:n,descId:e.descId,description:e.description})),yield this.loadDescriptions()}catch(r){this.error_$.set(r instanceof Error?r.message:"Description friss\xEDt\xE9s sikertelen.")}})}embeddingPollTimer=null;startEmbeddingPolling(){this.stopEmbeddingPolling(),this.embeddingPollTimer=setInterval(()=>{this.loadEmbeddingStatus().then(()=>{this.embeddingStatus_$()?.pending===0&&(this.isEmbedding_$.set(!1),this.stopEmbeddingPolling())})},3e3)}stopEmbeddingPolling(){this.embeddingPollTimer&&(clearInterval(this.embeddingPollTimer),this.embeddingPollTimer=null)}loadFileForTab(e){return I(this,null,function*(){let n=this.selectedProjectId_$();if(n){this.updateTabLoading({fileId:e.fileId,isLoading:!0});try{let r=yield F(this.ps_AS.getFileDetail({projectId:n,fileId:e.fileId}));this.tabFileCache.set(e.fileId,{file:r.file,chunks:r.chunks}),this.activeTabId_$()===e.fileId&&(this.selectedFile_$.set(r.file),this.selectedFileChunks_$.set(r.chunks),this.loadRelationsForFile({fileId:e.fileId}))}catch(r){this.error_$.set(r instanceof Error?r.message:"F\xE1jl detail bet\xF6lt\xE9se sikertelen.")}finally{this.updateTabLoading({fileId:e.fileId,isLoading:!1})}}})}updateTabLoading(e){this.openTabs_$.update(n=>n.map(r=>r.fileId===e.fileId?K(J({},r),{isLoading:e.isLoading}):r))}persistTabs(){let e=this.openTabs_$().map(r=>r.fileId);T.saveOpenTabIds(e);let n=this.activeTabId_$();n&&T.saveActiveTabId(n)}startStatusPolling(){this.stopStatusPolling(),this.statusPollTimer=setInterval(()=>{this.loadIngestionStatus()},3e3)}stopStatusPolling(){this.statusPollTimer&&(clearInterval(this.statusPollTimer),this.statusPollTimer=null)}restoreFromStorage(){this.isFileTreeOpen_$.set(T.loadPanelOpen("fileTree",!0)),this.isInfoPanelOpen_$.set(T.loadPanelOpen("infoPanel",!0));let e=T.loadExpandedFolders();e.length>0&&this.expandedFolders_$.set(new Set(e))}ngOnDestroy(){this.stopStatusPolling(),this.stopEmbeddingPolling()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Y({token:t,factory:t.\u0275fac})}return t})();var je=(t,a)=>a.id;function Me(t,a){if(t&1&&(i(0,"option",14),s(1),o()),t&2){let e=a.$implicit;C("value",e.id),l(),h(e.name)}}function Re(t,a){if(t&1){let e=M();i(0,"select",12),S("change",function(r){D(e);let d=p();return w(d.handleProjectChange(r.target.value))}),i(1,"option",13),s(2,"Select project..."),o(),b(3,Me,2,2,"option",14,je),o()}if(t&2){let e,n=p();C("value",(e=n.ps_DS.selectedProjectId_$())!==null&&e!==void 0?e:""),l(3),P(n.ps_DS.projects_$())}}function Ae(t,a){t&1&&(m(0,"span",18),s(1," Ingesting... "))}function Ne(t,a){t&1&&(s(0," Ingest "),E(),i(1,"svg",16),m(2,"polyline",3),o())}function Ve(t,a){if(t&1){let e=M();i(0,"div",17)(1,"button",19),S("click",function(){D(e);let r=p(2);return w(r.handleStartIngestion("full"))}),s(2," Full ingestion "),o(),i(3,"button",19),S("click",function(){D(e);let r=p(2);return w(r.handleStartIngestion("incremental"))}),s(4," Incremental "),o()()}}function Oe(t,a){if(t&1){let e=M();i(0,"div",6)(1,"button",15),S("click",function(){D(e);let r=p();return w(r.handleToggleIngestMenu())}),_(2,Ae,2,0)(3,Ne,3,0,":svg:svg",16),o(),_(4,Ve,5,0,"div",17),o()}if(t&2){let e=p();l(),O("opacity-50",e.ps_DS.isIngesting_$()),C("disabled",e.ps_DS.isIngesting_$()),l(),c(e.ps_DS.isIngesting_$()?2:3),l(2),c(e.isIngestMenuOpen_$()&&!e.ps_DS.isIngesting_$()?4:-1)}}function Ue(t,a){if(t&1&&(i(0,"span",8),s(1),o()),t&2){let e=a;C("title",e.relativePath),l(),x(" ",e.relativePath," ")}}function Be(t,a){t&1&&(i(0,"span",9),s(1,"No file selected"),o())}function Le(t,a){t&1&&(i(0,"span",9),s(1,"Select a project to begin"),o())}function Ge(t,a){if(t&1&&(i(0,"span",20),s(1),o(),i(2,"span",21),s(3,"|"),o(),i(4,"span",20),s(5),o(),m(6,"span",4)),t&2){let e=a;l(),x(" ",e.totalFiles," files "),l(4),x(" ",e.totalChunks," chunks ")}}var Se=(()=>{class t{ps_DS=v(g);isIngestMenuOpen_$=u(!1);handleProjectChange(e){e&&this.ps_DS.selectProject({projectId:e})}handleStartIngestion(e){this.isIngestMenuOpen_$.set(!1),this.ps_DS.startIngestion({mode:e})}handleToggleIngestMenu(){this.isIngestMenuOpen_$.update(e=>!e)}handleToggleFileTree(){this.ps_DS.toggleFileTree()}handleToggleSearchPanel(){this.ps_DS.toggleSearchPanel()}handleToggleInfoPanel(){this.ps_DS.toggleInfoPanel()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-ide-toolbar"]],hostAttrs:[1,"block","shrink-0"],decls:19,vars:12,consts:[["sSessionToolbarLeft","",1,"flex","items-center","gap-1","min-w-0"],[1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors","flex","items-center","gap-1","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","shrink-0","transition-transform","duration-150"],["points","6 9 12 15 18 9"],[1,"w-px","h-4","bg-neutral-700","shrink-0","self-center","mx-0.5"],[1,"bg-ccapBg","border","border-neonDefault","text-neutral-300","text-xs","rounded","px-2","py-1","max-w-[180px]","truncate","focus:outline-none","focus:border-neonCyan",3,"value"],[1,"relative","shrink-0"],["sSessionToolbarCenter","",1,"flex","items-center","justify-center","gap-2","min-w-0"],[1,"text-xs","text-neutral-500","truncate","max-w-[400px]",3,"title"],[1,"text-xs","text-neutral-500"],["sSessionToolbarRight","",1,"flex","items-center","gap-1","min-w-0","flex-wrap","justify-end"],[1,"px-2","py-1","text-xs","border","rounded","transition-colors","shrink-0",3,"click"],[1,"bg-ccapBg","border","border-neonDefault","text-neutral-300","text-xs","rounded","px-2","py-1","max-w-[180px]","truncate","focus:outline-none","focus:border-neonCyan",3,"change","value"],["value","","disabled",""],[3,"value"],[1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors","flex","items-center","gap-1",3,"click","disabled"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2",1,"w-3","h-3"],[1,"absolute","top-full","left-0","mt-1","bg-ccapSurface","border","border-neonDefault","rounded","shadow-lg","z-20","min-w-[140px]"],[1,"w-2","h-2","rounded-full","bg-neonCyan","animate-pulse","shrink-0"],[1,"block","w-full","text-left","px-3","py-1.5","text-xs","text-neutral-300","hover:bg-neonCyan/10","hover:text-neonCyan","transition-colors",3,"click"],[1,"text-[10px]","text-neutral-500","shrink-0"],[1,"text-[10px]","text-neutral-600","shrink-0"]],template:function(n,r){if(n&1&&(i(0,"app-s-session-shell-toolbar")(1,"div",0)(2,"button",1),S("click",function(){return r.handleToggleFileTree()}),E(),i(3,"svg",2),m(4,"polyline",3),o(),s(5," Files "),o(),j(),m(6,"div",4),_(7,Re,5,1,"select",5)(8,Oe,5,5,"div",6),o(),i(9,"div",7),_(10,Ue,2,2,"span",8)(11,Be,2,0,"span",9)(12,Le,2,0,"span",9),o(),i(13,"div",10),_(14,Ge,7,2),i(15,"button",11),S("click",function(){return r.handleToggleSearchPanel()}),s(16," Search "),o(),i(17,"button",11),S("click",function(){return r.handleToggleInfoPanel()}),s(18," Info "),o()()()),n&2){let d,f;l(3),O("rotate-90",r.ps_DS.isFileTreeOpen_$())("-rotate-90",!r.ps_DS.isFileTreeOpen_$()),l(4),c(r.ps_DS.isEmbedded_$()?-1:7),l(),c(r.ps_DS.selectedProjectId_$()?8:-1),l(2),c((d=r.ps_DS.selectedFile_$())?10:r.ps_DS.selectedProjectId_$()?11:12,d),l(4),c((f=r.ps_DS.stats_$())?14:-1,f),l(),k(r.ps_DS.isSearchPanelOpen_$()?"border-neonGreen/50 text-neonGreen bg-neonGreen/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600"),l(2),k(r.ps_DS.isInfoPanelOpen_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600")}},dependencies:[B,L,me],encapsulation:2})}return t})();var We=(t,a)=>a.path;function ze(t,a){if(t&1&&m(0,"app-ps-file-tree-node",6),t&2){let e=a.$implicit,n=p(3);C("node",e)("depth",n.depth+1)}}function He(t,a){if(t&1&&b(0,ze,1,2,"app-ps-file-tree-node",6,We),t&2){let e=p(2);P(e.node.children)}}function Xe(t,a){if(t&1){let e=M();i(0,"button",1),S("click",function(){D(e);let r=p();return w(r.handleFolderToggle())}),E(),i(1,"svg",2),m(2,"polyline",3),o(),j(),i(3,"span",4),s(4),o(),i(5,"span",5),s(6),o()(),_(7,He,2,0)}if(t&2){let e=p();H("padding-left",e.depth*16+4,"px"),l(),O("rotate-90",e.isExpanded),l(3),h(e.node.name),l(2),x(" ",e.node.fileCount," "),l(),c(e.isExpanded?7:-1)}}function Qe(t,a){if(t&1&&(i(0,"span",9),s(1),o()),t&2){let e=p(2);l(),h(e.node.file.chunkCount)}}function Je(t,a){if(t&1){let e=M();i(0,"button",7),S("click",function(){D(e);let r=p();return w(r.handleFileClick())}),m(1,"span",8),i(2,"span",4),s(3),o(),_(4,Qe,2,1,"span",9),o()}if(t&2){let e=p();k(e.isActiveFile?"border-l-2 border-neonCyan bg-neonCyan/5 text-neonCyan":"text-neutral-400 hover:bg-neonCyan/5 hover:text-neutral-300 border-l-2 border-transparent"),H("padding-left",e.depth*16+20,"px"),l(),k((e.node.file==null?null:e.node.file.sourceType)==="code"?"bg-neonCyan/60":(e.node.file==null?null:e.node.file.sourceType)==="rule"?"bg-neonAmber/60":"bg-neonGreen/60"),l(2),h(e.node.name),l(),c(e.node.file&&e.node.file.chunkCount?4:-1)}}var Ce=(()=>{class t{node;depth;ps_DS=v(g);handleFolderToggle(){this.ps_DS.toggleFolder({folderPath:this.node.path})}handleFileClick(){this.node.file&&this.ps_DS.openFileInTab({file:this.node.file})}get isExpanded(){return this.ps_DS.expandedFolders_$().has(this.node.path)}get isActiveFile(){return!this.node.isFolder&&!!this.node.file&&this.ps_DS.activeTabId_$()===this.node.file.id}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-file-tree-node"]],hostAttrs:[1,"block"],inputs:{node:"node",depth:"depth"},decls:2,vars:1,consts:[[1,"flex","items-center","w-full","text-left","py-0.5","pr-2","text-xs","transition-colors",3,"padding-left","class"],[1,"flex","items-center","w-full","text-left","py-0.5","pr-2","text-xs","text-neutral-400","hover:bg-neonCyan/5","hover:text-neutral-300","transition-colors","group",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","mr-1","shrink-0","transition-transform","duration-100"],["points","9 18 15 12 9 6"],[1,"truncate"],[1,"ml-auto","text-[10px]","text-neutral-600","group-hover:text-neutral-500","shrink-0"],[3,"node","depth"],[1,"flex","items-center","w-full","text-left","py-0.5","pr-2","text-xs","transition-colors",3,"click"],[1,"w-2","h-2","rounded-full","mr-1.5","shrink-0"],[1,"ml-auto","text-[10px]","text-neutral-600","shrink-0"]],template:function(n,r){n&1&&_(0,Xe,8,7)(1,Je,5,8,"button",0),n&2&&c(r.node.isFolder?0:1)},dependencies:[t],encapsulation:2})}return t})();var Ye=(t,a)=>a.path;function Ze(t,a){t&1&&(i(0,"div",3),s(1," Loading... "),o())}function et(t,a){t&1&&(i(0,"div",4),s(1," No files found "),o())}function tt(t,a){if(t&1&&m(0,"app-ps-file-tree-node",17),t&2){let e=a.$implicit;C("node",e)("depth",0)}}function nt(t,a){if(t&1&&b(0,tt,1,2,"app-ps-file-tree-node",17,Ye),t&2){let e=p();P(e.filteredTree_$())}}function it(t,a){if(t&1&&(i(0,"option",18),s(1),o()),t&2){let e=a.$implicit;C("value",e),l(),h(e)}}function ot(t,a){if(t&1){let e=M();i(0,"select",6),S("change",function(r){D(e);let d=p();return w(d.handleModuleChange(r.target.value))}),i(1,"option",7),s(2,"All modules"),o(),b(3,it,2,2,"option",18,U),o()}if(t&2){let e=p();C("value",e.ps_DS.filterModule_$()),l(3),P(e.ps_DS.availableModules_$())}}var ve=(()=>{class t{ps_DS=v(g);filteredTree_$=Z(()=>{let e=this.ps_DS.treeSearchQuery_$(),n=this.ps_DS.fileTree_$();return e.trim()?G.filterTreeBySearch({nodes:n,query:e}):n});handleSearchChange(e){this.ps_DS.treeSearchQuery_$.set(e)}handleSourceTypeChange(e){this.ps_DS.filterSourceType_$.set(e),this.ps_DS.loadFilesAndBuildTree()}handleProjectPartChange(e){this.ps_DS.filterProjectPart_$.set(e),this.ps_DS.loadFilesAndBuildTree()}handleModuleChange(e){this.ps_DS.filterModule_$.set(e),this.ps_DS.loadFilesAndBuildTree()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-file-tree"]],hostAttrs:[1,"flex","flex-col","h-full","overflow-hidden"],decls:30,vars:5,consts:[[1,"shrink-0","p-2","border-b","border-neonDefault/30"],["type","text","placeholder","Search files...",1,"w-full","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-1","text-xs","text-neutral-300","placeholder-neutral-600","focus:outline-none","focus:border-neonCyan/60",3,"input","value"],[1,"flex-1","overflow-y-auto","overflow-x-hidden","min-h-0","py-1"],[1,"flex","items-center","justify-center","py-8","text-neutral-500","text-xs"],[1,"flex","items-center","justify-center","py-8","text-neutral-600","text-xs"],[1,"shrink-0","border-t","border-neonDefault/30","p-2","space-y-1"],[1,"w-full","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-0.5","text-[10px]","text-neutral-400","focus:outline-none","focus:border-neonCyan/60",3,"change","value"],["value",""],["value","code"],["value","document"],["value","rule"],["value","server"],["value","client"],["value","cli"],["value","e2e"],["value","shared"],[1,"w-full","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-0.5","text-[10px]","text-neutral-400","focus:outline-none","focus:border-neonCyan/60",3,"value"],[3,"node","depth"],[3,"value"]],template:function(n,r){n&1&&(i(0,"div",0)(1,"input",1),S("input",function(f){return r.handleSearchChange(f.target.value)}),o()(),i(2,"div",2),_(3,Ze,2,0,"div",3)(4,et,2,0,"div",4)(5,nt,2,0),o(),i(6,"div",5)(7,"select",6),S("change",function(f){return r.handleSourceTypeChange(f.target.value)}),i(8,"option",7),s(9,"All types"),o(),i(10,"option",8),s(11,"Code"),o(),i(12,"option",9),s(13,"Document"),o(),i(14,"option",10),s(15,"Rule"),o()(),i(16,"select",6),S("change",function(f){return r.handleProjectPartChange(f.target.value)}),i(17,"option",7),s(18,"All parts"),o(),i(19,"option",11),s(20,"Server"),o(),i(21,"option",12),s(22,"Client"),o(),i(23,"option",13),s(24,"CLI"),o(),i(25,"option",14),s(26,"E2E"),o(),i(27,"option",15),s(28,"Shared"),o()(),_(29,ot,5,1,"select",16),o()),n&2&&(l(),C("value",r.ps_DS.treeSearchQuery_$()),l(2),c(r.ps_DS.isLoading_$()?3:r.filteredTree_$().length?5:4),l(4),C("value",r.ps_DS.filterSourceType_$()),l(9),C("value",r.ps_DS.filterProjectPart_$()),l(13),c(r.ps_DS.availableModules_$().length?29:-1))},dependencies:[B,L,Ce],encapsulation:2})}return t})();var lt=(t,a)=>a.fileId;function at(t,a){t&1&&m(0,"span",3)}function st(t,a){if(t&1){let e=M();i(0,"button",2),S("click",function(){let r=D(e).$implicit,d=p(2);return w(d.handleTabClick(r))}),_(1,at,1,0,"span",3),i(2,"span",4),s(3),o(),i(4,"span",5),S("click",function(r){let d=D(e).$implicit,f=p(2);return w(f.handleTabClose(r,d))}),E(),i(5,"svg",6),m(6,"line",7)(7,"line",8),o()()()}if(t&2){let e=a.$implicit,n=p(2);k(n.ps_DS.activeTabId_$()===e.fileId?"border-b-2 border-b-neonCyan text-neonCyan bg-neonCyan/5":"text-neutral-400 hover:text-neutral-300 hover:bg-neutral-800 border-b-2 border-b-transparent"),l(),c(e.isLoading?1:-1),l(2),h(e.fileName)}}function dt(t,a){if(t&1&&(i(0,"div",0),b(1,st,8,4,"button",1,lt),o()),t&2){let e=p();l(),P(e.ps_DS.openTabs_$())}}var ge=(()=>{class t{ps_DS=v(g);handleTabClick(e){this.ps_DS.setActiveTab({fileId:e.fileId})}handleTabClose(e,n){e.stopPropagation(),this.ps_DS.closeTab({fileId:n.fileId})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-tab-bar"]],hostAttrs:[1,"block","shrink-0"],decls:1,vars:1,consts:[[1,"flex","items-stretch","overflow-x-auto","border-b","border-neonDefault/30","bg-ccapBg","scrollbar-thin","scrollbar-thumb-neutral-700"],[1,"flex","items-center","gap-1.5","px-3","py-1.5","text-xs","whitespace-nowrap","border-r","border-neonDefault/20","transition-colors","shrink-0","max-w-[200px]","group",3,"class"],[1,"flex","items-center","gap-1.5","px-3","py-1.5","text-xs","whitespace-nowrap","border-r","border-neonDefault/20","transition-colors","shrink-0","max-w-[200px]","group",3,"click"],[1,"w-2","h-2","rounded-full","bg-neonCyan","animate-pulse","shrink-0"],[1,"truncate"],[1,"ml-1","w-4","h-4","flex","items-center","justify-center","rounded","hover:bg-neutral-600","text-neutral-500","hover:text-neutral-200","opacity-0","group-hover:opacity-100","transition-opacity","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2.5",1,"w-2.5","h-2.5"],["x1","18","y1","6","x2","6","y2","18"],["x1","6","y1","6","x2","18","y2","18"]],template:function(n,r){n&1&&_(0,dt,3,0,"div",0),n&2&&c(r.ps_DS.openTabs_$().length?0:-1)},encapsulation:2})}return t})();var pt=(t,a)=>a.id;function _t(t,a){t&1&&(i(0,"div",1),E(),i(1,"svg",4),m(2,"path",5)(3,"polyline",6),o(),j(),i(4,"span",7),s(5,"Open a file from the tree"),o()())}function mt(t,a){t&1&&(i(0,"div",2),s(1," No chunks available for this file "),o())}function ut(t,a){if(t&1&&m(0,"span",12),t&2){let e=p().$implicit;C("title","Embedded: "+e.dimensions+"d, "+e.embeddingTimeMs+"ms")}}function ft(t,a){t&1&&m(0,"span",13)}function ht(t,a){t&1&&m(0,"span",14)}function xt(t,a){if(t&1&&(i(0,"span",15),s(1),o()),t&2){let e=p().$implicit;l(),V(" L",e.lineStart,"-",e.lineEnd," ")}}function St(t,a){if(t&1&&(i(0,"span",17),s(1),o()),t&2){let e=p().$implicit;l(),x(" ",e.chunkType," ")}}function Ct(t,a){if(t&1&&(i(0,"span",18),s(1),o()),t&2){let e=p().$implicit;C("title",e.headerPath),l(),x(" ",e.headerPath," ")}}function vt(t,a){if(t&1&&(i(0,"span",20),s(1),o()),t&2){let e=a.$implicit;l(),x(" ",e," ")}}function gt(t,a){if(t&1&&b(0,vt,2,1,"span",20,U),t&2){let e=p().$implicit;P(e.requirementCodes)}}function It(t,a){if(t&1){let e=M();i(0,"div",9),S("click",function(){let r=D(e).$implicit,d=p(2);return w(d.handleChunkClick(r))}),i(1,"div",10)(2,"span",11),s(3),o(),_(4,ut,1,1,"span",12)(5,ft,1,0,"span",13)(6,ht,1,0,"span",14)(7,xt,2,2,"span",15),i(8,"span",16),s(9),o(),_(10,St,2,1,"span",17)(11,Ct,2,2,"span",18)(12,gt,2,0),o(),i(13,"pre",19),s(14),o()()}if(t&2){let e=a.$implicit,n=p(2);k(n.ps_DS.selectedChunkIndex_$()===e.chunkIndex?"ring-1 ring-neonCyan/40 bg-neonCyan/3 border-neonCyan/30":"border-neonDefault/20 hover:border-neonDefault/40 bg-ccapSurface"),l(3),x(" #",e.chunkIndex," "),l(),c(e.embeddingStatus==="completed"?4:e.embeddingStatus==="error"?5:6),l(3),c(e.lineStart!==void 0&&e.lineEnd!==void 0?7:-1),l(2),V(" C",e.charStart,"-",e.charEnd," "),l(),c(e.chunkType?10:-1),l(),c(e.headerPath?11:-1),l(),c(e.requirementCodes.length?12:-1),l(2),h(e.text)}}function bt(t,a){if(t&1&&(i(0,"div",3),b(1,It,15,11,"div",8,pt),o()),t&2){let e=p();l(),P(e.ps_DS.selectedFileChunks_$())}}var Ie=(()=>{class t{ps_DS=v(g);handleChunkClick(e){this.ps_DS.selectChunk({chunkIndex:e.chunkIndex})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-chunk-viewer"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],decls:4,vars:1,consts:[[1,"flex-1","overflow-y-auto","min-h-0","p-3"],[1,"flex","flex-col","items-center","justify-center","h-full","text-neutral-600"],[1,"flex","items-center","justify-center","h-full","text-neutral-600","text-sm"],[1,"space-y-2"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1",1,"w-12","h-12","mb-3","text-neutral-700"],["d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"],["points","13 2 13 9 20 9"],[1,"text-sm"],[1,"rounded","border","transition-all","cursor-pointer",3,"class"],[1,"rounded","border","transition-all","cursor-pointer",3,"click"],[1,"flex","items-center","gap-2","px-3","py-1.5","border-b","border-neonDefault/10"],[1,"text-[10px]","font-mono","text-neutral-500"],[1,"w-2","h-2","rounded-full","bg-neonGreen","shrink-0",3,"title"],["title","Embedding error",1,"w-2","h-2","rounded-full","bg-red-400","shrink-0"],["title","Not embedded",1,"w-2","h-2","rounded-full","bg-neutral-600","shrink-0"],[1,"text-[10px]","text-neutral-600"],[1,"text-[10px]","text-neutral-600","font-mono"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonCyan/10","text-neonCyan"],[1,"text-[10px]","text-neutral-500","truncate","max-w-[250px]",3,"title"],[1,"px-3","py-2","text-xs","text-neutral-300","font-mono","whitespace-pre-wrap","break-words","overflow-x-auto","max-h-[400px]","overflow-y-auto","leading-relaxed"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonAmber/10","text-neonAmber"]],template:function(n,r){n&1&&(i(0,"div",0),_(1,_t,6,0,"div",1)(2,mt,2,0,"div",2)(3,bt,3,0,"div",3),o()),n&2&&(l(),c(r.ps_DS.activeTabId_$()?!r.ps_DS.selectedFileChunks_$().length&&!r.ps_DS.isLoading_$()?2:3:1))},encapsulation:2})}return t})();var $t=(t,a)=>a.code,be=(t,a)=>a.id;function yt(t,a){if(t&1&&(i(0,"div",22)(1,"div",13),s(2,"Module"),o(),i(3,"div",20),s(4),o()()),t&2){let e=p();l(4),h(e.moduleName)}}function Et(t,a){if(t&1&&(i(0,"div")(1,"div",13),s(2,"Role"),o(),i(3,"div",20),s(4),o()()),t&2){let e=p();l(4),h(e.fileRole)}}function kt(t,a){if(t&1&&(i(0,"div",25),s(1),o()),t&2){let e=p(2);l(),h(e.errorMessage)}}function Dt(t,a){if(t&1&&(i(0,"div",23)(1,"div",24),s(2,"Error"),o(),_(3,kt,2,1,"div",25),o()),t&2){let e=p();l(3),c(e.errorMessage?3:-1)}}function wt(t,a){if(t&1&&(i(0,"span",28),s(1),o()),t&2){let e=a.$implicit;l(),x(" ",e," ")}}function Ft(t,a){if(t&1&&(i(0,"div",22)(1,"div",26),s(2,"Requirements"),o(),i(3,"div",27),b(4,wt,2,1,"span",28,U),o()()),t&2){let e=p();l(4),P(e.requirementCodes)}}function jt(t,a){if(t&1&&(i(0,"div",13),s(1,"Path"),o(),i(2,"div",17),s(3),o(),i(4,"div",18)(5,"div")(6,"div",13),s(7,"Type"),o(),i(8,"span",19),s(9),o()(),i(10,"div")(11,"div",13),s(12,"Part"),o(),i(13,"div",20),s(14),o()(),i(15,"div")(16,"div",13),s(17,"Extension"),o(),i(18,"div",21),s(19),o()(),i(20,"div")(21,"div",13),s(22,"Lines"),o(),i(23,"div",20),s(24),o()(),i(25,"div")(26,"div",13),s(27,"Size"),o(),i(28,"div",20),s(29),o()(),i(30,"div")(31,"div",13),s(32,"Chunks"),o(),i(33,"div",20),s(34),o()()(),_(35,yt,5,1,"div",22)(36,Et,5,1,"div")(37,Dt,4,1,"div",23)(38,Ft,6,0,"div",22)),t&2){let e=a;l(3),h(e.relativePath),l(5),k(e.sourceType==="code"?"bg-neonCyan/10 text-neonCyan":e.sourceType==="rule"?"bg-neonAmber/10 text-neonAmber":"bg-neonGreen/10 text-neonGreen"),l(),x(" ",e.sourceType," "),l(5),h(e.projectPart),l(5),h(e.fileExtension),l(5),h(e.lineCount),l(5),x("",e.fileSizeBytes," B"),l(5),h(e.chunkCount),l(),c(e.moduleName?35:-1),l(),c(e.fileRole?36:-1),l(),c(e.status==="error"?37:-1),l(),c(e.requirementCodes.length?38:-1)}}function Mt(t,a){t&1&&(i(0,"div",6),s(1,"No file selected"),o())}function Rt(t,a){if(t&1&&(i(0,"span",8),s(1),o()),t&2){let e=p();l(),x(" ",e.ps_DS.requirementCodes_$().length," ")}}function At(t,a){t&1&&(i(0,"div",6),s(1,"No requirement codes"),o())}function Nt(t,a){if(t&1&&(i(0,"div",29)(1,"span",30),s(2),o(),i(3,"span",31),s(4),o()()),t&2){let e=a.$implicit;l(2),x(" ",e.code," "),l(2),V(" ",e.fileCount,"f / ",e.chunkCount,"c ")}}function Vt(t,a){if(t&1&&b(0,Nt,5,3,"div",29,$t),t&2){let e=p();P(e.ps_DS.requirementCodes_$())}}function Ot(t,a){if(t&1&&(i(0,"span",35),s(1),o()),t&2){let e=p().$implicit;l(),h(e.externalPackage)}}function Ut(t,a){if(t&1&&(i(0,"span",36),s(1),o()),t&2){let e,n,r=p().$implicit;C("title",(e=r.targetFilePath)!==null&&e!==void 0?e:""),l(),x(" ",(n=r.targetSymbol)!==null&&n!==void 0?n:r.targetFilePath," ")}}function Bt(t,a){if(t&1&&(i(0,"div",33)(1,"span",34),s(2),o(),_(3,Ot,2,1,"span",35)(4,Ut,2,2,"span",36),o()),t&2){let e=a.$implicit;l(),k(e.relationType==="import"?"bg-blue-900/50 text-blue-300":e.relationType==="injection"?"bg-purple-900/50 text-purple-300":e.relationType==="inheritance"?"bg-orange-900/50 text-orange-300":"bg-neutral-700 text-neutral-300"),l(),x(" ",e.relationType," "),l(),c(e.isExternalTarget?3:4)}}function Lt(t,a){if(t&1&&(i(0,"details",7)(1,"summary",2),E(),i(2,"svg",3),m(3,"polyline",4),o(),s(4," Relations "),j(),i(5,"span",8),s(6),o()(),i(7,"div",32),b(8,Bt,5,4,"div",33,be),o()()),t&2){let e=p();l(6),x(" ",e.ps_DS.relations_$().length," "),l(2),P(e.ps_DS.relations_$())}}function Gt(t,a){t&1&&m(0,"span",10)}function qt(t,a){if(t&1&&(i(0,"div")(1,"div",13),s(2,"Duration"),o(),i(3,"div",20),s(4),X(5,"number"),o()()),t&2){let e=p();l(4),x(" ",Q(5,1,e.durationMs/1e3,"1.0-1"),"s ")}}function Wt(t,a){if(t&1&&(i(0,"span",42),s(1),o()),t&2){let e=p();l(),x("err:",e.filesErrored,"")}}function zt(t,a){if(t&1&&(i(0,"div",43),s(1),o()),t&2){let e=p();l(),h(e.errorMessage)}}function Ht(t,a){if(t&1&&(i(0,"pre",44),s(1),o()),t&2){let e=p();l(),h(e.errorDetails)}}function Xt(t,a){if(t&1&&(i(0,"div",37)(1,"div")(2,"div",13),s(3,"Status"),o(),i(4,"div",38),s(5),o()(),i(6,"div")(7,"div",13),s(8,"Mode"),o(),i(9,"div",20),s(10),o()(),_(11,qt,6,4,"div"),i(12,"div")(13,"div",13),s(14,"Scanned"),o(),i(15,"div",20),s(16),o()()(),i(17,"div",39)(18,"span",40),s(19),o(),i(20,"span",41),s(21),o(),i(22,"span",42),s(23),o(),i(24,"span",13),s(25),o(),_(26,Wt,2,1,"span",42),o(),_(27,zt,2,1,"div",43)(28,Ht,2,1,"pre",44)),t&2){let e=a;l(4),k(e.status==="completed"?"text-neonGreen":e.status==="running"?"text-neonCyan":e.status==="failed"?"text-red-400":"text-neutral-400"),l(),x(" ",e.status," "),l(5),h(e.mode),l(),c(e.durationMs?11:-1),l(5),h(e.totalFilesScanned),l(3),x("+",e.filesNew,""),l(2),x("~",e.filesChanged,""),l(2),x("-",e.filesDeleted,""),l(2),x("=",e.filesUnchanged,""),l(),c(e.filesErrored?26:-1),l(),c(e.errorMessage?27:-1),l(),c(e.errorDetails?28:-1)}}function Qt(t,a){t&1&&(i(0,"div",6),s(1,"No ingestion runs"),o())}function Jt(t,a){t&1&&m(0,"span",11)}function Kt(t,a){if(t&1&&(i(0,"div",45),m(1,"div",46),o(),i(2,"div",13),s(3),X(4,"number"),o(),i(5,"div",47)(6,"div",48)(7,"div",49),s(8),o(),i(9,"div",35),s(10,"Total"),o()(),i(11,"div",48)(12,"div",50),s(13),o(),i(14,"div",35),s(15,"Done"),o()(),i(16,"div",48)(17,"div",51),s(18),o(),i(19,"div",35),s(20,"Pending"),o()(),i(21,"div",48)(22,"div",52),s(23),o(),i(24,"div",35),s(25,"Error"),o()()()),t&2){let e=a;l(),H("width",e.total>0?e.completed/e.total*100:0,"%"),l(2),le(" ",e.completed,"/",e.total," embedded (",e.total>0?Q(4,9,e.completed/e.total*100,"1.0-0"):0,"%) "),l(5),h(e.total),l(5),h(e.completed),l(5),h(e.pending),l(5),h(e.error)}}function Yt(t,a){t&1&&(i(0,"div",13),s(1,"No embedding status"),o())}function Zt(t,a){t&1&&(i(0,"span",16),m(1,"span",53),s(2," Embedding... "),o())}function en(t,a){t&1&&s(0," Embed Now ")}function tn(t,a){if(t&1&&(i(0,"div",58),s(1),o()),t&2){let e=p().$implicit;l(),h(e.description)}}function nn(t,a){t&1&&(i(0,"div",59),s(1,"No description"),o())}function on(t,a){if(t&1&&(i(0,"div",54)(1,"div",55)(2,"span",56),s(3),o(),i(4,"span",57),s(5),o()(),_(6,tn,2,1,"div",58)(7,nn,2,0,"div",59),o()),t&2){let e=a.$implicit;l(3),x(" ",e.elementType," "),l(2),h(e.displayName),l(),c(e.description?6:7)}}function rn(t,a){if(t&1&&(i(0,"details",7)(1,"summary",2),E(),i(2,"svg",3),m(3,"polyline",4),o(),s(4," Descriptions "),j(),i(5,"span",8),s(6),o()(),i(7,"div",32),b(8,on,8,3,"div",54,be),o()()),t&2){let e=p();l(6),x(" ",e.ps_DS.descriptions_$().length," "),l(2),P(e.ps_DS.descriptions_$())}}var Pe=(()=>{class t{ps_DS=v(g);handleStartEmbedding(){this.ps_DS.startEmbedding()}handleLoadEmbeddingStatus(){this.ps_DS.loadEmbeddingStatus()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-info-panel"]],hostAttrs:[1,"flex","flex-col","h-full","overflow-hidden"],decls:42,vars:14,consts:[[1,"flex-1","overflow-y-auto","min-h-0","p-2","space-y-2"],["open","",1,"group"],[1,"flex","items-center","gap-1","cursor-pointer","text-xs","font-semibold","text-neutral-300","py-1.5","px-2","rounded","hover:bg-neonCyan/5","transition-colors","select-none","border","border-neonDefault/20"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","shrink-0","transition-transform","duration-100","group-open:rotate-90","text-neutral-500"],["points","9 18 15 12 9 6"],[1,"mt-1","px-2","pb-1","space-y-1"],[1,"text-xs","text-neutral-600","py-2"],[1,"group"],[1,"ml-auto","text-[10px]","text-neutral-500"],[1,"mt-1","px-2","pb-1","space-y-1","max-h-[240px]","overflow-y-auto"],[1,"ml-1","w-2","h-2","rounded-full","bg-neonCyan","animate-pulse","shrink-0"],[1,"ml-1","w-2","h-2","rounded-full","bg-neonGreen","animate-pulse","shrink-0"],[1,"mt-1","px-2","pb-1","space-y-2"],[1,"text-[10px]","text-neutral-500"],["type","text","placeholder","Embedding Registry Entry ID","title","Paste the registry entry ID from Embedding Model Registry",1,"w-full","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-0.5","text-[10px]","text-neutral-400","focus:outline-none","focus:border-neonCyan/60",3,"change","value"],[1,"w-full","px-2","py-1","text-[10px]","border","rounded","transition-colors",3,"click","disabled"],[1,"inline-flex","items-center","gap-1"],[1,"text-xs","text-neutral-300","break-all","font-mono"],[1,"grid","grid-cols-2","gap-x-2","gap-y-1","mt-1"],[1,"text-xs","px-1.5","py-0.5","rounded-full","inline-block"],[1,"text-xs","text-neutral-300"],[1,"text-xs","text-neutral-300","font-mono"],[1,"mt-1"],[1,"mt-2","text-[10px]","text-red-400","bg-red-900/20","rounded","p-1.5"],[1,"font-bold"],[1,"mt-0.5","break-words"],[1,"text-[10px]","text-neutral-500","mb-0.5"],[1,"flex","flex-wrap","gap-1"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonAmber/10","text-neonAmber"],[1,"flex","items-center","gap-2","py-0.5"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonAmber/10","text-neonAmber","shrink-0","font-mono"],[1,"text-[10px]","text-neutral-500","shrink-0"],[1,"mt-1","px-2","pb-1","space-y-1","max-h-40","overflow-y-auto"],[1,"text-[10px]","flex","items-center","gap-1","py-0.5"],[1,"px-1","py-0.5","rounded","text-[9px]"],[1,"text-neutral-500"],[1,"text-neutral-400","truncate",3,"title"],[1,"grid","grid-cols-2","gap-x-2","gap-y-1"],[1,"text-xs","font-mono"],[1,"flex","flex-wrap","gap-1.5","mt-1"],[1,"text-[10px]","text-neonGreen"],[1,"text-[10px]","text-neonAmber"],[1,"text-[10px]","text-red-400"],[1,"text-[10px]","text-red-400","mt-1","break-words"],[1,"text-[9px]","text-red-300","bg-red-900/10","rounded","p-1","mt-1","max-h-20","overflow-y-auto","whitespace-pre-wrap"],[1,"w-full","bg-neutral-800","rounded-full","h-1.5"],[1,"bg-neonGreen","h-1.5","rounded-full","transition-all"],[1,"grid","grid-cols-4","gap-1","text-center","text-[10px]"],[1,"bg-neutral-800/60","rounded","p-1"],[1,"text-neutral-300","font-mono"],[1,"text-neonGreen","font-mono"],[1,"text-neonAmber","font-mono"],[1,"text-red-400","font-mono"],[1,"w-1.5","h-1.5","rounded-full","bg-neonGreen","animate-pulse"],[1,"text-[10px]","py-1","border-b","border-neonDefault/10"],[1,"flex","items-center","gap-1"],[1,"px-1","py-0.5","rounded","text-[9px]","bg-neonAmber/10","text-neonAmber"],[1,"text-neutral-300","font-medium"],[1,"text-neutral-500","mt-0.5"],[1,"text-neutral-600","italic","mt-0.5"]],template:function(n,r){if(n&1&&(i(0,"div",0)(1,"details",1)(2,"summary",2),E(),i(3,"svg",3),m(4,"polyline",4),o(),s(5," File Info "),o(),j(),i(6,"div",5),_(7,jt,39,13)(8,Mt,2,0,"div",6),o()(),i(9,"details",7)(10,"summary",2),E(),i(11,"svg",3),m(12,"polyline",4),o(),s(13," Requirements "),_(14,Rt,2,1,"span",8),o(),j(),i(15,"div",9),_(16,At,2,0,"div",6)(17,Vt,2,0),o()(),_(18,Lt,10,1,"details",7),i(19,"details",7)(20,"summary",2),E(),i(21,"svg",3),m(22,"polyline",4),o(),s(23," Ingestion "),_(24,Gt,1,0,"span",10),o(),j(),i(25,"div",5),_(26,Xt,29,13)(27,Qt,2,0,"div",6),o()(),i(28,"details",1)(29,"summary",2),E(),i(30,"svg",3),m(31,"polyline",4),o(),s(32," RAG / Embedding "),_(33,Jt,1,0,"span",11),o(),j(),i(34,"div",12),_(35,Kt,26,12)(36,Yt,2,0,"div",13),i(37,"input",14),S("change",function(f){return r.ps_DS.selectedRegistryEntryId_$.set(f.target.value),r.handleLoadEmbeddingStatus()}),o(),i(38,"button",15),S("click",function(){return r.handleStartEmbedding()}),_(39,Zt,3,0,"span",16)(40,en,1,0),o()()(),_(41,rn,10,1,"details",7),o()),n&2){let d,f,$,q;l(7),c((d=r.ps_DS.selectedFile_$())?7:8,d),l(7),c(r.ps_DS.requirementCodes_$().length?14:-1),l(2),c(r.ps_DS.requirementCodes_$().length?17:16),l(2),c(r.ps_DS.relations_$().length>0?18:-1),l(6),c(r.ps_DS.isIngesting_$()?24:-1),l(2),c((f=r.ps_DS.latestRun_$())?26:27,f),l(7),c(r.ps_DS.isEmbedding_$()?33:-1),l(2),c(($=r.ps_DS.embeddingStatus_$())?35:36,$),l(2),C("value",(q=r.ps_DS.selectedRegistryEntryId_$())!==null&&q!==void 0?q:""),l(),k(r.ps_DS.isEmbedding_$()?"border-neonGreen/50 text-neonGreen bg-neonGreen/10 opacity-50":"border-neonGreen/30 text-neonGreen hover:bg-neonGreen/10"),C("disabled",r.ps_DS.isEmbedding_$()||!r.ps_DS.selectedRegistryEntryId_$()),l(),c(r.ps_DS.isEmbedding_$()?39:40),l(2),c(r.ps_DS.descriptions_$().length>0?41:-1)}},dependencies:[ee],encapsulation:2})}return t})();function an(t,a){if(t&1&&(i(0,"span",1),s(1),o()),t&2){let e=p();l(),h(e.selectedProjectName_$())}}function sn(t,a){t&1&&(i(0,"span",1),s(1,"No project"),o())}function dn(t,a){if(t&1&&(i(0,"span",10),s(1),o()),t&2){let e=p(2);l(),x(" Chunk #",e.ps_DS.selectedChunkIndex_$()," ")}}function cn(t,a){if(t&1&&(m(0,"span",2),i(1,"span",9),s(2),o(),i(3,"span",1),s(4),o(),_(5,dn,2,1,"span",10)),t&2){let e=p();l(2),h(a.fileName),l(2),x("",e.ps_DS.selectedFileChunks_$().length," chunks"),l(),c(e.ps_DS.selectedChunkIndex_$()!==null?5:-1)}}function pn(t,a){t&1&&(i(0,"span",4),m(1,"span",11),s(2," Ingesting "),o())}function _n(t,a){t&1&&(i(0,"span",5),m(1,"span",12),s(2," Embedding "),o())}function mn(t,a){if(t&1&&(i(0,"span",6),s(1),o()),t&2){let e=a;l(),V(" ",e.completed,"/",e.total," emb ")}}function un(t,a){if(t&1&&(i(0,"span",7),s(1),o()),t&2){let e,n=p();C("title",(e=n.ps_DS.error_$())!==null&&e!==void 0?e:""),l(),x(" ",n.ps_DS.error_$()," ")}}function fn(t,a){t&1&&(i(0,"span",8),s(1,"Loading..."),o())}var Te=(()=>{class t{ps_DS=v(g);selectedProjectName_$=Z(()=>{let e=this.ps_DS.selectedProjectId_$();return e?this.ps_DS.projects_$().find(r=>r.id===e)?.name??"":""});static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-status-bar"]],hostAttrs:[1,"block","shrink-0"],decls:13,vars:8,consts:[[1,"flex","items-center","gap-3","px-3","py-1","border-t","border-neonDefault/30","bg-ccapBg","text-[10px]","text-neutral-500"],[1,"shrink-0"],[1,"w-px","h-3","bg-neutral-700","shrink-0"],[1,"flex-1"],[1,"flex","items-center","gap-1","text-neonCyan","shrink-0"],[1,"flex","items-center","gap-1","text-neonGreen","shrink-0"],[1,"text-[10px]","text-neutral-500","shrink-0"],[1,"text-red-400","truncate","max-w-[300px]","shrink-0",3,"title"],[1,"text-neutral-500","shrink-0"],[1,"truncate","max-w-[300px]"],[1,"text-neonCyan","shrink-0"],[1,"w-1.5","h-1.5","rounded-full","bg-neonCyan","animate-pulse"],[1,"w-1.5","h-1.5","rounded-full","bg-neonGreen","animate-pulse"]],template:function(n,r){if(n&1&&(i(0,"div",0),_(1,an,2,1,"span",1)(2,sn,2,0,"span",1),m(3,"span",2),i(4,"span",1),s(5),o(),_(6,cn,6,3),m(7,"span",3),_(8,pn,3,0,"span",4)(9,_n,3,0,"span",5)(10,mn,2,2,"span",6)(11,un,2,2,"span",7)(12,fn,2,0,"span",8),o()),n&2){let d,f;l(),c(r.selectedProjectName_$()?1:2),l(4),x("",r.ps_DS.filesTotal_$()," files"),l(),c((d=r.ps_DS.selectedFile_$())?6:-1,d),l(2),c(r.ps_DS.isIngesting_$()?8:-1),l(),c(r.ps_DS.isEmbedding_$()?9:-1),l(),c((f=r.ps_DS.embeddingStatus_$())?10:-1,f),l(),c(r.ps_DS.error_$()?11:-1),l(),c(r.ps_DS.isLoading_$()?12:-1)}},encapsulation:2})}return t})();var xn=(t,a)=>a.chunkId;function Sn(t,a){t&1&&(i(0,"span",3),m(1,"span",14),s(2," Searching... "),o())}function Cn(t,a){t&1&&s(0," Search ")}function vn(t,a){t&1&&(i(0,"div",10)(1,"span",15),m(2,"span",16),s(3," Searching... "),o()())}function gn(t,a){t&1&&(i(0,"div",11),s(1," No results found "),o())}function In(t,a){t&1&&(i(0,"div",12),E(),i(1,"svg",17),m(2,"circle",18)(3,"line",19),o(),j(),i(4,"span",20),s(5,"Enter a query to search"),o()())}function bn(t,a){if(t&1&&(i(0,"span",28),s(1),o()),t&2){let e=p().$implicit;l(),x(" ",e.file.sourceType," ")}}function Pn(t,a){if(t&1&&(i(0,"span",29),s(1),o()),t&2){let e=p().$implicit;l(),h(e.file.projectPart)}}function Tn(t,a){if(t&1&&(i(0,"span",30),s(1),o()),t&2){let e=p().$implicit;l(),h(e.file.moduleName)}}function $n(t,a){if(t&1&&(i(0,"span",31),s(1),o()),t&2){let e=p().$implicit;l(),V(" L",e.lineStart,"-",e.lineEnd," ")}}function yn(t,a){if(t&1){let e=M();i(0,"div",22),S("click",function(){let r=D(e).$implicit,d=p(2);return w(d.handleResultClick(r))}),i(1,"div",23)(2,"span",24),s(3),X(4,"number"),o(),i(5,"span",25),s(6),o(),i(7,"span",26),s(8),o()(),i(9,"div",27),_(10,bn,2,1,"span",28)(11,Pn,2,1,"span",29)(12,Tn,2,1,"span",30)(13,$n,2,2,"span",31),o(),i(14,"pre",32),s(15),o()()}if(t&2){let e=a.$implicit;l(2),k(e.score>=.8?"bg-neonGreen/15 text-neonGreen":e.score>=.6?"bg-neonAmber/15 text-neonAmber":"bg-neutral-700/50 text-neutral-400"),l(),x(" ",Q(4,11,e.score,"1.2-2")," "),l(2),C("title",e.file.relativePath),l(),x(" ",e.file.relativePath," "),l(2),x(" #",e.chunkIndex," "),l(2),c(e.file.sourceType?10:-1),l(),c(e.file.projectPart?11:-1),l(),c(e.file.moduleName?12:-1),l(),c(e.lineStart!==void 0&&e.lineEnd!==void 0?13:-1),l(2),h(e.text)}}function En(t,a){if(t&1&&(i(0,"div",13),b(1,yn,16,14,"div",21,xn),o()),t&2){let e=p();l(),P(e.ps_DS.searchResults_$())}}var $e=(()=>{class t{ps_DS=v(g);handleSearch(){this.ps_DS.search({query:this.ps_DS.searchQuery_$()})}handleResultClick(e){this.ps_DS.navigateToSearchResult({result:e})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-search-panel"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],decls:18,vars:7,consts:[[1,"flex","items-center","gap-2","px-3","py-2","border-b","border-neonDefault/20","shrink-0"],["type","text","placeholder","Semantic search...",1,"flex-1","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-1","text-xs","text-neutral-300","focus:outline-none","focus:border-neonGreen/60","placeholder:text-neutral-600",3,"input","keydown.enter","value"],[1,"px-3","py-1","text-xs","border","rounded","transition-colors","shrink-0",3,"click","disabled"],[1,"inline-flex","items-center","gap-1"],[1,"flex","items-center","gap-2","px-3","py-1.5","border-b","border-neonDefault/20","shrink-0"],[1,"bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-0.5","text-[10px]","text-neutral-400",3,"change","value"],["value","cosine"],["value","euclidean"],["value","dot-product"],[1,"flex-1","overflow-y-auto","min-h-0","p-3"],[1,"flex","items-center","justify-center","h-full","text-neutral-600"],[1,"flex","items-center","justify-center","h-full","text-neutral-600","text-sm"],[1,"flex","flex-col","items-center","justify-center","h-full","text-neutral-600"],[1,"space-y-2"],[1,"w-1.5","h-1.5","rounded-full","bg-neonGreen","animate-pulse"],[1,"inline-flex","items-center","gap-2","text-sm"],[1,"w-2","h-2","rounded-full","bg-neonGreen","animate-pulse"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1",1,"w-12","h-12","mb-3","text-neutral-700"],["cx","11","cy","11","r","8"],["x1","21","y1","21","x2","16.65","y2","16.65"],[1,"text-sm"],[1,"rounded","border","border-neonDefault/20","hover:border-neonGreen/40","bg-ccapSurface","hover:bg-neonGreen/3","transition-all","cursor-pointer"],[1,"rounded","border","border-neonDefault/20","hover:border-neonGreen/40","bg-ccapSurface","hover:bg-neonGreen/3","transition-all","cursor-pointer",3,"click"],[1,"flex","items-center","gap-2","px-3","py-1.5","border-b","border-neonDefault/10"],[1,"text-[10px]","font-mono","px-1.5","py-0.5","rounded-full","shrink-0"],[1,"text-xs","text-neutral-400","truncate",3,"title"],[1,"text-[10px]","text-neutral-600","shrink-0","ml-auto"],[1,"flex","items-center","gap-1.5","px-3","py-1"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonCyan/10","text-neonCyan"],[1,"text-[10px]","text-neutral-500"],[1,"text-[10px]","text-neutral-600"],[1,"text-[10px]","text-neutral-600","ml-auto"],[1,"px-3","py-2","text-[11px]","text-neutral-400","font-mono","whitespace-pre-wrap","break-words","max-h-[120px]","overflow-y-auto","leading-relaxed"]],template:function(n,r){n&1&&(i(0,"div",0)(1,"input",1),S("input",function(f){return r.ps_DS.searchQuery_$.set(f.target.value)})("keydown.enter",function(){return r.handleSearch()}),o(),i(2,"button",2),S("click",function(){return r.handleSearch()}),_(3,Sn,3,0,"span",3)(4,Cn,1,0),o()(),i(5,"div",4)(6,"select",5),S("change",function(f){return r.ps_DS.searchMetric_$.set(f.target.value)}),i(7,"option",6),s(8,"Cosine"),o(),i(9,"option",7),s(10,"Euclidean"),o(),i(11,"option",8),s(12,"Dot Product"),o()()(),i(13,"div",9),_(14,vn,4,0,"div",10)(15,gn,2,0,"div",11)(16,In,6,0,"div",12)(17,En,3,0,"div",13),o()),n&2&&(l(),C("value",r.ps_DS.searchQuery_$()),l(),k(r.ps_DS.isSearching_$()?"border-neonGreen/50 text-neonGreen bg-neonGreen/10 opacity-50":"border-neonGreen/30 text-neonGreen hover:bg-neonGreen/10"),C("disabled",r.ps_DS.isSearching_$()||!r.ps_DS.searchQuery_$()),l(),c(r.ps_DS.isSearching_$()?3:4),l(3),C("value",r.ps_DS.searchMetric_$()),l(8),c(r.ps_DS.isSearching_$()?14:!r.ps_DS.searchResults_$().length&&r.ps_DS.searchQuery_$()?15:r.ps_DS.searchResults_$().length?17:16))},dependencies:[B,L,ee],encapsulation:2})}return t})();function Dn(t,a){t&1&&m(0,"app-ps-search-panel")}function wn(t,a){t&1&&m(0,"app-ps-chunk-viewer")}var ji=(()=>{class t{projectId;ps_DS=v(g);fileTreeWidth_$=u(260);infoPanelWidth_$=u(300);isResizing_$=u(!1);ngOnInit(){this.fileTreeWidth_$.set(Math.max(160,Math.min(500,T.loadPanelWidth("fileTree",260)))),this.infoPanelWidth_$.set(Math.max(200,Math.min(550,T.loadPanelWidth("infoPanel",300)))),this.ps_DS.restoreFromStorage(),this.projectId?(this.ps_DS.isEmbedded_$.set(!0),this.ps_DS.selectProject({projectId:this.projectId})):(this.ps_DS.isEmbedded_$.set(!1),this.ps_DS.loadProjects().then(()=>{let e=T.loadSelectedProjectId();e&&this.ps_DS.projects_$().some(n=>n.id===e)&&this.ps_DS.selectProject({projectId:e})}))}ngOnChanges(e){if(e.projectId&&!e.projectId.firstChange){let n=e.projectId.currentValue;n&&this.ps_DS.selectProject({projectId:n})}}handleFileTreeResizeStart(e){let n=this.fileTreeWidth_$(),r=e.clientX;this.isResizing_$.set(!0),ne.attachUntilPointerUp({startEvent:e,onMove:d=>{let f=d.clientX-r,$=Math.max(160,Math.min(500,n+f));this.fileTreeWidth_$.set($)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("fileTree",this.fileTreeWidth_$())}})}handleInfoPanelResizeStart(e){let n=this.infoPanelWidth_$(),r=e.clientX;this.isResizing_$.set(!0),ne.attachUntilPointerUp({startEvent:e,onMove:d=>{let f=r-d.clientX,$=Math.max(200,Math.min(550,n+f));this.infoPanelWidth_$.set($)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("infoPanel",this.infoPanelWidth_$())}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-ide-shell"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],inputs:{projectId:"projectId"},features:[re],decls:12,vars:8,consts:[[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],[3,"startResizeStart","endResizeStart","isStartOpen","isEndOpen","startWidthPx","endWidthPx","isResizing"],["sDetailColumnStart",""],["sDetailColumnMain","",1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],["sDetailColumnEnd",""]],template:function(n,r){n&1&&(i(0,"div",0),m(1,"app-ps-ide-toolbar"),i(2,"app-s-session-detail-three-column-layout",1),S("startResizeStart",function(f){return r.handleFileTreeResizeStart(f)})("endResizeStart",function(f){return r.handleInfoPanelResizeStart(f)}),i(3,"div",2),m(4,"app-ps-file-tree"),o(),i(5,"div",3),m(6,"app-ps-tab-bar"),_(7,Dn,1,0,"app-ps-search-panel")(8,wn,1,0,"app-ps-chunk-viewer"),o(),i(9,"div",4),m(10,"app-ps-info-panel"),o()(),m(11,"app-ps-status-bar"),o()),n&2&&(O("select-none",r.isResizing_$()),l(2),C("isStartOpen",r.ps_DS.isFileTreeOpen_$())("isEndOpen",r.ps_DS.isInfoPanelOpen_$())("startWidthPx",r.fileTreeWidth_$())("endWidthPx",r.infoPanelWidth_$())("isResizing",r.isResizing_$()),l(5),c(r.ps_DS.isSearchPanelOpen_$()?7:8))},dependencies:[ue,Se,ve,ge,Ie,Pe,Te,$e],encapsulation:2})}return t})();var oo=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=oe({type:t});static \u0275inj=ie({providers:[g],imports:[ae,ce,de,fe]})}return t})();export{ji as a,oo as b};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as ne}from"./chunk-Q2PKIGLB.js";import{g as fe}from"./chunk-4LZT5VNB.js";import{a as ue}from"./chunk-7JUIBZEE.js";import{a as me}from"./chunk-C7XPBJTG.js";import{a as te}from"./chunk-I7BQNGDL.js";import{o as B,p as L,v as ce}from"./chunk-EO4DNTT4.js";import{f as _e}from"./chunk-MJ5UWAPM.js";import{a as R}from"./chunk-5UPNU54P.js";import{I as pe}from"./chunk-THJC2TOK.js";import{$a as X,C as v,D as y,E as oe,Fa as s,Ga as h,Ha as x,I as re,Ia as V,J as D,Ja as le,K as w,Kb as de,L as E,M as j,Z as l,a as J,aa as u,b as K,bb as Q,da as _,ga as C,ha as H,hb as Z,ia as O,ja as k,k as I,la as c,na as U,oa as b,p as F,pa as P,qa as i,ra as o,sa as m,sb as ee,ua as M,ub as ae,va as S,wa as p,xb as se,y as Y,z as ie}from"./chunk-TBMJSIBB.js";var A="ccap-projectSource",T=class{static savePanelWidth(a,e){R.writeNumber(`${A}:panelWidth:${a}`,e)}static loadPanelWidth(a,e){return R.readNumber(`${A}:panelWidth:${a}`,e)}static savePanelOpen(a,e){R.writeBoolean(`${A}:panelOpen:${a}`,e)}static loadPanelOpen(a,e){return R.readBoolean(`${A}:panelOpen:${a}`,e)}static saveSelectedProjectId(a){R.writeString(`${A}:selectedProjectId`,a)}static loadSelectedProjectId(){return R.readString(`${A}:selectedProjectId`)??""}static saveExpandedFolders(a){R.writeJson(`${A}:expandedFolders`,a)}static loadExpandedFolders(){let a=R.readJson(`${A}:expandedFolders`,[]);return Array.isArray(a)?a:[]}static saveOpenTabIds(a){R.writeJson(`${A}:openTabIds`,a)}static loadOpenTabIds(){let a=R.readJson(`${A}:openTabIds`,[]);return Array.isArray(a)?a:[]}static saveActiveTabId(a){R.writeString(`${A}:activeTabId`,a)}static loadActiveTabId(){return R.readString(`${A}:activeTabId`)??""}};var he=(()=>{class t{baseUrl=`${pe.api.baseUrl}/project-source`;http=v(se);startIngestion(e){return this.http.post(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/ingest`,{mode:e.mode})}listIngestionRuns(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/ingestion-runs`)}getIngestionStatus(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/ingestion-status`)}listFiles(e){let n=new URLSearchParams;e.sourceType&&n.set("sourceType",e.sourceType),e.projectPart&&n.set("projectPart",e.projectPart),e.moduleName&&n.set("moduleName",e.moduleName),e.fileRole&&n.set("fileRole",e.fileRole),e.requirementCode&&n.set("requirementCode",e.requirementCode),e.search&&n.set("search",e.search);let r=n.toString(),d=`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/files${r?"?"+r:""}`;return this.http.get(d)}getFileDetail(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/files/${encodeURIComponent(e.fileId)}`)}getRequirementCodes(e){let n=e.codePrefix?`?codePrefix=${encodeURIComponent(e.codePrefix)}`:"";return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/requirement-codes${n}`)}getStats(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/stats`)}getModules(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/modules`)}deleteProjectData(e){return this.http.delete(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}`)}startEmbedding(e){return this.http.post(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/embed`,{registryEntryId:e.registryEntryId})}getEmbeddingStatus(e){let n=`?registryEntryId=${encodeURIComponent(e.registryEntryId)}`;return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/embedding-status${n}`)}search(e){return this.http.post(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/search`,{registryEntryId:e.registryEntryId,query:e.query,topK:e.topK??10,metric:e.metric??"cosine",filters:e.filters})}listRelations(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/relations`)}getRelationsForFile(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/files/${encodeURIComponent(e.fileId)}/relations`)}listRunFlows(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/run-flows`)}listDataFlows(e){return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/data-flows`)}listDescriptions(e){let n=e.elementType?`?elementType=${encodeURIComponent(e.elementType)}`:"";return this.http.get(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/descriptions${n}`)}updateDescription(e){return this.http.put(`${this.baseUrl}/projects/${encodeURIComponent(e.projectId)}/descriptions/${encodeURIComponent(e.descId)}`,{description:e.description})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var G=class t{static buildFileTree(a){let e=new Map,n=[];for(let r of a.files){let d=r.relativePath.split("/"),f=n,$="";for(let W=0;W<d.length-1;W++){$=$?$+"/"+d[W]:d[W];let z=e.get($);z||(z={path:$,name:d[W],isFolder:!0,children:[],file:null,fileCount:0},e.set($,z),f.push(z)),f=z.children}let q=d[d.length-1];f.push({path:r.relativePath,name:q,isFolder:!1,children:[],file:r,fileCount:0})}return t.sortAndCount({nodes:n}),n}static filterTreeBySearch(a){if(!a.query.trim())return a.nodes;let e=te.normalizeForSearch(a.query);return t.filterNodes({nodes:a.nodes,normalizedQuery:e})}static sortAndCount(a){let e=0;a.nodes.sort((n,r)=>n.isFolder&&!r.isFolder?-1:!n.isFolder&&r.isFolder?1:n.name.localeCompare(r.name));for(let n of a.nodes)n.isFolder?(n.fileCount=t.sortAndCount({nodes:n.children}),e+=n.fileCount):e++;return e}static filterNodes(a){let e=[];for(let n of a.nodes){let r=te.normalizeForSearch(n.name).includes(a.normalizedQuery);if(n.isFolder){let d=t.filterNodes({nodes:n.children,normalizedQuery:a.normalizedQuery});(d.length>0||r)&&e.push(K(J({},n),{children:d.length>0?d:n.children,fileCount:d.reduce((f,$)=>f+($.isFolder?$.fileCount:1),0)}))}else r&&e.push(n)}return e}};var g=(()=>{class t{selectedProjectId_$=u(null);projects_$=u([]);stats_$=u(null);latestRun_$=u(null);isIngesting_$=u(!1);files_$=u([]);filesTotal_$=u(0);fileTree_$=u([]);expandedFolders_$=u(new Set);treeSearchQuery_$=u("");openTabs_$=u([]);activeTabId_$=u(null);tabFileCache=new Map;selectedFile_$=u(null);selectedFileChunks_$=u([]);selectedChunkIndex_$=u(null);requirementCodes_$=u([]);availableModules_$=u([]);filterSourceType_$=u("");filterProjectPart_$=u("");filterModule_$=u("");filterFileRole_$=u("");filterReqCode_$=u("");filterSearch_$=u("");isFileTreeOpen_$=u(!0);isInfoPanelOpen_$=u(!0);isEmbedded_$=u(!1);isSearchPanelOpen_$=u(!1);embeddingStatus_$=u(null);isEmbedding_$=u(!1);searchQuery_$=u("");searchResults_$=u([]);isSearching_$=u(!1);selectedRegistryEntryId_$=u(null);relations_$=u([]);runFlows_$=u([]);dataFlows_$=u([]);descriptions_$=u([]);searchMetric_$=u("cosine");isLoading_$=u(!1);error_$=u(null);ps_AS=v(he);pm_AS=v(_e);statusPollTimer=null;loadProjects(){return I(this,null,function*(){try{let n=((yield this.pm_AS.listProjects()).projects??[]).filter(r=>r.localPath&&r.isActive).map(r=>({id:r._id??"",name:r.name??"",localPath:r.localPath??""}));this.projects_$.set(n)}catch(e){this.error_$.set(e instanceof Error?e.message:"Projekt lista bet\xF6lt\xE9se sikertelen.")}})}selectProject(e){return I(this,null,function*(){let n=this.selectedProjectId_$()===e.projectId;n&&this.files_$().length>0||(this.selectedProjectId_$.set(e.projectId),this.error_$.set(null),T.saveSelectedProjectId(e.projectId),n||(this.openTabs_$.set([]),this.activeTabId_$.set(null),this.tabFileCache.clear(),this.selectedFile_$.set(null),this.selectedFileChunks_$.set([]),this.selectedChunkIndex_$.set(null)),yield Promise.all([this.loadStats(),this.loadIngestionStatus(),this.loadModules(),this.loadFilesAndBuildTree(),this.loadRequirementCodes(),this.loadDescriptions()]))})}startIngestion(e){return I(this,null,function*(){let n=this.selectedProjectId_$();if(n){this.isIngesting_$.set(!0),this.error_$.set(null);try{yield F(this.ps_AS.startIngestion({projectId:n,mode:e.mode})),this.startStatusPolling()}catch(r){this.error_$.set(r instanceof Error?r.message:"Ingestion ind\xEDt\xE1s sikertelen."),this.isIngesting_$.set(!1)}}})}loadIngestionStatus(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.getIngestionStatus({projectId:e})),r=this.latestRun_$();if((n.run?.status!==r?.status||n.run?.totalChunksCreated!==r?.totalChunksCreated||n.run?.completedAt!==r?.completedAt)&&this.latestRun_$.set(n.run),n.run?.status==="running")this.isIngesting_$.set(!0);else{let f=this.isIngesting_$();this.isIngesting_$.set(!1),this.stopStatusPolling(),f&&(this.loadFilesAndBuildTree(),this.loadStats(),this.loadRequirementCodes())}}catch(n){this.error_$.set(n instanceof Error?n.message:"Ingestion st\xE1tusz bet\xF6lt\xE9se sikertelen.")}})}loadFilesAndBuildTree(){return I(this,null,function*(){yield this.loadFiles(),this.rebuildTree()})}loadFiles(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e){this.isLoading_$.set(!0),this.error_$.set(null);try{let n=yield F(this.ps_AS.listFiles({projectId:e,sourceType:this.filterSourceType_$()||void 0,projectPart:this.filterProjectPart_$()||void 0,moduleName:this.filterModule_$()||void 0,fileRole:this.filterFileRole_$()||void 0,requirementCode:this.filterReqCode_$()||void 0,search:this.filterSearch_$()||void 0}));this.files_$.set(n.items),this.filesTotal_$.set(n.total)}catch(n){this.error_$.set(n instanceof Error?n.message:"F\xE1jl lista bet\xF6lt\xE9se sikertelen.")}finally{this.isLoading_$.set(!1)}}})}rebuildTree(){let e=G.buildFileTree({files:this.files_$()});this.fileTree_$.set(e)}toggleFolder(e){this.expandedFolders_$.update(n=>{let r=new Set(n);return r.has(e.folderPath)?r.delete(e.folderPath):r.add(e.folderPath),T.saveExpandedFolders(Array.from(r)),r})}openFileInTab(e){let n=e.file.id,r=this.openTabs_$();if(r.some($=>$.fileId===n)){this.setActiveTab({fileId:n});return}let f={fileId:n,fileName:e.file.fileName,relativePath:e.file.relativePath,isLoading:!1};this.openTabs_$.set([...r,f]),this.setActiveTab({fileId:n}),this.persistTabs(),this.tabFileCache.has(n)||this.loadFileForTab({fileId:n})}closeTab(e){let n=this.openTabs_$(),r=n.findIndex(f=>f.fileId===e.fileId);if(r===-1)return;let d=n.filter(f=>f.fileId!==e.fileId);if(this.openTabs_$.set(d),this.tabFileCache.delete(e.fileId),this.activeTabId_$()===e.fileId)if(d.length>0){let f=Math.min(r,d.length-1);this.setActiveTab({fileId:d[f].fileId})}else this.activeTabId_$.set(null),this.selectedFile_$.set(null),this.selectedFileChunks_$.set([]),this.selectedChunkIndex_$.set(null);this.persistTabs()}setActiveTab(e){this.activeTabId_$.set(e.fileId),this.selectedChunkIndex_$.set(null),T.saveActiveTabId(e.fileId);let n=this.tabFileCache.get(e.fileId);n?(this.selectedFile_$.set(n.file),this.selectedFileChunks_$.set(n.chunks),this.loadRelationsForFile({fileId:e.fileId})):(this.selectedFile_$.set(null),this.selectedFileChunks_$.set([]),this.loadFileForTab({fileId:e.fileId}))}selectChunk(e){let n=this.selectedChunkIndex_$();this.selectedChunkIndex_$.set(n===e.chunkIndex?null:e.chunkIndex)}loadStats(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.getStats({projectId:e}));this.stats_$.set(n.stats)}catch(n){this.error_$.set(n instanceof Error?n.message:"Statisztik\xE1k bet\xF6lt\xE9se sikertelen.")}})}loadRequirementCodes(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.getRequirementCodes({projectId:e}));this.requirementCodes_$.set(n.items)}catch(n){this.error_$.set(n instanceof Error?n.message:"Requirement k\xF3dok bet\xF6lt\xE9se sikertelen.")}})}loadModules(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.getModules({projectId:e}));this.availableModules_$.set(n.modules)}catch(n){this.error_$.set(n instanceof Error?n.message:"Modul lista bet\xF6lt\xE9se sikertelen.")}})}toggleFileTree(){let e=!this.isFileTreeOpen_$();this.isFileTreeOpen_$.set(e),T.savePanelOpen("fileTree",e)}toggleInfoPanel(){let e=!this.isInfoPanelOpen_$();this.isInfoPanelOpen_$.set(e),T.savePanelOpen("infoPanel",e)}toggleSearchPanel(){this.isSearchPanelOpen_$.set(!this.isSearchPanelOpen_$())}loadEmbeddingStatus(){return I(this,null,function*(){let e=this.selectedProjectId_$(),n=this.selectedRegistryEntryId_$();if(!(!e||!n))try{let r=yield F(this.ps_AS.getEmbeddingStatus({projectId:e,registryEntryId:n}));this.embeddingStatus_$.set(r)}catch(r){this.error_$.set(r instanceof Error?r.message:"Embedding st\xE1tusz bet\xF6lt\xE9se sikertelen.")}})}startEmbedding(){return I(this,null,function*(){let e=this.selectedProjectId_$(),n=this.selectedRegistryEntryId_$();if(!(!e||!n)){this.isEmbedding_$.set(!0),this.error_$.set(null);try{yield F(this.ps_AS.startEmbedding({projectId:e,registryEntryId:n})),this.startEmbeddingPolling()}catch(r){this.error_$.set(r instanceof Error?r.message:"Embedding ind\xEDt\xE1s sikertelen."),this.isEmbedding_$.set(!1)}}})}search(e){return I(this,null,function*(){let n=this.selectedProjectId_$(),r=this.selectedRegistryEntryId_$();if(!(!n||!r||!e.query.trim())){this.isSearching_$.set(!0),this.error_$.set(null);try{let d=yield F(this.ps_AS.search({projectId:n,registryEntryId:r,query:e.query,metric:this.searchMetric_$()}));this.searchResults_$.set(d.results)}catch(d){this.error_$.set(d instanceof Error?d.message:"Keres\xE9s sikertelen.")}finally{this.isSearching_$.set(!1)}}})}navigateToSearchResult(e){let n=this.files_$().find(r=>r.relativePath===e.result.file.relativePath);n&&(this.openFileInTab({file:n}),this.isSearchPanelOpen_$.set(!1))}loadRelationsForFile(e){return I(this,null,function*(){let n=this.selectedProjectId_$();if(n)try{let r=yield F(this.ps_AS.getRelationsForFile({projectId:n,fileId:e.fileId}));this.relations_$.set([...r.outgoing,...r.incoming])}catch{}})}loadRunFlows(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.listRunFlows({projectId:e}));this.runFlows_$.set(n.items)}catch{}})}loadDataFlows(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.listDataFlows({projectId:e}));this.dataFlows_$.set(n.items)}catch{}})}loadDescriptions(){return I(this,null,function*(){let e=this.selectedProjectId_$();if(e)try{let n=yield F(this.ps_AS.listDescriptions({projectId:e}));this.descriptions_$.set(n.items)}catch{}})}updateDescription(e){return I(this,null,function*(){let n=this.selectedProjectId_$();if(n)try{yield F(this.ps_AS.updateDescription({projectId:n,descId:e.descId,description:e.description})),yield this.loadDescriptions()}catch(r){this.error_$.set(r instanceof Error?r.message:"Description friss\xEDt\xE9s sikertelen.")}})}embeddingPollTimer=null;startEmbeddingPolling(){this.stopEmbeddingPolling(),this.embeddingPollTimer=setInterval(()=>{this.loadEmbeddingStatus().then(()=>{this.embeddingStatus_$()?.pending===0&&(this.isEmbedding_$.set(!1),this.stopEmbeddingPolling())})},3e3)}stopEmbeddingPolling(){this.embeddingPollTimer&&(clearInterval(this.embeddingPollTimer),this.embeddingPollTimer=null)}loadFileForTab(e){return I(this,null,function*(){let n=this.selectedProjectId_$();if(n){this.updateTabLoading({fileId:e.fileId,isLoading:!0});try{let r=yield F(this.ps_AS.getFileDetail({projectId:n,fileId:e.fileId}));this.tabFileCache.set(e.fileId,{file:r.file,chunks:r.chunks}),this.activeTabId_$()===e.fileId&&(this.selectedFile_$.set(r.file),this.selectedFileChunks_$.set(r.chunks),this.loadRelationsForFile({fileId:e.fileId}))}catch(r){this.error_$.set(r instanceof Error?r.message:"F\xE1jl detail bet\xF6lt\xE9se sikertelen.")}finally{this.updateTabLoading({fileId:e.fileId,isLoading:!1})}}})}updateTabLoading(e){this.openTabs_$.update(n=>n.map(r=>r.fileId===e.fileId?K(J({},r),{isLoading:e.isLoading}):r))}persistTabs(){let e=this.openTabs_$().map(r=>r.fileId);T.saveOpenTabIds(e);let n=this.activeTabId_$();n&&T.saveActiveTabId(n)}startStatusPolling(){this.stopStatusPolling(),this.statusPollTimer=setInterval(()=>{this.loadIngestionStatus()},3e3)}stopStatusPolling(){this.statusPollTimer&&(clearInterval(this.statusPollTimer),this.statusPollTimer=null)}restoreFromStorage(){this.isFileTreeOpen_$.set(T.loadPanelOpen("fileTree",!0)),this.isInfoPanelOpen_$.set(T.loadPanelOpen("infoPanel",!0));let e=T.loadExpandedFolders();e.length>0&&this.expandedFolders_$.set(new Set(e))}ngOnDestroy(){this.stopStatusPolling(),this.stopEmbeddingPolling()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Y({token:t,factory:t.\u0275fac})}return t})();var je=(t,a)=>a.id;function Me(t,a){if(t&1&&(i(0,"option",14),s(1),o()),t&2){let e=a.$implicit;C("value",e.id),l(),h(e.name)}}function Re(t,a){if(t&1){let e=M();i(0,"select",12),S("change",function(r){D(e);let d=p();return w(d.handleProjectChange(r.target.value))}),i(1,"option",13),s(2,"Select project..."),o(),b(3,Me,2,2,"option",14,je),o()}if(t&2){let e,n=p();C("value",(e=n.ps_DS.selectedProjectId_$())!==null&&e!==void 0?e:""),l(3),P(n.ps_DS.projects_$())}}function Ae(t,a){t&1&&(m(0,"span",18),s(1," Ingesting... "))}function Ne(t,a){t&1&&(s(0," Ingest "),E(),i(1,"svg",16),m(2,"polyline",3),o())}function Ve(t,a){if(t&1){let e=M();i(0,"div",17)(1,"button",19),S("click",function(){D(e);let r=p(2);return w(r.handleStartIngestion("full"))}),s(2," Full ingestion "),o(),i(3,"button",19),S("click",function(){D(e);let r=p(2);return w(r.handleStartIngestion("incremental"))}),s(4," Incremental "),o()()}}function Oe(t,a){if(t&1){let e=M();i(0,"div",6)(1,"button",15),S("click",function(){D(e);let r=p();return w(r.handleToggleIngestMenu())}),_(2,Ae,2,0)(3,Ne,3,0,":svg:svg",16),o(),_(4,Ve,5,0,"div",17),o()}if(t&2){let e=p();l(),O("opacity-50",e.ps_DS.isIngesting_$()),C("disabled",e.ps_DS.isIngesting_$()),l(),c(e.ps_DS.isIngesting_$()?2:3),l(2),c(e.isIngestMenuOpen_$()&&!e.ps_DS.isIngesting_$()?4:-1)}}function Ue(t,a){if(t&1&&(i(0,"span",8),s(1),o()),t&2){let e=a;C("title",e.relativePath),l(),x(" ",e.relativePath," ")}}function Be(t,a){t&1&&(i(0,"span",9),s(1,"No file selected"),o())}function Le(t,a){t&1&&(i(0,"span",9),s(1,"Select a project to begin"),o())}function Ge(t,a){if(t&1&&(i(0,"span",20),s(1),o(),i(2,"span",21),s(3,"|"),o(),i(4,"span",20),s(5),o(),m(6,"span",4)),t&2){let e=a;l(),x(" ",e.totalFiles," files "),l(4),x(" ",e.totalChunks," chunks ")}}var Se=(()=>{class t{ps_DS=v(g);isIngestMenuOpen_$=u(!1);handleProjectChange(e){e&&this.ps_DS.selectProject({projectId:e})}handleStartIngestion(e){this.isIngestMenuOpen_$.set(!1),this.ps_DS.startIngestion({mode:e})}handleToggleIngestMenu(){this.isIngestMenuOpen_$.update(e=>!e)}handleToggleFileTree(){this.ps_DS.toggleFileTree()}handleToggleSearchPanel(){this.ps_DS.toggleSearchPanel()}handleToggleInfoPanel(){this.ps_DS.toggleInfoPanel()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-ide-toolbar"]],hostAttrs:[1,"block","shrink-0"],decls:19,vars:12,consts:[["sSessionToolbarLeft","",1,"flex","items-center","gap-1","min-w-0"],[1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors","flex","items-center","gap-1","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","shrink-0","transition-transform","duration-150"],["points","6 9 12 15 18 9"],[1,"w-px","h-4","bg-neutral-700","shrink-0","self-center","mx-0.5"],[1,"bg-ccapBg","border","border-neonDefault","text-neutral-300","text-xs","rounded","px-2","py-1","max-w-[180px]","truncate","focus:outline-none","focus:border-neonCyan",3,"value"],[1,"relative","shrink-0"],["sSessionToolbarCenter","",1,"flex","items-center","justify-center","gap-2","min-w-0"],[1,"text-xs","text-neutral-500","truncate","max-w-[400px]",3,"title"],[1,"text-xs","text-neutral-500"],["sSessionToolbarRight","",1,"flex","items-center","gap-1","min-w-0","flex-wrap","justify-end"],[1,"px-2","py-1","text-xs","border","rounded","transition-colors","shrink-0",3,"click"],[1,"bg-ccapBg","border","border-neonDefault","text-neutral-300","text-xs","rounded","px-2","py-1","max-w-[180px]","truncate","focus:outline-none","focus:border-neonCyan",3,"change","value"],["value","","disabled",""],[3,"value"],[1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors","flex","items-center","gap-1",3,"click","disabled"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2",1,"w-3","h-3"],[1,"absolute","top-full","left-0","mt-1","bg-ccapSurface","border","border-neonDefault","rounded","shadow-lg","z-20","min-w-[140px]"],[1,"w-2","h-2","rounded-full","bg-neonCyan","animate-pulse","shrink-0"],[1,"block","w-full","text-left","px-3","py-1.5","text-xs","text-neutral-300","hover:bg-neonCyan/10","hover:text-neonCyan","transition-colors",3,"click"],[1,"text-[10px]","text-neutral-500","shrink-0"],[1,"text-[10px]","text-neutral-600","shrink-0"]],template:function(n,r){if(n&1&&(i(0,"app-s-session-shell-toolbar")(1,"div",0)(2,"button",1),S("click",function(){return r.handleToggleFileTree()}),E(),i(3,"svg",2),m(4,"polyline",3),o(),s(5," Files "),o(),j(),m(6,"div",4),_(7,Re,5,1,"select",5)(8,Oe,5,5,"div",6),o(),i(9,"div",7),_(10,Ue,2,2,"span",8)(11,Be,2,0,"span",9)(12,Le,2,0,"span",9),o(),i(13,"div",10),_(14,Ge,7,2),i(15,"button",11),S("click",function(){return r.handleToggleSearchPanel()}),s(16," Search "),o(),i(17,"button",11),S("click",function(){return r.handleToggleInfoPanel()}),s(18," Info "),o()()()),n&2){let d,f;l(3),O("rotate-90",r.ps_DS.isFileTreeOpen_$())("-rotate-90",!r.ps_DS.isFileTreeOpen_$()),l(4),c(r.ps_DS.isEmbedded_$()?-1:7),l(),c(r.ps_DS.selectedProjectId_$()?8:-1),l(2),c((d=r.ps_DS.selectedFile_$())?10:r.ps_DS.selectedProjectId_$()?11:12,d),l(4),c((f=r.ps_DS.stats_$())?14:-1,f),l(),k(r.ps_DS.isSearchPanelOpen_$()?"border-neonGreen/50 text-neonGreen bg-neonGreen/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600"),l(2),k(r.ps_DS.isInfoPanelOpen_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600")}},dependencies:[B,L,me],encapsulation:2})}return t})();var We=(t,a)=>a.path;function ze(t,a){if(t&1&&m(0,"app-ps-file-tree-node",6),t&2){let e=a.$implicit,n=p(3);C("node",e)("depth",n.depth+1)}}function He(t,a){if(t&1&&b(0,ze,1,2,"app-ps-file-tree-node",6,We),t&2){let e=p(2);P(e.node.children)}}function Xe(t,a){if(t&1){let e=M();i(0,"button",1),S("click",function(){D(e);let r=p();return w(r.handleFolderToggle())}),E(),i(1,"svg",2),m(2,"polyline",3),o(),j(),i(3,"span",4),s(4),o(),i(5,"span",5),s(6),o()(),_(7,He,2,0)}if(t&2){let e=p();H("padding-left",e.depth*16+4,"px"),l(),O("rotate-90",e.isExpanded),l(3),h(e.node.name),l(2),x(" ",e.node.fileCount," "),l(),c(e.isExpanded?7:-1)}}function Qe(t,a){if(t&1&&(i(0,"span",9),s(1),o()),t&2){let e=p(2);l(),h(e.node.file.chunkCount)}}function Je(t,a){if(t&1){let e=M();i(0,"button",7),S("click",function(){D(e);let r=p();return w(r.handleFileClick())}),m(1,"span",8),i(2,"span",4),s(3),o(),_(4,Qe,2,1,"span",9),o()}if(t&2){let e=p();k(e.isActiveFile?"border-l-2 border-neonCyan bg-neonCyan/5 text-neonCyan":"text-neutral-400 hover:bg-neonCyan/5 hover:text-neutral-300 border-l-2 border-transparent"),H("padding-left",e.depth*16+20,"px"),l(),k((e.node.file==null?null:e.node.file.sourceType)==="code"?"bg-neonCyan/60":(e.node.file==null?null:e.node.file.sourceType)==="rule"?"bg-neonAmber/60":"bg-neonGreen/60"),l(2),h(e.node.name),l(),c(e.node.file&&e.node.file.chunkCount?4:-1)}}var Ce=(()=>{class t{node;depth;ps_DS=v(g);handleFolderToggle(){this.ps_DS.toggleFolder({folderPath:this.node.path})}handleFileClick(){this.node.file&&this.ps_DS.openFileInTab({file:this.node.file})}get isExpanded(){return this.ps_DS.expandedFolders_$().has(this.node.path)}get isActiveFile(){return!this.node.isFolder&&!!this.node.file&&this.ps_DS.activeTabId_$()===this.node.file.id}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-file-tree-node"]],hostAttrs:[1,"block"],inputs:{node:"node",depth:"depth"},decls:2,vars:1,consts:[[1,"flex","items-center","w-full","text-left","py-0.5","pr-2","text-xs","transition-colors",3,"padding-left","class"],[1,"flex","items-center","w-full","text-left","py-0.5","pr-2","text-xs","text-neutral-400","hover:bg-neonCyan/5","hover:text-neutral-300","transition-colors","group",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","mr-1","shrink-0","transition-transform","duration-100"],["points","9 18 15 12 9 6"],[1,"truncate"],[1,"ml-auto","text-[10px]","text-neutral-600","group-hover:text-neutral-500","shrink-0"],[3,"node","depth"],[1,"flex","items-center","w-full","text-left","py-0.5","pr-2","text-xs","transition-colors",3,"click"],[1,"w-2","h-2","rounded-full","mr-1.5","shrink-0"],[1,"ml-auto","text-[10px]","text-neutral-600","shrink-0"]],template:function(n,r){n&1&&_(0,Xe,8,7)(1,Je,5,8,"button",0),n&2&&c(r.node.isFolder?0:1)},dependencies:[t],encapsulation:2})}return t})();var Ye=(t,a)=>a.path;function Ze(t,a){t&1&&(i(0,"div",3),s(1," Loading... "),o())}function et(t,a){t&1&&(i(0,"div",4),s(1," No files found "),o())}function tt(t,a){if(t&1&&m(0,"app-ps-file-tree-node",17),t&2){let e=a.$implicit;C("node",e)("depth",0)}}function nt(t,a){if(t&1&&b(0,tt,1,2,"app-ps-file-tree-node",17,Ye),t&2){let e=p();P(e.filteredTree_$())}}function it(t,a){if(t&1&&(i(0,"option",18),s(1),o()),t&2){let e=a.$implicit;C("value",e),l(),h(e)}}function ot(t,a){if(t&1){let e=M();i(0,"select",6),S("change",function(r){D(e);let d=p();return w(d.handleModuleChange(r.target.value))}),i(1,"option",7),s(2,"All modules"),o(),b(3,it,2,2,"option",18,U),o()}if(t&2){let e=p();C("value",e.ps_DS.filterModule_$()),l(3),P(e.ps_DS.availableModules_$())}}var ve=(()=>{class t{ps_DS=v(g);filteredTree_$=Z(()=>{let e=this.ps_DS.treeSearchQuery_$(),n=this.ps_DS.fileTree_$();return e.trim()?G.filterTreeBySearch({nodes:n,query:e}):n});handleSearchChange(e){this.ps_DS.treeSearchQuery_$.set(e)}handleSourceTypeChange(e){this.ps_DS.filterSourceType_$.set(e),this.ps_DS.loadFilesAndBuildTree()}handleProjectPartChange(e){this.ps_DS.filterProjectPart_$.set(e),this.ps_DS.loadFilesAndBuildTree()}handleModuleChange(e){this.ps_DS.filterModule_$.set(e),this.ps_DS.loadFilesAndBuildTree()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-file-tree"]],hostAttrs:[1,"flex","flex-col","h-full","overflow-hidden"],decls:30,vars:5,consts:[[1,"shrink-0","p-2","border-b","border-neonDefault/30"],["type","text","placeholder","Search files...",1,"w-full","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-1","text-xs","text-neutral-300","placeholder-neutral-600","focus:outline-none","focus:border-neonCyan/60",3,"input","value"],[1,"flex-1","overflow-y-auto","overflow-x-hidden","min-h-0","py-1"],[1,"flex","items-center","justify-center","py-8","text-neutral-500","text-xs"],[1,"flex","items-center","justify-center","py-8","text-neutral-600","text-xs"],[1,"shrink-0","border-t","border-neonDefault/30","p-2","space-y-1"],[1,"w-full","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-0.5","text-[10px]","text-neutral-400","focus:outline-none","focus:border-neonCyan/60",3,"change","value"],["value",""],["value","code"],["value","document"],["value","rule"],["value","server"],["value","client"],["value","cli"],["value","e2e"],["value","shared"],[1,"w-full","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-0.5","text-[10px]","text-neutral-400","focus:outline-none","focus:border-neonCyan/60",3,"value"],[3,"node","depth"],[3,"value"]],template:function(n,r){n&1&&(i(0,"div",0)(1,"input",1),S("input",function(f){return r.handleSearchChange(f.target.value)}),o()(),i(2,"div",2),_(3,Ze,2,0,"div",3)(4,et,2,0,"div",4)(5,nt,2,0),o(),i(6,"div",5)(7,"select",6),S("change",function(f){return r.handleSourceTypeChange(f.target.value)}),i(8,"option",7),s(9,"All types"),o(),i(10,"option",8),s(11,"Code"),o(),i(12,"option",9),s(13,"Document"),o(),i(14,"option",10),s(15,"Rule"),o()(),i(16,"select",6),S("change",function(f){return r.handleProjectPartChange(f.target.value)}),i(17,"option",7),s(18,"All parts"),o(),i(19,"option",11),s(20,"Server"),o(),i(21,"option",12),s(22,"Client"),o(),i(23,"option",13),s(24,"CLI"),o(),i(25,"option",14),s(26,"E2E"),o(),i(27,"option",15),s(28,"Shared"),o()(),_(29,ot,5,1,"select",16),o()),n&2&&(l(),C("value",r.ps_DS.treeSearchQuery_$()),l(2),c(r.ps_DS.isLoading_$()?3:r.filteredTree_$().length?5:4),l(4),C("value",r.ps_DS.filterSourceType_$()),l(9),C("value",r.ps_DS.filterProjectPart_$()),l(13),c(r.ps_DS.availableModules_$().length?29:-1))},dependencies:[B,L,Ce],encapsulation:2})}return t})();var lt=(t,a)=>a.fileId;function at(t,a){t&1&&m(0,"span",3)}function st(t,a){if(t&1){let e=M();i(0,"button",2),S("click",function(){let r=D(e).$implicit,d=p(2);return w(d.handleTabClick(r))}),_(1,at,1,0,"span",3),i(2,"span",4),s(3),o(),i(4,"span",5),S("click",function(r){let d=D(e).$implicit,f=p(2);return w(f.handleTabClose(r,d))}),E(),i(5,"svg",6),m(6,"line",7)(7,"line",8),o()()()}if(t&2){let e=a.$implicit,n=p(2);k(n.ps_DS.activeTabId_$()===e.fileId?"border-b-2 border-b-neonCyan text-neonCyan bg-neonCyan/5":"text-neutral-400 hover:text-neutral-300 hover:bg-neutral-800 border-b-2 border-b-transparent"),l(),c(e.isLoading?1:-1),l(2),h(e.fileName)}}function dt(t,a){if(t&1&&(i(0,"div",0),b(1,st,8,4,"button",1,lt),o()),t&2){let e=p();l(),P(e.ps_DS.openTabs_$())}}var ge=(()=>{class t{ps_DS=v(g);handleTabClick(e){this.ps_DS.setActiveTab({fileId:e.fileId})}handleTabClose(e,n){e.stopPropagation(),this.ps_DS.closeTab({fileId:n.fileId})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-tab-bar"]],hostAttrs:[1,"block","shrink-0"],decls:1,vars:1,consts:[[1,"flex","items-stretch","overflow-x-auto","border-b","border-neonDefault/30","bg-ccapBg","scrollbar-thin","scrollbar-thumb-neutral-700"],[1,"flex","items-center","gap-1.5","px-3","py-1.5","text-xs","whitespace-nowrap","border-r","border-neonDefault/20","transition-colors","shrink-0","max-w-[200px]","group",3,"class"],[1,"flex","items-center","gap-1.5","px-3","py-1.5","text-xs","whitespace-nowrap","border-r","border-neonDefault/20","transition-colors","shrink-0","max-w-[200px]","group",3,"click"],[1,"w-2","h-2","rounded-full","bg-neonCyan","animate-pulse","shrink-0"],[1,"truncate"],[1,"ml-1","w-4","h-4","flex","items-center","justify-center","rounded","hover:bg-neutral-600","text-neutral-500","hover:text-neutral-200","opacity-0","group-hover:opacity-100","transition-opacity","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2.5",1,"w-2.5","h-2.5"],["x1","18","y1","6","x2","6","y2","18"],["x1","6","y1","6","x2","18","y2","18"]],template:function(n,r){n&1&&_(0,dt,3,0,"div",0),n&2&&c(r.ps_DS.openTabs_$().length?0:-1)},encapsulation:2})}return t})();var pt=(t,a)=>a.id;function _t(t,a){t&1&&(i(0,"div",1),E(),i(1,"svg",4),m(2,"path",5)(3,"polyline",6),o(),j(),i(4,"span",7),s(5,"Open a file from the tree"),o()())}function mt(t,a){t&1&&(i(0,"div",2),s(1," No chunks available for this file "),o())}function ut(t,a){if(t&1&&m(0,"span",12),t&2){let e=p().$implicit;C("title","Embedded: "+e.dimensions+"d, "+e.embeddingTimeMs+"ms")}}function ft(t,a){t&1&&m(0,"span",13)}function ht(t,a){t&1&&m(0,"span",14)}function xt(t,a){if(t&1&&(i(0,"span",15),s(1),o()),t&2){let e=p().$implicit;l(),V(" L",e.lineStart,"-",e.lineEnd," ")}}function St(t,a){if(t&1&&(i(0,"span",17),s(1),o()),t&2){let e=p().$implicit;l(),x(" ",e.chunkType," ")}}function Ct(t,a){if(t&1&&(i(0,"span",18),s(1),o()),t&2){let e=p().$implicit;C("title",e.headerPath),l(),x(" ",e.headerPath," ")}}function vt(t,a){if(t&1&&(i(0,"span",20),s(1),o()),t&2){let e=a.$implicit;l(),x(" ",e," ")}}function gt(t,a){if(t&1&&b(0,vt,2,1,"span",20,U),t&2){let e=p().$implicit;P(e.requirementCodes)}}function It(t,a){if(t&1){let e=M();i(0,"div",9),S("click",function(){let r=D(e).$implicit,d=p(2);return w(d.handleChunkClick(r))}),i(1,"div",10)(2,"span",11),s(3),o(),_(4,ut,1,1,"span",12)(5,ft,1,0,"span",13)(6,ht,1,0,"span",14)(7,xt,2,2,"span",15),i(8,"span",16),s(9),o(),_(10,St,2,1,"span",17)(11,Ct,2,2,"span",18)(12,gt,2,0),o(),i(13,"pre",19),s(14),o()()}if(t&2){let e=a.$implicit,n=p(2);k(n.ps_DS.selectedChunkIndex_$()===e.chunkIndex?"ring-1 ring-neonCyan/40 bg-neonCyan/3 border-neonCyan/30":"border-neonDefault/20 hover:border-neonDefault/40 bg-ccapSurface"),l(3),x(" #",e.chunkIndex," "),l(),c(e.embeddingStatus==="completed"?4:e.embeddingStatus==="error"?5:6),l(3),c(e.lineStart!==void 0&&e.lineEnd!==void 0?7:-1),l(2),V(" C",e.charStart,"-",e.charEnd," "),l(),c(e.chunkType?10:-1),l(),c(e.headerPath?11:-1),l(),c(e.requirementCodes.length?12:-1),l(2),h(e.text)}}function bt(t,a){if(t&1&&(i(0,"div",3),b(1,It,15,11,"div",8,pt),o()),t&2){let e=p();l(),P(e.ps_DS.selectedFileChunks_$())}}var Ie=(()=>{class t{ps_DS=v(g);handleChunkClick(e){this.ps_DS.selectChunk({chunkIndex:e.chunkIndex})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-chunk-viewer"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],decls:4,vars:1,consts:[[1,"flex-1","overflow-y-auto","min-h-0","p-3"],[1,"flex","flex-col","items-center","justify-center","h-full","text-neutral-600"],[1,"flex","items-center","justify-center","h-full","text-neutral-600","text-sm"],[1,"space-y-2"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1",1,"w-12","h-12","mb-3","text-neutral-700"],["d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"],["points","13 2 13 9 20 9"],[1,"text-sm"],[1,"rounded","border","transition-all","cursor-pointer",3,"class"],[1,"rounded","border","transition-all","cursor-pointer",3,"click"],[1,"flex","items-center","gap-2","px-3","py-1.5","border-b","border-neonDefault/10"],[1,"text-[10px]","font-mono","text-neutral-500"],[1,"w-2","h-2","rounded-full","bg-neonGreen","shrink-0",3,"title"],["title","Embedding error",1,"w-2","h-2","rounded-full","bg-red-400","shrink-0"],["title","Not embedded",1,"w-2","h-2","rounded-full","bg-neutral-600","shrink-0"],[1,"text-[10px]","text-neutral-600"],[1,"text-[10px]","text-neutral-600","font-mono"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonCyan/10","text-neonCyan"],[1,"text-[10px]","text-neutral-500","truncate","max-w-[250px]",3,"title"],[1,"px-3","py-2","text-xs","text-neutral-300","font-mono","whitespace-pre-wrap","break-words","overflow-x-auto","max-h-[400px]","overflow-y-auto","leading-relaxed"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonAmber/10","text-neonAmber"]],template:function(n,r){n&1&&(i(0,"div",0),_(1,_t,6,0,"div",1)(2,mt,2,0,"div",2)(3,bt,3,0,"div",3),o()),n&2&&(l(),c(r.ps_DS.activeTabId_$()?!r.ps_DS.selectedFileChunks_$().length&&!r.ps_DS.isLoading_$()?2:3:1))},encapsulation:2})}return t})();var $t=(t,a)=>a.code,be=(t,a)=>a.id;function yt(t,a){if(t&1&&(i(0,"div",22)(1,"div",13),s(2,"Module"),o(),i(3,"div",20),s(4),o()()),t&2){let e=p();l(4),h(e.moduleName)}}function Et(t,a){if(t&1&&(i(0,"div")(1,"div",13),s(2,"Role"),o(),i(3,"div",20),s(4),o()()),t&2){let e=p();l(4),h(e.fileRole)}}function kt(t,a){if(t&1&&(i(0,"div",25),s(1),o()),t&2){let e=p(2);l(),h(e.errorMessage)}}function Dt(t,a){if(t&1&&(i(0,"div",23)(1,"div",24),s(2,"Error"),o(),_(3,kt,2,1,"div",25),o()),t&2){let e=p();l(3),c(e.errorMessage?3:-1)}}function wt(t,a){if(t&1&&(i(0,"span",28),s(1),o()),t&2){let e=a.$implicit;l(),x(" ",e," ")}}function Ft(t,a){if(t&1&&(i(0,"div",22)(1,"div",26),s(2,"Requirements"),o(),i(3,"div",27),b(4,wt,2,1,"span",28,U),o()()),t&2){let e=p();l(4),P(e.requirementCodes)}}function jt(t,a){if(t&1&&(i(0,"div",13),s(1,"Path"),o(),i(2,"div",17),s(3),o(),i(4,"div",18)(5,"div")(6,"div",13),s(7,"Type"),o(),i(8,"span",19),s(9),o()(),i(10,"div")(11,"div",13),s(12,"Part"),o(),i(13,"div",20),s(14),o()(),i(15,"div")(16,"div",13),s(17,"Extension"),o(),i(18,"div",21),s(19),o()(),i(20,"div")(21,"div",13),s(22,"Lines"),o(),i(23,"div",20),s(24),o()(),i(25,"div")(26,"div",13),s(27,"Size"),o(),i(28,"div",20),s(29),o()(),i(30,"div")(31,"div",13),s(32,"Chunks"),o(),i(33,"div",20),s(34),o()()(),_(35,yt,5,1,"div",22)(36,Et,5,1,"div")(37,Dt,4,1,"div",23)(38,Ft,6,0,"div",22)),t&2){let e=a;l(3),h(e.relativePath),l(5),k(e.sourceType==="code"?"bg-neonCyan/10 text-neonCyan":e.sourceType==="rule"?"bg-neonAmber/10 text-neonAmber":"bg-neonGreen/10 text-neonGreen"),l(),x(" ",e.sourceType," "),l(5),h(e.projectPart),l(5),h(e.fileExtension),l(5),h(e.lineCount),l(5),x("",e.fileSizeBytes," B"),l(5),h(e.chunkCount),l(),c(e.moduleName?35:-1),l(),c(e.fileRole?36:-1),l(),c(e.status==="error"?37:-1),l(),c(e.requirementCodes.length?38:-1)}}function Mt(t,a){t&1&&(i(0,"div",6),s(1,"No file selected"),o())}function Rt(t,a){if(t&1&&(i(0,"span",8),s(1),o()),t&2){let e=p();l(),x(" ",e.ps_DS.requirementCodes_$().length," ")}}function At(t,a){t&1&&(i(0,"div",6),s(1,"No requirement codes"),o())}function Nt(t,a){if(t&1&&(i(0,"div",29)(1,"span",30),s(2),o(),i(3,"span",31),s(4),o()()),t&2){let e=a.$implicit;l(2),x(" ",e.code," "),l(2),V(" ",e.fileCount,"f / ",e.chunkCount,"c ")}}function Vt(t,a){if(t&1&&b(0,Nt,5,3,"div",29,$t),t&2){let e=p();P(e.ps_DS.requirementCodes_$())}}function Ot(t,a){if(t&1&&(i(0,"span",35),s(1),o()),t&2){let e=p().$implicit;l(),h(e.externalPackage)}}function Ut(t,a){if(t&1&&(i(0,"span",36),s(1),o()),t&2){let e,n,r=p().$implicit;C("title",(e=r.targetFilePath)!==null&&e!==void 0?e:""),l(),x(" ",(n=r.targetSymbol)!==null&&n!==void 0?n:r.targetFilePath," ")}}function Bt(t,a){if(t&1&&(i(0,"div",33)(1,"span",34),s(2),o(),_(3,Ot,2,1,"span",35)(4,Ut,2,2,"span",36),o()),t&2){let e=a.$implicit;l(),k(e.relationType==="import"?"bg-blue-900/50 text-blue-300":e.relationType==="injection"?"bg-purple-900/50 text-purple-300":e.relationType==="inheritance"?"bg-orange-900/50 text-orange-300":"bg-neutral-700 text-neutral-300"),l(),x(" ",e.relationType," "),l(),c(e.isExternalTarget?3:4)}}function Lt(t,a){if(t&1&&(i(0,"details",7)(1,"summary",2),E(),i(2,"svg",3),m(3,"polyline",4),o(),s(4," Relations "),j(),i(5,"span",8),s(6),o()(),i(7,"div",32),b(8,Bt,5,4,"div",33,be),o()()),t&2){let e=p();l(6),x(" ",e.ps_DS.relations_$().length," "),l(2),P(e.ps_DS.relations_$())}}function Gt(t,a){t&1&&m(0,"span",10)}function qt(t,a){if(t&1&&(i(0,"div")(1,"div",13),s(2,"Duration"),o(),i(3,"div",20),s(4),X(5,"number"),o()()),t&2){let e=p();l(4),x(" ",Q(5,1,e.durationMs/1e3,"1.0-1"),"s ")}}function Wt(t,a){if(t&1&&(i(0,"span",42),s(1),o()),t&2){let e=p();l(),x("err:",e.filesErrored,"")}}function zt(t,a){if(t&1&&(i(0,"div",43),s(1),o()),t&2){let e=p();l(),h(e.errorMessage)}}function Ht(t,a){if(t&1&&(i(0,"pre",44),s(1),o()),t&2){let e=p();l(),h(e.errorDetails)}}function Xt(t,a){if(t&1&&(i(0,"div",37)(1,"div")(2,"div",13),s(3,"Status"),o(),i(4,"div",38),s(5),o()(),i(6,"div")(7,"div",13),s(8,"Mode"),o(),i(9,"div",20),s(10),o()(),_(11,qt,6,4,"div"),i(12,"div")(13,"div",13),s(14,"Scanned"),o(),i(15,"div",20),s(16),o()()(),i(17,"div",39)(18,"span",40),s(19),o(),i(20,"span",41),s(21),o(),i(22,"span",42),s(23),o(),i(24,"span",13),s(25),o(),_(26,Wt,2,1,"span",42),o(),_(27,zt,2,1,"div",43)(28,Ht,2,1,"pre",44)),t&2){let e=a;l(4),k(e.status==="completed"?"text-neonGreen":e.status==="running"?"text-neonCyan":e.status==="failed"?"text-red-400":"text-neutral-400"),l(),x(" ",e.status," "),l(5),h(e.mode),l(),c(e.durationMs?11:-1),l(5),h(e.totalFilesScanned),l(3),x("+",e.filesNew,""),l(2),x("~",e.filesChanged,""),l(2),x("-",e.filesDeleted,""),l(2),x("=",e.filesUnchanged,""),l(),c(e.filesErrored?26:-1),l(),c(e.errorMessage?27:-1),l(),c(e.errorDetails?28:-1)}}function Qt(t,a){t&1&&(i(0,"div",6),s(1,"No ingestion runs"),o())}function Jt(t,a){t&1&&m(0,"span",11)}function Kt(t,a){if(t&1&&(i(0,"div",45),m(1,"div",46),o(),i(2,"div",13),s(3),X(4,"number"),o(),i(5,"div",47)(6,"div",48)(7,"div",49),s(8),o(),i(9,"div",35),s(10,"Total"),o()(),i(11,"div",48)(12,"div",50),s(13),o(),i(14,"div",35),s(15,"Done"),o()(),i(16,"div",48)(17,"div",51),s(18),o(),i(19,"div",35),s(20,"Pending"),o()(),i(21,"div",48)(22,"div",52),s(23),o(),i(24,"div",35),s(25,"Error"),o()()()),t&2){let e=a;l(),H("width",e.total>0?e.completed/e.total*100:0,"%"),l(2),le(" ",e.completed,"/",e.total," embedded (",e.total>0?Q(4,9,e.completed/e.total*100,"1.0-0"):0,"%) "),l(5),h(e.total),l(5),h(e.completed),l(5),h(e.pending),l(5),h(e.error)}}function Yt(t,a){t&1&&(i(0,"div",13),s(1,"No embedding status"),o())}function Zt(t,a){t&1&&(i(0,"span",16),m(1,"span",53),s(2," Embedding... "),o())}function en(t,a){t&1&&s(0," Embed Now ")}function tn(t,a){if(t&1&&(i(0,"div",58),s(1),o()),t&2){let e=p().$implicit;l(),h(e.description)}}function nn(t,a){t&1&&(i(0,"div",59),s(1,"No description"),o())}function on(t,a){if(t&1&&(i(0,"div",54)(1,"div",55)(2,"span",56),s(3),o(),i(4,"span",57),s(5),o()(),_(6,tn,2,1,"div",58)(7,nn,2,0,"div",59),o()),t&2){let e=a.$implicit;l(3),x(" ",e.elementType," "),l(2),h(e.displayName),l(),c(e.description?6:7)}}function rn(t,a){if(t&1&&(i(0,"details",7)(1,"summary",2),E(),i(2,"svg",3),m(3,"polyline",4),o(),s(4," Descriptions "),j(),i(5,"span",8),s(6),o()(),i(7,"div",32),b(8,on,8,3,"div",54,be),o()()),t&2){let e=p();l(6),x(" ",e.ps_DS.descriptions_$().length," "),l(2),P(e.ps_DS.descriptions_$())}}var Pe=(()=>{class t{ps_DS=v(g);handleStartEmbedding(){this.ps_DS.startEmbedding()}handleLoadEmbeddingStatus(){this.ps_DS.loadEmbeddingStatus()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-info-panel"]],hostAttrs:[1,"flex","flex-col","h-full","overflow-hidden"],decls:42,vars:14,consts:[[1,"flex-1","overflow-y-auto","min-h-0","p-2","space-y-2"],["open","",1,"group"],[1,"flex","items-center","gap-1","cursor-pointer","text-xs","font-semibold","text-neutral-300","py-1.5","px-2","rounded","hover:bg-neonCyan/5","transition-colors","select-none","border","border-neonDefault/20"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","shrink-0","transition-transform","duration-100","group-open:rotate-90","text-neutral-500"],["points","9 18 15 12 9 6"],[1,"mt-1","px-2","pb-1","space-y-1"],[1,"text-xs","text-neutral-600","py-2"],[1,"group"],[1,"ml-auto","text-[10px]","text-neutral-500"],[1,"mt-1","px-2","pb-1","space-y-1","max-h-[240px]","overflow-y-auto"],[1,"ml-1","w-2","h-2","rounded-full","bg-neonCyan","animate-pulse","shrink-0"],[1,"ml-1","w-2","h-2","rounded-full","bg-neonGreen","animate-pulse","shrink-0"],[1,"mt-1","px-2","pb-1","space-y-2"],[1,"text-[10px]","text-neutral-500"],["type","text","placeholder","Embedding Registry Entry ID","title","Paste the registry entry ID from Embedding Model Registry",1,"w-full","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-0.5","text-[10px]","text-neutral-400","focus:outline-none","focus:border-neonCyan/60",3,"change","value"],[1,"w-full","px-2","py-1","text-[10px]","border","rounded","transition-colors",3,"click","disabled"],[1,"inline-flex","items-center","gap-1"],[1,"text-xs","text-neutral-300","break-all","font-mono"],[1,"grid","grid-cols-2","gap-x-2","gap-y-1","mt-1"],[1,"text-xs","px-1.5","py-0.5","rounded-full","inline-block"],[1,"text-xs","text-neutral-300"],[1,"text-xs","text-neutral-300","font-mono"],[1,"mt-1"],[1,"mt-2","text-[10px]","text-red-400","bg-red-900/20","rounded","p-1.5"],[1,"font-bold"],[1,"mt-0.5","break-words"],[1,"text-[10px]","text-neutral-500","mb-0.5"],[1,"flex","flex-wrap","gap-1"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonAmber/10","text-neonAmber"],[1,"flex","items-center","gap-2","py-0.5"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonAmber/10","text-neonAmber","shrink-0","font-mono"],[1,"text-[10px]","text-neutral-500","shrink-0"],[1,"mt-1","px-2","pb-1","space-y-1","max-h-40","overflow-y-auto"],[1,"text-[10px]","flex","items-center","gap-1","py-0.5"],[1,"px-1","py-0.5","rounded","text-[9px]"],[1,"text-neutral-500"],[1,"text-neutral-400","truncate",3,"title"],[1,"grid","grid-cols-2","gap-x-2","gap-y-1"],[1,"text-xs","font-mono"],[1,"flex","flex-wrap","gap-1.5","mt-1"],[1,"text-[10px]","text-neonGreen"],[1,"text-[10px]","text-neonAmber"],[1,"text-[10px]","text-red-400"],[1,"text-[10px]","text-red-400","mt-1","break-words"],[1,"text-[9px]","text-red-300","bg-red-900/10","rounded","p-1","mt-1","max-h-20","overflow-y-auto","whitespace-pre-wrap"],[1,"w-full","bg-neutral-800","rounded-full","h-1.5"],[1,"bg-neonGreen","h-1.5","rounded-full","transition-all"],[1,"grid","grid-cols-4","gap-1","text-center","text-[10px]"],[1,"bg-neutral-800/60","rounded","p-1"],[1,"text-neutral-300","font-mono"],[1,"text-neonGreen","font-mono"],[1,"text-neonAmber","font-mono"],[1,"text-red-400","font-mono"],[1,"w-1.5","h-1.5","rounded-full","bg-neonGreen","animate-pulse"],[1,"text-[10px]","py-1","border-b","border-neonDefault/10"],[1,"flex","items-center","gap-1"],[1,"px-1","py-0.5","rounded","text-[9px]","bg-neonAmber/10","text-neonAmber"],[1,"text-neutral-300","font-medium"],[1,"text-neutral-500","mt-0.5"],[1,"text-neutral-600","italic","mt-0.5"]],template:function(n,r){if(n&1&&(i(0,"div",0)(1,"details",1)(2,"summary",2),E(),i(3,"svg",3),m(4,"polyline",4),o(),s(5," File Info "),o(),j(),i(6,"div",5),_(7,jt,39,13)(8,Mt,2,0,"div",6),o()(),i(9,"details",7)(10,"summary",2),E(),i(11,"svg",3),m(12,"polyline",4),o(),s(13," Requirements "),_(14,Rt,2,1,"span",8),o(),j(),i(15,"div",9),_(16,At,2,0,"div",6)(17,Vt,2,0),o()(),_(18,Lt,10,1,"details",7),i(19,"details",7)(20,"summary",2),E(),i(21,"svg",3),m(22,"polyline",4),o(),s(23," Ingestion "),_(24,Gt,1,0,"span",10),o(),j(),i(25,"div",5),_(26,Xt,29,13)(27,Qt,2,0,"div",6),o()(),i(28,"details",1)(29,"summary",2),E(),i(30,"svg",3),m(31,"polyline",4),o(),s(32," RAG / Embedding "),_(33,Jt,1,0,"span",11),o(),j(),i(34,"div",12),_(35,Kt,26,12)(36,Yt,2,0,"div",13),i(37,"input",14),S("change",function(f){return r.ps_DS.selectedRegistryEntryId_$.set(f.target.value),r.handleLoadEmbeddingStatus()}),o(),i(38,"button",15),S("click",function(){return r.handleStartEmbedding()}),_(39,Zt,3,0,"span",16)(40,en,1,0),o()()(),_(41,rn,10,1,"details",7),o()),n&2){let d,f,$,q;l(7),c((d=r.ps_DS.selectedFile_$())?7:8,d),l(7),c(r.ps_DS.requirementCodes_$().length?14:-1),l(2),c(r.ps_DS.requirementCodes_$().length?17:16),l(2),c(r.ps_DS.relations_$().length>0?18:-1),l(6),c(r.ps_DS.isIngesting_$()?24:-1),l(2),c((f=r.ps_DS.latestRun_$())?26:27,f),l(7),c(r.ps_DS.isEmbedding_$()?33:-1),l(2),c(($=r.ps_DS.embeddingStatus_$())?35:36,$),l(2),C("value",(q=r.ps_DS.selectedRegistryEntryId_$())!==null&&q!==void 0?q:""),l(),k(r.ps_DS.isEmbedding_$()?"border-neonGreen/50 text-neonGreen bg-neonGreen/10 opacity-50":"border-neonGreen/30 text-neonGreen hover:bg-neonGreen/10"),C("disabled",r.ps_DS.isEmbedding_$()||!r.ps_DS.selectedRegistryEntryId_$()),l(),c(r.ps_DS.isEmbedding_$()?39:40),l(2),c(r.ps_DS.descriptions_$().length>0?41:-1)}},dependencies:[ee],encapsulation:2})}return t})();function an(t,a){if(t&1&&(i(0,"span",1),s(1),o()),t&2){let e=p();l(),h(e.selectedProjectName_$())}}function sn(t,a){t&1&&(i(0,"span",1),s(1,"No project"),o())}function dn(t,a){if(t&1&&(i(0,"span",10),s(1),o()),t&2){let e=p(2);l(),x(" Chunk #",e.ps_DS.selectedChunkIndex_$()," ")}}function cn(t,a){if(t&1&&(m(0,"span",2),i(1,"span",9),s(2),o(),i(3,"span",1),s(4),o(),_(5,dn,2,1,"span",10)),t&2){let e=p();l(2),h(a.fileName),l(2),x("",e.ps_DS.selectedFileChunks_$().length," chunks"),l(),c(e.ps_DS.selectedChunkIndex_$()!==null?5:-1)}}function pn(t,a){t&1&&(i(0,"span",4),m(1,"span",11),s(2," Ingesting "),o())}function _n(t,a){t&1&&(i(0,"span",5),m(1,"span",12),s(2," Embedding "),o())}function mn(t,a){if(t&1&&(i(0,"span",6),s(1),o()),t&2){let e=a;l(),V(" ",e.completed,"/",e.total," emb ")}}function un(t,a){if(t&1&&(i(0,"span",7),s(1),o()),t&2){let e,n=p();C("title",(e=n.ps_DS.error_$())!==null&&e!==void 0?e:""),l(),x(" ",n.ps_DS.error_$()," ")}}function fn(t,a){t&1&&(i(0,"span",8),s(1,"Loading..."),o())}var Te=(()=>{class t{ps_DS=v(g);selectedProjectName_$=Z(()=>{let e=this.ps_DS.selectedProjectId_$();return e?this.ps_DS.projects_$().find(r=>r.id===e)?.name??"":""});static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-status-bar"]],hostAttrs:[1,"block","shrink-0"],decls:13,vars:8,consts:[[1,"flex","items-center","gap-3","px-3","py-1","border-t","border-neonDefault/30","bg-ccapBg","text-[10px]","text-neutral-500"],[1,"shrink-0"],[1,"w-px","h-3","bg-neutral-700","shrink-0"],[1,"flex-1"],[1,"flex","items-center","gap-1","text-neonCyan","shrink-0"],[1,"flex","items-center","gap-1","text-neonGreen","shrink-0"],[1,"text-[10px]","text-neutral-500","shrink-0"],[1,"text-red-400","truncate","max-w-[300px]","shrink-0",3,"title"],[1,"text-neutral-500","shrink-0"],[1,"truncate","max-w-[300px]"],[1,"text-neonCyan","shrink-0"],[1,"w-1.5","h-1.5","rounded-full","bg-neonCyan","animate-pulse"],[1,"w-1.5","h-1.5","rounded-full","bg-neonGreen","animate-pulse"]],template:function(n,r){if(n&1&&(i(0,"div",0),_(1,an,2,1,"span",1)(2,sn,2,0,"span",1),m(3,"span",2),i(4,"span",1),s(5),o(),_(6,cn,6,3),m(7,"span",3),_(8,pn,3,0,"span",4)(9,_n,3,0,"span",5)(10,mn,2,2,"span",6)(11,un,2,2,"span",7)(12,fn,2,0,"span",8),o()),n&2){let d,f;l(),c(r.selectedProjectName_$()?1:2),l(4),x("",r.ps_DS.filesTotal_$()," files"),l(),c((d=r.ps_DS.selectedFile_$())?6:-1,d),l(2),c(r.ps_DS.isIngesting_$()?8:-1),l(),c(r.ps_DS.isEmbedding_$()?9:-1),l(),c((f=r.ps_DS.embeddingStatus_$())?10:-1,f),l(),c(r.ps_DS.error_$()?11:-1),l(),c(r.ps_DS.isLoading_$()?12:-1)}},encapsulation:2})}return t})();var xn=(t,a)=>a.chunkId;function Sn(t,a){t&1&&(i(0,"span",3),m(1,"span",14),s(2," Searching... "),o())}function Cn(t,a){t&1&&s(0," Search ")}function vn(t,a){t&1&&(i(0,"div",10)(1,"span",15),m(2,"span",16),s(3," Searching... "),o()())}function gn(t,a){t&1&&(i(0,"div",11),s(1," No results found "),o())}function In(t,a){t&1&&(i(0,"div",12),E(),i(1,"svg",17),m(2,"circle",18)(3,"line",19),o(),j(),i(4,"span",20),s(5,"Enter a query to search"),o()())}function bn(t,a){if(t&1&&(i(0,"span",28),s(1),o()),t&2){let e=p().$implicit;l(),x(" ",e.file.sourceType," ")}}function Pn(t,a){if(t&1&&(i(0,"span",29),s(1),o()),t&2){let e=p().$implicit;l(),h(e.file.projectPart)}}function Tn(t,a){if(t&1&&(i(0,"span",30),s(1),o()),t&2){let e=p().$implicit;l(),h(e.file.moduleName)}}function $n(t,a){if(t&1&&(i(0,"span",31),s(1),o()),t&2){let e=p().$implicit;l(),V(" L",e.lineStart,"-",e.lineEnd," ")}}function yn(t,a){if(t&1){let e=M();i(0,"div",22),S("click",function(){let r=D(e).$implicit,d=p(2);return w(d.handleResultClick(r))}),i(1,"div",23)(2,"span",24),s(3),X(4,"number"),o(),i(5,"span",25),s(6),o(),i(7,"span",26),s(8),o()(),i(9,"div",27),_(10,bn,2,1,"span",28)(11,Pn,2,1,"span",29)(12,Tn,2,1,"span",30)(13,$n,2,2,"span",31),o(),i(14,"pre",32),s(15),o()()}if(t&2){let e=a.$implicit;l(2),k(e.score>=.8?"bg-neonGreen/15 text-neonGreen":e.score>=.6?"bg-neonAmber/15 text-neonAmber":"bg-neutral-700/50 text-neutral-400"),l(),x(" ",Q(4,11,e.score,"1.2-2")," "),l(2),C("title",e.file.relativePath),l(),x(" ",e.file.relativePath," "),l(2),x(" #",e.chunkIndex," "),l(2),c(e.file.sourceType?10:-1),l(),c(e.file.projectPart?11:-1),l(),c(e.file.moduleName?12:-1),l(),c(e.lineStart!==void 0&&e.lineEnd!==void 0?13:-1),l(2),h(e.text)}}function En(t,a){if(t&1&&(i(0,"div",13),b(1,yn,16,14,"div",21,xn),o()),t&2){let e=p();l(),P(e.ps_DS.searchResults_$())}}var $e=(()=>{class t{ps_DS=v(g);handleSearch(){this.ps_DS.search({query:this.ps_DS.searchQuery_$()})}handleResultClick(e){this.ps_DS.navigateToSearchResult({result:e})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-search-panel"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],decls:18,vars:7,consts:[[1,"flex","items-center","gap-2","px-3","py-2","border-b","border-neonDefault/20","shrink-0"],["type","text","placeholder","Semantic search...",1,"flex-1","bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-1","text-xs","text-neutral-300","focus:outline-none","focus:border-neonGreen/60","placeholder:text-neutral-600",3,"input","keydown.enter","value"],[1,"px-3","py-1","text-xs","border","rounded","transition-colors","shrink-0",3,"click","disabled"],[1,"inline-flex","items-center","gap-1"],[1,"flex","items-center","gap-2","px-3","py-1.5","border-b","border-neonDefault/20","shrink-0"],[1,"bg-ccapBg","border","border-neonDefault/40","rounded","px-2","py-0.5","text-[10px]","text-neutral-400",3,"change","value"],["value","cosine"],["value","euclidean"],["value","dot-product"],[1,"flex-1","overflow-y-auto","min-h-0","p-3"],[1,"flex","items-center","justify-center","h-full","text-neutral-600"],[1,"flex","items-center","justify-center","h-full","text-neutral-600","text-sm"],[1,"flex","flex-col","items-center","justify-center","h-full","text-neutral-600"],[1,"space-y-2"],[1,"w-1.5","h-1.5","rounded-full","bg-neonGreen","animate-pulse"],[1,"inline-flex","items-center","gap-2","text-sm"],[1,"w-2","h-2","rounded-full","bg-neonGreen","animate-pulse"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1",1,"w-12","h-12","mb-3","text-neutral-700"],["cx","11","cy","11","r","8"],["x1","21","y1","21","x2","16.65","y2","16.65"],[1,"text-sm"],[1,"rounded","border","border-neonDefault/20","hover:border-neonGreen/40","bg-ccapSurface","hover:bg-neonGreen/3","transition-all","cursor-pointer"],[1,"rounded","border","border-neonDefault/20","hover:border-neonGreen/40","bg-ccapSurface","hover:bg-neonGreen/3","transition-all","cursor-pointer",3,"click"],[1,"flex","items-center","gap-2","px-3","py-1.5","border-b","border-neonDefault/10"],[1,"text-[10px]","font-mono","px-1.5","py-0.5","rounded-full","shrink-0"],[1,"text-xs","text-neutral-400","truncate",3,"title"],[1,"text-[10px]","text-neutral-600","shrink-0","ml-auto"],[1,"flex","items-center","gap-1.5","px-3","py-1"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","bg-neonCyan/10","text-neonCyan"],[1,"text-[10px]","text-neutral-500"],[1,"text-[10px]","text-neutral-600"],[1,"text-[10px]","text-neutral-600","ml-auto"],[1,"px-3","py-2","text-[11px]","text-neutral-400","font-mono","whitespace-pre-wrap","break-words","max-h-[120px]","overflow-y-auto","leading-relaxed"]],template:function(n,r){n&1&&(i(0,"div",0)(1,"input",1),S("input",function(f){return r.ps_DS.searchQuery_$.set(f.target.value)})("keydown.enter",function(){return r.handleSearch()}),o(),i(2,"button",2),S("click",function(){return r.handleSearch()}),_(3,Sn,3,0,"span",3)(4,Cn,1,0),o()(),i(5,"div",4)(6,"select",5),S("change",function(f){return r.ps_DS.searchMetric_$.set(f.target.value)}),i(7,"option",6),s(8,"Cosine"),o(),i(9,"option",7),s(10,"Euclidean"),o(),i(11,"option",8),s(12,"Dot Product"),o()()(),i(13,"div",9),_(14,vn,4,0,"div",10)(15,gn,2,0,"div",11)(16,In,6,0,"div",12)(17,En,3,0,"div",13),o()),n&2&&(l(),C("value",r.ps_DS.searchQuery_$()),l(),k(r.ps_DS.isSearching_$()?"border-neonGreen/50 text-neonGreen bg-neonGreen/10 opacity-50":"border-neonGreen/30 text-neonGreen hover:bg-neonGreen/10"),C("disabled",r.ps_DS.isSearching_$()||!r.ps_DS.searchQuery_$()),l(),c(r.ps_DS.isSearching_$()?3:4),l(3),C("value",r.ps_DS.searchMetric_$()),l(8),c(r.ps_DS.isSearching_$()?14:!r.ps_DS.searchResults_$().length&&r.ps_DS.searchQuery_$()?15:r.ps_DS.searchResults_$().length?17:16))},dependencies:[B,L,ee],encapsulation:2})}return t})();function Dn(t,a){t&1&&m(0,"app-ps-search-panel")}function wn(t,a){t&1&&m(0,"app-ps-chunk-viewer")}var ji=(()=>{class t{projectId;ps_DS=v(g);fileTreeWidth_$=u(260);infoPanelWidth_$=u(300);isResizing_$=u(!1);ngOnInit(){this.fileTreeWidth_$.set(Math.max(160,Math.min(500,T.loadPanelWidth("fileTree",260)))),this.infoPanelWidth_$.set(Math.max(200,Math.min(550,T.loadPanelWidth("infoPanel",300)))),this.ps_DS.restoreFromStorage(),this.projectId?(this.ps_DS.isEmbedded_$.set(!0),this.ps_DS.selectProject({projectId:this.projectId})):(this.ps_DS.isEmbedded_$.set(!1),this.ps_DS.loadProjects().then(()=>{let e=T.loadSelectedProjectId();e&&this.ps_DS.projects_$().some(n=>n.id===e)&&this.ps_DS.selectProject({projectId:e})}))}ngOnChanges(e){if(e.projectId&&!e.projectId.firstChange){let n=e.projectId.currentValue;n&&this.ps_DS.selectProject({projectId:n})}}handleFileTreeResizeStart(e){let n=this.fileTreeWidth_$(),r=e.clientX;this.isResizing_$.set(!0),ne.attachUntilPointerUp({startEvent:e,onMove:d=>{let f=d.clientX-r,$=Math.max(160,Math.min(500,n+f));this.fileTreeWidth_$.set($)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("fileTree",this.fileTreeWidth_$())}})}handleInfoPanelResizeStart(e){let n=this.infoPanelWidth_$(),r=e.clientX;this.isResizing_$.set(!0),ne.attachUntilPointerUp({startEvent:e,onMove:d=>{let f=r-d.clientX,$=Math.max(200,Math.min(550,n+f));this.infoPanelWidth_$.set($)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("infoPanel",this.infoPanelWidth_$())}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=y({type:t,selectors:[["app-ps-ide-shell"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],inputs:{projectId:"projectId"},features:[re],decls:12,vars:8,consts:[[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],[3,"startResizeStart","endResizeStart","isStartOpen","isEndOpen","startWidthPx","endWidthPx","isResizing"],["sDetailColumnStart",""],["sDetailColumnMain","",1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],["sDetailColumnEnd",""]],template:function(n,r){n&1&&(i(0,"div",0),m(1,"app-ps-ide-toolbar"),i(2,"app-s-session-detail-three-column-layout",1),S("startResizeStart",function(f){return r.handleFileTreeResizeStart(f)})("endResizeStart",function(f){return r.handleInfoPanelResizeStart(f)}),i(3,"div",2),m(4,"app-ps-file-tree"),o(),i(5,"div",3),m(6,"app-ps-tab-bar"),_(7,Dn,1,0,"app-ps-search-panel")(8,wn,1,0,"app-ps-chunk-viewer"),o(),i(9,"div",4),m(10,"app-ps-info-panel"),o()(),m(11,"app-ps-status-bar"),o()),n&2&&(O("select-none",r.isResizing_$()),l(2),C("isStartOpen",r.ps_DS.isFileTreeOpen_$())("isEndOpen",r.ps_DS.isInfoPanelOpen_$())("startWidthPx",r.fileTreeWidth_$())("endWidthPx",r.infoPanelWidth_$())("isResizing",r.isResizing_$()),l(5),c(r.ps_DS.isSearchPanelOpen_$()?7:8))},dependencies:[ue,Se,ve,ge,Ie,Pe,Te,$e],encapsulation:2})}return t})();var oo=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=oe({type:t});static \u0275inj=ie({providers:[g],imports:[ae,ce,de,fe]})}return t})();export{ji as a,oo as b};
|
|
2
|
+
//# sourceMappingURL=chunk-XODBV7IE.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as ks}from"./chunk-
|
|
1
|
+
import{j as ks}from"./chunk-FEPP5JND.js";import{I as $,N as Es,a as _s,b as ys,c as gs,d as ur,e as gt,f as ms,g as lr,i as hr,l as bs,n as dr,p as fr}from"./chunk-THJC2TOK.js";import{C as oe,H as _t,O as fs,P as De,a as as,aa as z,e as cr,f,g as ar,h as us,hb as ps,i as K,ib as yt,jb as Fe,k as u,l as ls,m as hs,w as pt,y as ds}from"./chunk-TBMJSIBB.js";var qe=f(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.DyFM_SocketEvent_Key=void 0;var vs=function(s){return s.incomingNewConnection="connection",s.outgoingNewConnection="connect",s.subscribe="subscribe",s.subscriptionSuccessful="subscriptionSuccessful",s.unsubscribe="unsubscribe",s.unsubscribeSuccessful="unsubscribeSuccessful",s.disconnect="disconnect",s.ping="ping",s.event="event",s.error="error",s}(vs||(Me.DyFM_SocketEvent_Key=vs={}))});var Ss=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.DyFM_SocketClient_Params=void 0;var yr=ur(),gr=gt(),bt=class{name;service;address;port;reconnectDelay=yr.second*30;reconnect=!0;socketOptions;constructor(e){Object.assign(this,e),this.reconnect=!!this.reconnectDelay,(this.socketOptions?.autoConnect||this.socketOptions?.reconnection||this.socketOptions?.reconnectionDelay)&&(gr.DyFM_Log.warn("autoConnect or reconnection is set to true in socketOptions, so reconnect is set to false",`
|
|
2
2
|
This means that the reconnection will use the socket.io reconnection logic, `,"not the Dynamo implementations."),this.reconnect=!1)}};xe.DyFM_SocketClient_Params=bt});var kt=f(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.DyFM_SocketEvent=void 0;var Ie=gs(),ws=ms(),Ee=gt(),mr=hr(),br=bs(),ke=qe(),Et=class{name;eventKey;serviceName;preProcesses;tasks;logEvent;logEventContent;stackLocation;constructor(e){try{this.name=e.name??e.eventKey,this.eventKey=e.eventKey,this.serviceName=e.serviceName??"UnknownSocketService",this.preProcesses=e.preProcesses??[],this.tasks=e.tasks??[],this.stackLocation=(0,mr.DyFM_getConstructionStackLocation)(),e.logEvent!==void 0?this.logEvent=e.logEvent:this.eventKey===ke.DyFM_SocketEvent_Key.subscribe?this.logEvent=!1:[ke.DyFM_SocketEvent_Key.incomingNewConnection,ke.DyFM_SocketEvent_Key.outgoingNewConnection,ke.DyFM_SocketEvent_Key.disconnect].includes(this.eventKey)?this.logEvent=Ie.DyFM_global_settings.log_settings.socket_allEvents||Ie.DyFM_global_settings.log_settings.socket_mainEvents:this.logEvent=Ie.DyFM_global_settings.log_settings.socket_allEvents,this.logEventContent=e.logEventContent??Ie.DyFM_global_settings.log_settings.socket_eventContent}catch(t){throw Ee.DyFM_Log.error(`
|
|
3
3
|
Socket Event params setup failed (${this.serviceName}): ${e.eventKey}`,t),t}}getPreLog(e){return u(this,null,function*(){try{this.logEventContent&&this.eventKey!==ke.DyFM_SocketEvent_Key.incomingNewConnection?Ee.DyFM_Log.log(`---> incoming socket(${this.serviceName}) event: ${this.eventKey};
|
|
4
4
|
|
|
@@ -8,4 +8,4 @@ socket-client(${this.params?.name}) Service setup finished`),yield this.connectS
|
|
|
8
8
|
Fn:. setupDefaultEvents`),this.defaultEvents.forEach(e=>{e.serviceName=this.params.name;let t=this.incomingEvents.find(n=>n.eventKey===e.eventKey);t?t.tasks.unshift(...e.tasks):this.incomingEvents.push(e)})}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Default Events failed, ERROR:`,e),e}})}setupSocketEvents(){return u(this,null,function*(){try{this.debugLog&&console.log(`Setup socket-client(${this.params.name}) Events...`),yield Lo.DyFM_Array.asyncForEach(this.incomingEvents,e=>u(this,null,function*(){e.serviceName=this.params.name,this.socket.on(e.eventKey,t=>u(this,null,function*(){try{yield e.executeEventTasks(t,this.params.service)}catch(n){k.DyFM_Log.error(`socket-client(${this.params.name}) Event failed, ERROR:`,n),yield this.emitEvent(X.DyFM_SocketEvent_Key.error,n)}}))}))}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Socket Events failed, ERROR:`,e),e}})}connectSocket(){return u(this,null,function*(){try{k.DyFM_Log.info(`< .. > socket-client(${this.params.name}) connecting to ${this.params.address}:${this.params.port} ...`),this.socket.connect(),this.params.reconnect&&(yield this.tryReconnectIfNeeded())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Connect Socket failed, ERROR:`,e),e}})}tryingToReconnect=!1;tryReconnectIfNeeded(){return u(this,null,function*(){try{if(console.log("tryReconnectIfNeeded",this._params.reconnectDelay),this.tryingToReconnect){k.DyFM_Log.warn(`socket-client(${this.params.name}) already trying to reconnect!`);return}if(!this.params.reconnect){k.DyFM_Log.warn(`socket-client(${this.params.name}) Dynamo reconnection is disabled!`);return}this.tryingToReconnect=!0,this.logFn&&console.log(`
|
|
9
9
|
Fn:. tryReconnectIfNeeded`),yield vn.DyFM_Async.delay(this._params.reconnectDelay),this.connected||(this.tryingToReconnect=!1,yield this.connectSocket())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Try Reconnect failed, ERROR:`,e),this.tryingToReconnect=!1,e}})}reconnect(){this.tryingToReconnect=!1,this.socket&&this.socket.disconnect(),this.connectSocket()}};lt.DyFM_SocketClient_ServiceBase=os});var wn=f(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});var ht=(ys(),K(_s));ht.__exportStar(qe(),be);ht.__exportStar(Ss(),be);ht.__exportStar(kt(),be);ht.__exportStar(Sn(),be)});function pr(s,e){!e?.injector&&_t(pr);let t=e?.injector??oe(fs),n=new hs(1),r=Fe(()=>{let i;try{i=s()}catch(o){yt(()=>n.error(o));return}yt(()=>n.next(i))},{injector:t,manualCleanup:!0});return t.get(De).onDestroy(()=>{r.destroy(),n.complete()}),n.asObservable()}function mt(s,e){let t=!e?.manualCleanup;t&&!e?.injector&&_t(mt);let n=t?e?.injector?.get(De)??oe(De):null,r=_r(e?.equal),i;e?.requireSync?i=z({kind:0},{equal:r}):i=z({kind:1,value:e?.initialValue},{equal:r});let o=s.subscribe({next:c=>i.set({kind:1,value:c}),error:c=>{if(e?.rejectErrors)throw c;i.set({kind:2,error:c})}});if(e?.requireSync&&i().kind===0)throw new pt(601,!1);return n?.onDestroy(o.unsubscribe.bind(o)),ps(()=>{let c=i();switch(c.kind){case 1:return c.value;case 2:throw c.error;case 0:throw new pt(601,!1)}},{equal:e?.equal})}function _r(s=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&s(e.value,t.value)}var C=us(fr()),d=us(wn());var j=function(s){return s.connecting="connecting",s.connected="connected",s.error="error",s}(j||{});function dt(){if($.socketUrl!==void 0&&$.socketUrl.trim()!=="")return $.socketUrl.trim();if(typeof window<"u"){let s=new URL(window.location.href).origin;return C.DyFM_Log.warn("CCAP_Socket | socketUrl not set, using same-origin fallback:",s),s}return""}function U(s){return s!=null&&typeof s=="object"&&!(s instanceof Error)}function Cn(){return typeof globalThis>"u"?!1:globalThis.jasmine!==void 0}var Tn="answer",On="notify-user",Rn="agent-events",Pn="context:updated",An="monitoring:event",Nn="user-notification",Dn="cc-session:status",Fn="cc-session:output",Mn="cc-session:event",qn="cc-session:list-update",xn="cc-session:session-update",In="ca-session:status",jn="ca-session:output",Ln="ca-session:event",Bn="ca-session:list-update",Un="ext-session-msg:message",Kn="ext-session-msg:update",$n="user-interaction:request",Vn="instance-data:session-status-updated",Wn="instance:presence-update",Hn="openclaw-instance-data:status-updated",Yn="cci-instance-data:status-updated",Xn="cai-instance-data:status-updated",Jn="terminal:list:result",zn="terminal:start:result",Gn="terminal:command-result",Qn="terminal:command-output",Zn="cc:rate-limit-update",er="cc:account-usage-update",tr="cc:account-list-update",sr="session-queue:updated",nr="session-queue:lock-changed",Uo="system-error",Ko="terminal-error",$o="server:start-id",Vo="connect_error",Wo=8*C.second,Yc=(()=>{class s extends d.DyFM_SocketClient_ServiceBase{status_$=z(j.connecting);lastError_$=z(null);connectAttemptCount_$=z(0);hasEverConnected=!1;connectionTimeoutId=null;knownServerStartId=null;eventSubject_S=new ls;event$=this.eventSubject_S.asObservable();connected_$=mt(this.connected$,{initialValue:!1});get socketAddress(){return dt()||(this.params?.address??"")}globalError_CS=oe(ks);settingsGeneral_DS=oe(Es);constructor(){super(),Cn()||this.startConnectionTimeout(),Fe(()=>{this.connected&&!this.subscribed&&this.subscribe()})}startConnectionTimeout(){this.clearConnectionTimeout(),this.connectionTimeoutId=setTimeout(()=>{if(this.connectionTimeoutId=null,this.status_$()===j.connecting){let t=new Error("Socket connection timeout \u2013 server unreachable or setup failed. Click to reconnect.");this.status_$.set(j.error),this.lastError_$.set(t),C.DyFM_Log.warn("CCAP_Socket | Connection timeout")}},Wo)}clearConnectionTimeout(){this.connectionTimeoutId!==null&&(clearTimeout(this.connectionTimeoutId),this.connectionTimeoutId=null)}getParams(){let t=dt(),n=Cn(),r={path:"/socket",transports:["polling","websocket"],reconnectionDelay:1e3};return n&&(r.reconnection=!1),new d.DyFM_SocketClient_Params({name:"CCAP Client",address:t,reconnect:!n,reconnectDelay:C.minute,socketOptions:r})}getIncomingEvents(){let t=this,n=(r,i)=>{try{let o=U(i)?i:{};if(!t.eventSubject_S){let c=`Socket event dropped: eventSubject not initialized | event: ${r} | This means the socket event system is not functional \u2014 no live updates will arrive.`;C.DyFM_Log.error(`[CCAP_Socket] ${c}`),t.globalError_CS.showError(new Error(c),"client-socket-event-subject");return}t.eventSubject_S.next({event:r,payload:o})}catch(o){let c=o instanceof Error?o.message:String(o);C.DyFM_Log.error(`[CCAP_Socket] pushEnvelope failed | event: ${r} | ${c}`),t.globalError_CS.showError(o instanceof Error?o:new Error(`Socket event processing failed: ${r} \u2014 ${c}`),"client-socket-push-envelope")}};return[new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.outgoingNewConnection,tasks:[()=>u(this,null,function*(){t.clearConnectionTimeout(),t.hasEverConnected=!0,t.status_$.set(j.connected),t.lastError_$.set(null),t.connectAttemptCount_$.set(0),C.DyFM_Log.info("CCAP_Socket | Connected")})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.disconnect,tasks:[()=>u(this,null,function*(){t.hasEverConnected&&t.status_$.set(j.error),C.DyFM_Log.info("CCAP_Socket | Disconnected")})]}),new d.DyFM_SocketEvent({eventKey:Vo,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.connectAttemptCount_$.update(a=>a+1);let i=r instanceof Error?r:new Error(String(r)),o=U(r)?r.description:void 0,c=U(r)?r.type:void 0;C.DyFM_Log.info("CCAP_Socket | connect_error",`attempt #${t.connectAttemptCount_$()}`,i?.message??String(r),o!==void 0?String(o):"",c!==void 0?String(c):""),t.status_$.set(j.error);let h=t.params?.address??"",_=t.buildSocketErrorDisplay({err:i,socketUrl:h,eventType:"connect_error",raw:r});t.lastError_$.set(_),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(_.fullMessage??_.message??i.message),stack:typeof _.stack=="string"?_.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.error,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.status_$.set(j.error);let i=r instanceof Error?r:new Error(String(r)),o=t.params?.address??"",c=t.buildSocketErrorDisplay({err:i,socketUrl:o,eventType:"error",raw:r});t.lastError_$.set(c),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(c.fullMessage??c.message??i.message),stack:typeof c.stack=="string"?c.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:Tn,tasks:[r=>u(this,null,function*(){n(Tn,r)})]}),new d.DyFM_SocketEvent({eventKey:On,tasks:[r=>u(this,null,function*(){n(On,r)})]}),new d.DyFM_SocketEvent({eventKey:Rn,tasks:[r=>u(this,null,function*(){n(Rn,r)})]}),new d.DyFM_SocketEvent({eventKey:Pn,tasks:[r=>u(this,null,function*(){n(Pn,r)})]}),new d.DyFM_SocketEvent({eventKey:An,tasks:[r=>u(this,null,function*(){n(An,r)})]}),new d.DyFM_SocketEvent({eventKey:Nn,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{};if(n(Nn,r),i.type===Uo){let o=t.buildServerErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}else if(i.type===Ko){let o=t.buildTerminalErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}})]}),new d.DyFM_SocketEvent({eventKey:$o,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{},o=typeof i.serverStartId=="number"?i.serverStartId:void 0;o!==void 0&&(t.knownServerStartId===null?(t.knownServerStartId=o,C.DyFM_Log.info("CCAP_Socket | Server start ID stored:",o)):t.knownServerStartId!==o&&(C.DyFM_Log.warn("CCAP_Socket | Server restarted (start ID changed), reloading page"),window.location.reload()))})]}),new d.DyFM_SocketEvent({eventKey:Dn,tasks:[r=>u(this,null,function*(){n(Dn,r)})]}),new d.DyFM_SocketEvent({eventKey:Fn,tasks:[r=>u(this,null,function*(){n(Fn,r)})]}),new d.DyFM_SocketEvent({eventKey:Mn,tasks:[r=>u(this,null,function*(){n(Mn,r)})]}),new d.DyFM_SocketEvent({eventKey:qn,tasks:[r=>u(this,null,function*(){n(qn,r)})]}),new d.DyFM_SocketEvent({eventKey:xn,tasks:[r=>u(this,null,function*(){n(xn,r)})]}),new d.DyFM_SocketEvent({eventKey:In,tasks:[r=>u(this,null,function*(){n(In,r)})]}),new d.DyFM_SocketEvent({eventKey:jn,tasks:[r=>u(this,null,function*(){n(jn,r)})]}),new d.DyFM_SocketEvent({eventKey:Ln,tasks:[r=>u(this,null,function*(){n(Ln,r)})]}),new d.DyFM_SocketEvent({eventKey:Bn,tasks:[r=>u(this,null,function*(){n(Bn,r)})]}),new d.DyFM_SocketEvent({eventKey:Un,tasks:[r=>u(this,null,function*(){n(Un,r)})]}),new d.DyFM_SocketEvent({eventKey:Kn,tasks:[r=>u(this,null,function*(){n(Kn,r)})]}),new d.DyFM_SocketEvent({eventKey:$n,tasks:[r=>u(this,null,function*(){n($n,r)})]}),new d.DyFM_SocketEvent({eventKey:Vn,tasks:[r=>u(this,null,function*(){n(Vn,r)})]}),new d.DyFM_SocketEvent({eventKey:Wn,tasks:[r=>u(this,null,function*(){n(Wn,r)})]}),new d.DyFM_SocketEvent({eventKey:Hn,tasks:[r=>u(this,null,function*(){n(Hn,r)})]}),new d.DyFM_SocketEvent({eventKey:Yn,tasks:[r=>u(this,null,function*(){n(Yn,r)})]}),new d.DyFM_SocketEvent({eventKey:Xn,tasks:[r=>u(this,null,function*(){n(Xn,r)})]}),new d.DyFM_SocketEvent({eventKey:Jn,tasks:[r=>u(this,null,function*(){n(Jn,r)})]}),new d.DyFM_SocketEvent({eventKey:zn,tasks:[r=>u(this,null,function*(){n(zn,r)})]}),new d.DyFM_SocketEvent({eventKey:Gn,tasks:[r=>u(this,null,function*(){n(Gn,r)})]}),new d.DyFM_SocketEvent({eventKey:Qn,tasks:[r=>u(this,null,function*(){n(Qn,r)})]}),new d.DyFM_SocketEvent({eventKey:sr,tasks:[r=>u(this,null,function*(){n(sr,r)})]}),new d.DyFM_SocketEvent({eventKey:nr,tasks:[r=>u(this,null,function*(){n(nr,r)})]}),new d.DyFM_SocketEvent({eventKey:Zn,tasks:[r=>u(this,null,function*(){n(Zn,r)})]}),new d.DyFM_SocketEvent({eventKey:er,tasks:[r=>u(this,null,function*(){n(er,r)})]}),new d.DyFM_SocketEvent({eventKey:tr,tasks:[r=>u(this,null,function*(){n(tr,r)})]})]}getSubscriptionContent(){return u(this,null,function*(){let t=this.socket?.id;return Promise.resolve({clientId:t})})}shouldReportSocketConnectionErrorsToErrorList(){return this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0}buildSocketErrorDisplay(t){let n=t.err.message?.trim()?t.err.message:"WebSocket connection failed",r=t.socketUrl.trim()?`WebSocket: ${n} \u2014 ${t.socketUrl}`:`WebSocket: ${n}`,i={message:r,fullMessage:r,name:t.err.name,stack:t.err.stack??null,socketUrl:t.socketUrl,transport:"websocket",eventType:t.eventType,attemptedAt:new Date().toISOString(),connectAttempt:this.connectAttemptCount_$()},o=$.socketUrl!==void 0&&$.socketUrl.trim()!=="";i.socketUrlSource=o?"environment.socketUrl":"same-origin fallback";let c=this.params?.socketOptions?.transports??[];if(c.length>0&&(i.configuredTransports=c.join(", ")),typeof window<"u"&&(i.pageOrigin=window.location.origin),U(t.raw)){let _=t.raw,a=_.description;if(typeof a=="string"&&a.trim())i.description=a.trim();else if(a instanceof Error)i.description=a.message,a.stack&&(i.descriptionStack=a.stack);else if(a instanceof Event)i.description=this.extractDomEventInfo(a);else if(U(a)){let l=a,y=[];typeof l.message=="string"&&l.message.trim()&&y.push(l.message.trim()),typeof l.status=="number"&&(i.httpStatus=l.status,y.push(`HTTP ${l.status}`)),typeof l.statusText=="string"&&l.statusText.trim()&&(i.httpStatusText=l.statusText.trim(),y.push(l.statusText.trim())),typeof l.responseURL=="string"&&l.responseURL.trim()&&(i.responseUrl=l.responseURL.trim()),y.length>0&&(i.description=y.join(" \u2013 "))}typeof _.type=="string"&&_.type.trim()&&(i.type=_.type.trim()),U(_.context)&&(i.errorContext=_.context)}t.raw instanceof Event&&!i.description&&(i.description=this.extractDomEventInfo(t.raw));let h=[r];if(typeof i.description=="string"&&h.push(`Cause: ${i.description}`),typeof i.httpStatus=="number"){let _=typeof i.httpStatusText=="string"?` ${i.httpStatusText}`:"";h.push(`HTTP: ${i.httpStatus}${_}`)}return typeof i.responseUrl=="string"&&h.push(`Response URL: ${i.responseUrl}`),h.push(`Attempt: #${i.connectAttempt}`),h.push(`Source: ${i.socketUrlSource}`),i.fullMessage=h.join(" | "),i}extractDomEventInfo(t){let n=[];n.push(`type=${t.type}`);let r=t.target;return U(r)&&(typeof r.readyState=="number"&&n.push(`readyState=${r.readyState}`),typeof r.url=="string"&&r.url&&n.push(`url=${r.url}`),typeof r.responseURL=="string"&&r.responseURL&&n.push(`responseURL=${r.responseURL}`),typeof r.status=="number"&&n.push(`status=${r.status}`)),n.push("(DOM Event - tipikusan SSL cert reject, CORS, vagy network unreachable)"),n.join(", ")}buildTerminalErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=typeof t.code=="string"?t.code:String(t.code??""),i=[n];r&&i.push(`K\xF3d: ${r}`),typeof t.terminalId=="string"&&t.terminalId.trim()&&i.push(`Termin\xE1l ID: ${t.terminalId.trim()}`),typeof t.path=="string"&&t.path.trim()&&i.push(`Path: ${t.path.trim()}`);let o=i.join(`
|
|
10
10
|
`),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:null,detailsText:o,timestamp:c}}buildServerErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=t.stack,i=typeof r=="string"?r:r!=null?String(r):null,o=typeof t.detailsText=="string"?t.detailsText:JSON.stringify(t,null,2),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:i,detailsText:o,timestamp:c}}reconnect(){if(this.socket){this.clearConnectionTimeout(),this.status_$.set(j.connecting),this.lastError_$.set(null),this.connectAttemptCount_$.set(0),this.startConnectionTimeout();let t=this.params?.address??dt();C.DyFM_Log.info("CCAP_Socket | Reconnecting to",t),this.socket.disconnect(),this.socket.connect()}}emit(t,n){this.socket?.connected&&this.socket.emit(t,n)}diagnoseConnection(){return u(this,null,function*(){let t=this.params?.address??dt(),n={timestamp:new Date().toISOString(),socketUrl:t,socketUrlSource:$.socketUrl!==void 0&&$.socketUrl.trim()!==""?"environment.socketUrl":"same-origin fallback",pageOrigin:typeof window<"u"?window.location.origin:"",socketConnected:this.socket?.connected??!1,socketId:this.socket?.id??null,connectAttemptCount:this.connectAttemptCount_$(),currentStatus:this.status_$()},r=yield s.probeEndpoint("/api/server/status","serverStatusApi");if(n.serverStatusApi=r,r.ok===!0&&r.body!==void 0){let _=r.body;if(_!==null&&typeof _=="object"){let a=_;n.serverReportedHttpPort=a.httpPort??null,n.serverReportedSocketPort=a.socketPort??null}}let i=this.params?.socketOptions?.path??"/socket",o=`${t}${i}/?EIO=4&transport=polling&t=${Date.now()}`,c=yield s.probeEndpoint(o,"socketIoPolling");n.socketIoPolling=c;let h=n.serverReportedSocketPort;if(typeof h=="number"&&h>0){let _=`http://localhost:${h}${i}/?EIO=4&transport=polling&t=${Date.now()}`,a=yield s.probeEndpoint(_,"socketIoDirectPort");n.socketIoDirectPort=a}return n})}static probeEndpoint(t,n){return u(this,null,function*(){let r={url:t,label:n},i=performance.now();try{let o=yield fetch(t,{method:"GET",cache:"no-store"}),c=Math.round(performance.now()-i);r.ok=o.ok,r.httpStatus=o.status,r.httpStatusText=o.statusText,r.elapsedMs=c;try{let h=yield o.text();try{r.body=JSON.parse(h)}catch{r.bodyPreview=h.substring(0,300)}}catch{r.bodyReadError="Failed to read response body"}}catch(o){let c=Math.round(performance.now()-i);r.elapsedMs=c,r.ok=!1,r.fetchError=o instanceof Error?o.message:String(o),o instanceof TypeError&&(r.fetchErrorType="TypeError (network/CORS/SSL)")}return r})}ngOnDestroy(){this.clearConnectionTimeout(),this.socket&&this.socket.disconnect()}static \u0275fac=function(n){return new(n||s)};static \u0275prov=ds({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{pr as a,mt as b,wn as c,j as d,Yc as e};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-YUERPBPZ.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./chunk-EGRHWZRV.js";import{a as Ve}from"./chunk-Q2PKIGLB.js";import{a as we}from"./chunk-6HMRYXOI.js";import{a as Ie,b as X}from"./chunk-5ATMD4SY.js";import"./chunk-NLYXP47X.js";import{g as Re}from"./chunk-A6TWPSUA.js";import"./chunk-WI4NEQOH.js";import"./chunk-7JUIBZEE.js";import{a as Pe,b as Ee,c as q}from"./chunk-C7XPBJTG.js";import{b as te,f as ke,g as Ae}from"./chunk-EVREGV4D.js";import"./chunk-WPHEQXWB.js";import{b as Me}from"./chunk-GWFZKTPN.js";import"./chunk-YR6NTERF.js";import"./chunk-2BZ4R623.js";import"./chunk-FD6QRJ7H.js";import"./chunk-Q2NVIOCY.js";import{a as De}from"./chunk-4ZEPJMCK.js";import{a as ee}from"./chunk-J32YRK3S.js";import"./chunk-G5CYHOH4.js";import"./chunk-XJDLUP33.js";import"./chunk-LUJCXLWT.js";import"./chunk-V3VQWJQL.js";import"./chunk-MJJNEYN2.js";import"./chunk-TZIBF6RE.js";import"./chunk-ZBTWQZNB.js";import"./chunk-FLAJXIYW.js";import{b as ve,c as N,f as W,i as B,n as z,o as j,p as H,v as Se}from"./chunk-EO4DNTT4.js";import{k as Te}from"./chunk-X2RTRMJW.js";import{a as V}from"./chunk-5UPNU54P.js";import{j as ye}from"./chunk-QFD5FURA.js";import{I as $e}from"./chunk-HHHXXHAW.js";import{Aa as he,Ba as me,C as x,D as I,E as se,Eb as xe,Fa as _,Fb as ge,Ga as k,Gb as U,J as m,K as u,Kb as be,L as le,M as de,Z as d,aa as l,ca as ce,da as M,ga as f,ha as _e,hb as b,ia as R,jb as ue,k as C,la as y,na as P,oa as S,p as v,pa as $,q as re,qa as r,ra as s,sa as w,ua as E,ub as fe,va as h,wa as c,xb as Ce,y as F,z as ae,za as pe}from"./chunk-TBMJSIBB.js";var Q="ccap-consultant",T=class{static savePanelOpen(a,e){V.writeBoolean(`${Q}:panelOpen:${a}`,e)}static loadPanelOpen(a,e){return V.readBoolean(`${Q}:panelOpen:${a}`,e)}static savePanelWidth(a,e){V.writeNumber(`${Q}:panelWidth:${a}`,e)}static loadPanelWidth(a,e){return V.readNumber(`${Q}:panelWidth:${a}`,e)}};var Oe=(()=>{class i{baseUrl=`${$e.api.baseUrl}/consultant`;http=x(Ce);listThreads(){return v(this.http.get(this.baseUrl))}getPickerOptions(){return v(this.http.get(`${this.baseUrl}/picker-options`))}createThread(e){return v(this.http.post(this.baseUrl,e))}getThread(e){return v(this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`))}patchThread(e){let t={};return e.label!=null&&(t.label=e.label),e.providerInstanceId!=null&&(t.providerInstanceId=e.providerInstanceId),e.model!=null&&(t.model=e.model),v(this.http.patch(`${this.baseUrl}/${encodeURIComponent(e.threadId)}`,t))}deleteThread(e){return v(this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`))}postMessage(e){return v(this.http.post(`${this.baseUrl}/${encodeURIComponent(e.threadId)}/messages`,{text:e.text,allowWebSearch:e.allowWebSearch,attachments:e.attachments}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=F({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var G=(()=>{class i{consultant_AS=x(Oe);globalError_CS=x(ye);threads_$=l([]);threadsLoading_$=l(!1);threadsError_$=l(null);selectedThread_$=l(null);selectedThreadLoading_$=l(!1);selectedThreadError_$=l(null);sending_$=l(!1);activeThreadId_$=l("");defaults_$=l({providerInstanceId:"",model:""});pickerOptions_$=l([]);pickerOptionsLoading_$=l(!1);loadPickerOptions(){return C(this,null,function*(){this.pickerOptionsLoading_$.set(!0);try{let e=yield this.consultant_AS.getPickerOptions(),t=Array.isArray(e.entries)?e.entries.map(i.parseRegistryEntry).filter(n=>n!==null):[];this.pickerOptions_$.set(t),this.defaults_$.set({providerInstanceId:typeof e.defaults?.providerInstanceId=="string"?e.defaults.providerInstanceId:"",model:typeof e.defaults?.model=="string"?e.defaults.model:""})}catch(e){this.globalError_CS.showError(e,"Consultant_DataService.loadPickerOptions")}finally{this.pickerOptionsLoading_$.set(!1)}})}loadThreads(){return C(this,null,function*(){this.threadsLoading_$.set(!0),this.threadsError_$.set(null);try{let e=yield this.consultant_AS.listThreads(),n=(Array.isArray(e.threads)?e.threads:[]).map(o=>({threadId:typeof o.threadId=="string"?o.threadId:"",label:typeof o.label=="string"?o.label:"",providerInstanceId:typeof o.providerInstanceId=="string"?o.providerInstanceId:"",model:typeof o.model=="string"?o.model:"",messageCount:typeof o.messageCount=="number"?o.messageCount:0,updatedAt:typeof o.updatedAt=="string"?o.updatedAt:""}));this.threads_$.set(n)}catch(e){this.threadsError_$.set(e),this.globalError_CS.showError(e,"Consultant_DataService.loadThreads")}finally{this.threadsLoading_$.set(!1)}})}loadThreadDetail(e){return C(this,null,function*(){this.activeThreadId_$.set(e),this.selectedThreadLoading_$.set(!0),this.selectedThreadError_$.set(null);try{let t=yield this.consultant_AS.getThread(e),n=i.parseThreadDetail(t.thread);this.selectedThread_$.set(n)}catch(t){this.selectedThreadError_$.set(t),this.globalError_CS.showError(t,"Consultant_DataService.loadThreadDetail")}finally{this.selectedThreadLoading_$.set(!1)}})}sendMessage(e){return C(this,null,function*(){this.sending_$.set(!0);try{let n=(yield this.consultant_AS.postMessage(e)).thread;if(i.isPlainRecord(n)){let o=i.parseThreadDetail(n);this.selectedThread_$.set(o)}yield this.loadThreads()}catch(t){throw this.globalError_CS.showError(t,"Consultant_DataService.sendMessage"),t}finally{this.sending_$.set(!1)}})}updateThreadConfig(e){return C(this,null,function*(){try{let t=yield this.consultant_AS.patchThread(e),n=i.parseThreadDetail(t.thread);this.selectedThread_$.set(n),yield this.loadThreads()}catch(t){throw this.globalError_CS.showError(t,"Consultant_DataService.updateThreadConfig"),t}})}createThread(e){return C(this,null,function*(){try{let n=(yield this.consultant_AS.createThread(e)).thread.threadId,o=typeof n=="string"?n:"";return yield this.loadThreads(),o}catch(t){throw this.globalError_CS.showError(t,"Consultant_DataService.createThread"),t}})}deleteThread(e){return C(this,null,function*(){try{yield this.consultant_AS.deleteThread(e),this.activeThreadId_$()===e&&(this.selectedThread_$.set(null),this.activeThreadId_$.set("")),yield this.loadThreads()}catch(t){throw this.globalError_CS.showError(t,"Consultant_DataService.deleteThread"),t}})}static parseThreadDetail(e){let t=typeof e.threadId=="string"?e.threadId:"";if(!t.length)return null;let n=e.messages,o=[];if(Array.isArray(n))for(let p of n){if(!i.isPlainRecord(p))continue;let A=typeof p.id=="string"?p.id:"",Y=p.role;if(Y!=="user"&&Y!=="assistant")continue;let L={id:A,role:Y};typeof p.rawUserText=="string"&&(L.rawUserText=p.rawUserText),typeof p.content=="string"&&(L.content=p.content);let ie=p.userParts;if(Array.isArray(ie)){let oe=[];for(let D of ie){if(!i.isPlainRecord(D))continue;let J=D.type;if(J!=="text"&&J!=="image_url")continue;let Z={type:J};typeof D.text=="string"&&(Z.text=D.text),typeof D.imageUrl=="string"&&(Z.imageUrl=D.imageUrl),oe.push(Z)}L.userParts=oe}o.push(L)}return{threadId:t,label:typeof e.label=="string"?e.label:"",providerInstanceId:typeof e.providerInstanceId=="string"?e.providerInstanceId:"",model:typeof e.model=="string"?e.model:"",messages:o,updatedAt:typeof e.updatedAt=="string"?e.updatedAt:""}}static isPlainRecord(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}static parseRegistryEntry(e){if(!i.isPlainRecord(e))return null;let t=typeof e.provider=="string"?e.provider:"",n=typeof e.modelName=="string"?e.modelName:"";if(!t.length||!n.length)return null;let o=e.capabilities,p=Array.isArray(o)?o.filter(A=>typeof A=="string"):void 0;return{id:typeof e.id=="string"?e.id:"",provider:t,modelName:n,enabled:e.enabled===!0,capabilities:p}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=F({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var g=class{static collectSortedProviders(a){let e=new Set;for(let t of a){let n=t.provider.trim();n.length>0&&e.add(n)}return[...e].sort()}static collectSortedModelsForProvider(a,e){let t=e.trim();if(!t.length)return[];let n=[];for(let o of a){let p=o.modelName.trim();o.provider===t&&p.length>0&&n.push(p)}return[...new Set(n)].sort()}};var ze=(i,a)=>a.id;function je(i,a){i&1&&(r(0,"div",5),_(1,"Loading..."),s())}function He(i,a){if(i&1){let e=E();r(0,"app-s-session-list-row",9),h("selected",function(n){m(e);let o=c(2);return u(o.handleSelectThread(n))})("contextMenu",function(n){m(e);let o=c(2);return u(o.handleRowContextMenu(n))}),s()}if(i&2){let e=a.$implicit,t=c(2);f("view",e)("isActive",t.consultant_DS.activeThreadId_$()===e.id)}}function Xe(i,a){if(i&1&&S(0,He,1,2,"app-s-session-list-row",8,ze),i&2){let e=c();$(e.threadRowViews_$())}}function qe(i,a){i&1&&(r(0,"div",6),_(1,"No threads"),s())}function Qe(i,a){if(i&1&&(r(0,"option",16),_(1),s()),i&2){let e=a.$implicit,t=c(2);f("value",e),d(),k(t.providerDisplayLabelsMap_$()[e]||e)}}function Ge(i,a){if(i&1&&(r(0,"option",16),_(1),s()),i&2){let e=a.$implicit;f("value",e),d(),k(e)}}function Ke(i,a){if(i&1){let e=E();r(0,"div",10),h("click",function(){m(e);let n=c();return u(n.handleCloseCreate())}),r(1,"div",11),h("click",function(n){return m(e),u(n.stopPropagation())}),r(2,"h3",12),_(3,"New consultant thread"),s(),r(4,"div",13)(5,"label",14),_(6,"Label (optional)"),s(),r(7,"input",15),h("ngModelChange",function(n){m(e);let o=c();return u(o.newLabel_$.set(n))}),s(),r(8,"label",14),_(9,"Provider"),s(),r(10,"select",15),h("ngModelChange",function(n){m(e);let o=c();return u(o.handleProviderChange(n))}),S(11,Qe,2,2,"option",16,P),s(),r(13,"label",14),_(14,"Model"),s(),r(15,"select",15),h("ngModelChange",function(n){m(e);let o=c();return u(o.newModel_$.set(n))}),S(16,Ge,2,2,"option",16,P),s()(),r(18,"div",17)(19,"button",18),h("click",function(){m(e);let n=c();return u(n.handleCloseCreate())}),_(20," Cancel "),s(),r(21,"button",19),h("click",function(){m(e);let n=c();return u(n.handleCreateThread())}),_(22," Create "),s()()()()}if(i&2){let e=c();d(7),f("ngModel",e.newLabel_$()),d(3),f("ngModel",e.newProvider_$()),d(),$(e.providerOptions_$()),d(4),f("ngModel",e.newModel_$()),d(),$(e.modelsForNewProvider_$()),d(5),f("disabled",e.isCreating_$()||!e.newProvider_$().trim()||!e.newModel_$().trim())}}function Ye(i,a){if(i&1){let e=E();r(0,"div",20),h("click",function(){m(e);let n=c();return u(n.handleCloseCtxMenu())}),s(),r(1,"div",21)(2,"button",22),h("click",function(){m(e);let n=c();return u(n.handleCtxDelete())}),_(3," Delete "),s()()}if(i&2){let e=c();d(),_e("left",e.ctxMenuPos_$().x,"px")("top",e.ctxMenuPos_$().y,"px")}}var Le=(()=>{class i{consultant_DS=x(G);router=x(U);modelRegistry_DS=x(De);isCreateOpen_$=l(!1);newLabel_$=l("");newProvider_$=l("");newModel_$=l("");isCreating_$=l(!1);providerOptions_$=b(()=>g.collectSortedProviders(this.consultant_DS.pickerOptions_$()));modelsForNewProvider_$=b(()=>g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),this.newProvider_$()));providerDisplayLabelsMap_$=b(()=>{let e=this.modelRegistry_DS.setupConfigForRegistry_$(),t=this.providerOptions_$(),n={};for(let o of t)n[o]==null&&(n[o]=ee.getProviderDisplayLabel(o,e));return n});threadProviderDisplayLabels_$=b(()=>{let e=this.modelRegistry_DS.setupConfigForRegistry_$(),t=new Set;for(let o of this.consultant_DS.threads_$()){let p=o.providerInstanceId.trim();p.length>0&&t.add(p)}for(let o of this.providerOptions_$())t.add(o);let n={};for(let o of t)n[o]=ee.getProviderDisplayLabel(o,e);return n});threadRowViews_$=b(()=>this.consultant_DS.threads_$().map(e=>({id:e.threadId,label:e.label||e.threadId,status:"",statusColorClass:"bg-neutral-600",isArchived:!1,lastActivityAt:e.updatedAt,isRunning:!1})));ctxMenuThread_$=l(null);ctxMenuPos_$=l({x:0,y:0});ngOnInit(){this.consultant_DS.loadThreads(),this.consultant_DS.loadPickerOptions(),this.modelRegistry_DS.loadSetupConfigForRegistry()}handleSelectThread(e){this.router.navigate(["/consultant",e])}handleOpenCreate(){return C(this,null,function*(){yield this.consultant_DS.loadPickerOptions();let e=this.consultant_DS.defaults_$(),t=this.providerOptions_$();if(e.providerInstanceId.length>0&&t.includes(e.providerInstanceId)){let n=g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),e.providerInstanceId);e.model.length>0&&n.includes(e.model)?(this.newProvider_$.set(e.providerInstanceId),this.newModel_$.set(e.model)):(this.newProvider_$.set(e.providerInstanceId),this.newModel_$.set(n[0]??""))}else{let n=t[0]??"";this.newProvider_$.set(n);let o=g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),n);this.newModel_$.set(o[0]??"")}this.newLabel_$.set(""),this.isCreateOpen_$.set(!0)})}handleCloseCreate(){this.isCreateOpen_$.set(!1)}handleProviderChange(e){this.newProvider_$.set(e);let t=g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),e);this.newModel_$.set(t[0]??"")}handleCreateThread(){return C(this,null,function*(){let e=this.newProvider_$().trim(),t=this.newModel_$().trim();if(!(!e.length||!t.length)){this.isCreating_$.set(!0);try{let n=this.newLabel_$().trim(),o=yield this.consultant_DS.createThread({label:n.length>0?n:void 0,providerInstanceId:e,model:t});this.isCreateOpen_$.set(!1),o.length>0&&this.router.navigate(["/consultant",o])}finally{this.isCreating_$.set(!1)}}})}handleRowContextMenu(e){let t=this.consultant_DS.threads_$().find(n=>n.threadId===e.id);t&&(this.ctxMenuThread_$.set(t),this.ctxMenuPos_$.set({x:e.event.clientX,y:e.event.clientY}))}handleCloseCtxMenu(){this.ctxMenuThread_$.set(null)}handleCtxDelete(){return C(this,null,function*(){let e=this.ctxMenuThread_$();if(e){this.handleCloseCtxMenu();try{yield this.consultant_DS.deleteThread(e.threadId),this.router.navigate(["/consultant"])}catch{}}})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-ccap-consultant-dashboard"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],decls:12,vars:3,consts:[[1,"flex","flex-col","flex-1","min-h-0"],[1,"shrink-0","p-2","border-b","border-neonDefault","flex","items-center","gap-2"],[1,"text-xs","font-semibold","text-neutral-300","flex-1","truncate"],["type","button",1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors",3,"click"],[1,"flex-1","overflow-y-auto"],[1,"p-3","text-xs","text-neutral-500"],[1,"p-4","text-center","text-neutral-500","text-xs"],[1,"fixed","inset-0","z-40","flex","items-center","justify-center","bg-black/60","p-4"],[3,"view","isActive"],[3,"selected","contextMenu","view","isActive"],[1,"fixed","inset-0","z-40","flex","items-center","justify-center","bg-black/60","p-4",3,"click"],[1,"w-full","max-w-md","rounded-lg","border","border-neonDefault","bg-neutral-900","p-4","shadow-xl",3,"click"],[1,"text-sm","font-semibold","text-neutral-200","mb-3"],[1,"flex","flex-col","gap-2","text-xs"],[1,"text-neutral-400"],[1,"w-full","px-2","py-1","rounded","bg-neutral-800","border","border-neutral-600","text-neutral-200",3,"ngModelChange","ngModel"],[3,"value"],[1,"flex","justify-end","gap-2","mt-4"],["type","button",1,"px-2","py-1","text-xs","border","border-neutral-600","text-neutral-400","rounded",3,"click"],["type","button",1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-200","rounded","disabled:opacity-40",3,"click","disabled"],[1,"fixed","inset-0","z-40",3,"click"],[1,"fixed","z-50","min-w-[140px]","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-xl","py-1","text-xs"],[1,"w-full","text-left","px-3","py-1.5","text-red-400","hover:bg-red-500/10","transition-colors",3,"click"]],template:function(t,n){if(t&1&&(r(0,"div",0)(1,"div",1)(2,"span",2),_(3,"Consultant"),s(),r(4,"button",3),h("click",function(){return n.handleOpenCreate()}),_(5," + New "),s()(),r(6,"div",4),M(7,je,2,0,"div",5)(8,Xe,2,0)(9,qe,2,0,"div",6),s()(),M(10,Ke,23,4,"div",7)(11,Ye,4,4)),t&2){let o;d(7),y(n.consultant_DS.threadsLoading_$()?7:n.threadRowViews_$().length?8:9),d(3),y(n.isCreateOpen_$()?10:-1),d(),y((o=n.ctxMenuThread_$())?11:-1,o)}},dependencies:[j,H,N,z,W,B,Me],encapsulation:2})}return i})();var We=(()=>{class i{sidebarWidth_$=l(320);isSidebarOpen_$=l(!0);isResizing_$=l(!1);ngOnInit(){let e=T.loadPanelWidth("sidebar",320);this.sidebarWidth_$.set(Math.max(200,Math.min(600,e))),this.isSidebarOpen_$.set(T.loadPanelOpen("sidebar",!0))}handleSidebarResizeStart(e){let t=e.clientX,n=this.sidebarWidth_$();this.isResizing_$.set(!0),Ve.attachUntilPointerUp({startEvent:e,onMove:o=>{let p=o.clientX-t,A=Math.max(200,Math.min(600,n+p));this.sidebarWidth_$.set(A)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("sidebar",this.sidebarWidth_$())}})}handleToggleSidebar(){this.isSidebarOpen_$.update(e=>!e),T.savePanelOpen("sidebar",this.isSidebarOpen_$())}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-ccap-consultant-shell"]],hostAttrs:[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],decls:14,vars:9,consts:[[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],["sSessionToolbarLeft","",1,"flex","items-center","gap-1","min-w-0"],["type","button",1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors","flex","items-center","gap-1","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","shrink-0","transition-transform","duration-150"],["points","6 9 12 15 18 9"],["sSessionToolbarCenter","",1,"min-w-0"],["sSessionToolbarRight","",1,"min-w-0"],[3,"sidebarResizeStart","isSidebarOpen","sidebarWidthPx","isResizing"],["sSessionShellSidebar","",1,"flex","flex-col","overflow-hidden","h-full"],["sSessionShellMain","",1,"flex","min-h-0","flex-1","flex-col","overflow-hidden","[&>router-outlet]:contents"]],template:function(t,n){t&1&&(r(0,"div",0)(1,"app-s-session-shell-toolbar")(2,"div",1)(3,"button",2),h("click",function(){return n.handleToggleSidebar()}),le(),r(4,"svg",3),w(5,"polyline",4),s(),_(6," Consultant "),s()(),de(),w(7,"div",5)(8,"div",6),s(),r(9,"app-s-resizable-session-shell-layout",7),h("sidebarResizeStart",function(p){return n.handleSidebarResizeStart(p)}),r(10,"div",8),w(11,"app-ccap-consultant-dashboard"),s(),r(12,"div",9),w(13,"router-outlet"),s()()()),t&2&&(R("select-none",n.isResizing_$()),d(4),R("rotate-90",n.isSidebarOpen_$())("-rotate-90",!n.isSidebarOpen_$()),d(5),f("isSidebarOpen",n.isSidebarOpen_$())("sidebarWidthPx",n.sidebarWidth_$())("isResizing",n.isResizing_$()))},dependencies:[ge,Pe,Ee,Le],encapsulation:2})}return i})();var K=class i{static fromMessage(a){let e=a.role==="user",t=e?i.buildUserBodyText(a):a.content??"";return{listKey:a.id,kind:e?te.userPrompt:te.assistant,bodyText:t,isUserAligned:e,flags:{showCopy:!0,showRawInfo:!1,useEditDiffForExpandable:!1}}}static buildUserBodyText(a){let e=(a.rawUserText??"").trim();return(a.userParts?.length??0)>1?e.length>0?`${e}
|
|
1
|
+
import"./chunk-EGRHWZRV.js";import{a as Ve}from"./chunk-Q2PKIGLB.js";import{a as we}from"./chunk-S6QKTKFK.js";import{a as Ie,b as X}from"./chunk-IH7DUL5D.js";import"./chunk-AUFQ5CVV.js";import{g as Re}from"./chunk-4LZT5VNB.js";import"./chunk-SFFDZ5GE.js";import"./chunk-7JUIBZEE.js";import{a as Pe,b as Ee,c as q}from"./chunk-C7XPBJTG.js";import{b as te,f as ke,g as Ae}from"./chunk-LWYOOBW7.js";import"./chunk-WPHEQXWB.js";import{b as Me}from"./chunk-KQKTJVOB.js";import"./chunk-I7BQNGDL.js";import"./chunk-FQ7VQRGH.js";import"./chunk-DUZIRE6Y.js";import"./chunk-Q2NVIOCY.js";import{a as De}from"./chunk-U4VT4P2X.js";import{a as ee}from"./chunk-J32YRK3S.js";import"./chunk-7LZ73Q2C.js";import"./chunk-XFNHCEJC.js";import"./chunk-JKHAXZVP.js";import"./chunk-V3VQWJQL.js";import"./chunk-WY6NC7W6.js";import"./chunk-YUERPBPZ.js";import"./chunk-ZBTWQZNB.js";import"./chunk-FLAJXIYW.js";import{b as ve,c as N,f as W,i as B,n as z,o as j,p as H,v as Se}from"./chunk-EO4DNTT4.js";import{k as Te}from"./chunk-MJ5UWAPM.js";import{a as V}from"./chunk-5UPNU54P.js";import{j as ye}from"./chunk-FEPP5JND.js";import{I as $e}from"./chunk-THJC2TOK.js";import{Aa as he,Ba as me,C as x,D as I,E as se,Eb as xe,Fa as _,Fb as ge,Ga as k,Gb as U,J as m,K as u,Kb as be,L as le,M as de,Z as d,aa as l,ca as ce,da as M,ga as f,ha as _e,hb as b,ia as R,jb as ue,k as C,la as y,na as P,oa as S,p as v,pa as $,q as re,qa as r,ra as s,sa as w,ua as E,ub as fe,va as h,wa as c,xb as Ce,y as F,z as ae,za as pe}from"./chunk-TBMJSIBB.js";var Q="ccap-consultant",T=class{static savePanelOpen(a,e){V.writeBoolean(`${Q}:panelOpen:${a}`,e)}static loadPanelOpen(a,e){return V.readBoolean(`${Q}:panelOpen:${a}`,e)}static savePanelWidth(a,e){V.writeNumber(`${Q}:panelWidth:${a}`,e)}static loadPanelWidth(a,e){return V.readNumber(`${Q}:panelWidth:${a}`,e)}};var Oe=(()=>{class i{baseUrl=`${$e.api.baseUrl}/consultant`;http=x(Ce);listThreads(){return v(this.http.get(this.baseUrl))}getPickerOptions(){return v(this.http.get(`${this.baseUrl}/picker-options`))}createThread(e){return v(this.http.post(this.baseUrl,e))}getThread(e){return v(this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`))}patchThread(e){let t={};return e.label!=null&&(t.label=e.label),e.providerInstanceId!=null&&(t.providerInstanceId=e.providerInstanceId),e.model!=null&&(t.model=e.model),v(this.http.patch(`${this.baseUrl}/${encodeURIComponent(e.threadId)}`,t))}deleteThread(e){return v(this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`))}postMessage(e){return v(this.http.post(`${this.baseUrl}/${encodeURIComponent(e.threadId)}/messages`,{text:e.text,allowWebSearch:e.allowWebSearch,attachments:e.attachments}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=F({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var G=(()=>{class i{consultant_AS=x(Oe);globalError_CS=x(ye);threads_$=l([]);threadsLoading_$=l(!1);threadsError_$=l(null);selectedThread_$=l(null);selectedThreadLoading_$=l(!1);selectedThreadError_$=l(null);sending_$=l(!1);activeThreadId_$=l("");defaults_$=l({providerInstanceId:"",model:""});pickerOptions_$=l([]);pickerOptionsLoading_$=l(!1);loadPickerOptions(){return C(this,null,function*(){this.pickerOptionsLoading_$.set(!0);try{let e=yield this.consultant_AS.getPickerOptions(),t=Array.isArray(e.entries)?e.entries.map(i.parseRegistryEntry).filter(n=>n!==null):[];this.pickerOptions_$.set(t),this.defaults_$.set({providerInstanceId:typeof e.defaults?.providerInstanceId=="string"?e.defaults.providerInstanceId:"",model:typeof e.defaults?.model=="string"?e.defaults.model:""})}catch(e){this.globalError_CS.showError(e,"Consultant_DataService.loadPickerOptions")}finally{this.pickerOptionsLoading_$.set(!1)}})}loadThreads(){return C(this,null,function*(){this.threadsLoading_$.set(!0),this.threadsError_$.set(null);try{let e=yield this.consultant_AS.listThreads(),n=(Array.isArray(e.threads)?e.threads:[]).map(o=>({threadId:typeof o.threadId=="string"?o.threadId:"",label:typeof o.label=="string"?o.label:"",providerInstanceId:typeof o.providerInstanceId=="string"?o.providerInstanceId:"",model:typeof o.model=="string"?o.model:"",messageCount:typeof o.messageCount=="number"?o.messageCount:0,updatedAt:typeof o.updatedAt=="string"?o.updatedAt:""}));this.threads_$.set(n)}catch(e){this.threadsError_$.set(e),this.globalError_CS.showError(e,"Consultant_DataService.loadThreads")}finally{this.threadsLoading_$.set(!1)}})}loadThreadDetail(e){return C(this,null,function*(){this.activeThreadId_$.set(e),this.selectedThreadLoading_$.set(!0),this.selectedThreadError_$.set(null);try{let t=yield this.consultant_AS.getThread(e),n=i.parseThreadDetail(t.thread);this.selectedThread_$.set(n)}catch(t){this.selectedThreadError_$.set(t),this.globalError_CS.showError(t,"Consultant_DataService.loadThreadDetail")}finally{this.selectedThreadLoading_$.set(!1)}})}sendMessage(e){return C(this,null,function*(){this.sending_$.set(!0);try{let n=(yield this.consultant_AS.postMessage(e)).thread;if(i.isPlainRecord(n)){let o=i.parseThreadDetail(n);this.selectedThread_$.set(o)}yield this.loadThreads()}catch(t){throw this.globalError_CS.showError(t,"Consultant_DataService.sendMessage"),t}finally{this.sending_$.set(!1)}})}updateThreadConfig(e){return C(this,null,function*(){try{let t=yield this.consultant_AS.patchThread(e),n=i.parseThreadDetail(t.thread);this.selectedThread_$.set(n),yield this.loadThreads()}catch(t){throw this.globalError_CS.showError(t,"Consultant_DataService.updateThreadConfig"),t}})}createThread(e){return C(this,null,function*(){try{let n=(yield this.consultant_AS.createThread(e)).thread.threadId,o=typeof n=="string"?n:"";return yield this.loadThreads(),o}catch(t){throw this.globalError_CS.showError(t,"Consultant_DataService.createThread"),t}})}deleteThread(e){return C(this,null,function*(){try{yield this.consultant_AS.deleteThread(e),this.activeThreadId_$()===e&&(this.selectedThread_$.set(null),this.activeThreadId_$.set("")),yield this.loadThreads()}catch(t){throw this.globalError_CS.showError(t,"Consultant_DataService.deleteThread"),t}})}static parseThreadDetail(e){let t=typeof e.threadId=="string"?e.threadId:"";if(!t.length)return null;let n=e.messages,o=[];if(Array.isArray(n))for(let p of n){if(!i.isPlainRecord(p))continue;let A=typeof p.id=="string"?p.id:"",Y=p.role;if(Y!=="user"&&Y!=="assistant")continue;let L={id:A,role:Y};typeof p.rawUserText=="string"&&(L.rawUserText=p.rawUserText),typeof p.content=="string"&&(L.content=p.content);let ie=p.userParts;if(Array.isArray(ie)){let oe=[];for(let D of ie){if(!i.isPlainRecord(D))continue;let J=D.type;if(J!=="text"&&J!=="image_url")continue;let Z={type:J};typeof D.text=="string"&&(Z.text=D.text),typeof D.imageUrl=="string"&&(Z.imageUrl=D.imageUrl),oe.push(Z)}L.userParts=oe}o.push(L)}return{threadId:t,label:typeof e.label=="string"?e.label:"",providerInstanceId:typeof e.providerInstanceId=="string"?e.providerInstanceId:"",model:typeof e.model=="string"?e.model:"",messages:o,updatedAt:typeof e.updatedAt=="string"?e.updatedAt:""}}static isPlainRecord(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}static parseRegistryEntry(e){if(!i.isPlainRecord(e))return null;let t=typeof e.provider=="string"?e.provider:"",n=typeof e.modelName=="string"?e.modelName:"";if(!t.length||!n.length)return null;let o=e.capabilities,p=Array.isArray(o)?o.filter(A=>typeof A=="string"):void 0;return{id:typeof e.id=="string"?e.id:"",provider:t,modelName:n,enabled:e.enabled===!0,capabilities:p}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=F({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var g=class{static collectSortedProviders(a){let e=new Set;for(let t of a){let n=t.provider.trim();n.length>0&&e.add(n)}return[...e].sort()}static collectSortedModelsForProvider(a,e){let t=e.trim();if(!t.length)return[];let n=[];for(let o of a){let p=o.modelName.trim();o.provider===t&&p.length>0&&n.push(p)}return[...new Set(n)].sort()}};var ze=(i,a)=>a.id;function je(i,a){i&1&&(r(0,"div",5),_(1,"Loading..."),s())}function He(i,a){if(i&1){let e=E();r(0,"app-s-session-list-row",9),h("selected",function(n){m(e);let o=c(2);return u(o.handleSelectThread(n))})("contextMenu",function(n){m(e);let o=c(2);return u(o.handleRowContextMenu(n))}),s()}if(i&2){let e=a.$implicit,t=c(2);f("view",e)("isActive",t.consultant_DS.activeThreadId_$()===e.id)}}function Xe(i,a){if(i&1&&S(0,He,1,2,"app-s-session-list-row",8,ze),i&2){let e=c();$(e.threadRowViews_$())}}function qe(i,a){i&1&&(r(0,"div",6),_(1,"No threads"),s())}function Qe(i,a){if(i&1&&(r(0,"option",16),_(1),s()),i&2){let e=a.$implicit,t=c(2);f("value",e),d(),k(t.providerDisplayLabelsMap_$()[e]||e)}}function Ge(i,a){if(i&1&&(r(0,"option",16),_(1),s()),i&2){let e=a.$implicit;f("value",e),d(),k(e)}}function Ke(i,a){if(i&1){let e=E();r(0,"div",10),h("click",function(){m(e);let n=c();return u(n.handleCloseCreate())}),r(1,"div",11),h("click",function(n){return m(e),u(n.stopPropagation())}),r(2,"h3",12),_(3,"New consultant thread"),s(),r(4,"div",13)(5,"label",14),_(6,"Label (optional)"),s(),r(7,"input",15),h("ngModelChange",function(n){m(e);let o=c();return u(o.newLabel_$.set(n))}),s(),r(8,"label",14),_(9,"Provider"),s(),r(10,"select",15),h("ngModelChange",function(n){m(e);let o=c();return u(o.handleProviderChange(n))}),S(11,Qe,2,2,"option",16,P),s(),r(13,"label",14),_(14,"Model"),s(),r(15,"select",15),h("ngModelChange",function(n){m(e);let o=c();return u(o.newModel_$.set(n))}),S(16,Ge,2,2,"option",16,P),s()(),r(18,"div",17)(19,"button",18),h("click",function(){m(e);let n=c();return u(n.handleCloseCreate())}),_(20," Cancel "),s(),r(21,"button",19),h("click",function(){m(e);let n=c();return u(n.handleCreateThread())}),_(22," Create "),s()()()()}if(i&2){let e=c();d(7),f("ngModel",e.newLabel_$()),d(3),f("ngModel",e.newProvider_$()),d(),$(e.providerOptions_$()),d(4),f("ngModel",e.newModel_$()),d(),$(e.modelsForNewProvider_$()),d(5),f("disabled",e.isCreating_$()||!e.newProvider_$().trim()||!e.newModel_$().trim())}}function Ye(i,a){if(i&1){let e=E();r(0,"div",20),h("click",function(){m(e);let n=c();return u(n.handleCloseCtxMenu())}),s(),r(1,"div",21)(2,"button",22),h("click",function(){m(e);let n=c();return u(n.handleCtxDelete())}),_(3," Delete "),s()()}if(i&2){let e=c();d(),_e("left",e.ctxMenuPos_$().x,"px")("top",e.ctxMenuPos_$().y,"px")}}var Le=(()=>{class i{consultant_DS=x(G);router=x(U);modelRegistry_DS=x(De);isCreateOpen_$=l(!1);newLabel_$=l("");newProvider_$=l("");newModel_$=l("");isCreating_$=l(!1);providerOptions_$=b(()=>g.collectSortedProviders(this.consultant_DS.pickerOptions_$()));modelsForNewProvider_$=b(()=>g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),this.newProvider_$()));providerDisplayLabelsMap_$=b(()=>{let e=this.modelRegistry_DS.setupConfigForRegistry_$(),t=this.providerOptions_$(),n={};for(let o of t)n[o]==null&&(n[o]=ee.getProviderDisplayLabel(o,e));return n});threadProviderDisplayLabels_$=b(()=>{let e=this.modelRegistry_DS.setupConfigForRegistry_$(),t=new Set;for(let o of this.consultant_DS.threads_$()){let p=o.providerInstanceId.trim();p.length>0&&t.add(p)}for(let o of this.providerOptions_$())t.add(o);let n={};for(let o of t)n[o]=ee.getProviderDisplayLabel(o,e);return n});threadRowViews_$=b(()=>this.consultant_DS.threads_$().map(e=>({id:e.threadId,label:e.label||e.threadId,status:"",statusColorClass:"bg-neutral-600",isArchived:!1,lastActivityAt:e.updatedAt,isRunning:!1})));ctxMenuThread_$=l(null);ctxMenuPos_$=l({x:0,y:0});ngOnInit(){this.consultant_DS.loadThreads(),this.consultant_DS.loadPickerOptions(),this.modelRegistry_DS.loadSetupConfigForRegistry()}handleSelectThread(e){this.router.navigate(["/consultant",e])}handleOpenCreate(){return C(this,null,function*(){yield this.consultant_DS.loadPickerOptions();let e=this.consultant_DS.defaults_$(),t=this.providerOptions_$();if(e.providerInstanceId.length>0&&t.includes(e.providerInstanceId)){let n=g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),e.providerInstanceId);e.model.length>0&&n.includes(e.model)?(this.newProvider_$.set(e.providerInstanceId),this.newModel_$.set(e.model)):(this.newProvider_$.set(e.providerInstanceId),this.newModel_$.set(n[0]??""))}else{let n=t[0]??"";this.newProvider_$.set(n);let o=g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),n);this.newModel_$.set(o[0]??"")}this.newLabel_$.set(""),this.isCreateOpen_$.set(!0)})}handleCloseCreate(){this.isCreateOpen_$.set(!1)}handleProviderChange(e){this.newProvider_$.set(e);let t=g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),e);this.newModel_$.set(t[0]??"")}handleCreateThread(){return C(this,null,function*(){let e=this.newProvider_$().trim(),t=this.newModel_$().trim();if(!(!e.length||!t.length)){this.isCreating_$.set(!0);try{let n=this.newLabel_$().trim(),o=yield this.consultant_DS.createThread({label:n.length>0?n:void 0,providerInstanceId:e,model:t});this.isCreateOpen_$.set(!1),o.length>0&&this.router.navigate(["/consultant",o])}finally{this.isCreating_$.set(!1)}}})}handleRowContextMenu(e){let t=this.consultant_DS.threads_$().find(n=>n.threadId===e.id);t&&(this.ctxMenuThread_$.set(t),this.ctxMenuPos_$.set({x:e.event.clientX,y:e.event.clientY}))}handleCloseCtxMenu(){this.ctxMenuThread_$.set(null)}handleCtxDelete(){return C(this,null,function*(){let e=this.ctxMenuThread_$();if(e){this.handleCloseCtxMenu();try{yield this.consultant_DS.deleteThread(e.threadId),this.router.navigate(["/consultant"])}catch{}}})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-ccap-consultant-dashboard"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],decls:12,vars:3,consts:[[1,"flex","flex-col","flex-1","min-h-0"],[1,"shrink-0","p-2","border-b","border-neonDefault","flex","items-center","gap-2"],[1,"text-xs","font-semibold","text-neutral-300","flex-1","truncate"],["type","button",1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors",3,"click"],[1,"flex-1","overflow-y-auto"],[1,"p-3","text-xs","text-neutral-500"],[1,"p-4","text-center","text-neutral-500","text-xs"],[1,"fixed","inset-0","z-40","flex","items-center","justify-center","bg-black/60","p-4"],[3,"view","isActive"],[3,"selected","contextMenu","view","isActive"],[1,"fixed","inset-0","z-40","flex","items-center","justify-center","bg-black/60","p-4",3,"click"],[1,"w-full","max-w-md","rounded-lg","border","border-neonDefault","bg-neutral-900","p-4","shadow-xl",3,"click"],[1,"text-sm","font-semibold","text-neutral-200","mb-3"],[1,"flex","flex-col","gap-2","text-xs"],[1,"text-neutral-400"],[1,"w-full","px-2","py-1","rounded","bg-neutral-800","border","border-neutral-600","text-neutral-200",3,"ngModelChange","ngModel"],[3,"value"],[1,"flex","justify-end","gap-2","mt-4"],["type","button",1,"px-2","py-1","text-xs","border","border-neutral-600","text-neutral-400","rounded",3,"click"],["type","button",1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-200","rounded","disabled:opacity-40",3,"click","disabled"],[1,"fixed","inset-0","z-40",3,"click"],[1,"fixed","z-50","min-w-[140px]","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-xl","py-1","text-xs"],[1,"w-full","text-left","px-3","py-1.5","text-red-400","hover:bg-red-500/10","transition-colors",3,"click"]],template:function(t,n){if(t&1&&(r(0,"div",0)(1,"div",1)(2,"span",2),_(3,"Consultant"),s(),r(4,"button",3),h("click",function(){return n.handleOpenCreate()}),_(5," + New "),s()(),r(6,"div",4),M(7,je,2,0,"div",5)(8,Xe,2,0)(9,qe,2,0,"div",6),s()(),M(10,Ke,23,4,"div",7)(11,Ye,4,4)),t&2){let o;d(7),y(n.consultant_DS.threadsLoading_$()?7:n.threadRowViews_$().length?8:9),d(3),y(n.isCreateOpen_$()?10:-1),d(),y((o=n.ctxMenuThread_$())?11:-1,o)}},dependencies:[j,H,N,z,W,B,Me],encapsulation:2})}return i})();var We=(()=>{class i{sidebarWidth_$=l(320);isSidebarOpen_$=l(!0);isResizing_$=l(!1);ngOnInit(){let e=T.loadPanelWidth("sidebar",320);this.sidebarWidth_$.set(Math.max(200,Math.min(600,e))),this.isSidebarOpen_$.set(T.loadPanelOpen("sidebar",!0))}handleSidebarResizeStart(e){let t=e.clientX,n=this.sidebarWidth_$();this.isResizing_$.set(!0),Ve.attachUntilPointerUp({startEvent:e,onMove:o=>{let p=o.clientX-t,A=Math.max(200,Math.min(600,n+p));this.sidebarWidth_$.set(A)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("sidebar",this.sidebarWidth_$())}})}handleToggleSidebar(){this.isSidebarOpen_$.update(e=>!e),T.savePanelOpen("sidebar",this.isSidebarOpen_$())}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-ccap-consultant-shell"]],hostAttrs:[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],decls:14,vars:9,consts:[[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],["sSessionToolbarLeft","",1,"flex","items-center","gap-1","min-w-0"],["type","button",1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors","flex","items-center","gap-1","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","shrink-0","transition-transform","duration-150"],["points","6 9 12 15 18 9"],["sSessionToolbarCenter","",1,"min-w-0"],["sSessionToolbarRight","",1,"min-w-0"],[3,"sidebarResizeStart","isSidebarOpen","sidebarWidthPx","isResizing"],["sSessionShellSidebar","",1,"flex","flex-col","overflow-hidden","h-full"],["sSessionShellMain","",1,"flex","min-h-0","flex-1","flex-col","overflow-hidden","[&>router-outlet]:contents"]],template:function(t,n){t&1&&(r(0,"div",0)(1,"app-s-session-shell-toolbar")(2,"div",1)(3,"button",2),h("click",function(){return n.handleToggleSidebar()}),le(),r(4,"svg",3),w(5,"polyline",4),s(),_(6," Consultant "),s()(),de(),w(7,"div",5)(8,"div",6),s(),r(9,"app-s-resizable-session-shell-layout",7),h("sidebarResizeStart",function(p){return n.handleSidebarResizeStart(p)}),r(10,"div",8),w(11,"app-ccap-consultant-dashboard"),s(),r(12,"div",9),w(13,"router-outlet"),s()()()),t&2&&(R("select-none",n.isResizing_$()),d(4),R("rotate-90",n.isSidebarOpen_$())("-rotate-90",!n.isSidebarOpen_$()),d(5),f("isSidebarOpen",n.isSidebarOpen_$())("sidebarWidthPx",n.sidebarWidth_$())("isResizing",n.isResizing_$()))},dependencies:[ge,Pe,Ee,Le],encapsulation:2})}return i})();var K=class i{static fromMessage(a){let e=a.role==="user",t=e?i.buildUserBodyText(a):a.content??"";return{listKey:a.id,kind:e?te.userPrompt:te.assistant,bodyText:t,isUserAligned:e,flags:{showCopy:!0,showRawInfo:!1,useEditDiffForExpandable:!1}}}static buildUserBodyText(a){let e=(a.rawUserText??"").trim();return(a.userParts?.length??0)>1?e.length>0?`${e}
|
|
2
2
|
[attachments]`:"[attachments]":e.length>0?e:a.content??""}};var Ze=(i,a)=>a.listKey;function et(i,a){i&1&&(r(0,"div",0),_(1," Select a thread or create a new consultant chat. "),s())}function tt(i,a){i&1&&(r(0,"div",1),_(1,"Loading\u2026"),s())}function nt(i,a){if(i&1&&(r(0,"option",8),_(1),s()),i&2){let e=a.$implicit;f("value",e),d(),k(e)}}function it(i,a){if(i&1&&(r(0,"option",8),_(1),s()),i&2){let e=a.$implicit;f("value",e),d(),k(e)}}function ot(i,a){if(i&1&&(r(0,"div",18),w(1,"app-s-agent-console-message-bubble",19),s()),i&2){let e=a.$implicit;R("self-end",e.isUserAligned===!0)("self-start",e.isUserAligned!==!0),d(),f("view",e)}}function rt(i,a){if(i&1){let e=E();r(0,"app-s-session-chat-column-layout")(1,"div",2)(2,"div",3)(3,"div",4)(4,"span",5),_(5,"Label"),s(),r(6,"input",6),h("ngModelChange",function(n){m(e);let o=c(2);return u(o.localLabel_$.set(n))}),s()(),r(7,"div",4)(8,"span",5),_(9,"Provider"),s(),r(10,"select",7),h("ngModelChange",function(n){m(e);let o=c(2);return u(o.handleProviderChange(n))}),S(11,nt,2,2,"option",8,P),s()(),r(13,"div",4)(14,"span",5),_(15,"Model"),s(),r(16,"select",6),h("ngModelChange",function(n){m(e);let o=c(2);return u(o.localModel_$.set(n))}),S(17,it,2,2,"option",8,P),s()(),r(19,"button",9),h("click",function(){m(e);let n=c(2);return u(n.handleApplyConfig())}),_(20," Apply "),s(),r(21,"button",10),h("click",function(){m(e);let n=c(2);return u(n.handleDeleteThread())}),_(22," Delete "),s()()(),r(23,"div",11),S(24,ot,2,5,"div",12,Ze),s(),r(26,"div",13)(27,"label",14)(28,"input",15),h("ngModelChange",function(n){m(e);let o=c(2);return u(o.allowWebSearch_$.set(n))}),s(),_(29," Allow web search (Brave) "),s(),r(30,"app-s-session-input",16),h("draftTextChange",function(n){m(e);let o=c(2);return u(o.composerText_$.set(n))})("sendRequested",function(){m(e);let n=c(2);return u(n.handleSend())})("attachmentsChanged",function(n){m(e);let o=c(2);return u(o.handleAttachmentsChanged(n))}),r(31,"app-ccap-voice-record-button",17),h("transcriptSegmentReady",function(n){m(e);let o=c(2);return u(o.handleVoiceSegment(n))}),s()()()()}if(i&2){let e=c(2);d(6),f("ngModel",e.localLabel_$()),d(4),f("ngModel",e.localProvider_$()),d(),$(e.providerOptions_$()),d(5),f("ngModel",e.localModel_$()),d(),$(e.modelsForSelectedProvider_$()),d(7),$(e.consultantBubbleViews_$()),d(4),f("ngModel",e.allowWebSearch_$()),d(2),f("draftText",e.composerText_$())("isSending",e.consultant_DS.sending_$())("enableAttachments",!0)("textareaRows",3),d(),f("compactLayout",!0)}}function at(i,a){i&1&&(r(0,"div",0),_(1," Thread not loaded. "),s())}function st(i,a){if(i&1&&M(0,rt,32,9,"app-s-session-chat-column-layout")(1,at,2,0,"div",0),i&2){let e=c();y(e.consultant_DS.selectedThread_$()?0:1)}}var ne=(()=>{class i extends we{consultant_DS=x(G);route=x(xe);router=x(U);voiceInputUi_DS=x(Ie);sessionInputRef;composerText_$=l("");allowWebSearch_$=l(!1);localLabel_$=l("");localProvider_$=l("");localModel_$=l("");providerOptions_$=b(()=>g.collectSortedProviders(this.consultant_DS.pickerOptions_$()));modelsForSelectedProvider_$=b(()=>g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),this.localProvider_$()));consultantBubbleViews_$=b(()=>{let e=this.consultant_DS.selectedThread_$();return e?e.messages.map(t=>K.fromMessage(t)):[]});pendingAttachments=[];constructor(){super(),this.addSubscription(this.route.paramMap.pipe(re(e=>e.get("threadId")??"")).subscribe(e=>{e.length>0?this.consultant_DS.loadThreadDetail(e):(this.consultant_DS.selectedThread_$.set(null),this.consultant_DS.activeThreadId_$.set(""))})),ue(()=>{let e=this.consultant_DS.selectedThread_$();e!=null&&(this.localLabel_$.set(e.label),this.localProvider_$.set(e.providerInstanceId),this.localModel_$.set(e.model))},{allowSignalWrites:!0}),this.consultant_DS.loadPickerOptions()}ngOnDestroy(){super.ngOnDestroy()}handleProviderChange(e){this.localProvider_$.set(e);let t=g.collectSortedModelsForProvider(this.consultant_DS.pickerOptions_$(),e),n=this.localModel_$();t.includes(n)||this.localModel_$.set(t[0]??"")}handleApplyConfig(){return C(this,null,function*(){let e=this.consultant_DS.activeThreadId_$();e.length&&(yield this.consultant_DS.updateThreadConfig({threadId:e,label:this.localLabel_$(),providerInstanceId:this.localProvider_$(),model:this.localModel_$()}))})}handleDeleteThread(){return C(this,null,function*(){let e=this.consultant_DS.activeThreadId_$();e.length&&(yield this.consultant_DS.deleteThread(e),this.router.navigate(["/consultant"]))})}handleAttachmentsChanged(e){this.pendingAttachments=e}handleVoiceSegment(e){let t=e.text.trim();if(!t.length)return;let n=this.composerText_$().trim();this.composerText_$.set(n.length>0?`${n} ${t}`:t),this.voiceInputUi_DS.autoSendAfterVoice_$()&&e.isFinal&&this.handleSend()}handleSend(){return C(this,null,function*(){let e=this.consultant_DS.activeThreadId_$();if(!e.length)return;let t=this.composerText_$().trim(),n=[...this.pendingAttachments];if(!t.length&&!n.length)return;let o=n.map(p=>({kind:p.isImage?"image":"textDocument",mimeType:p.mimeType,fileName:p.fileName,dataBase64:p.base64}));yield this.consultant_DS.sendMessage({threadId:e,text:t,allowWebSearch:this.allowWebSearch_$(),attachments:o}),this.composerText_$.set(""),this.pendingAttachments=[],this.sessionInputRef?.clearAttachments()})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-ccap-consultant-detail"]],viewQuery:function(t,n){if(t&1&&pe(q,5),t&2){let o;he(o=me())&&(n.sessionInputRef=o.first)}},hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],features:[ce],decls:3,vars:1,consts:[[1,"flex","flex-1","items-center","justify-center","p-4","text-xs","text-neutral-500"],[1,"flex","flex-1","items-center","justify-center","text-xs","text-neutral-500"],["sChatColumnHeader","",1,"flex","shrink-0","flex-col","gap-2","border-b","border-neonDefault","bg-ccapSurface","p-2"],[1,"flex","flex-wrap","items-end","gap-2"],[1,"flex","flex-col","gap-0.5"],[1,"text-[10px]","text-neutral-500"],[1,"w-40","rounded","border","border-neutral-600","bg-neutral-800","px-2","py-1","text-xs","text-neutral-200",3,"ngModelChange","ngModel"],[1,"w-36","rounded","border","border-neutral-600","bg-neutral-800","px-2","py-1","text-xs","text-neutral-200",3,"ngModelChange","ngModel"],[3,"value"],["type","button",1,"rounded","border","border-neonDefault","px-2","py-1","text-xs","text-neutral-300",3,"click"],["type","button",1,"ml-auto","rounded","border","border-red-900","px-2","py-1","text-xs","text-red-300",3,"click"],["sChatColumnScroll","",1,"flex","flex-col","gap-3","p-3"],[1,"max-w-[85%]",3,"self-end","self-start"],["sChatColumnComposer","",1,"flex","flex-col"],[1,"flex","cursor-pointer","items-center","gap-2","px-2","pt-1","text-[10px]","text-neutral-400"],["type","checkbox",3,"ngModelChange","ngModel"],["acceptedFileTypes","image/png,image/jpeg,image/webp,image/gif,.txt,.md,text/plain,text/markdown","placeholder","Message\u2026",3,"draftTextChange","sendRequested","attachmentsChanged","draftText","isSending","enableAttachments","textareaRows"],["sInputTextareaAccessory","",3,"transcriptSegmentReady","compactLayout"],[1,"max-w-[85%]"],[3,"view"]],template:function(t,n){t&1&&M(0,et,2,0,"div",0)(1,tt,2,0,"div",1)(2,st,2,1),t&2&&y(n.consultant_DS.activeThreadId_$()?n.consultant_DS.selectedThreadLoading_$()?1:2:0)},dependencies:[j,H,N,ve,z,W,B,X,q,ke,Ae],encapsulation:2})}return i})();var lt=[{path:"",component:We,children:[{path:"",component:ne},{path:":threadId",component:ne}]}],xn=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[fe,Se,be.forChild(lt),Te,X,Re]})}return i})();export{xn as Consultant_Module};
|
|
3
|
-
//# sourceMappingURL=consultant.module-
|
|
3
|
+
//# sourceMappingURL=consultant.module-H4WF4E4O.js.map
|