vibe64 0.1.52 → 0.1.53
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/bin/upgrade-state.js +975 -974
- package/dist/assets/{GithubBrowserTabs-D7DveB8M.js → GithubBrowserTabs-DG2nCSNW.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-DDArM5uw.js → Vibe64AuthSettingsButton-9OLqOZao.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-Ab65VYSS.js → Vibe64DashboardShell-hWNziCur.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-DHLt5bST.js → Vibe64DatabaseWorkspace-TqXOZJpI.js} +1 -1
- package/dist/assets/{Vibe64FileArea-DCqpclYH.js → Vibe64FileArea-BljhpApn.js} +1 -1
- package/dist/assets/{Vibe64OutputControls-BPDF1XfG.js → Vibe64OutputControls-Dk_DWuFb.js} +1 -1
- package/dist/assets/{Vibe64RepositoryWorkspace-C107tX19.js → Vibe64RepositoryWorkspace-CDnsAlIz.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-BKJ1Qem_.js → Vibe64SessionFiles-DjeEvtpc.js} +1 -1
- package/dist/assets/{Vibe64UiStoryboardView-CJajdYSt.js → Vibe64UiStoryboardView-idZz86bx.js} +1 -1
- package/dist/assets/{_sessionId_-BaNhTTVN.js → _sessionId_-DLLJsju9.js} +1 -1
- package/dist/assets/{_slug_-D7mzZsk3.css → _slug_-BRPxP_Yn.css} +1 -1
- package/dist/assets/{_slug_-nHO3Bg-f.js → _slug_-JgF_FQ6F.js} +7 -7
- package/dist/assets/{app-DbGzTUVN.js → app-Cuw9E-ru.js} +1 -1
- package/dist/assets/{changes-D7NjgKWf.js → changes-CoR0-8EL.js} +1 -1
- package/dist/assets/{conversation-DV8qCsqw.js → conversation-B1UoWMaA.js} +1 -1
- package/dist/assets/{dashboard-DL95BPsz.js → dashboard-DnuIxR1s.js} +1 -1
- package/dist/assets/{english-definitions-ChTTs3cC.js → english-definitions-By4b_Yl2.js} +1 -1
- package/dist/assets/{env-BdJvhqF-.js → env-KUPen-sS.js} +1 -1
- package/dist/assets/{history-DmGNxMVh.js → history-S_cJLehJ.js} +1 -1
- package/dist/assets/{index-BXZp5ztx.js → index-CNkd6O5t.js} +3 -3
- package/dist/assets/{integrations-DAYe7RkJ.js → integrations-Dmbbbs_A.js} +1 -1
- package/dist/assets/{issues-D_zOo2IW.js → issues-EeBajY3I.js} +1 -1
- package/dist/assets/{learning-ilyEoffw.js → learning-DDRM-FoP.js} +1 -1
- package/dist/assets/{project-files-CJWdFXh4.js → project-files-CQ1BLaaP.js} +1 -1
- package/dist/assets/{publish-D728amkk.js → publish-bvwc-KoQ.js} +1 -1
- package/dist/assets/{pull-requests-BsbM-5MA.js → pull-requests-Ce1ECyuL.js} +1 -1
- package/dist/assets/{repository-C8NwO4bj.js → repository-CK3osHmp.js} +1 -1
- package/dist/assets/{settings-DTLY7ZT5.js → settings-PQGw4vfn.js} +1 -1
- package/dist/assets/{useArchivedVibe64Sessions-Cc9GdKlD.js → useArchivedVibe64Sessions-BAQjW01a.js} +1 -1
- package/dist/assets/{useAssistantAttachments-DJKqt1hL.js → useAssistantAttachments-DJWb1KdF.js} +1 -1
- package/dist/assets/{useVibe64ConversationLog-Co0DhC3R.js → useVibe64ConversationLog-CjUZuvV7.js} +1 -1
- package/dist/assets/{useVibe64SessionData-D7fBm9xf.js → useVibe64SessionData-CbY_B5mC.js} +1 -1
- package/dist/assets/{vibe64SessionFocus-8fHAeoyU.js → vibe64SessionFocus-Bd3JuuZe.js} +1 -1
- package/dist/index.html +4 -4
- package/docs/colleague-usage/conversation-context.md +3 -1
- package/docs/colleague-usage/temporary-chats.md +26 -1
- package/docs/colleague-usage/workspace-preparation.md +17 -0
- package/node_modules/@jskit-ai/assistant-core/locales/en.json +1 -0
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
- package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-core/locales/en.json +1 -0
- package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +43 -43
- package/node_modules/@local/vibe64-genesis/src/server/index.js +189 -182
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +68 -61
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +532 -532
- package/package.json +7 -7
- package/server.bundle.mjs +28835 -28791
package/dist/assets/{Vibe64RepositoryWorkspace-C107tX19.js → Vibe64RepositoryWorkspace-CDnsAlIz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as VProgressLinear,hr as __commonJSMin,t as VChip,x as VIcon,yr as __toESM}from"./VChip-BRhZ1px1.js";import{D as createVNode,E as createTextVNode,Ht as watch,On as unref,Pt as useId,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,er as normalizeStyle,g as computed,gn as reactive,it as onBeforeUnmount,mt as openBlock,o as Fragment,pn as onScopeDispose,qt as withCtx,tr as toDisplayString,v as createBlock,vn as ref,w as createSlots,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{r as getHttpWebClient}from"./httpClient-Dj5wBWSr.js";import{Fr as mdiSourceBranchSync,Ft as mdiFileCompare,G as mdiChevronRight,Ir as mdiSourceCommit,Lr as mdiSourceMerge,Q as mdiClose,Z as mdiClockOutline,c as mdiAccountOutline,nt as mdiCloudRefreshOutline,zr as mdiSourceRepository}from"./mdi-DwGK7nOu.js";import{t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VAlert}from"./VAlert-CBpSKTfy.js";import{t as VDivider}from"./VDivider-DY2s_j83.js";import{t as VSheet}from"./VSheet-C1Vro_q8.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSpacer}from"./VSpacer-B5ip6FSG.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{n as useRealtimeEvent}from"./useRealtimeEvent-DbrYLgvU.js";import{t as repositoryUpdateRelationship}from"./shared-CEFaGI9L.js";import{t as vibe64ApiError}from"./vibe64ApiResponses-B4VY77Q_.js";import{t as StudioErrorNotice_default}from"./StudioErrorNotice-Bo6gBu5l.js";import{r as writeLocalStorageJson,t as readLocalStorageJson}from"./browserLocalStorage-B4C7rHrs.js";import{A as vibe64RepositoryVersionDiffPath,M as vibe64SessionChangeDiffPath,N as vibe64SessionChangesPath,P as vibe64SessionCheckUpdatesPath,j as vibe64RepositoryVersionFilesPath,k as vibe64RepositoryHistoryPath,l as VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT,s as VIBE64_SESSION_CHANGED_EVENT}from"./vibe64SessionRequestConfig-DvrfyP8A.js";import{A as readRefOrGetterValue}from"./index-
|
|
1
|
+
import{_ as VProgressLinear,hr as __commonJSMin,t as VChip,x as VIcon,yr as __toESM}from"./VChip-BRhZ1px1.js";import{D as createVNode,E as createTextVNode,Ht as watch,On as unref,Pt as useId,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,er as normalizeStyle,g as computed,gn as reactive,it as onBeforeUnmount,mt as openBlock,o as Fragment,pn as onScopeDispose,qt as withCtx,tr as toDisplayString,v as createBlock,vn as ref,w as createSlots,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{r as getHttpWebClient}from"./httpClient-Dj5wBWSr.js";import{Fr as mdiSourceBranchSync,Ft as mdiFileCompare,G as mdiChevronRight,Ir as mdiSourceCommit,Lr as mdiSourceMerge,Q as mdiClose,Z as mdiClockOutline,c as mdiAccountOutline,nt as mdiCloudRefreshOutline,zr as mdiSourceRepository}from"./mdi-DwGK7nOu.js";import{t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VAlert}from"./VAlert-CBpSKTfy.js";import{t as VDivider}from"./VDivider-DY2s_j83.js";import{t as VSheet}from"./VSheet-C1Vro_q8.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSpacer}from"./VSpacer-B5ip6FSG.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{n as useRealtimeEvent}from"./useRealtimeEvent-DbrYLgvU.js";import{t as repositoryUpdateRelationship}from"./shared-CEFaGI9L.js";import{t as vibe64ApiError}from"./vibe64ApiResponses-B4VY77Q_.js";import{t as StudioErrorNotice_default}from"./StudioErrorNotice-Bo6gBu5l.js";import{r as writeLocalStorageJson,t as readLocalStorageJson}from"./browserLocalStorage-B4C7rHrs.js";import{A as vibe64RepositoryVersionDiffPath,M as vibe64SessionChangeDiffPath,N as vibe64SessionChangesPath,P as vibe64SessionCheckUpdatesPath,j as vibe64RepositoryVersionFilesPath,k as vibe64RepositoryHistoryPath,l as VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT,s as VIBE64_SESSION_CHANGED_EVENT}from"./vibe64SessionRequestConfig-DvrfyP8A.js";import{A as readRefOrGetterValue}from"./index-CNkd6O5t.js";import{t as Vibe64TemporaryAiFixAction_default}from"./Vibe64TemporaryAiFixAction-DT62W459.js";import{n as diffWordsWithSpace,r as diffChars}from"./libesm-CR-iGldz.js";import{i as repositoryStatusSessionId,n as repositoryStatusRealtimeNeedsCanonicalCheck,r as repositoryStatusRealtimeShouldRefresh}from"./vibe64RepositoryRealtime-CHT4-6VN.js";import{t as Vibe64DashboardPageHeader_default}from"./Vibe64DashboardPageHeader-BKo3ufyj.js";var LineType;(function(LineType){LineType[`INSERT`]=`insert`;LineType[`DELETE`]=`delete`;LineType[`CONTEXT`]=`context`})(LineType||(LineType={}));var OutputFormatType={LINE_BY_LINE:`line-by-line`,SIDE_BY_SIDE:`side-by-side`};var LineMatchingType={LINES:`lines`,WORDS:`words`,NONE:`none`};var DiffStyleType={WORD:`word`,CHAR:`char`};var ColorSchemeType;(function(ColorSchemeType){ColorSchemeType[`AUTO`]=`auto`;ColorSchemeType[`DARK`]=`dark`;ColorSchemeType[`LIGHT`]=`light`})(ColorSchemeType||(ColorSchemeType={}));var regex=RegExp(`[`+[`-`,`[`,`]`,`/`,`{`,`}`,`(`,`)`,`*`,`+`,`?`,`.`,`\\`,`^`,`$`,`|`].join(`\\`)+`]`,`g`);function escapeForRegExp(str){return str.replace(regex,`\\$&`)}function unifyPath(path){return path?path.replace(/\\/g,`/`):path}function hashCode(text){let i,chr,len;let hash=0;for(i=0,len=text.length;i<len;i++){chr=text.charCodeAt(i);hash=(hash<<5)-hash+chr;hash|=0}return hash}function max(arr){const length=arr.length;let max=-Infinity;for(let i=0;i<length;i++)max=Math.max(max,arr[i]);return max}function getExtension(filename,language){const filenameParts=filename.split(`.`);return filenameParts.length>1?filenameParts[filenameParts.length-1]:language}function startsWithAny(str,prefixes){return prefixes.reduce((startsWith,prefix)=>startsWith||str.startsWith(prefix),false)}var baseDiffFilenamePrefixes=[`a/`,`b/`,`i/`,`w/`,`c/`,`o/`];function getFilename(line,linePrefix,extraPrefix){const prefixes=extraPrefix!==void 0?[...baseDiffFilenamePrefixes,extraPrefix]:baseDiffFilenamePrefixes;const[,filename=``]=(linePrefix?new RegExp(`^${escapeForRegExp(linePrefix)} "?(.+?)"?$`):new RegExp(`^"?(.+?)"?$`)).exec(line)||[];const matchingPrefix=prefixes.find(p=>filename.indexOf(p)===0);return(matchingPrefix?filename.slice(matchingPrefix.length):filename).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,``)}function getSrcFilename(line,srcPrefix){return getFilename(line,`---`,srcPrefix)}function getDstFilename(line,dstPrefix){return getFilename(line,`+++`,dstPrefix)}function parse(diffInput,config={}){const files=[];let currentFile=null;let currentBlock=null;let oldLine=null;let oldLine2=null;let newLine=null;let possibleOldName=null;let possibleNewName=null;const oldFileNameHeader=`--- `;const newFileNameHeader=`+++ `;const hunkHeaderPrefix=`@@`;const oldMode=/^old mode (\d{6})/;const newMode=/^new mode (\d{6})/;const deletedFileMode=/^deleted file mode (\d{6})/;const newFileMode=/^new file mode (\d{6})/;const copyFrom=/^copy from "?(.+)"?/;const copyTo=/^copy to "?(.+)"?/;const renameFrom=/^rename from "?(.+)"?/;const renameTo=/^rename to "?(.+)"?/;const similarityIndex=/^similarity index (\d+)%/;const dissimilarityIndex=/^dissimilarity index (\d+)%/;const index=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/;const binaryFiles=/^Binary files (.*) and (.*) differ/;const binaryDiff=/^GIT binary patch/;const combinedIndex=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/;const combinedMode=/^mode (\d{6}),(\d{6})\.\.(\d{6})/;const combinedNewFile=/^new file mode (\d{6})/;const combinedDeletedFile=/^deleted file mode (\d{6}),(\d{6})/;const diffLines=diffInput.replace(/\/g,``).replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`);function saveBlock(){if(currentBlock!==null&¤tFile!==null){currentFile.blocks.push(currentBlock);currentBlock=null}}function saveFile(){if(currentFile!==null){if(!currentFile.oldName&&possibleOldName!==null)currentFile.oldName=possibleOldName;if(!currentFile.newName&&possibleNewName!==null)currentFile.newName=possibleNewName;if(currentFile.newName){files.push(currentFile);currentFile=null}}possibleOldName=null;possibleNewName=null}function startFile(){saveBlock();saveFile();currentFile={blocks:[],deletedLines:0,addedLines:0}}function startBlock(line){saveBlock();let values;if(currentFile!==null){if(values=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(line)){currentFile.isCombined=false;oldLine=parseInt(values[1],10);newLine=parseInt(values[2],10)}else if(values=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(line)){currentFile.isCombined=true;oldLine=parseInt(values[1],10);oldLine2=parseInt(values[2],10);newLine=parseInt(values[3],10)}else{if(line.startsWith(hunkHeaderPrefix))console.error(`Failed to parse lines, starting in 0!`);oldLine=0;newLine=0;currentFile.isCombined=false}}currentBlock={lines:[],oldStartLine:oldLine,oldStartLine2:oldLine2,newStartLine:newLine,header:line}}function createLine(line){if(currentFile===null||currentBlock===null||oldLine===null||newLine===null)return;const currentLine={content:line};const addedPrefixes=currentFile.isCombined?[`+ `,` +`,`++`]:[`+`];const deletedPrefixes=currentFile.isCombined?[`- `,` -`,`--`]:[`-`];if(startsWithAny(line,addedPrefixes)){currentFile.addedLines++;currentLine.type=LineType.INSERT;currentLine.oldNumber=void 0;currentLine.newNumber=newLine++}else if(startsWithAny(line,deletedPrefixes)){currentFile.deletedLines++;currentLine.type=LineType.DELETE;currentLine.oldNumber=oldLine++;currentLine.newNumber=void 0}else{currentLine.type=LineType.CONTEXT;currentLine.oldNumber=oldLine++;currentLine.newNumber=newLine++}currentBlock.lines.push(currentLine)}function existHunkHeader(line,lineIdx){let idx=lineIdx;while(idx<diffLines.length-3){if(line.startsWith(`diff`))return false;if(diffLines[idx].startsWith(oldFileNameHeader)&&diffLines[idx+1].startsWith(newFileNameHeader)&&diffLines[idx+2].startsWith(hunkHeaderPrefix))return true;idx++}return false}diffLines.forEach((line,lineIndex)=>{if(!line||line.startsWith(`*`))return;let values;const prevLine=diffLines[lineIndex-1];const nxtLine=diffLines[lineIndex+1];const afterNxtLine=diffLines[lineIndex+2];if(line.startsWith(`diff --git`)||line.startsWith(`diff --combined`)){startFile();if(values=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(line)){possibleOldName=getFilename(values[1],void 0,config.dstPrefix);possibleNewName=getFilename(values[2],void 0,config.srcPrefix)}if(currentFile===null)throw new Error(`Where is my file !!!`);currentFile.isGitDiff=true;return}if(line.startsWith(`Binary files`)&&!(currentFile===null||currentFile===void 0?void 0:currentFile.isGitDiff)){startFile();if(values=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(line)){possibleOldName=getFilename(values[1],void 0,config.dstPrefix);possibleNewName=getFilename(values[2],void 0,config.srcPrefix)}if(currentFile===null)throw new Error(`Where is my file !!!`);currentFile.isBinary=true;return}if(!currentFile||!currentFile.isGitDiff&¤tFile&&line.startsWith(oldFileNameHeader)&&nxtLine.startsWith(newFileNameHeader)&&afterNxtLine.startsWith(hunkHeaderPrefix))startFile();if(currentFile===null||currentFile===void 0?void 0:currentFile.isTooBig)return;if(currentFile&&(typeof config.diffMaxChanges===`number`&¤tFile.addedLines+currentFile.deletedLines>config.diffMaxChanges||typeof config.diffMaxLineLength===`number`&&line.length>config.diffMaxLineLength)){currentFile.isTooBig=true;currentFile.addedLines=0;currentFile.deletedLines=0;currentFile.blocks=[];currentBlock=null;startBlock(typeof config.diffTooBigMessage===`function`?config.diffTooBigMessage(files.length):`Diff too big to be displayed`);return}if(line.startsWith(oldFileNameHeader)&&nxtLine.startsWith(newFileNameHeader)||line.startsWith(newFileNameHeader)&&prevLine.startsWith(oldFileNameHeader)){if(currentFile&&!currentFile.oldName&&line.startsWith(`--- `)&&(values=getSrcFilename(line,config.srcPrefix))){currentFile.oldName=values;currentFile.language=getExtension(currentFile.oldName,currentFile.language);return}if(currentFile&&!currentFile.newName&&line.startsWith(`+++ `)&&(values=getDstFilename(line,config.dstPrefix))){currentFile.newName=values;currentFile.language=getExtension(currentFile.newName,currentFile.language);return}}if(currentFile&&(line.startsWith(hunkHeaderPrefix)||currentFile.isGitDiff&¤tFile.oldName&¤tFile.newName&&!currentBlock)){startBlock(line);return}if(currentBlock&&(line.startsWith(`+`)||line.startsWith(`-`)||line.startsWith(` `))){createLine(line);return}const doesNotExistHunkHeader=!existHunkHeader(line,lineIndex);if(currentFile===null)throw new Error(`Where is my file !!!`);if(values=oldMode.exec(line))currentFile.oldMode=values[1];else if(values=newMode.exec(line))currentFile.newMode=values[1];else if(values=deletedFileMode.exec(line)){currentFile.deletedFileMode=values[1];currentFile.isDeleted=true}else if(values=newFileMode.exec(line)){currentFile.newFileMode=values[1];currentFile.isNew=true}else if(values=copyFrom.exec(line)){if(doesNotExistHunkHeader)currentFile.oldName=values[1];currentFile.isCopy=true}else if(values=copyTo.exec(line)){if(doesNotExistHunkHeader)currentFile.newName=values[1];currentFile.isCopy=true}else if(values=renameFrom.exec(line)){if(doesNotExistHunkHeader)currentFile.oldName=values[1];currentFile.isRename=true}else if(values=renameTo.exec(line)){if(doesNotExistHunkHeader)currentFile.newName=values[1];currentFile.isRename=true}else if(values=binaryFiles.exec(line)){currentFile.isBinary=true;currentFile.oldName=getFilename(values[1],void 0,config.srcPrefix);currentFile.newName=getFilename(values[2],void 0,config.dstPrefix);startBlock(`Binary file`)}else if(binaryDiff.test(line)){currentFile.isBinary=true;startBlock(line)}else if(values=similarityIndex.exec(line))currentFile.unchangedPercentage=parseInt(values[1],10);else if(values=dissimilarityIndex.exec(line))currentFile.changedPercentage=parseInt(values[1],10);else if(values=index.exec(line)){currentFile.checksumBefore=values[1];currentFile.checksumAfter=values[2];if(values[3])currentFile.mode=values[3]}else if(values=combinedIndex.exec(line)){currentFile.checksumBefore=[values[2],values[3]];currentFile.checksumAfter=values[1]}else if(values=combinedMode.exec(line)){currentFile.oldMode=[values[2],values[3]];currentFile.newMode=values[1]}else if(values=combinedNewFile.exec(line)){currentFile.newFileMode=values[1];currentFile.isNew=true}else if(values=combinedDeletedFile.exec(line)){currentFile.deletedFileMode=values[1];currentFile.isDeleted=true}});saveBlock();saveFile();return files}function levenshtein(a,b){if(a.length===0)return b.length;if(b.length===0)return a.length;const matrix=[];let i=0;for(;i<=b.length;i++)matrix[i]=[i];let j=0;for(;j<=a.length;j++)matrix[0][j]=j;for(i=1;i<=b.length;i++)for(j=1;j<=a.length;j++)if(b.charAt(i-1)===a.charAt(j-1))matrix[i][j]=matrix[i-1][j-1];else matrix[i][j]=Math.min(matrix[i-1][j-1]+1,Math.min(matrix[i][j-1]+1,matrix[i-1][j]+1));return matrix[b.length][a.length]}function newDistanceFn(str){return(x,y)=>{const xValue=str(x).trim();const yValue=str(y).trim();return levenshtein(xValue,yValue)/(xValue.length+yValue.length)}}function newMatcherFn(distance){function findBestMatch(a,b,cache=new Map){let bestMatchDist=Infinity;let bestMatch;for(let i=0;i<a.length;++i)for(let j=0;j<b.length;++j){const cacheKey=JSON.stringify([a[i],b[j]]);let md;if(!(cache.has(cacheKey)&&(md=cache.get(cacheKey)))){md=distance(a[i],b[j]);cache.set(cacheKey,md)}if(md<bestMatchDist){bestMatchDist=md;bestMatch={indexA:i,indexB:j,score:bestMatchDist}}}return bestMatch}function group(a,b,level=0,cache=new Map){const bm=findBestMatch(a,b,cache);if(!bm||a.length+b.length<3)return[[a,b]];const a1=a.slice(0,bm.indexA);const b1=b.slice(0,bm.indexB);const aMatch=[a[bm.indexA]];const bMatch=[b[bm.indexB]];const tailA=bm.indexA+1;const tailB=bm.indexB+1;const a2=a.slice(tailA);const b2=b.slice(tailB);const group1=group(a1,b1,level+1,cache);const groupMatch=group(aMatch,bMatch,level+1,cache);const group2=group(a2,b2,level+1,cache);let result=groupMatch;if(bm.indexA>0||bm.indexB>0)result=group1.concat(result);if(a.length>tailA||b.length>tailB)result=result.concat(group2);return result}return group}var CSSLineClass={INSERTS:`d2h-ins`,DELETES:`d2h-del`,CONTEXT:`d2h-cntx`,INFO:`d2h-info`,INSERT_CHANGES:`d2h-ins d2h-change`,DELETE_CHANGES:`d2h-del d2h-change`};var defaultRenderConfig={matching:LineMatchingType.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:DiffStyleType.WORD,colorScheme:ColorSchemeType.LIGHT};var separator=`/`;var distance=newDistanceFn(change=>change.value);var matcher=newMatcherFn(distance);function isDevNullName(name){return name.indexOf(`dev/null`)!==-1}function removeInsElements(line){return line.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,``)}function removeDelElements(line){return line.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,``)}function toCSSClass(lineType){switch(lineType){case LineType.CONTEXT:return CSSLineClass.CONTEXT;case LineType.INSERT:return CSSLineClass.INSERTS;case LineType.DELETE:return CSSLineClass.DELETES}}function colorSchemeToCss(colorScheme){switch(colorScheme){case ColorSchemeType.DARK:return`d2h-dark-color-scheme`;case ColorSchemeType.AUTO:return`d2h-auto-color-scheme`;case ColorSchemeType.LIGHT:default:return`d2h-light-color-scheme`}}function prefixLength(isCombined){return isCombined?2:1}function escapeForHtml(str){return str.slice(0).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`)}function deconstructLine(line,isCombined,escape=true){const indexToSplit=prefixLength(isCombined);return{prefix:line.substring(0,indexToSplit),content:escape?escapeForHtml(line.substring(indexToSplit)):line.substring(indexToSplit)}}function filenameDiff(file){const oldFilename=unifyPath(file.oldName);const newFilename=unifyPath(file.newName);if(oldFilename!==newFilename&&!isDevNullName(oldFilename)&&!isDevNullName(newFilename)){const prefixPaths=[];const suffixPaths=[];const oldFilenameParts=oldFilename.split(separator);const newFilenameParts=newFilename.split(separator);const oldFilenamePartsSize=oldFilenameParts.length;const newFilenamePartsSize=newFilenameParts.length;let i=0;let j=oldFilenamePartsSize-1;let k=newFilenamePartsSize-1;while(i<j&&i<k)if(oldFilenameParts[i]===newFilenameParts[i]){prefixPaths.push(newFilenameParts[i]);i+=1}else break;while(j>i&&k>i)if(oldFilenameParts[j]===newFilenameParts[k]){suffixPaths.unshift(newFilenameParts[k]);j-=1;k-=1}else break;const finalPrefix=prefixPaths.join(separator);const finalSuffix=suffixPaths.join(separator);const oldRemainingPath=oldFilenameParts.slice(i,j+1).join(separator);const newRemainingPath=newFilenameParts.slice(i,k+1).join(separator);if(finalPrefix.length&&finalSuffix.length)return finalPrefix+`/{`+oldRemainingPath+` → `+newRemainingPath+`}/`+finalSuffix;else if(finalPrefix.length)return finalPrefix+`/{`+oldRemainingPath+` → `+newRemainingPath+`}`;else if(finalSuffix.length)return`{`+oldRemainingPath+` → `+newRemainingPath+`}/`+finalSuffix;return oldFilename+` → `+newFilename}else if(!isDevNullName(newFilename))return newFilename;else return oldFilename}function getHtmlId(file){return`d2h-${hashCode(filenameDiff(file)).toString().slice(-6)}`}function getFileIcon(file){let templateName=`file-changed`;if(file.isRename)templateName=`file-renamed`;else if(file.isCopy)templateName=`file-renamed`;else if(file.isNew)templateName=`file-added`;else if(file.isDeleted)templateName=`file-deleted`;else if(file.newName!==file.oldName)templateName=`file-renamed`;return templateName}function diffHighlight(diffLine1,diffLine2,isCombined,config={}){const{matching,maxLineLengthHighlight,matchWordsThreshold,diffStyle}=Object.assign(Object.assign({},defaultRenderConfig),config);const line1=deconstructLine(diffLine1,isCombined,false);const line2=deconstructLine(diffLine2,isCombined,false);if(line1.content.length>maxLineLengthHighlight||line2.content.length>maxLineLengthHighlight)return{oldLine:{prefix:line1.prefix,content:escapeForHtml(line1.content)},newLine:{prefix:line2.prefix,content:escapeForHtml(line2.content)}};const diff=diffStyle===`char`?diffChars(line1.content,line2.content):diffWordsWithSpace(line1.content,line2.content);const changedWords=[];if(diffStyle===`word`&&matching===`words`){const removed=diff.filter(element=>element.removed);const added=diff.filter(element=>element.added);matcher(added,removed).forEach(chunk=>{if(chunk[0].length===1&&chunk[1].length===1){if(distance(chunk[0][0],chunk[1][0])<matchWordsThreshold){changedWords.push(chunk[0][0]);changedWords.push(chunk[1][0])}}})}const highlightedLine=diff.reduce((highlightedLine,part)=>{const elemType=part.added?`ins`:part.removed?`del`:null;const addClass=changedWords.indexOf(part)>-1?` class="d2h-change"`:``;const escapedValue=escapeForHtml(part.value);return elemType!==null?`${highlightedLine}<${elemType}${addClass}>${escapedValue}</${elemType}>`:`${highlightedLine}${escapedValue}`},``);return{oldLine:{prefix:line1.prefix,content:removeInsElements(highlightedLine)},newLine:{prefix:line2.prefix,content:removeDelElements(highlightedLine)}}}var baseTemplatesPath$2=`file-summary`;var iconsBaseTemplatesPath$2=`icon`;var defaultFileListRendererConfig={colorScheme:defaultRenderConfig.colorScheme};var FileListRenderer=class{constructor(hoganUtils,config={}){this.hoganUtils=hoganUtils;this.config=Object.assign(Object.assign({},defaultFileListRendererConfig),config)}render(diffFiles){const files=diffFiles.map(file=>this.hoganUtils.render(baseTemplatesPath$2,`line`,{fileHtmlId:getHtmlId(file),oldName:file.oldName,newName:file.newName,fileName:filenameDiff(file),deletedLines:`-`+file.deletedLines,addedLines:`+`+file.addedLines},{fileIcon:this.hoganUtils.template(iconsBaseTemplatesPath$2,getFileIcon(file))})).join(`
|
|
4
4
|
`);return this.hoganUtils.render(baseTemplatesPath$2,`wrapper`,{colorScheme:colorSchemeToCss(this.config.colorScheme),filesNumber:diffFiles.length,files})}};var defaultLineByLineRendererConfig=Object.assign(Object.assign({},defaultRenderConfig),{renderNothingWhenEmpty:false,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200});var genericTemplatesPath$1=`generic`;var baseTemplatesPath$1=`line-by-line`;var iconsBaseTemplatesPath$1=`icon`;var tagsBaseTemplatesPath$1=`tag`;var LineByLineRenderer=class{constructor(hoganUtils,config={}){this.hoganUtils=hoganUtils;this.config=Object.assign(Object.assign({},defaultLineByLineRendererConfig),config)}render(diffFiles){const diffsHtml=diffFiles.map(file=>{let diffs;if(file.blocks.length)diffs=this.generateFileHtml(file);else diffs=this.generateEmptyDiff();return this.makeFileDiffHtml(file,diffs)}).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{fr as vShow,ht as useDisplay,mr as withModifiers,pr as withKeys,t as VChip,x as VIcon}from"./VChip-BRhZ1px1.js";import{$ as mergeModels,$n as normalizeProps,D as createVNode,E as createTextVNode,Ft as useModel,Ht as watch,On as unref,St as resolveComponent,Yt as withDirectives,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,er as normalizeStyle,et as mergeProps,g as computed,gn as reactive,it as onBeforeUnmount,mt as openBlock,o as Fragment,pn as onScopeDispose,qt as withCtx,tr as toDisplayString,tt as nextTick,un as isRef,v as createBlock,vn as ref,w as createSlots,wn as toRef,wt as resolveDynamicComponent,xn as shallowRef,xt as renderSlot,y as createCommentVNode,z as guardReactiveProps}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{t as useEndpointResource}from"./useEndpointResource-BaT7yEQ5.js";import{f as normalizeText}from"./normalize-Cecw_kDB.js";import{r as getHttpWebClient}from"./httpClient-Dj5wBWSr.js";import{n as VList,s as VListItem,t as VMenu}from"./VMenu-BaCC4Of9.js";import{t as VTextField}from"./VTextField-Dmm1M-tz.js";import{r as projectAppPath}from"./vibe64ProjectScope.local-BbrorE15.js";import{r as scopedDevelopmentApiUrl,t as resolveStudioRequestUrl}from"./studioUrls-BcpEogWH.js";import{s as ROUTE_VISIBILITY_PUBLIC}from"./errorMessageHelpers-KoewcxJa.js";import{$t as mdiFolderOutline,Br as mdiStar,Dt as mdiDotsVertical,G as mdiChevronRight,Hn as mdiMagnify,Hr as mdiStop,Jn as mdiMicrophoneOff,Lt as mdiFileDocumentOutline,Nt as mdiFileCodeOutline,Ot as mdiDownload,Q as mdiClose,Tr as mdiSend,Tt as mdiDotsHorizontal,Ut as mdiFileSearchOutline,Vr as mdiStarOutline,Vt as mdiFilePlusOutline,W as mdiChevronLeft,ft as mdiContentCopy,gr as mdiRefresh,hr as mdiRedoVariant,ht as mdiContentSaveOutline,ni as mdiUndoVariant,oi as mdiVolumeHigh,qn as mdiMicrophone,ri as mdiUpload,si as mdiVolumeOff,st as mdiCollapseAllOutline,t as mdiAccountCheckOutline,xr as mdiRobotOutline,zt as mdiFileMoveOutline}from"./mdi-DwGK7nOu.js";import{t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VAlert}from"./VAlert-CBpSKTfy.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSpacer}from"./VSpacer-B5ip6FSG.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-DFBUIKJZ.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{n as assistantAttachmentFilesFromDropEvent,r as assistantAttachmentFilesFromPasteEvent,t as useAssistantAttachments}from"./useAssistantAttachments-
|
|
1
|
+
import{fr as vShow,ht as useDisplay,mr as withModifiers,pr as withKeys,t as VChip,x as VIcon}from"./VChip-BRhZ1px1.js";import{$ as mergeModels,$n as normalizeProps,D as createVNode,E as createTextVNode,Ft as useModel,Ht as watch,On as unref,St as resolveComponent,Yt as withDirectives,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,er as normalizeStyle,et as mergeProps,g as computed,gn as reactive,it as onBeforeUnmount,mt as openBlock,o as Fragment,pn as onScopeDispose,qt as withCtx,tr as toDisplayString,tt as nextTick,un as isRef,v as createBlock,vn as ref,w as createSlots,wn as toRef,wt as resolveDynamicComponent,xn as shallowRef,xt as renderSlot,y as createCommentVNode,z as guardReactiveProps}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{t as useEndpointResource}from"./useEndpointResource-BaT7yEQ5.js";import{f as normalizeText}from"./normalize-Cecw_kDB.js";import{r as getHttpWebClient}from"./httpClient-Dj5wBWSr.js";import{n as VList,s as VListItem,t as VMenu}from"./VMenu-BaCC4Of9.js";import{t as VTextField}from"./VTextField-Dmm1M-tz.js";import{r as projectAppPath}from"./vibe64ProjectScope.local-BbrorE15.js";import{r as scopedDevelopmentApiUrl,t as resolveStudioRequestUrl}from"./studioUrls-BcpEogWH.js";import{s as ROUTE_VISIBILITY_PUBLIC}from"./errorMessageHelpers-KoewcxJa.js";import{$t as mdiFolderOutline,Br as mdiStar,Dt as mdiDotsVertical,G as mdiChevronRight,Hn as mdiMagnify,Hr as mdiStop,Jn as mdiMicrophoneOff,Lt as mdiFileDocumentOutline,Nt as mdiFileCodeOutline,Ot as mdiDownload,Q as mdiClose,Tr as mdiSend,Tt as mdiDotsHorizontal,Ut as mdiFileSearchOutline,Vr as mdiStarOutline,Vt as mdiFilePlusOutline,W as mdiChevronLeft,ft as mdiContentCopy,gr as mdiRefresh,hr as mdiRedoVariant,ht as mdiContentSaveOutline,ni as mdiUndoVariant,oi as mdiVolumeHigh,qn as mdiMicrophone,ri as mdiUpload,si as mdiVolumeOff,st as mdiCollapseAllOutline,t as mdiAccountCheckOutline,xr as mdiRobotOutline,zt as mdiFileMoveOutline}from"./mdi-DwGK7nOu.js";import{t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VAlert}from"./VAlert-CBpSKTfy.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSpacer}from"./VSpacer-B5ip6FSG.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-DFBUIKJZ.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{n as assistantAttachmentFilesFromDropEvent,r as assistantAttachmentFilesFromPasteEvent,t as useAssistantAttachments}from"./useAssistantAttachments-DJWb1KdF.js";import{_ as _sfc_main$19,b as AssistantMessageAttachments_default,g as scrollElementNearBottom,h as useScrollToBottom,i as AssistantAttachmentPreview_default,p as AssistantPromptInput_default,s as AssistantConversationElement_default,u as AssistantAttachmentQueue_default,v as LongTextPreviewBlocks_default,y as parseLongTextReviewBlocks}from"./conversation-B1UoWMaA.js";import"./conversation-T8Yax4Gz.js";import{n as useRealtimeEvent}from"./useRealtimeEvent-DbrYLgvU.js";import{t as usePaths}from"./usePaths-DaWJ_Tvi.js";import{a as conversationAttachmentReference,g as vibe64AgentExecutionProfileAuditSnapshot,i as conversationAttachmentContentType,l as vibe64AssistantSelectionLabel,o as normalizeVibe64ConversationAttachments,u as vibe64ProviderPresentation}from"./shared-MIKdzAzL.js";import{c as assistantGoalManagementMessage,l as assistantGoalObjective,u as assistantModeLabel}from"./assistantRouting-CX0aG7dC.js";import{t as useCommand}from"./useCommand-DGM7l3ja.js";import{t as useUiFeedback}from"./useUiFeedback-CZj76aLa.js";import"./shared-CEFaGI9L.js";import{a as useVibe64FileUploads,c as vibe64DroppedFiles,d as uploadFileRequest,f as VIBE64_UPLOAD_MAX_BYTES,i as Vibe64FileConflictDialog_default,l as vibe64FileArea,n as Vibe64FileUploadQueue_default,o as filePreviewImageType,r as Vibe64FileTransferDialog_default,s as Vibe64ImagePreview_default,t as Vibe64FileArea_default,u as vibe64FileTransferMessage}from"./Vibe64FileArea-BljhpApn.js";import{n as vibe64ApiResponseError,t as vibe64ApiError}from"./vibe64ApiResponses-B4VY77Q_.js";import{n as stableLocalStorageKeyPart,r as writeLocalStorageJson,t as readLocalStorageJson}from"./browserLocalStorage-B4C7rHrs.js";import{t as writeClipboardText}from"./clipboard-CZs9aH3L.js";import{i as vibe64RealtimePayloadFromCurrentTab,n as vibe64BrowserTabOriginId}from"./vibe64BrowserTabOrigin-D6Mxx-QS.js";import{$ as vibe64SourceEditorSearchPath,G as vibe64SourceEditorExplanationFollowupsStreamPath,H as vibe64SourceEditorChangesStreamPath,I as vibe64SessionPath,J as vibe64SourceEditorExplanationsCleanupPath,K as vibe64SourceEditorExplanationPath,Q as vibe64SourceEditorResolvePathPath,U as vibe64SourceEditorCreateFilePath,V as vibe64SessionsQueryKey,W as vibe64SourceEditorDownloadPath,X as vibe64SourceEditorFilePath,Y as vibe64SourceEditorExplanationsStreamPath,Z as vibe64SourceEditorFilesPath,c as VIBE64_SESSION_SUMMARY_CHANGED_EVENT,d as VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT,h as vibe64AgentAttachmentPath,l as VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT,m as vibe64AgentAttachmentFilePath,o as VIBE64_SESSIONS_API_SUFFIX,q as vibe64SourceEditorExplanationStopPath,tt as vibe64SourceEditorTreePath,u as VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT}from"./vibe64SessionRequestConfig-DvrfyP8A.js";import{n as useVibe64SystemGraph}from"./useVibe64SystemGraph-BdvumnPL.js";import{A as readRefOrGetterValue,G as VoiceConversationSettings_default,J as VoiceAvatar_default,K as VoiceConversationControls_default,T as F,U as useVibe64Voice,W as VoiceConversationHost_default,X as VTab,Y as VTabs,at as usePageActivity,q as useVoiceLauncher,w as GithubMarkdown_default,z as createProjectVoiceBinding}from"./index-CNkd6O5t.js";import{$ as rectangularSelection,A as foldService,B as tags$1,C as continuedIndent,Ct as NodeWeakMap,D as flatIndent,E as delimitedIndent,Et as parseMixed,F as sublanguageProp,G as drawSelection,H as EditorView,I as syntaxHighlighting,J as getPanel,K as dropCursor,L as syntaxTree,M as indentOnInput,N as indentUnit,O as foldInside,P as languageDataProp,Q as lineNumbers,R as Tag,S as bracketMatchingHandle,St as NodeType,T as defineLanguageFacet,Tt as Tree,U as ViewPlugin,V as Decoration,W as crosshairCursor,X as highlightActiveLineGutter,Z as keymap,_ as LanguageDescription,_t as findClusterBreak,a as redo,at as Compartment,b as StreamLanguage,bt as NodeProp,c as completeFromList,ct as Facet,d as ContextTracker,dt as StateEffect,et as runScopeHandlers,f as ExternalTokenizer,ft as StateField,g as Language,gt as countColumn,h as LRLanguage,ht as combineConfig,i as indentWithTab,it as CharCategory,j as indentNodeProp,k as foldNodeProp,l as ifNotIn,lt as Prec,m as LocalTokenGroup,mt as codePointSize,n as history,nt as showPanel,o as undo,ot as EditorSelection,p as LRParser,pt as codePointAt,q as getDialog,r as historyKeymap,rt as crelt,s as CompletionContext,st as EditorState,t as defaultKeymap,tt as showDialog,u as snippetCompletion,ut as RangeSetBuilder,v as LanguageSupport,vt as fromCodePoint,w as defaultHighlightStyle,wt as Parser,x as bracketMatching,xt as NodeSet,y as ParseContext,yt as IterMode,z as styleTags}from"./dist-CDa9Iec1.js";import{s as vibe64SessionShortLabel}from"./vibe64SessionViewModel-B0cCumM8.js";import{n as vibe64SessionDebugError,r as vibe64SessionDebugLog}from"./vibe64SessionDebugLog-D6ibBX8L.js";import{t as diffLines}from"./libesm-CR-iGldz.js";import{t as downloadAttachment}from"./vibe64AttachmentDownload-Cngh16Hf.js";function parseIntegrationSetupRequest(message){if(message?.role!==`assistant`||typeof message.text!==`string`)return null;const lines=message.text.replace(/\r\n/gu,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`);let fence=null;for(let index=0;index<lines.length;index+=1){const line=lines[index];if(fence){const closing=/^ {0,3}(`{3,}|~{3,})\s*$/u.exec(line);if(!closing||closing[1][0]!==fence.character||closing[1].length<fence.length)continue;if(fence.request){if(lines.slice(index+1).some(tail=>tail.trim()))return null;const payload=lines.slice(fence.start+1,index).join(`
|
|
4
4
|
`);if(payload.length>1024)return null;let value;try{value=JSON.parse(payload)}catch{return null}if(!value||Array.isArray(value)||typeof value!==`object`||Object.keys(value).length!==1||typeof value.integrationId!==`string`||!value.integrationId.trim()||value.integrationId.length>200||/[\p{Cc}\p{Cf}]/u.test(value.integrationId))return null;return{integrationId:value.integrationId,text:lines.slice(0,fence.start).join(`
|
package/dist/assets/{Vibe64UiStoryboardView-CJajdYSt.js → Vibe64UiStoryboardView-idZz86bx.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as VProgressLinear,dr as vModelText,fr as vShow,mr as withModifiers,n as VChipGroup,pr as withKeys,t as VChip,ur as vModelSelect,x as VIcon}from"./VChip-BRhZ1px1.js";import{Cn as toRaw,D as createVNode,E as createTextVNode,Ht as watch,On as unref,Pt as useId,St as resolveComponent,Yt as withDirectives,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,er as normalizeStyle,et as mergeProps,fn as markRaw,g as computed,it as onBeforeUnmount,jt as toHandlers,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,tt as nextTick,un as isRef,v as createBlock,vn as ref,w as createSlots,wn as toRef,xn as shallowRef,xt as renderSlot,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{r as getHttpWebClient}from"./httpClient-Dj5wBWSr.js";import{d as VVirtualScroll,t as VSelect}from"./VSelect-CFmsjLP4.js";import{c as VListItemTitle,l as VListItemSubtitle,n as VList,o as VListSubheader,s as VListItem,t as VMenu}from"./VMenu-BaCC4Of9.js";import{t as VTextField}from"./VTextField-Dmm1M-tz.js";import{$t as mdiFolderOutline,A as mdiBookOpenPageVariantOutline,An as mdiLanguageRust,C as mdiArrowLeft,Cn as mdiLanguageHtml5,Dn as mdiLanguagePhp,En as mdiLanguageKotlin,Fn as mdiLightningBoltOutline,Gn as mdiMenuDown,Hn as mdiMagnify,Jt as mdiFlaskOutline,Lt as mdiFileDocumentOutline,Nt as mdiFileCodeOutline,On as mdiLanguagePython,Pt as mdiFileCogOutline,Q as mdiClose,Rt as mdiFileImageOutline,Sn as mdiLanguageGo,Tn as mdiLanguageJavascript,Vr as mdiStarOutline,Wt as mdiFileTableOutline,Z as mdiClockOutline,bn as mdiLanguageCsharp,ci as mdiVuejs,dr as mdiPuzzleOutline,er as mdiPackageVariantClosed,gr as mdiRefresh,h as mdiApi,it as mdiCodeTags,jn as mdiLanguageTypescript,kn as mdiLanguageRuby,on as mdiHeartPulse,ot as mdiCogOutline,pr as mdiRecordCircleOutline,rt as mdiCodeJson,ut as mdiConsoleLine,wn as mdiLanguageJava,xn as mdiLanguageCss3,yn as mdiLanguageCpp,z as mdiCheck}from"./mdi-DwGK7nOu.js";import{i as VBtnToggle,t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VAlert}from"./VAlert-CBpSKTfy.js";import{t as VDivider}from"./VDivider-DY2s_j83.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{a as VCardSubtitle,i as VCardTitle,n as VCardText,r as VCardItem,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-DFBUIKJZ.js";import{t as VSwitch}from"./VSwitch-fUpmdN4R.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{t as usePaths}from"./usePaths-DaWJ_Tvi.js";import{n as useVibe64SystemGraph,t as SYSTEM_GRAPH_API_SUFFIX}from"./useVibe64SystemGraph-BdvumnPL.js";import{a as Vibe64UsageRecordingSummary_default,c as USAGE_RECORDING_API_SUFFIX,it as VToolbarTitle,rt as VToolbar,s as Vibe64UsageRecordDialog_default,tt as VBottomSheet}from"./index-BXZp5ztx.js";import{a as _sfc_main$d,i as _sfc_main$1$1,n as Position,s as _sfc_main$f,t as MarkerType}from"./vue-flow-core-BlVEnES8.js";var _hoisted_1$11={class:`usage-picker__label`};var _hoisted_2$11={class:`usage-picker__body`};var _sfc_main$11={__name:`Vibe64UsageEntryPicker`,props:{modelValue:{type:Boolean,default:false},label:{type:String,required:true},title:{type:String,required:true}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(VBtn,{class:`usage-picker`,variant:`outlined`,block:``,"append-icon":unref(mdiMenuDown),"aria-label":__props.label,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,true))},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$11,toDisplayString(__props.label),1)]),_:1},8,[`append-icon`,`aria-label`]),createVNode(VDialog,{"model-value":__props.modelValue,fullscreen:``,transition:`dialog-bottom-transition`,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{class:`usage-picker__dialog`},{default:withCtx(()=>[createVNode(VToolbar,{density:`comfortable`,color:`surface`},{default:withCtx(()=>[createVNode(VBtn,{icon:unref(mdiClose),"aria-label":`Close`,onClick:_cache[1]||(_cache[1]=$event=>emit(`update:modelValue`,false))},null,8,[`icon`]),createVNode(VToolbarTitle,{class:`text-title-large`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.title),1)]),_:1})]),_:1}),createBaseVNode(`div`,_hoisted_2$11,[renderSlot(_ctx.$slots,`default`,{},void 0,true)])]),_:3})]),_:3},8,[`model-value`])],64)}}};var Vibe64UsageEntryPicker_default=_plugin_vue_export_helper_default(_sfc_main$11,[[`__scopeId`,`data-v-fa55c2f3`]]);var USAGE_ENTRY_KINDS=Object.freeze([{kind:`page`,label:`Page`,plural:`Pages`,icon:mdiFileDocumentOutline},{kind:`component`,label:`Component`,plural:`Components`,icon:mdiPuzzleOutline},{kind:`route`,label:`Route`,plural:`Routes`,icon:mdiApi},{kind:`action`,label:`Action`,plural:`Actions`,icon:mdiLightningBoltOutline},{kind:`library-export`,label:`Library export`,plural:`Library exports`,icon:mdiPackageVariantClosed},{kind:`cli-command`,label:`Command`,plural:`Commands`,icon:mdiConsoleLine},{kind:`job`,label:`Job`,plural:`Jobs`,icon:mdiClockOutline},{kind:`program-operation`,label:`Program operation`,plural:`Program operations`,icon:mdiBookOpenPageVariantOutline},{kind:`test`,label:`Test file`,plural:`Test files`,icon:mdiFlaskOutline}].map(Object.freeze));var USAGE_MODES=Object.freeze([Object.freeze({value:`imports`,title:`Imports`}),Object.freeze({value:`calls`,title:`Calls`}),Object.freeze({value:`recording`,title:`Recording`})]);var USAGE_QUERY_KEYS=Object.freeze([`view`,`entry`,`mode`,`subsystem`,`recording`,`request`]);var MORE_NODES=1e3;function entryKind(kind){return USAGE_ENTRY_KINDS.find(item=>item.kind===kind)||{kind,label:kind,plural:kind,icon:`M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z`}}var text=value=>typeof value===`string`?value.trim():Array.isArray(value)?text(value[0]):``;function usageStateFromQuery(query={}){const view=text(query.view)===`usage`?`usage`:`map`;const mode=USAGE_MODES.some(item=>item.value===text(query.mode))?text(query.mode):`calls`;return{view,entry:view===`usage`?text(query.entry):``,mode:view===`usage`?mode:`calls`,subsystem:view===`usage`?text(query.subsystem):``,recording:view===`usage`?text(query.recording):``,request:view===`usage`?text(query.request):``}}function usageQueryFor(query={},state={}){const next=Object.fromEntries(Object.entries(query).filter(([key])=>!USAGE_QUERY_KEYS.includes(key)));const normalized=usageStateFromQuery(state);if(normalized.view!==`usage`)return next;next.view=`usage`;next.mode=normalized.mode;for(const key of[`entry`,`subsystem`,`recording`,`request`])if(normalized[key])next[key]=normalized[key];return next}function sameUsageState(left={},right={}){const a=usageStateFromQuery(left);const b=usageStateFromQuery(right);return USAGE_QUERY_KEYS.every(key=>a[key]===b[key])}function sameQuery(left={},right={}){return[...new Set([...Object.keys(left),...Object.keys(right)])].every(key=>String(left[key]??``)===String(right[key]??``))}function functionLabel(fn={}){if(fn.kind===`module`)return`${fileName(fn.file)} top level`;const name=fn.name||`anonymous (line ${fn.start?.line??`?`})`;return fn.container?`${fn.container}.${name}`:name}function fileName(filePath=``){return String(filePath).split(`/`).pop()}function shortLocation(filePath=``,line=null){if(line)return`${fileName(filePath)}:${line}`;const folders=String(filePath).split(`/`).slice(0,-1);return folders.length>2?`…/${folders.slice(-2).join(`/`)}`:folders.join(`/`)}function pathParts(filePath=``){return String(filePath).split(/(?<=\/)/u)}function countLabel(count,singular,plural=`${singular}s`){return`${Number(count||0).toLocaleString()} ${count===1?singular:plural}`}function subsystemSections(subsystems=[],groups=[],{countKey,showUntouched=false}={}){const reached=item=>Number(item[countKey]||0)>0;const visible=subsystems.filter(item=>showUntouched||reached(item));const alphabetical=(left,right)=>left.title.localeCompare(right.title);const sections=[];for(const group of groups){const cards=visible.filter(item=>item.group===group.id).sort(alphabetical);if(cards.length)sections.push({id:group.id,title:group.title,cards})}const placed=new Set(groups.map(group=>group.id));const rest=visible.filter(item=>!placed.has(item.group)).sort(alphabetical);if(rest.length)sections.push({id:``,title:groups.length?`Other subsystems`:``,cards:rest});return{sections,untouched:subsystems.filter(item=>!reached(item)).length}}function crossingsFrom(crossings=[],subsystemId=``,subsystems=[]){const titles=new Map(subsystems.map(item=>[item.id,item.title]));return crossings.filter(crossing=>crossing.fromSubsystemId===subsystemId).map(crossing=>({...crossing,title:titles.get(crossing.toSubsystemId)||crossing.toSubsystemId}))}var COUNT_KEYS=Object.freeze({imports:`fileCount`,calls:`functionCount`,recording:`ranCount`});function subsystemCard(mode,item={}){if(mode===`imports`)return{count:countLabel(item.fileCount,`file`),detail:``};if(mode===`calls`)return{count:countLabel(item.functionCount,`function`),detail:`${Number(item.exact||0).toLocaleString()} by exact calls · ${Number(item.probable||0).toLocaleString()} only via probable`};return{count:`${countLabel(item.ranCount,`function`)} ran`,detail:``,plumbing:item.plumbingCount||0}}function crossingText(mode,crossing={}){if(mode===`imports`)return countLabel(crossing.count,`import`);const exact=Number(crossing.exact||0);const probable=Number(crossing.probable||0);if(mode===`recording`)return countLabel(exact+probable,`call in code`,`calls in code`);return[[exact&&countLabel(exact,`exact call`),probable&&(exact?`${probable.toLocaleString()} probable`:countLabel(probable,`probable call`))].filter(Boolean).join(`, `),crossing.renders&&`renders ${countLabel(crossing.renders,`component`)}`].filter(Boolean).join(` · `)}function depthTitle(depth){return depth===0?`Start`:depth===1?`1 step away`:`${depth} steps away`}function edgeCounts(edges=[]){const out=new Map;const into=new Map;for(const edge of edges){out.set(edge.from,(out.get(edge.from)||0)+1);into.set(edge.to,(into.get(edge.to)||0)+1)}return{out,into}}function webNodes(mode,data={}){const edges=data.edges||[];const{out,into}=edgeCounts(edges);if(mode===`imports`)return(data.files||[]).map(file=>({id:file.id,title:fileName(file.path),subtitle:file.path,location:shortLocation(file.path),file:file.path,start:null,depth:file.depth,certainty:null,outCount:out.get(file.id)||0,inCount:into.get(file.id)||0,unresolved:0}));if(mode===`calls`){const unresolved=new Map;for(const item of data.unresolved||[])unresolved.set(item.fromFunctionId,(unresolved.get(item.fromFunctionId)||0)+1);return(data.functions||[]).map(fn=>({id:fn.id,functionId:fn.id,title:functionLabel(fn),subtitle:`${fn.file}:${fn.start.line}`,location:shortLocation(fn.file,fn.start.line),file:fn.file,start:fn.start,depth:fn.depth,certainty:fn.reach,outCount:fn.callCount||0,inCount:fn.calledByCount||0,unresolved:unresolved.get(fn.id)||0}))}return recordedDepths(data.nodes||[],edges).map(node=>({id:node.id,functionId:node.functionId,title:functionLabel({name:node.name,start:node.start}),subtitle:`${node.file}:${node.start.line}`,location:shortLocation(node.file,node.start.line),file:node.file,start:node.start,depth:node.depth,certainty:null,count:node.count,plumbing:node.plumbing,join:node.join,reason:node.reason,outCount:out.get(node.id)||0,inCount:into.get(node.id)||0,unresolved:0}))}function depthColumns(nodes=[]){const columns=new Map;for(const node of nodes){const depth=Number(node.depth||0);if(!columns.has(depth))columns.set(depth,[]);columns.get(depth).push(node)}return[...columns.entries()].sort(([left],[right])=>left-right).map(([depth,items])=>({depth,items}))}var NODE=Object.freeze({width:220,height:76,columnGap:72,rowGap:16,padding:16});function canvasLayout(nodes=[],edges=[]){const positions=new Map;const columns=depthColumns(nodes);columns.forEach((column,columnIndex)=>column.items.forEach((node,rowIndex)=>{positions.set(node.id,{x:NODE.padding+columnIndex*(NODE.width+NODE.columnGap),y:NODE.padding+rowIndex*(NODE.height+NODE.rowGap)})}));const tallest=Math.max(0,...columns.map(column=>column.items.length));return{positions,paths:edges.filter(edge=>positions.has(edge.from)&&positions.has(edge.to)).map(edge=>{const from=positions.get(edge.from);const to=positions.get(edge.to);const forward=to.x>from.x;const start={x:from.x+NODE.width,y:from.y+NODE.height/2};const end=forward?{x:to.x,y:to.y+NODE.height/2}:{x:to.x+NODE.width,y:to.y+NODE.height/2};const bend=forward?Math.max(32,(end.x-start.x)/2):NODE.columnGap/2+Math.abs(end.y-start.y)/4;const d=forward?`M ${start.x} ${start.y} C ${start.x+bend} ${start.y}, ${end.x-bend} ${end.y}, ${end.x} ${end.y}`:`M ${start.x} ${start.y} C ${start.x+bend} ${start.y}, ${end.x+bend} ${end.y}, ${end.x} ${end.y}`;return{...edge,key:`${edge.from}>${edge.to}`,d}}),width:NODE.padding*2+Math.max(1,columns.length)*NODE.width+Math.max(0,columns.length-1)*NODE.columnGap,height:NODE.padding*2+tallest*NODE.height+Math.max(0,tallest-1)*NODE.rowGap}}var CERTAINTY_TEXT=Object.freeze({exact:`exact`,probable:`probable`,unresolved:`unresolved`});var METHOD_TEXT=Object.freeze({checker:`proved by types`,"di-binding":`dependency binding`,"route-action":`the route's action`,"argument-flow":`passed as an argument`,"import-scope":`matched by imported name`,"same-file-name":`matched by name in this file`,self:`same class`,"receiver-name":`matched by method name`,operation:`request`,renders:``,none:``});function callMethodText(method=``){return METHOD_TEXT[method]??method}var ANALYSIS_NAMES=Object.freeze({jskit:`JSKIT`});function coverageText(coverage=``){if(coverage.startsWith(`adapter:`)){const family=coverage.slice(8).split(`.`)[0];return`Calls read by ${ANALYSIS_NAMES[family]||family} analysis, which can prove exact calls`}if(coverage===`generic`)return`Calls read by name only: probable at best`;return`Calls not read for this file`}function callGroups(rows=[],heading){return[`exact`,`probable`].map(certainty=>({certainty,title:`${heading} (${certainty})`,rows:rows.filter(row=>row.certainty===certainty)})).filter(group=>group.rows.length)}function routeTemplateFor(method=``,requestPath=``,routes=[]){const parts=String(requestPath).split(`/`);const match=routes.find(route=>{const[routeMethod,template]=String(route.title||``).split(` `);if(!template||routeMethod.toUpperCase()!==String(method).toUpperCase())return false;const templateParts=template.split(`/`);return templateParts.length===parts.length&&templateParts.every((part,position)=>part===parts[position]||part.startsWith(`:`)||part===`*`)});return match?match.title.split(` `).slice(1).join(` `):``}var BACKGROUND_TEXT=`Not separated per request for this server`;var OUTSIDE_REQUESTS_TEXT=`Start-up and work outside requests`;var isBackgroundRequest=(request={})=>request.kind===`background`||/^bg_[0-9]+$/u.test(String(request.id||``));var READINESS_TEXT=`Launch readiness check`;var isReadinessRequest=(request={})=>request.kind===`readiness`;function onlyBackground(requests=[]){const ran=requests.filter(request=>Number(request.functionCount||0)>0&&!isReadinessRequest(request));return ran.length>0&&ran.every(isBackgroundRequest)}function requestTitle(request={},routes=[],requests=[request]){if(isBackgroundRequest(request))return onlyBackground(requests)?BACKGROUND_TEXT:OUTSIDE_REQUESTS_TEXT;if(isReadinessRequest(request))return READINESS_TEXT;return routeTemplateFor(request.method,request.path,routes)||request.path||`Request not in the request log`}function requestGroups(requests=[],interactions=[]){const byId=new Map(interactions.map(interaction=>[interaction.id,interaction]));const groups=[];for(const request of requests){const interaction=byId.get(request.interaction)||null;const last=groups.at(-1);if(last&&last.interaction?.id===interaction?.id)last.requests.push(request);else groups.push({key:`${interaction?.id||`none`}:${request.id}`,interaction,requests:[request]})}return groups}var INTERACTION_VERBS=Object.freeze({click:`Click`,enter:`Enter`,submit:`Submit`});function interactionTitle(interaction){if(!interaction)return``;return`${INTERACTION_VERBS[interaction.kind]||INTERACTION_VERBS.click}: ${interaction.label}${interaction.componentFile?` (${fileName(interaction.componentFile)})`:``}`}function recordingWeb(functions=[],join=null){const joined=new Map((join?.joined||[]).map(item=>[item.index,item]));const nodes=functions.map((fn,index)=>{const match=joined.get(index)||{functionId:null,subsystemId:null,join:`none`};return{id:match.functionId||`ran:${index}`,functionId:match.functionId,name:fn.name,file:fn.path,start:fn.start,end:fn.end,count:fn.count,plumbing:fn.plumbing===true,subsystemId:match.subsystemId,join:match.join,reason:match.reason}});const edges=(join?.edges||[]).filter(edge=>nodes[edge.from]&&nodes[edge.to]).map(edge=>({from:nodes[edge.from].id,to:nodes[edge.to].id,certainty:edge.certainty}));const subsystems=(join?.subsystems||[]).map(owner=>{const ran=nodes.filter(node=>node.subsystemId===owner.id);return{...owner,ranCount:ran.length,plumbingCount:ran.filter(node=>node.plumbing).length}});const owners=new Map(nodes.map(node=>[node.id,node.subsystemId]));const crossings=new Map;for(const edge of edges){const from=owners.get(edge.from);const to=owners.get(edge.to);if(!from||!to||from===to)continue;const key=`${from}\n${to}`;if(!crossings.has(key))crossings.set(key,{fromSubsystemId:from,toSubsystemId:to,exact:0,probable:0});crossings.get(key)[edge.certainty===`exact`?`exact`:`probable`]+=1}return{nodes,edges,subsystems,crossings:[...crossings.values()]}}function recordedDepths(nodes=[],edges=[]){const ids=new Set(nodes.map(node=>node.id));const inside=edges.filter(edge=>ids.has(edge.from)&&ids.has(edge.to)&&edge.from!==edge.to);const incoming=new Map(nodes.map(node=>[node.id,0]));for(const edge of inside)incoming.set(edge.to,incoming.get(edge.to)+1);const depth=new Map;const queue=nodes.filter(node=>incoming.get(node.id)===0).map(node=>node.id);for(const id of queue)depth.set(id,0);for(let head=0;head<queue.length;head+=1)for(const edge of inside)if(edge.from===queue[head]&&!depth.has(edge.to)){depth.set(edge.to,depth.get(queue[head])+1);queue.push(edge.to)}return nodes.map(node=>({...node,depth:depth.get(node.id)??0}))}function unavailableRuntimes(targets=[]){if(!targets.length||targets.some(target=>target.available))return[];return[...new Set(targets.flatMap(target=>target.runtimes||[]))]}var NOT_SCANNED_CODE=`vibe64_genesis_city_missing`;var NOT_IGNORED_TEXT=`Git does not ignore .genesis/call-web.json in this project, so the last scan could not read calls. Add /.genesis/call-web.json to the project's .gitignore, then refresh the architecture scan.`;function joinText(join=``,reason=``){if(join===`stale`)return`Changed since the last scan`;if(join===`none`&&reason===`not-ignored`)return`Calls not read: Git does not ignore the call web`;if(join===`none`&&reason===`language`)return`Calls not read in this file's language`;if(join===`none`)return`Not in the last scan`;return``}var _hoisted_1$10={class:`usage-entry-rail`,"aria-label":`Entry points`};var _hoisted_2$10={class:`usage-entry-rail__body`};var _hoisted_3$10={key:1,class:`pa-2`,"aria-busy":`true`,"aria-label":`Loading entry points`};var _hoisted_4$10={key:2,class:`usage-entry-rail__empty`,role:`status`};var _hoisted_5$10={key:0,class:`text-body-medium`};var _sfc_main$10={__name:`Vibe64UsageEntryRail`,props:{entries:{type:Array,default:()=>[]},kinds:{type:Array,default:()=>[]},search:{type:String,default:``},kind:{type:String,default:``},selectedId:{type:String,default:``},loading:{type:Boolean,default:false},error:{type:String,default:``},hasMore:{type:Boolean,default:false},refreshing:{type:Boolean,default:false}},emits:[`update:search`,`update:kind`,`select`,`more`,`retry`,`refresh`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const rows=computed(()=>props.hasMore?[...props.entries,{id:`\0more`,more:true}]:props.entries);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$10,[createVNode(VTextField,{"model-value":__props.search,class:`usage-entry-rail__search`,label:`Search entries`,"prepend-inner-icon":unref(mdiMagnify),variant:`outlined`,density:`comfortable`,maxlength:`80`,clearable:``,"hide-details":``,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>emit(`update:search`,$event||``))},null,8,[`model-value`,`prepend-inner-icon`]),__props.kinds.length?(openBlock(),createBlock(VChipGroup,{key:0,"model-value":__props.kind,class:`usage-entry-rail__kinds`,column:``,"selected-class":`usage-entry-rail__kind--selected`,"aria-label":`Entry kinds`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:kind`,$event||``))},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.kinds,item=>{return openBlock(),createBlock(VChip,{key:item.kind,value:item.kind,filter:``,variant:`outlined`,size:`small`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(entryKind)(item.kind).plural)+` · `+toDisplayString(item.count),1)]),_:2},1032,[`value`])}),128))]),_:1},8,[`model-value`])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$10,[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`ma-3`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[2]||(_cache[2]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.entries.length?(openBlock(),createElementBlock(`div`,_hoisted_3$10,[(openBlock(),createElementBlock(Fragment,null,renderList(6,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!__props.entries.length?(openBlock(),createElementBlock(`div`,_hoisted_4$10,[__props.search||__props.kind?(openBlock(),createElementBlock(`p`,_hoisted_5$10,`No entry points match.`)):(openBlock(),createElementBlock(Fragment,{key:1},[_cache[7]||(_cache[7]=createBaseVNode(`p`,{class:`text-body-medium`},`No entry points found yet. Refresh the architecture scan.`,-1)),createVNode(VBtn,{variant:`tonal`,loading:__props.refreshing,"prepend-icon":unref(mdiRefresh),onClick:_cache[3]||(_cache[3]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`,`prepend-icon`])],64))])):(openBlock(),createBlock(VVirtualScroll,{key:3,items:rows.value,"item-key":`id`,class:`usage-entry-rail__list`,role:`listbox`,"aria-label":`Entry points`},{default:withCtx(({item})=>[item.more?(openBlock(),createBlock(VBtn,{key:0,block:``,variant:`text`,class:`my-1`,loading:__props.loading,onClick:_cache[4]||(_cache[4]=$event=>emit(`more`))},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Show more`,-1)])]),_:1},8,[`loading`])):(openBlock(),createBlock(VListItem,{key:1,active:item.id===__props.selectedId,role:`option`,"aria-selected":item.id===__props.selectedId,"prepend-icon":unref(entryKind)(item.kind).icon,"aria-label":`${unref(entryKind)(item.kind).label}: ${item.title}, ${item.file}`,color:`primary`,rounded:`xl`,lines:`two`,class:`usage-entry-rail__item`,onClick:$event=>emit(`select`,item)},{title:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(item.title),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[9]||(_cache[9]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),subtitle:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(item.file),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[10]||(_cache[10]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),_:2},1032,[`active`,`aria-selected`,`prepend-icon`,`aria-label`,`onClick`]))]),_:1},8,[`items`]))])])}}};var Vibe64UsageEntryRail_default=_plugin_vue_export_helper_default(_sfc_main$10,[[`__scopeId`,`data-v-47c23b19`]]);var _hoisted_1$9=[`aria-label`];var _hoisted_2$9={class:`usage-panel__header`};var _hoisted_3$9={class:`usage-panel__heading`};var _hoisted_4$9={class:`text-title-medium`};var _hoisted_5$9={class:`text-body-small`};var _hoisted_6$8={class:`usage-panel__actions`};var _hoisted_7$7={key:0,class:`text-body-medium`};var _hoisted_8$7={key:0,class:`usage-panel__note text-body-small`,role:`note`};var _hoisted_9$7={key:1,class:`usage-panel__note text-body-medium`};var _hoisted_10$7={key:1,"aria-busy":`true`,"aria-label":`Loading calls`};var _hoisted_11$7={class:`usage-panel__note text-body-small`};var _hoisted_12$7=[`aria-label`];var _hoisted_13$6={class:`text-title-small`};var _hoisted_14$6={key:0,class:`usage-panel__ran`};var _hoisted_15$4={key:0};var _hoisted_16$4={key:0,class:`usage-panel__section`,"aria-label":`Unresolved calls`};var _hoisted_17$4={class:`text-title-small`};var _hoisted_18$4={key:1,class:`usage-panel__note text-body-medium`};var _hoisted_19$4={key:2,class:`usage-panel__note text-body-small`};var _sfc_main$9={__name:`Vibe64UsageFunctionPanel`,props:{node:{type:Object,required:true},detail:{type:Object,default:null},loading:{type:Boolean,default:false},error:{type:String,default:``},ran:{type:Map,default:null}},emits:[`close`,`select`,`open-source`,`retry`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const sections=computed(()=>{if(!props.detail)return[];const calls=props.detail.calls.map(row=>({...row,fn:row.target,site:props.detail.function.file}));const calledBy=props.detail.calledBy.map(row=>({...row,fn:row.source,site:row.source.file}));const renders=row=>row.method===`renders`;return[...callGroups(calls.filter(row=>!renders(row)),`Calls`),...callGroups(calls.filter(renders),`Renders`),...callGroups(calledBy.filter(row=>!renders(row)),`Called by`),...callGroups(calledBy.filter(renders),`Rendered by`)]});const ranText=computed(()=>{if(props.node.count===void 0)return``;return props.node.count==null?`Ran in this request`:`Ran ${props.node.count.toLocaleString()} ${props.node.count===1?`time`:`times`}`});const joinNote=computed(()=>{if(!props.node.join||props.node.join===`exact`)return``;if(props.node.join===`name-line`)return`Matched by name near this line: the file moved slightly since the scan.`;if(props.node.reason===`not-ignored`)return NOT_IGNORED_TEXT;if(props.node.reason===`language`)return`The scan reads calls only in the languages of the project's Stack components, and this file's language is not among them.`;return`${joinText(props.node.join)}. Refresh the architecture scan to see its calls.`});const importText=computed(()=>props.node.functionId||props.node.join?``:`Imports ${props.node.outCount} of the reached files · imported by ${props.node.inCount}`);const methodText=row=>callMethodText(row.method);const ranLabel=count=>count==null?`ran`:`ran ${count.toLocaleString()} ${count===1?`time`:`times`}`;function openAt(start,file=props.node.file){emit(`open-source`,{path:file,line:start?.line||1,column:start?.column||1})}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:`usage-panel`,"aria-label":`Details for ${__props.node.title}`},[createBaseVNode(`header`,_hoisted_2$9,[createBaseVNode(`div`,_hoisted_3$9,[createBaseVNode(`h3`,_hoisted_4$9,toDisplayString(__props.node.title),1),createBaseVNode(`p`,_hoisted_5$9,toDisplayString(__props.node.subtitle),1)]),createVNode(VBtn,{icon:unref(mdiClose),variant:`text`,size:`small`,"aria-label":`Close details`,onClick:_cache[0]||(_cache[0]=$event=>emit(`close`))},null,8,[`icon`])]),createBaseVNode(`div`,_hoisted_6$8,[createVNode(VBtn,{variant:`tonal`,"prepend-icon":unref(mdiCodeTags),onClick:_cache[1]||(_cache[1]=$event=>openAt(__props.node.start))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`Open source`,-1)])]),_:1},8,[`prepend-icon`]),ranText.value?(openBlock(),createElementBlock(`span`,_hoisted_7$7,toDisplayString(ranText.value),1)):createCommentVNode(``,true)]),joinNote.value?(openBlock(),createElementBlock(`p`,_hoisted_8$7,toDisplayString(joinNote.value),1)):createCommentVNode(``,true),importText.value?(openBlock(),createElementBlock(`p`,_hoisted_9$7,toDisplayString(importText.value),1)):createCommentVNode(``,true),__props.node.functionId?(openBlock(),createElementBlock(Fragment,{key:2},[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[2]||(_cache[2]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.detail?(openBlock(),createElementBlock(`div`,_hoisted_10$7,[createVNode(VSkeletonLoader,{type:`list-item-two-line, list-item-two-line, list-item-two-line`})])):__props.detail?(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`p`,_hoisted_11$7,toDisplayString(unref(coverageText)(__props.detail.function.coverage||``)),1),(openBlock(true),createElementBlock(Fragment,null,renderList(sections.value,group=>{return openBlock(),createElementBlock(`section`,{key:group.title,class:`usage-panel__section`,"aria-label":group.title},[createBaseVNode(`h4`,_hoisted_13$6,toDisplayString(group.title),1),createVNode(VList,{density:`compact`,class:`usage-panel__list`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(group.rows,(row,position)=>{return openBlock(),createBlock(VListItem,{key:position,rounded:`lg`,lines:`two`,onClick:$event=>emit(`select`,row.fn)},{append:withCtx(()=>[createVNode(VChip,{size:`x-small`,variant:row.certainty===`exact`?`tonal`:`outlined`,class:`mr-1`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(CERTAINTY_TEXT)[row.certainty]),1)]),_:2},1032,[`variant`]),row.start?(openBlock(),createBlock(VBtn,{key:0,icon:unref(mdiCodeTags),variant:`text`,size:`x-small`,"aria-label":`Open the ${row.method===`renders`?`tag`:`call`} at line ${row.start.line}`,onClick:withModifiers($event=>openAt(row.start,row.site),[`stop`])},null,8,[`icon`,`aria-label`,`onClick`])):createCommentVNode(``,true)]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(functionLabel)(row.fn)),1),__props.ran?.has(row.fn.id)?(openBlock(),createElementBlock(`span`,_hoisted_14$6,` · `+toDisplayString(ranLabel(__props.ran.get(row.fn.id))),1)):createCommentVNode(``,true)]),_:2},1024),createVNode(VListItemSubtitle,{class:`usage-panel__callee`},{default:withCtx(()=>[createBaseVNode(`code`,null,toDisplayString(row.callee),1),methodText(row)?(openBlock(),createElementBlock(`span`,_hoisted_15$4,` · `+toDisplayString(methodText(row)),1)):createCommentVNode(``,true)]),_:2},1024)]),_:2},1032,[`onClick`])}),128))]),_:2},1024)],8,_hoisted_12$7)}),128)),__props.detail.unresolved.length?(openBlock(),createElementBlock(`section`,_hoisted_16$4,[createBaseVNode(`h4`,_hoisted_17$4,`Unresolved (`+toDisplayString(__props.detail.totals.unresolved)+`)`,1),createVNode(VList,{density:`compact`,class:`usage-panel__list`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.detail.unresolved,(item,position)=>{return openBlock(),createBlock(VListItem,{key:position,rounded:`lg`,onClick:$event=>openAt(item.start)},{default:withCtx(()=>[createVNode(VListItemTitle,{class:`usage-panel__callee text-body-medium`},{default:withCtx(()=>[_cache[5]||(_cache[5]=createTextVNode(`Unresolved call: `,-1)),createBaseVNode(`code`,null,toDisplayString(item.callee),1)]),_:2},1024),createVNode(VListItemSubtitle,null,{default:withCtx(()=>[createTextVNode(`Line `+toDisplayString(item.start.line),1)]),_:2},1024)]),_:2},1032,[`onClick`])}),128))]),_:1})])):createCommentVNode(``,true),!sections.value.length&&!__props.detail.unresolved.length?(openBlock(),createElementBlock(`p`,_hoisted_18$4,`No calls in or out are known for this function.`)):createCommentVNode(``,true),__props.detail.truncated?(openBlock(),createElementBlock(`p`,_hoisted_19$4,`Each list shows its first `+toDisplayString(__props.detail.limits.list)+`.`,1)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],8,_hoisted_1$9)}}};var Vibe64UsageFunctionPanel_default=_plugin_vue_export_helper_default(_sfc_main$9,[[`__scopeId`,`data-v-7f48fcaa`]]);var _hoisted_1$8={class:`usage-recordings`,"aria-label":`Recordings`};var _hoisted_2$8={key:1,"aria-busy":`true`,"aria-label":`Loading recordings`};var _hoisted_3$8={key:2,class:`usage-recordings__empty`,role:`status`};var _hoisted_4$8={key:0,class:`text-body-medium`};var _hoisted_5$8={key:1,class:`text-body-medium`};var _hoisted_6$7={key:1,class:`usage-recordings__live text-body-small`,role:`status`};var _hoisted_7$6={key:3,class:`usage-recordings__live text-body-small`};var _hoisted_8$6={key:5,"aria-busy":`true`,"aria-label":`Loading requests`};var _hoisted_9$6={key:6,class:`usage-recordings__empty text-body-medium`,role:`status`};var _hoisted_10$6={class:`d-sr-only`};var _hoisted_11$6={key:8,class:`usage-recordings__footer`};var _hoisted_12$6={class:`text-body-small`};var _sfc_main$8={__name:`Vibe64UsageRecordingResults`,props:{recordings:{type:Array,default:()=>[]},recordingId:{type:String,default:``},requests:{type:Array,default:()=>[]},interactions:{type:Array,default:()=>[]},total:{type:Number,default:null},hasMore:{type:Boolean,default:false},newestFirst:{type:Boolean,default:false},requestId:{type:String,default:``},search:{type:String,default:``},includeEmpty:{type:Boolean,default:false},routes:{type:Array,default:()=>[]},unavailable:{type:Array,default:()=>[]},loading:{type:Boolean,default:false},requestsLoading:{type:Boolean,default:false},error:{type:String,default:``},sessionId:{type:String,default:``}},emits:[`update:recordingId`,`update:requestId`,`update:search`,`update:includeEmpty`,`more`,`retry`,`deleted`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const timeFormat=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`});const recordingItems=computed(()=>props.recordings.map(recording=>({value:recording.id,title:`${recording.target?.label||`Recording`} · ${recording.startedAt?timeFormat.format(new Date(recording.startedAt)):``} · ${countLabel(recording.counts?.requests,`request`)}${recording.state===`recording`?` · recording`:``}`})));const selectedRecording=computed(()=>props.recordings.find(recording=>recording.id===props.recordingId)||null);const groups=computed(()=>requestGroups(props.requests,props.interactions));const footerText=computed(()=>{if(!props.hasMore)return`Newest requests first`;const shown=props.total==null?`Showing ${countLabel(props.requests.length,`request`)}`:`Showing ${props.requests.length.toLocaleString()} of ${countLabel(Math.max(props.total,props.requests.length),`request`)}`;return props.newestFirst?`${shown}, newest first`:shown});const MARKS={background:{icon:mdiCogOutline,label:`Start-up`},readiness:{icon:mdiHeartPulse,label:`Readiness check`},run:{icon:mdiConsoleLine,label:`Command run`}};const markOf=request=>isBackgroundRequest(request)?MARKS.background:isReadinessRequest(request)?MARKS.readiness:/^run_/u.test(String(request.id))?MARKS.run:null;function subtitle(request){return[isBackgroundRequest(request)?onlyBackground(props.requests)?`Everything that ran while recording`:`Outside any request`:isReadinessRequest(request)?`Vibe64 checking that the launch started`:request.status,countLabel(request.fileCount,`file`),countLabel(request.functionCount,`function`)].filter(Boolean).join(` · `)}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$8,[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`mx-1`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[0]||(_cache[0]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.recordings.length?(openBlock(),createElementBlock(`div`,_hoisted_2$8,[(openBlock(),createElementBlock(Fragment,null,renderList(4,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!__props.recordings.length?(openBlock(),createElementBlock(`div`,_hoisted_3$8,[__props.unavailable.length?(openBlock(),createElementBlock(`p`,_hoisted_4$8,[_cache[7]||(_cache[7]=createTextVNode(` Recording not available for this project's runtimes (`,-1)),createBaseVNode(`code`,null,toDisplayString(__props.unavailable.join("`, `")),1),_cache[8]||(_cache[8]=createTextVNode(`). Imports and Calls still work. `,-1))])):(openBlock(),createElementBlock(`p`,_hoisted_5$8,`No recordings yet. Use Record to capture what runs, then pick a request here.`))])):(openBlock(),createElementBlock(Fragment,{key:3},[createVNode(VSelect,{"model-value":__props.recordingId,items:recordingItems.value,label:`Recording`,variant:`outlined`,density:`comfortable`,"hide-details":``,class:`usage-recordings__select`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:recordingId`,$event))},null,8,[`model-value`,`items`]),selectedRecording.value&&__props.sessionId?(openBlock(),createBlock(unref(Vibe64UsageRecordingSummary_default),{key:0,recording:selectedRecording.value,"session-id":__props.sessionId,onDeleted:_cache[2]||(_cache[2]=$event=>emit(`deleted`,$event))},null,8,[`recording`,`session-id`])):createCommentVNode(``,true),createVNode(VTextField,{"model-value":__props.search,label:`Search requests`,"prepend-inner-icon":unref(mdiMagnify),variant:`outlined`,density:`comfortable`,maxlength:`80`,clearable:``,"hide-details":``,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>emit(`update:search`,$event||``))},null,8,[`model-value`,`prepend-inner-icon`]),createVNode(VSwitch,{"model-value":__props.includeEmpty,color:`primary`,density:`compact`,inset:``,"hide-details":``,label:`Show requests that ran no project code`,class:`usage-recordings__switch`,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>emit(`update:includeEmpty`,Boolean($event)))},null,8,[`model-value`]),selectedRecording.value?.state===`recording`?(openBlock(),createElementBlock(`p`,_hoisted_6$7,`Recording now. New requests appear as they finish.`)):createCommentVNode(``,true),selectedRecording.value?.requestLog?.full?(openBlock(),createBlock(VAlert,{key:2,type:`warning`,variant:`tonal`,density:`compact`},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(` Request log full; later requests not recorded `,-1)])]),_:1})):createCommentVNode(``,true),__props.includeEmpty&&selectedRecording.value?.requestLog?.assets?(openBlock(),createElementBlock(`p`,_hoisted_7$6,toDisplayString(unref(countLabel)(selectedRecording.value.requestLog.assets,`script, style, image or font load`))+` counted, not listed. `,1)):createCommentVNode(``,true),selectedRecording.value?.target?.kind===`web`&&unref(onlyBackground)(__props.requests)?(openBlock(),createBlock(VAlert,{key:4,type:`info`,variant:`tonal`,density:`compact`,class:`usage-recordings__shared`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(BACKGROUND_TEXT))+`: its requests share one process, so this recording shows everything that ran while it recorded. `,1)]),_:1})):createCommentVNode(``,true),__props.requestsLoading&&!groups.value.length?(openBlock(),createElementBlock(`div`,_hoisted_8$6,[(openBlock(),createElementBlock(Fragment,null,renderList(4,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!groups.value.length?(openBlock(),createElementBlock(`p`,_hoisted_9$6,toDisplayString(__props.search?`No requests match.`:`No requests ran project code yet.`),1)):(openBlock(),createBlock(VList,{key:7,class:`usage-recordings__list`,density:`comfortable`,"aria-label":`Requests`,role:`listbox`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(groups.value,(group,position)=>{return openBlock(),createElementBlock(Fragment,{key:group.key},[group.interaction||position>0?(openBlock(),createBlock(VListSubheader,{key:0,class:`usage-recordings__interaction`},{default:withCtx(()=>[createTextVNode(toDisplayString(group.interaction?unref(interactionTitle)(group.interaction):`Other requests`),1)]),_:2},1024)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(group.requests,request=>{return openBlock(),createBlock(VListItem,{key:request.id,active:request.id===__props.requestId,role:`option`,"aria-selected":request.id===__props.requestId,color:`primary`,rounded:`xl`,lines:`two`,class:normalizeClass([`usage-recordings__request`,{"usage-recordings__request--secondary":unref(isReadinessRequest)(request)}]),onClick:$event=>emit(`update:requestId`,request.id)},{prepend:withCtx(()=>[createVNode(VChip,{size:`small`,variant:`tonal`,label:``,class:`usage-recordings__method`,title:markOf(request)?.label},{default:withCtx(()=>[markOf(request)?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(VIcon,{icon:markOf(request).icon,size:`small`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_10$6,toDisplayString(markOf(request).label),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(request.method||`–`),1)],64))]),_:2},1032,[`title`])]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(unref(requestTitle)(request,__props.routes,__props.requests)),(part,index)=>{return openBlock(),createElementBlock(Fragment,{key:index},[createTextVNode(toDisplayString(part),1),_cache[10]||(_cache[10]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),_:2},1024),createVNode(VListItemSubtitle,null,{default:withCtx(()=>[createTextVNode(toDisplayString(subtitle(request)),1)]),_:2},1024)]),_:2},1032,[`active`,`aria-selected`,`class`,`onClick`])}),128))],64)}),128))]),_:1})),groups.value.length&&(__props.hasMore||__props.newestFirst)?(openBlock(),createElementBlock(`div`,_hoisted_11$6,[createBaseVNode(`p`,_hoisted_12$6,toDisplayString(footerText.value),1),__props.hasMore?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,size:`small`,loading:__props.requestsLoading,onClick:_cache[5]||(_cache[5]=$event=>emit(`more`))},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(`Show more`,-1)])]),_:1},8,[`loading`])):createCommentVNode(``,true)])):createCommentVNode(``,true)],64))])}}};var Vibe64UsageRecordingResults_default=_plugin_vue_export_helper_default(_sfc_main$8,[[`__scopeId`,`data-v-839efb0c`]]);var _hoisted_1$7={key:0,class:`usage-web__empty text-body-medium`,role:`status`};var _hoisted_2$7=[`aria-label`];var _hoisted_3$7={key:0,class:`usage-web__group-title text-title-small`};var _hoisted_4$7={class:`usage-web__cards`};var _hoisted_5$7={key:0,class:`text-body-small`};var _hoisted_6$6={class:`usage-web__crossings`,"aria-label":`Crossings`};var _hoisted_7$5={class:`usage-web__zoom`};var _hoisted_8$5={class:`usage-web__zoom-title text-title-medium`};var _hoisted_9$5={key:0,class:`usage-web__legend`,"aria-label":`Legend`};var _hoisted_10$5={key:0,class:`usage-web__crossings`,"aria-label":`Leaving this subsystem`};var _hoisted_11$5={key:1,class:`usage-web__empty text-body-medium`,role:`status`};var _hoisted_12$5={class:`usage-web__row-path`};var _hoisted_13$5={class:`usage-web__row-counts`};var _hoisted_14$5={key:3,class:`usage-web__frame`};var _hoisted_15$3=[`width`,`height`];var _hoisted_16$3=[`id`];var _hoisted_17$3=[`d`,`marker-end`];var _hoisted_18$3=[`x1`,`y1`,`x2`,`y2`];var _hoisted_19$3=[`cx`,`cy`];var _hoisted_20$2=[`aria-pressed`,`aria-label`,`title`,`onClick`];var _hoisted_21$2={class:`usage-node__head`};var _hoisted_22$2={class:`usage-node__title text-body-medium`};var _hoisted_23$2={key:0,class:`usage-node__badge text-label-small`};var _hoisted_24$2={class:`usage-node__subtitle text-body-small`};var _hoisted_25$2={key:0,class:`usage-web__more`,"aria-hidden":`true`};var stubRoom=32;var _sfc_main$7={__name:`Vibe64UsageWebCanvas`,props:{mode:{type:String,required:true},subsystems:{type:Array,default:()=>[]},groups:{type:Array,default:()=>[]},crossings:{type:Array,default:()=>[]},zoomedId:{type:String,default:``},nodes:{type:Array,default:()=>[]},edges:{type:Array,default:()=>[]},selectedId:{type:String,default:``},showUntouched:{type:Boolean,default:false},compact:{type:Boolean,default:false},startSubsystemId:{type:String,default:``}},emits:[`zoom`,`select`,`update:showUntouched`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const countKey=computed(()=>COUNT_KEYS[props.mode]);const reached=item=>Number(item[countKey.value]||0)>0;const cardText=item=>subsystemCard(props.mode,item);const layout=computed(()=>subsystemSections(props.subsystems,props.groups,{countKey:countKey.value,showUntouched:props.showUntouched}));const zoomedTitle=computed(()=>props.subsystems.find(item=>item.id===props.zoomedId)?.title||props.zoomedId);const leaving=computed(()=>props.zoomedId?crossingsFrom(props.crossings,props.zoomedId,props.subsystems):[]);const emptyText=computed(()=>props.mode===`recording`?`This request ran no project code that the last scan knows.`:`Nothing is reached from this entry.`);const zoomEmptyText=computed(()=>props.mode===`imports`?`No files in this subsystem are reached.`:props.mode===`calls`?`No functions in this subsystem are reached.`:`No functions in this subsystem ran.`);const columns=computed(()=>depthColumns(props.nodes));const plan=computed(()=>canvasLayout(props.nodes,props.edges));const stubs=computed(()=>props.nodes.filter(node=>node.unresolved).map(node=>{const position=plan.value.positions.get(node.id);return{id:node.id,count:node.unresolved,x:position.x+NODE.width,y:position.y+NODE.height-12}}));const arrowId=`usage-arrow-${useId()}`;const scroller=ref(null);const moreRight=ref(false);function measureScroll(){const element=scroller.value;moreRight.value=Boolean(element)&&element.scrollLeft+element.clientWidth<element.scrollWidth-1}let resizeObserver=null;watch(scroller,element=>{resizeObserver?.disconnect();resizeObserver=element&&typeof ResizeObserver===`function`?new ResizeObserver(measureScroll):null;resizeObserver?.observe(element);measureScroll()},{flush:`post`});watch(plan,()=>nextTick(measureScroll));onBeforeUnmount(()=>resizeObserver?.disconnect());function nodeStyle(node){const position=plan.value.positions.get(node.id);return{left:`${position.x}px`,top:`${position.y}px`,width:`${NODE.width}px`,height:`${NODE.height}px`}}const SHORT_JOIN=Object.freeze({stale:`changed`,none:`not scanned`});function badge(node,full=false){if(props.mode===`recording`&&node.join!==`exact`&&node.join!==`name-line`)return full?joinText(node.join,node.reason):SHORT_JOIN[node.join]||``;if(props.mode===`recording`)return node.count==null?`ran`:`×${node.count.toLocaleString()}`;if(node.certainty===`probable`)return full?`only via probable calls`:`probable`;return``}function rowCounts(node){if(props.mode===`recording`)return badge(node,true);const[out,into]=props.mode===`imports`?[`imports`,`imported by`]:[`calls`,`called by`];return[badge(node,true),`${out} ${node.outCount} → · ${into} ${node.inCount} ←`,node.unresolved&&countLabel(node.unresolved,`unresolved call`)].filter(Boolean).join(` · `)}function nodeLabel(node){return[node.title,node.subtitle,props.mode===`recording`?badge(node,true):rowCounts(node)].filter(Boolean).join(`, `)}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,{class:normalizeClass([`usage-web`,{"usage-web--compact":__props.compact}])},[!__props.zoomedId?(openBlock(),createElementBlock(Fragment,{key:0},[!layout.value.sections.length?(openBlock(),createElementBlock(`p`,_hoisted_1$7,toDisplayString(emptyText.value),1)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(layout.value.sections,section=>{return openBlock(),createElementBlock(`section`,{key:section.id||`all`,class:`usage-web__group`,"aria-label":section.title||`Subsystems`},[section.title?(openBlock(),createElementBlock(`h3`,_hoisted_3$7,toDisplayString(section.title),1)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_4$7,[(openBlock(true),createElementBlock(Fragment,null,renderList(section.cards,card=>{return openBlock(),createBlock(VCard,{key:card.id,class:normalizeClass([`usage-web__card`,{"usage-web__card--untouched":!reached(card)}]),variant:`outlined`,rounded:`lg`,disabled:!reached(card),"aria-label":`${card.title}: ${cardText(card).count}`,onClick:$event=>emit(`zoom`,card.id)},{default:withCtx(()=>[createVNode(VCardItem,null,createSlots({default:withCtx(()=>[createVNode(VCardTitle,{class:`text-title-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(card.title),1)]),_:2},1024),createVNode(VCardSubtitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(cardText(card).count),1)]),_:2},1024)]),_:2},[card.id===__props.startSubsystemId?{name:`append`,fn:withCtx(()=>[_cache[2]||(_cache[2]=createBaseVNode(`span`,{class:`usage-web__start text-label-medium`},`Starts here`,-1))]),key:`0`}:void 0]),1024),cardText(card).detail||cardText(card).plumbing||unref(crossingsFrom)(__props.crossings,card.id,__props.subsystems).length?(openBlock(),createBlock(VCardText,{key:0,class:`usage-web__card-body`},{default:withCtx(()=>[cardText(card).detail?(openBlock(),createElementBlock(`p`,_hoisted_5$7,toDisplayString(cardText(card).detail),1)):createCommentVNode(``,true),cardText(card).plumbing?(openBlock(),createBlock(VChip,{key:1,size:`small`,variant:`tonal`,class:`usage-web__plumbing`},{default:withCtx(()=>[createTextVNode(`Shared plumbing (`+toDisplayString(cardText(card).plumbing)+`)`,1)]),_:2},1024)):createCommentVNode(``,true),createBaseVNode(`ul`,_hoisted_6$6,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(crossingsFrom)(__props.crossings,card.id,__props.subsystems),crossing=>{return openBlock(),createElementBlock(`li`,{key:crossing.toSubsystemId,class:`text-body-small`},` → `+toDisplayString(crossing.title)+` · `+toDisplayString(unref(crossingText)(__props.mode,crossing)),1)}),128))])]),_:2},1024)):createCommentVNode(``,true)]),_:2},1032,[`class`,`disabled`,`aria-label`,`onClick`])}),128))])],8,_hoisted_2$7)}),128)),layout.value.untouched?(openBlock(),createBlock(VChip,{key:1,class:`usage-web__untouched`,variant:__props.showUntouched?`tonal`:`outlined`,"prepend-icon":__props.showUntouched?unref(mdiCheck):void 0,role:`switch`,"aria-checked":__props.showUntouched,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:showUntouched`,!__props.showUntouched))},{default:withCtx(()=>[createTextVNode(` Show untouched (`+toDisplayString(layout.value.untouched)+`) `,1)]),_:1},8,[`variant`,`prepend-icon`,`aria-checked`])):createCommentVNode(``,true)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`header`,_hoisted_7$5,[createVNode(VBtn,{variant:`text`,"prepend-icon":unref(mdiArrowLeft),onClick:_cache[1]||(_cache[1]=$event=>emit(`zoom`,``))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`All subsystems`,-1)])]),_:1},8,[`prepend-icon`]),createBaseVNode(`h3`,_hoisted_8$5,toDisplayString(zoomedTitle.value),1),renderSlot(_ctx.$slots,`zoom-actions`,{},void 0,true),__props.mode!==`imports`&&!__props.compact?(openBlock(),createElementBlock(`div`,_hoisted_9$5,[createVNode(VChip,{size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createBaseVNode(`svg`,{width:`24`,height:`8`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`4`,x2:`24`,y2:`4`,class:`usage-web__line usage-web__line--exact`})],-1),createTextVNode(`Exact`,-1)])]),_:1}),createVNode(VChip,{size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createBaseVNode(`svg`,{width:`24`,height:`8`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`4`,x2:`24`,y2:`4`,class:`usage-web__line usage-web__line--probable`})],-1),createTextVNode(`Probable`,-1)])]),_:1}),__props.mode===`calls`?(openBlock(),createBlock(VChip,{key:0,size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createBaseVNode(`svg`,{width:`24`,height:`10`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`5`,x2:`14`,y2:`5`,class:`usage-web__line usage-web__line--probable`}),createBaseVNode(`circle`,{cx:`18`,cy:`5`,r:`4`,class:`usage-web__stub`})],-1),createTextVNode(`Unresolved`,-1)])]),_:1})):createCommentVNode(``,true)])):createCommentVNode(``,true)]),leaving.value.length?(openBlock(),createElementBlock(`ul`,_hoisted_10$5,[(openBlock(true),createElementBlock(Fragment,null,renderList(leaving.value,crossing=>{return openBlock(),createElementBlock(`li`,{key:crossing.toSubsystemId,class:`text-body-small`},`→ `+toDisplayString(crossing.title)+` · `+toDisplayString(unref(crossingText)(__props.mode,crossing)),1)}),128))])):createCommentVNode(``,true),!__props.nodes.length?(openBlock(),createElementBlock(`p`,_hoisted_11$5,toDisplayString(zoomEmptyText.value),1)):__props.compact?(openBlock(),createBlock(VList,{key:2,class:`usage-web__rows`,density:`comfortable`,"aria-label":`Reached in this subsystem`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(columns.value,column=>{return openBlock(),createElementBlock(Fragment,{key:column.depth},[createVNode(VListSubheader,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(depthTitle)(column.depth)),1)]),_:2},1024),(openBlock(true),createElementBlock(Fragment,null,renderList(column.items,node=>{return openBlock(),createBlock(VListItem,{key:node.id,active:node.id===__props.selectedId,color:`primary`,rounded:`lg`,lines:`three`,title:node.title,onClick:$event=>emit(`select`,node)},{subtitle:withCtx(()=>[createBaseVNode(`span`,_hoisted_12$5,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(node.subtitle),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[7]||(_cache[7]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),createBaseVNode(`span`,_hoisted_13$5,toDisplayString(rowCounts(node)),1)]),_:2},1032,[`active`,`title`,`onClick`])}),128))],64)}),128))]),_:1})):(openBlock(),createElementBlock(`div`,_hoisted_14$5,[createBaseVNode(`div`,{ref_key:`scroller`,ref:scroller,class:`usage-web__scroll`,onScrollPassive:measureScroll},[createBaseVNode(`div`,{class:`usage-web__plane`,style:normalizeStyle({width:`${plan.value.width+stubRoom}px`,height:`${plan.value.height}px`})},[(openBlock(),createElementBlock(`svg`,{class:`usage-web__edges`,width:plan.value.width+stubRoom,height:plan.value.height,"aria-hidden":`true`},[createBaseVNode(`defs`,null,[(openBlock(),createElementBlock(Fragment,null,renderList([`exact`,`probable`],certainty=>{return createBaseVNode(`marker`,{id:`${arrowId}-${certainty}`,key:certainty,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`},[createBaseVNode(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,class:normalizeClass(`usage-web__arrow usage-web__arrow--${certainty}`)},null,2)],8,_hoisted_16$3)}),64))]),(openBlock(true),createElementBlock(Fragment,null,renderList(plan.value.paths,edge=>{return openBlock(),createElementBlock(`path`,{key:edge.key,d:edge.d,"marker-end":`url(#${arrowId}-${edge.certainty===`probable`?`probable`:`exact`})`,class:normalizeClass([`usage-web__line`,[`usage-web__line--${edge.certainty||`exact`}`,{"usage-web__line--dim":__props.selectedId&&edge.from!==__props.selectedId&&edge.to!==__props.selectedId}]])},null,10,_hoisted_17$3)}),128)),(openBlock(true),createElementBlock(Fragment,null,renderList(stubs.value,stub=>{return openBlock(),createElementBlock(`g`,{key:stub.id},[createBaseVNode(`line`,{x1:stub.x,y1:stub.y,x2:stub.x+14,y2:stub.y,class:`usage-web__line usage-web__line--probable`},null,8,_hoisted_18$3),createBaseVNode(`circle`,{cx:stub.x+19,cy:stub.y,r:`5`,class:`usage-web__stub`},[createBaseVNode(`title`,null,toDisplayString(unref(countLabel)(stub.count,`unresolved call`)),1)],8,_hoisted_19$3)])}),128))],8,_hoisted_15$3)),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.nodes,node=>{return openBlock(),createElementBlock(`button`,{key:node.id,type:`button`,class:normalizeClass([`usage-node`,{"usage-node--selected":node.id===__props.selectedId,"usage-node--probable":node.certainty===`probable`,"usage-node--plumbing":node.plumbing}]),style:normalizeStyle(nodeStyle(node)),"aria-pressed":node.id===__props.selectedId,"aria-label":nodeLabel(node),title:[node.title,node.subtitle,badge(node,true)].filter(Boolean).join(`
|
|
1
|
+
import{_ as VProgressLinear,dr as vModelText,fr as vShow,mr as withModifiers,n as VChipGroup,pr as withKeys,t as VChip,ur as vModelSelect,x as VIcon}from"./VChip-BRhZ1px1.js";import{Cn as toRaw,D as createVNode,E as createTextVNode,Ht as watch,On as unref,Pt as useId,St as resolveComponent,Yt as withDirectives,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,er as normalizeStyle,et as mergeProps,fn as markRaw,g as computed,it as onBeforeUnmount,jt as toHandlers,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,tt as nextTick,un as isRef,v as createBlock,vn as ref,w as createSlots,wn as toRef,xn as shallowRef,xt as renderSlot,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{r as getHttpWebClient}from"./httpClient-Dj5wBWSr.js";import{d as VVirtualScroll,t as VSelect}from"./VSelect-CFmsjLP4.js";import{c as VListItemTitle,l as VListItemSubtitle,n as VList,o as VListSubheader,s as VListItem,t as VMenu}from"./VMenu-BaCC4Of9.js";import{t as VTextField}from"./VTextField-Dmm1M-tz.js";import{$t as mdiFolderOutline,A as mdiBookOpenPageVariantOutline,An as mdiLanguageRust,C as mdiArrowLeft,Cn as mdiLanguageHtml5,Dn as mdiLanguagePhp,En as mdiLanguageKotlin,Fn as mdiLightningBoltOutline,Gn as mdiMenuDown,Hn as mdiMagnify,Jt as mdiFlaskOutline,Lt as mdiFileDocumentOutline,Nt as mdiFileCodeOutline,On as mdiLanguagePython,Pt as mdiFileCogOutline,Q as mdiClose,Rt as mdiFileImageOutline,Sn as mdiLanguageGo,Tn as mdiLanguageJavascript,Vr as mdiStarOutline,Wt as mdiFileTableOutline,Z as mdiClockOutline,bn as mdiLanguageCsharp,ci as mdiVuejs,dr as mdiPuzzleOutline,er as mdiPackageVariantClosed,gr as mdiRefresh,h as mdiApi,it as mdiCodeTags,jn as mdiLanguageTypescript,kn as mdiLanguageRuby,on as mdiHeartPulse,ot as mdiCogOutline,pr as mdiRecordCircleOutline,rt as mdiCodeJson,ut as mdiConsoleLine,wn as mdiLanguageJava,xn as mdiLanguageCss3,yn as mdiLanguageCpp,z as mdiCheck}from"./mdi-DwGK7nOu.js";import{i as VBtnToggle,t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VAlert}from"./VAlert-CBpSKTfy.js";import{t as VDivider}from"./VDivider-DY2s_j83.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{a as VCardSubtitle,i as VCardTitle,n as VCardText,r as VCardItem,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-DFBUIKJZ.js";import{t as VSwitch}from"./VSwitch-fUpmdN4R.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{t as usePaths}from"./usePaths-DaWJ_Tvi.js";import{n as useVibe64SystemGraph,t as SYSTEM_GRAPH_API_SUFFIX}from"./useVibe64SystemGraph-BdvumnPL.js";import{a as Vibe64UsageRecordingSummary_default,c as USAGE_RECORDING_API_SUFFIX,it as VToolbarTitle,rt as VToolbar,s as Vibe64UsageRecordDialog_default,tt as VBottomSheet}from"./index-CNkd6O5t.js";import{a as _sfc_main$d,i as _sfc_main$1$1,n as Position,s as _sfc_main$f,t as MarkerType}from"./vue-flow-core-BlVEnES8.js";var _hoisted_1$11={class:`usage-picker__label`};var _hoisted_2$11={class:`usage-picker__body`};var _sfc_main$11={__name:`Vibe64UsageEntryPicker`,props:{modelValue:{type:Boolean,default:false},label:{type:String,required:true},title:{type:String,required:true}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(VBtn,{class:`usage-picker`,variant:`outlined`,block:``,"append-icon":unref(mdiMenuDown),"aria-label":__props.label,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,true))},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$11,toDisplayString(__props.label),1)]),_:1},8,[`append-icon`,`aria-label`]),createVNode(VDialog,{"model-value":__props.modelValue,fullscreen:``,transition:`dialog-bottom-transition`,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{class:`usage-picker__dialog`},{default:withCtx(()=>[createVNode(VToolbar,{density:`comfortable`,color:`surface`},{default:withCtx(()=>[createVNode(VBtn,{icon:unref(mdiClose),"aria-label":`Close`,onClick:_cache[1]||(_cache[1]=$event=>emit(`update:modelValue`,false))},null,8,[`icon`]),createVNode(VToolbarTitle,{class:`text-title-large`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.title),1)]),_:1})]),_:1}),createBaseVNode(`div`,_hoisted_2$11,[renderSlot(_ctx.$slots,`default`,{},void 0,true)])]),_:3})]),_:3},8,[`model-value`])],64)}}};var Vibe64UsageEntryPicker_default=_plugin_vue_export_helper_default(_sfc_main$11,[[`__scopeId`,`data-v-fa55c2f3`]]);var USAGE_ENTRY_KINDS=Object.freeze([{kind:`page`,label:`Page`,plural:`Pages`,icon:mdiFileDocumentOutline},{kind:`component`,label:`Component`,plural:`Components`,icon:mdiPuzzleOutline},{kind:`route`,label:`Route`,plural:`Routes`,icon:mdiApi},{kind:`action`,label:`Action`,plural:`Actions`,icon:mdiLightningBoltOutline},{kind:`library-export`,label:`Library export`,plural:`Library exports`,icon:mdiPackageVariantClosed},{kind:`cli-command`,label:`Command`,plural:`Commands`,icon:mdiConsoleLine},{kind:`job`,label:`Job`,plural:`Jobs`,icon:mdiClockOutline},{kind:`program-operation`,label:`Program operation`,plural:`Program operations`,icon:mdiBookOpenPageVariantOutline},{kind:`test`,label:`Test file`,plural:`Test files`,icon:mdiFlaskOutline}].map(Object.freeze));var USAGE_MODES=Object.freeze([Object.freeze({value:`imports`,title:`Imports`}),Object.freeze({value:`calls`,title:`Calls`}),Object.freeze({value:`recording`,title:`Recording`})]);var USAGE_QUERY_KEYS=Object.freeze([`view`,`entry`,`mode`,`subsystem`,`recording`,`request`]);var MORE_NODES=1e3;function entryKind(kind){return USAGE_ENTRY_KINDS.find(item=>item.kind===kind)||{kind,label:kind,plural:kind,icon:`M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z`}}var text=value=>typeof value===`string`?value.trim():Array.isArray(value)?text(value[0]):``;function usageStateFromQuery(query={}){const view=text(query.view)===`usage`?`usage`:`map`;const mode=USAGE_MODES.some(item=>item.value===text(query.mode))?text(query.mode):`calls`;return{view,entry:view===`usage`?text(query.entry):``,mode:view===`usage`?mode:`calls`,subsystem:view===`usage`?text(query.subsystem):``,recording:view===`usage`?text(query.recording):``,request:view===`usage`?text(query.request):``}}function usageQueryFor(query={},state={}){const next=Object.fromEntries(Object.entries(query).filter(([key])=>!USAGE_QUERY_KEYS.includes(key)));const normalized=usageStateFromQuery(state);if(normalized.view!==`usage`)return next;next.view=`usage`;next.mode=normalized.mode;for(const key of[`entry`,`subsystem`,`recording`,`request`])if(normalized[key])next[key]=normalized[key];return next}function sameUsageState(left={},right={}){const a=usageStateFromQuery(left);const b=usageStateFromQuery(right);return USAGE_QUERY_KEYS.every(key=>a[key]===b[key])}function sameQuery(left={},right={}){return[...new Set([...Object.keys(left),...Object.keys(right)])].every(key=>String(left[key]??``)===String(right[key]??``))}function functionLabel(fn={}){if(fn.kind===`module`)return`${fileName(fn.file)} top level`;const name=fn.name||`anonymous (line ${fn.start?.line??`?`})`;return fn.container?`${fn.container}.${name}`:name}function fileName(filePath=``){return String(filePath).split(`/`).pop()}function shortLocation(filePath=``,line=null){if(line)return`${fileName(filePath)}:${line}`;const folders=String(filePath).split(`/`).slice(0,-1);return folders.length>2?`…/${folders.slice(-2).join(`/`)}`:folders.join(`/`)}function pathParts(filePath=``){return String(filePath).split(/(?<=\/)/u)}function countLabel(count,singular,plural=`${singular}s`){return`${Number(count||0).toLocaleString()} ${count===1?singular:plural}`}function subsystemSections(subsystems=[],groups=[],{countKey,showUntouched=false}={}){const reached=item=>Number(item[countKey]||0)>0;const visible=subsystems.filter(item=>showUntouched||reached(item));const alphabetical=(left,right)=>left.title.localeCompare(right.title);const sections=[];for(const group of groups){const cards=visible.filter(item=>item.group===group.id).sort(alphabetical);if(cards.length)sections.push({id:group.id,title:group.title,cards})}const placed=new Set(groups.map(group=>group.id));const rest=visible.filter(item=>!placed.has(item.group)).sort(alphabetical);if(rest.length)sections.push({id:``,title:groups.length?`Other subsystems`:``,cards:rest});return{sections,untouched:subsystems.filter(item=>!reached(item)).length}}function crossingsFrom(crossings=[],subsystemId=``,subsystems=[]){const titles=new Map(subsystems.map(item=>[item.id,item.title]));return crossings.filter(crossing=>crossing.fromSubsystemId===subsystemId).map(crossing=>({...crossing,title:titles.get(crossing.toSubsystemId)||crossing.toSubsystemId}))}var COUNT_KEYS=Object.freeze({imports:`fileCount`,calls:`functionCount`,recording:`ranCount`});function subsystemCard(mode,item={}){if(mode===`imports`)return{count:countLabel(item.fileCount,`file`),detail:``};if(mode===`calls`)return{count:countLabel(item.functionCount,`function`),detail:`${Number(item.exact||0).toLocaleString()} by exact calls · ${Number(item.probable||0).toLocaleString()} only via probable`};return{count:`${countLabel(item.ranCount,`function`)} ran`,detail:``,plumbing:item.plumbingCount||0}}function crossingText(mode,crossing={}){if(mode===`imports`)return countLabel(crossing.count,`import`);const exact=Number(crossing.exact||0);const probable=Number(crossing.probable||0);if(mode===`recording`)return countLabel(exact+probable,`call in code`,`calls in code`);return[[exact&&countLabel(exact,`exact call`),probable&&(exact?`${probable.toLocaleString()} probable`:countLabel(probable,`probable call`))].filter(Boolean).join(`, `),crossing.renders&&`renders ${countLabel(crossing.renders,`component`)}`].filter(Boolean).join(` · `)}function depthTitle(depth){return depth===0?`Start`:depth===1?`1 step away`:`${depth} steps away`}function edgeCounts(edges=[]){const out=new Map;const into=new Map;for(const edge of edges){out.set(edge.from,(out.get(edge.from)||0)+1);into.set(edge.to,(into.get(edge.to)||0)+1)}return{out,into}}function webNodes(mode,data={}){const edges=data.edges||[];const{out,into}=edgeCounts(edges);if(mode===`imports`)return(data.files||[]).map(file=>({id:file.id,title:fileName(file.path),subtitle:file.path,location:shortLocation(file.path),file:file.path,start:null,depth:file.depth,certainty:null,outCount:out.get(file.id)||0,inCount:into.get(file.id)||0,unresolved:0}));if(mode===`calls`){const unresolved=new Map;for(const item of data.unresolved||[])unresolved.set(item.fromFunctionId,(unresolved.get(item.fromFunctionId)||0)+1);return(data.functions||[]).map(fn=>({id:fn.id,functionId:fn.id,title:functionLabel(fn),subtitle:`${fn.file}:${fn.start.line}`,location:shortLocation(fn.file,fn.start.line),file:fn.file,start:fn.start,depth:fn.depth,certainty:fn.reach,outCount:fn.callCount||0,inCount:fn.calledByCount||0,unresolved:unresolved.get(fn.id)||0}))}return recordedDepths(data.nodes||[],edges).map(node=>({id:node.id,functionId:node.functionId,title:functionLabel({name:node.name,start:node.start}),subtitle:`${node.file}:${node.start.line}`,location:shortLocation(node.file,node.start.line),file:node.file,start:node.start,depth:node.depth,certainty:null,count:node.count,plumbing:node.plumbing,join:node.join,reason:node.reason,outCount:out.get(node.id)||0,inCount:into.get(node.id)||0,unresolved:0}))}function depthColumns(nodes=[]){const columns=new Map;for(const node of nodes){const depth=Number(node.depth||0);if(!columns.has(depth))columns.set(depth,[]);columns.get(depth).push(node)}return[...columns.entries()].sort(([left],[right])=>left-right).map(([depth,items])=>({depth,items}))}var NODE=Object.freeze({width:220,height:76,columnGap:72,rowGap:16,padding:16});function canvasLayout(nodes=[],edges=[]){const positions=new Map;const columns=depthColumns(nodes);columns.forEach((column,columnIndex)=>column.items.forEach((node,rowIndex)=>{positions.set(node.id,{x:NODE.padding+columnIndex*(NODE.width+NODE.columnGap),y:NODE.padding+rowIndex*(NODE.height+NODE.rowGap)})}));const tallest=Math.max(0,...columns.map(column=>column.items.length));return{positions,paths:edges.filter(edge=>positions.has(edge.from)&&positions.has(edge.to)).map(edge=>{const from=positions.get(edge.from);const to=positions.get(edge.to);const forward=to.x>from.x;const start={x:from.x+NODE.width,y:from.y+NODE.height/2};const end=forward?{x:to.x,y:to.y+NODE.height/2}:{x:to.x+NODE.width,y:to.y+NODE.height/2};const bend=forward?Math.max(32,(end.x-start.x)/2):NODE.columnGap/2+Math.abs(end.y-start.y)/4;const d=forward?`M ${start.x} ${start.y} C ${start.x+bend} ${start.y}, ${end.x-bend} ${end.y}, ${end.x} ${end.y}`:`M ${start.x} ${start.y} C ${start.x+bend} ${start.y}, ${end.x+bend} ${end.y}, ${end.x} ${end.y}`;return{...edge,key:`${edge.from}>${edge.to}`,d}}),width:NODE.padding*2+Math.max(1,columns.length)*NODE.width+Math.max(0,columns.length-1)*NODE.columnGap,height:NODE.padding*2+tallest*NODE.height+Math.max(0,tallest-1)*NODE.rowGap}}var CERTAINTY_TEXT=Object.freeze({exact:`exact`,probable:`probable`,unresolved:`unresolved`});var METHOD_TEXT=Object.freeze({checker:`proved by types`,"di-binding":`dependency binding`,"route-action":`the route's action`,"argument-flow":`passed as an argument`,"import-scope":`matched by imported name`,"same-file-name":`matched by name in this file`,self:`same class`,"receiver-name":`matched by method name`,operation:`request`,renders:``,none:``});function callMethodText(method=``){return METHOD_TEXT[method]??method}var ANALYSIS_NAMES=Object.freeze({jskit:`JSKIT`});function coverageText(coverage=``){if(coverage.startsWith(`adapter:`)){const family=coverage.slice(8).split(`.`)[0];return`Calls read by ${ANALYSIS_NAMES[family]||family} analysis, which can prove exact calls`}if(coverage===`generic`)return`Calls read by name only: probable at best`;return`Calls not read for this file`}function callGroups(rows=[],heading){return[`exact`,`probable`].map(certainty=>({certainty,title:`${heading} (${certainty})`,rows:rows.filter(row=>row.certainty===certainty)})).filter(group=>group.rows.length)}function routeTemplateFor(method=``,requestPath=``,routes=[]){const parts=String(requestPath).split(`/`);const match=routes.find(route=>{const[routeMethod,template]=String(route.title||``).split(` `);if(!template||routeMethod.toUpperCase()!==String(method).toUpperCase())return false;const templateParts=template.split(`/`);return templateParts.length===parts.length&&templateParts.every((part,position)=>part===parts[position]||part.startsWith(`:`)||part===`*`)});return match?match.title.split(` `).slice(1).join(` `):``}var BACKGROUND_TEXT=`Not separated per request for this server`;var OUTSIDE_REQUESTS_TEXT=`Start-up and work outside requests`;var isBackgroundRequest=(request={})=>request.kind===`background`||/^bg_[0-9]+$/u.test(String(request.id||``));var READINESS_TEXT=`Launch readiness check`;var isReadinessRequest=(request={})=>request.kind===`readiness`;function onlyBackground(requests=[]){const ran=requests.filter(request=>Number(request.functionCount||0)>0&&!isReadinessRequest(request));return ran.length>0&&ran.every(isBackgroundRequest)}function requestTitle(request={},routes=[],requests=[request]){if(isBackgroundRequest(request))return onlyBackground(requests)?BACKGROUND_TEXT:OUTSIDE_REQUESTS_TEXT;if(isReadinessRequest(request))return READINESS_TEXT;return routeTemplateFor(request.method,request.path,routes)||request.path||`Request not in the request log`}function requestGroups(requests=[],interactions=[]){const byId=new Map(interactions.map(interaction=>[interaction.id,interaction]));const groups=[];for(const request of requests){const interaction=byId.get(request.interaction)||null;const last=groups.at(-1);if(last&&last.interaction?.id===interaction?.id)last.requests.push(request);else groups.push({key:`${interaction?.id||`none`}:${request.id}`,interaction,requests:[request]})}return groups}var INTERACTION_VERBS=Object.freeze({click:`Click`,enter:`Enter`,submit:`Submit`});function interactionTitle(interaction){if(!interaction)return``;return`${INTERACTION_VERBS[interaction.kind]||INTERACTION_VERBS.click}: ${interaction.label}${interaction.componentFile?` (${fileName(interaction.componentFile)})`:``}`}function recordingWeb(functions=[],join=null){const joined=new Map((join?.joined||[]).map(item=>[item.index,item]));const nodes=functions.map((fn,index)=>{const match=joined.get(index)||{functionId:null,subsystemId:null,join:`none`};return{id:match.functionId||`ran:${index}`,functionId:match.functionId,name:fn.name,file:fn.path,start:fn.start,end:fn.end,count:fn.count,plumbing:fn.plumbing===true,subsystemId:match.subsystemId,join:match.join,reason:match.reason}});const edges=(join?.edges||[]).filter(edge=>nodes[edge.from]&&nodes[edge.to]).map(edge=>({from:nodes[edge.from].id,to:nodes[edge.to].id,certainty:edge.certainty}));const subsystems=(join?.subsystems||[]).map(owner=>{const ran=nodes.filter(node=>node.subsystemId===owner.id);return{...owner,ranCount:ran.length,plumbingCount:ran.filter(node=>node.plumbing).length}});const owners=new Map(nodes.map(node=>[node.id,node.subsystemId]));const crossings=new Map;for(const edge of edges){const from=owners.get(edge.from);const to=owners.get(edge.to);if(!from||!to||from===to)continue;const key=`${from}\n${to}`;if(!crossings.has(key))crossings.set(key,{fromSubsystemId:from,toSubsystemId:to,exact:0,probable:0});crossings.get(key)[edge.certainty===`exact`?`exact`:`probable`]+=1}return{nodes,edges,subsystems,crossings:[...crossings.values()]}}function recordedDepths(nodes=[],edges=[]){const ids=new Set(nodes.map(node=>node.id));const inside=edges.filter(edge=>ids.has(edge.from)&&ids.has(edge.to)&&edge.from!==edge.to);const incoming=new Map(nodes.map(node=>[node.id,0]));for(const edge of inside)incoming.set(edge.to,incoming.get(edge.to)+1);const depth=new Map;const queue=nodes.filter(node=>incoming.get(node.id)===0).map(node=>node.id);for(const id of queue)depth.set(id,0);for(let head=0;head<queue.length;head+=1)for(const edge of inside)if(edge.from===queue[head]&&!depth.has(edge.to)){depth.set(edge.to,depth.get(queue[head])+1);queue.push(edge.to)}return nodes.map(node=>({...node,depth:depth.get(node.id)??0}))}function unavailableRuntimes(targets=[]){if(!targets.length||targets.some(target=>target.available))return[];return[...new Set(targets.flatMap(target=>target.runtimes||[]))]}var NOT_SCANNED_CODE=`vibe64_genesis_city_missing`;var NOT_IGNORED_TEXT=`Git does not ignore .genesis/call-web.json in this project, so the last scan could not read calls. Add /.genesis/call-web.json to the project's .gitignore, then refresh the architecture scan.`;function joinText(join=``,reason=``){if(join===`stale`)return`Changed since the last scan`;if(join===`none`&&reason===`not-ignored`)return`Calls not read: Git does not ignore the call web`;if(join===`none`&&reason===`language`)return`Calls not read in this file's language`;if(join===`none`)return`Not in the last scan`;return``}var _hoisted_1$10={class:`usage-entry-rail`,"aria-label":`Entry points`};var _hoisted_2$10={class:`usage-entry-rail__body`};var _hoisted_3$10={key:1,class:`pa-2`,"aria-busy":`true`,"aria-label":`Loading entry points`};var _hoisted_4$10={key:2,class:`usage-entry-rail__empty`,role:`status`};var _hoisted_5$10={key:0,class:`text-body-medium`};var _sfc_main$10={__name:`Vibe64UsageEntryRail`,props:{entries:{type:Array,default:()=>[]},kinds:{type:Array,default:()=>[]},search:{type:String,default:``},kind:{type:String,default:``},selectedId:{type:String,default:``},loading:{type:Boolean,default:false},error:{type:String,default:``},hasMore:{type:Boolean,default:false},refreshing:{type:Boolean,default:false}},emits:[`update:search`,`update:kind`,`select`,`more`,`retry`,`refresh`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const rows=computed(()=>props.hasMore?[...props.entries,{id:`\0more`,more:true}]:props.entries);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$10,[createVNode(VTextField,{"model-value":__props.search,class:`usage-entry-rail__search`,label:`Search entries`,"prepend-inner-icon":unref(mdiMagnify),variant:`outlined`,density:`comfortable`,maxlength:`80`,clearable:``,"hide-details":``,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>emit(`update:search`,$event||``))},null,8,[`model-value`,`prepend-inner-icon`]),__props.kinds.length?(openBlock(),createBlock(VChipGroup,{key:0,"model-value":__props.kind,class:`usage-entry-rail__kinds`,column:``,"selected-class":`usage-entry-rail__kind--selected`,"aria-label":`Entry kinds`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:kind`,$event||``))},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.kinds,item=>{return openBlock(),createBlock(VChip,{key:item.kind,value:item.kind,filter:``,variant:`outlined`,size:`small`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(entryKind)(item.kind).plural)+` · `+toDisplayString(item.count),1)]),_:2},1032,[`value`])}),128))]),_:1},8,[`model-value`])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$10,[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`ma-3`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[2]||(_cache[2]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.entries.length?(openBlock(),createElementBlock(`div`,_hoisted_3$10,[(openBlock(),createElementBlock(Fragment,null,renderList(6,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!__props.entries.length?(openBlock(),createElementBlock(`div`,_hoisted_4$10,[__props.search||__props.kind?(openBlock(),createElementBlock(`p`,_hoisted_5$10,`No entry points match.`)):(openBlock(),createElementBlock(Fragment,{key:1},[_cache[7]||(_cache[7]=createBaseVNode(`p`,{class:`text-body-medium`},`No entry points found yet. Refresh the architecture scan.`,-1)),createVNode(VBtn,{variant:`tonal`,loading:__props.refreshing,"prepend-icon":unref(mdiRefresh),onClick:_cache[3]||(_cache[3]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`,`prepend-icon`])],64))])):(openBlock(),createBlock(VVirtualScroll,{key:3,items:rows.value,"item-key":`id`,class:`usage-entry-rail__list`,role:`listbox`,"aria-label":`Entry points`},{default:withCtx(({item})=>[item.more?(openBlock(),createBlock(VBtn,{key:0,block:``,variant:`text`,class:`my-1`,loading:__props.loading,onClick:_cache[4]||(_cache[4]=$event=>emit(`more`))},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Show more`,-1)])]),_:1},8,[`loading`])):(openBlock(),createBlock(VListItem,{key:1,active:item.id===__props.selectedId,role:`option`,"aria-selected":item.id===__props.selectedId,"prepend-icon":unref(entryKind)(item.kind).icon,"aria-label":`${unref(entryKind)(item.kind).label}: ${item.title}, ${item.file}`,color:`primary`,rounded:`xl`,lines:`two`,class:`usage-entry-rail__item`,onClick:$event=>emit(`select`,item)},{title:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(item.title),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[9]||(_cache[9]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),subtitle:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(item.file),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[10]||(_cache[10]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),_:2},1032,[`active`,`aria-selected`,`prepend-icon`,`aria-label`,`onClick`]))]),_:1},8,[`items`]))])])}}};var Vibe64UsageEntryRail_default=_plugin_vue_export_helper_default(_sfc_main$10,[[`__scopeId`,`data-v-47c23b19`]]);var _hoisted_1$9=[`aria-label`];var _hoisted_2$9={class:`usage-panel__header`};var _hoisted_3$9={class:`usage-panel__heading`};var _hoisted_4$9={class:`text-title-medium`};var _hoisted_5$9={class:`text-body-small`};var _hoisted_6$8={class:`usage-panel__actions`};var _hoisted_7$7={key:0,class:`text-body-medium`};var _hoisted_8$7={key:0,class:`usage-panel__note text-body-small`,role:`note`};var _hoisted_9$7={key:1,class:`usage-panel__note text-body-medium`};var _hoisted_10$7={key:1,"aria-busy":`true`,"aria-label":`Loading calls`};var _hoisted_11$7={class:`usage-panel__note text-body-small`};var _hoisted_12$7=[`aria-label`];var _hoisted_13$6={class:`text-title-small`};var _hoisted_14$6={key:0,class:`usage-panel__ran`};var _hoisted_15$4={key:0};var _hoisted_16$4={key:0,class:`usage-panel__section`,"aria-label":`Unresolved calls`};var _hoisted_17$4={class:`text-title-small`};var _hoisted_18$4={key:1,class:`usage-panel__note text-body-medium`};var _hoisted_19$4={key:2,class:`usage-panel__note text-body-small`};var _sfc_main$9={__name:`Vibe64UsageFunctionPanel`,props:{node:{type:Object,required:true},detail:{type:Object,default:null},loading:{type:Boolean,default:false},error:{type:String,default:``},ran:{type:Map,default:null}},emits:[`close`,`select`,`open-source`,`retry`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const sections=computed(()=>{if(!props.detail)return[];const calls=props.detail.calls.map(row=>({...row,fn:row.target,site:props.detail.function.file}));const calledBy=props.detail.calledBy.map(row=>({...row,fn:row.source,site:row.source.file}));const renders=row=>row.method===`renders`;return[...callGroups(calls.filter(row=>!renders(row)),`Calls`),...callGroups(calls.filter(renders),`Renders`),...callGroups(calledBy.filter(row=>!renders(row)),`Called by`),...callGroups(calledBy.filter(renders),`Rendered by`)]});const ranText=computed(()=>{if(props.node.count===void 0)return``;return props.node.count==null?`Ran in this request`:`Ran ${props.node.count.toLocaleString()} ${props.node.count===1?`time`:`times`}`});const joinNote=computed(()=>{if(!props.node.join||props.node.join===`exact`)return``;if(props.node.join===`name-line`)return`Matched by name near this line: the file moved slightly since the scan.`;if(props.node.reason===`not-ignored`)return NOT_IGNORED_TEXT;if(props.node.reason===`language`)return`The scan reads calls only in the languages of the project's Stack components, and this file's language is not among them.`;return`${joinText(props.node.join)}. Refresh the architecture scan to see its calls.`});const importText=computed(()=>props.node.functionId||props.node.join?``:`Imports ${props.node.outCount} of the reached files · imported by ${props.node.inCount}`);const methodText=row=>callMethodText(row.method);const ranLabel=count=>count==null?`ran`:`ran ${count.toLocaleString()} ${count===1?`time`:`times`}`;function openAt(start,file=props.node.file){emit(`open-source`,{path:file,line:start?.line||1,column:start?.column||1})}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:`usage-panel`,"aria-label":`Details for ${__props.node.title}`},[createBaseVNode(`header`,_hoisted_2$9,[createBaseVNode(`div`,_hoisted_3$9,[createBaseVNode(`h3`,_hoisted_4$9,toDisplayString(__props.node.title),1),createBaseVNode(`p`,_hoisted_5$9,toDisplayString(__props.node.subtitle),1)]),createVNode(VBtn,{icon:unref(mdiClose),variant:`text`,size:`small`,"aria-label":`Close details`,onClick:_cache[0]||(_cache[0]=$event=>emit(`close`))},null,8,[`icon`])]),createBaseVNode(`div`,_hoisted_6$8,[createVNode(VBtn,{variant:`tonal`,"prepend-icon":unref(mdiCodeTags),onClick:_cache[1]||(_cache[1]=$event=>openAt(__props.node.start))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`Open source`,-1)])]),_:1},8,[`prepend-icon`]),ranText.value?(openBlock(),createElementBlock(`span`,_hoisted_7$7,toDisplayString(ranText.value),1)):createCommentVNode(``,true)]),joinNote.value?(openBlock(),createElementBlock(`p`,_hoisted_8$7,toDisplayString(joinNote.value),1)):createCommentVNode(``,true),importText.value?(openBlock(),createElementBlock(`p`,_hoisted_9$7,toDisplayString(importText.value),1)):createCommentVNode(``,true),__props.node.functionId?(openBlock(),createElementBlock(Fragment,{key:2},[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[2]||(_cache[2]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.detail?(openBlock(),createElementBlock(`div`,_hoisted_10$7,[createVNode(VSkeletonLoader,{type:`list-item-two-line, list-item-two-line, list-item-two-line`})])):__props.detail?(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`p`,_hoisted_11$7,toDisplayString(unref(coverageText)(__props.detail.function.coverage||``)),1),(openBlock(true),createElementBlock(Fragment,null,renderList(sections.value,group=>{return openBlock(),createElementBlock(`section`,{key:group.title,class:`usage-panel__section`,"aria-label":group.title},[createBaseVNode(`h4`,_hoisted_13$6,toDisplayString(group.title),1),createVNode(VList,{density:`compact`,class:`usage-panel__list`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(group.rows,(row,position)=>{return openBlock(),createBlock(VListItem,{key:position,rounded:`lg`,lines:`two`,onClick:$event=>emit(`select`,row.fn)},{append:withCtx(()=>[createVNode(VChip,{size:`x-small`,variant:row.certainty===`exact`?`tonal`:`outlined`,class:`mr-1`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(CERTAINTY_TEXT)[row.certainty]),1)]),_:2},1032,[`variant`]),row.start?(openBlock(),createBlock(VBtn,{key:0,icon:unref(mdiCodeTags),variant:`text`,size:`x-small`,"aria-label":`Open the ${row.method===`renders`?`tag`:`call`} at line ${row.start.line}`,onClick:withModifiers($event=>openAt(row.start,row.site),[`stop`])},null,8,[`icon`,`aria-label`,`onClick`])):createCommentVNode(``,true)]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(functionLabel)(row.fn)),1),__props.ran?.has(row.fn.id)?(openBlock(),createElementBlock(`span`,_hoisted_14$6,` · `+toDisplayString(ranLabel(__props.ran.get(row.fn.id))),1)):createCommentVNode(``,true)]),_:2},1024),createVNode(VListItemSubtitle,{class:`usage-panel__callee`},{default:withCtx(()=>[createBaseVNode(`code`,null,toDisplayString(row.callee),1),methodText(row)?(openBlock(),createElementBlock(`span`,_hoisted_15$4,` · `+toDisplayString(methodText(row)),1)):createCommentVNode(``,true)]),_:2},1024)]),_:2},1032,[`onClick`])}),128))]),_:2},1024)],8,_hoisted_12$7)}),128)),__props.detail.unresolved.length?(openBlock(),createElementBlock(`section`,_hoisted_16$4,[createBaseVNode(`h4`,_hoisted_17$4,`Unresolved (`+toDisplayString(__props.detail.totals.unresolved)+`)`,1),createVNode(VList,{density:`compact`,class:`usage-panel__list`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.detail.unresolved,(item,position)=>{return openBlock(),createBlock(VListItem,{key:position,rounded:`lg`,onClick:$event=>openAt(item.start)},{default:withCtx(()=>[createVNode(VListItemTitle,{class:`usage-panel__callee text-body-medium`},{default:withCtx(()=>[_cache[5]||(_cache[5]=createTextVNode(`Unresolved call: `,-1)),createBaseVNode(`code`,null,toDisplayString(item.callee),1)]),_:2},1024),createVNode(VListItemSubtitle,null,{default:withCtx(()=>[createTextVNode(`Line `+toDisplayString(item.start.line),1)]),_:2},1024)]),_:2},1032,[`onClick`])}),128))]),_:1})])):createCommentVNode(``,true),!sections.value.length&&!__props.detail.unresolved.length?(openBlock(),createElementBlock(`p`,_hoisted_18$4,`No calls in or out are known for this function.`)):createCommentVNode(``,true),__props.detail.truncated?(openBlock(),createElementBlock(`p`,_hoisted_19$4,`Each list shows its first `+toDisplayString(__props.detail.limits.list)+`.`,1)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],8,_hoisted_1$9)}}};var Vibe64UsageFunctionPanel_default=_plugin_vue_export_helper_default(_sfc_main$9,[[`__scopeId`,`data-v-7f48fcaa`]]);var _hoisted_1$8={class:`usage-recordings`,"aria-label":`Recordings`};var _hoisted_2$8={key:1,"aria-busy":`true`,"aria-label":`Loading recordings`};var _hoisted_3$8={key:2,class:`usage-recordings__empty`,role:`status`};var _hoisted_4$8={key:0,class:`text-body-medium`};var _hoisted_5$8={key:1,class:`text-body-medium`};var _hoisted_6$7={key:1,class:`usage-recordings__live text-body-small`,role:`status`};var _hoisted_7$6={key:3,class:`usage-recordings__live text-body-small`};var _hoisted_8$6={key:5,"aria-busy":`true`,"aria-label":`Loading requests`};var _hoisted_9$6={key:6,class:`usage-recordings__empty text-body-medium`,role:`status`};var _hoisted_10$6={class:`d-sr-only`};var _hoisted_11$6={key:8,class:`usage-recordings__footer`};var _hoisted_12$6={class:`text-body-small`};var _sfc_main$8={__name:`Vibe64UsageRecordingResults`,props:{recordings:{type:Array,default:()=>[]},recordingId:{type:String,default:``},requests:{type:Array,default:()=>[]},interactions:{type:Array,default:()=>[]},total:{type:Number,default:null},hasMore:{type:Boolean,default:false},newestFirst:{type:Boolean,default:false},requestId:{type:String,default:``},search:{type:String,default:``},includeEmpty:{type:Boolean,default:false},routes:{type:Array,default:()=>[]},unavailable:{type:Array,default:()=>[]},loading:{type:Boolean,default:false},requestsLoading:{type:Boolean,default:false},error:{type:String,default:``},sessionId:{type:String,default:``}},emits:[`update:recordingId`,`update:requestId`,`update:search`,`update:includeEmpty`,`more`,`retry`,`deleted`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const timeFormat=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`});const recordingItems=computed(()=>props.recordings.map(recording=>({value:recording.id,title:`${recording.target?.label||`Recording`} · ${recording.startedAt?timeFormat.format(new Date(recording.startedAt)):``} · ${countLabel(recording.counts?.requests,`request`)}${recording.state===`recording`?` · recording`:``}`})));const selectedRecording=computed(()=>props.recordings.find(recording=>recording.id===props.recordingId)||null);const groups=computed(()=>requestGroups(props.requests,props.interactions));const footerText=computed(()=>{if(!props.hasMore)return`Newest requests first`;const shown=props.total==null?`Showing ${countLabel(props.requests.length,`request`)}`:`Showing ${props.requests.length.toLocaleString()} of ${countLabel(Math.max(props.total,props.requests.length),`request`)}`;return props.newestFirst?`${shown}, newest first`:shown});const MARKS={background:{icon:mdiCogOutline,label:`Start-up`},readiness:{icon:mdiHeartPulse,label:`Readiness check`},run:{icon:mdiConsoleLine,label:`Command run`}};const markOf=request=>isBackgroundRequest(request)?MARKS.background:isReadinessRequest(request)?MARKS.readiness:/^run_/u.test(String(request.id))?MARKS.run:null;function subtitle(request){return[isBackgroundRequest(request)?onlyBackground(props.requests)?`Everything that ran while recording`:`Outside any request`:isReadinessRequest(request)?`Vibe64 checking that the launch started`:request.status,countLabel(request.fileCount,`file`),countLabel(request.functionCount,`function`)].filter(Boolean).join(` · `)}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$8,[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`mx-1`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[0]||(_cache[0]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.recordings.length?(openBlock(),createElementBlock(`div`,_hoisted_2$8,[(openBlock(),createElementBlock(Fragment,null,renderList(4,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!__props.recordings.length?(openBlock(),createElementBlock(`div`,_hoisted_3$8,[__props.unavailable.length?(openBlock(),createElementBlock(`p`,_hoisted_4$8,[_cache[7]||(_cache[7]=createTextVNode(` Recording not available for this project's runtimes (`,-1)),createBaseVNode(`code`,null,toDisplayString(__props.unavailable.join("`, `")),1),_cache[8]||(_cache[8]=createTextVNode(`). Imports and Calls still work. `,-1))])):(openBlock(),createElementBlock(`p`,_hoisted_5$8,`No recordings yet. Use Record to capture what runs, then pick a request here.`))])):(openBlock(),createElementBlock(Fragment,{key:3},[createVNode(VSelect,{"model-value":__props.recordingId,items:recordingItems.value,label:`Recording`,variant:`outlined`,density:`comfortable`,"hide-details":``,class:`usage-recordings__select`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:recordingId`,$event))},null,8,[`model-value`,`items`]),selectedRecording.value&&__props.sessionId?(openBlock(),createBlock(unref(Vibe64UsageRecordingSummary_default),{key:0,recording:selectedRecording.value,"session-id":__props.sessionId,onDeleted:_cache[2]||(_cache[2]=$event=>emit(`deleted`,$event))},null,8,[`recording`,`session-id`])):createCommentVNode(``,true),createVNode(VTextField,{"model-value":__props.search,label:`Search requests`,"prepend-inner-icon":unref(mdiMagnify),variant:`outlined`,density:`comfortable`,maxlength:`80`,clearable:``,"hide-details":``,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>emit(`update:search`,$event||``))},null,8,[`model-value`,`prepend-inner-icon`]),createVNode(VSwitch,{"model-value":__props.includeEmpty,color:`primary`,density:`compact`,inset:``,"hide-details":``,label:`Show requests that ran no project code`,class:`usage-recordings__switch`,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>emit(`update:includeEmpty`,Boolean($event)))},null,8,[`model-value`]),selectedRecording.value?.state===`recording`?(openBlock(),createElementBlock(`p`,_hoisted_6$7,`Recording now. New requests appear as they finish.`)):createCommentVNode(``,true),selectedRecording.value?.requestLog?.full?(openBlock(),createBlock(VAlert,{key:2,type:`warning`,variant:`tonal`,density:`compact`},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(` Request log full; later requests not recorded `,-1)])]),_:1})):createCommentVNode(``,true),__props.includeEmpty&&selectedRecording.value?.requestLog?.assets?(openBlock(),createElementBlock(`p`,_hoisted_7$6,toDisplayString(unref(countLabel)(selectedRecording.value.requestLog.assets,`script, style, image or font load`))+` counted, not listed. `,1)):createCommentVNode(``,true),selectedRecording.value?.target?.kind===`web`&&unref(onlyBackground)(__props.requests)?(openBlock(),createBlock(VAlert,{key:4,type:`info`,variant:`tonal`,density:`compact`,class:`usage-recordings__shared`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(BACKGROUND_TEXT))+`: its requests share one process, so this recording shows everything that ran while it recorded. `,1)]),_:1})):createCommentVNode(``,true),__props.requestsLoading&&!groups.value.length?(openBlock(),createElementBlock(`div`,_hoisted_8$6,[(openBlock(),createElementBlock(Fragment,null,renderList(4,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!groups.value.length?(openBlock(),createElementBlock(`p`,_hoisted_9$6,toDisplayString(__props.search?`No requests match.`:`No requests ran project code yet.`),1)):(openBlock(),createBlock(VList,{key:7,class:`usage-recordings__list`,density:`comfortable`,"aria-label":`Requests`,role:`listbox`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(groups.value,(group,position)=>{return openBlock(),createElementBlock(Fragment,{key:group.key},[group.interaction||position>0?(openBlock(),createBlock(VListSubheader,{key:0,class:`usage-recordings__interaction`},{default:withCtx(()=>[createTextVNode(toDisplayString(group.interaction?unref(interactionTitle)(group.interaction):`Other requests`),1)]),_:2},1024)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(group.requests,request=>{return openBlock(),createBlock(VListItem,{key:request.id,active:request.id===__props.requestId,role:`option`,"aria-selected":request.id===__props.requestId,color:`primary`,rounded:`xl`,lines:`two`,class:normalizeClass([`usage-recordings__request`,{"usage-recordings__request--secondary":unref(isReadinessRequest)(request)}]),onClick:$event=>emit(`update:requestId`,request.id)},{prepend:withCtx(()=>[createVNode(VChip,{size:`small`,variant:`tonal`,label:``,class:`usage-recordings__method`,title:markOf(request)?.label},{default:withCtx(()=>[markOf(request)?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(VIcon,{icon:markOf(request).icon,size:`small`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_10$6,toDisplayString(markOf(request).label),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(request.method||`–`),1)],64))]),_:2},1032,[`title`])]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(unref(requestTitle)(request,__props.routes,__props.requests)),(part,index)=>{return openBlock(),createElementBlock(Fragment,{key:index},[createTextVNode(toDisplayString(part),1),_cache[10]||(_cache[10]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),_:2},1024),createVNode(VListItemSubtitle,null,{default:withCtx(()=>[createTextVNode(toDisplayString(subtitle(request)),1)]),_:2},1024)]),_:2},1032,[`active`,`aria-selected`,`class`,`onClick`])}),128))],64)}),128))]),_:1})),groups.value.length&&(__props.hasMore||__props.newestFirst)?(openBlock(),createElementBlock(`div`,_hoisted_11$6,[createBaseVNode(`p`,_hoisted_12$6,toDisplayString(footerText.value),1),__props.hasMore?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,size:`small`,loading:__props.requestsLoading,onClick:_cache[5]||(_cache[5]=$event=>emit(`more`))},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(`Show more`,-1)])]),_:1},8,[`loading`])):createCommentVNode(``,true)])):createCommentVNode(``,true)],64))])}}};var Vibe64UsageRecordingResults_default=_plugin_vue_export_helper_default(_sfc_main$8,[[`__scopeId`,`data-v-839efb0c`]]);var _hoisted_1$7={key:0,class:`usage-web__empty text-body-medium`,role:`status`};var _hoisted_2$7=[`aria-label`];var _hoisted_3$7={key:0,class:`usage-web__group-title text-title-small`};var _hoisted_4$7={class:`usage-web__cards`};var _hoisted_5$7={key:0,class:`text-body-small`};var _hoisted_6$6={class:`usage-web__crossings`,"aria-label":`Crossings`};var _hoisted_7$5={class:`usage-web__zoom`};var _hoisted_8$5={class:`usage-web__zoom-title text-title-medium`};var _hoisted_9$5={key:0,class:`usage-web__legend`,"aria-label":`Legend`};var _hoisted_10$5={key:0,class:`usage-web__crossings`,"aria-label":`Leaving this subsystem`};var _hoisted_11$5={key:1,class:`usage-web__empty text-body-medium`,role:`status`};var _hoisted_12$5={class:`usage-web__row-path`};var _hoisted_13$5={class:`usage-web__row-counts`};var _hoisted_14$5={key:3,class:`usage-web__frame`};var _hoisted_15$3=[`width`,`height`];var _hoisted_16$3=[`id`];var _hoisted_17$3=[`d`,`marker-end`];var _hoisted_18$3=[`x1`,`y1`,`x2`,`y2`];var _hoisted_19$3=[`cx`,`cy`];var _hoisted_20$2=[`aria-pressed`,`aria-label`,`title`,`onClick`];var _hoisted_21$2={class:`usage-node__head`};var _hoisted_22$2={class:`usage-node__title text-body-medium`};var _hoisted_23$2={key:0,class:`usage-node__badge text-label-small`};var _hoisted_24$2={class:`usage-node__subtitle text-body-small`};var _hoisted_25$2={key:0,class:`usage-web__more`,"aria-hidden":`true`};var stubRoom=32;var _sfc_main$7={__name:`Vibe64UsageWebCanvas`,props:{mode:{type:String,required:true},subsystems:{type:Array,default:()=>[]},groups:{type:Array,default:()=>[]},crossings:{type:Array,default:()=>[]},zoomedId:{type:String,default:``},nodes:{type:Array,default:()=>[]},edges:{type:Array,default:()=>[]},selectedId:{type:String,default:``},showUntouched:{type:Boolean,default:false},compact:{type:Boolean,default:false},startSubsystemId:{type:String,default:``}},emits:[`zoom`,`select`,`update:showUntouched`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const countKey=computed(()=>COUNT_KEYS[props.mode]);const reached=item=>Number(item[countKey.value]||0)>0;const cardText=item=>subsystemCard(props.mode,item);const layout=computed(()=>subsystemSections(props.subsystems,props.groups,{countKey:countKey.value,showUntouched:props.showUntouched}));const zoomedTitle=computed(()=>props.subsystems.find(item=>item.id===props.zoomedId)?.title||props.zoomedId);const leaving=computed(()=>props.zoomedId?crossingsFrom(props.crossings,props.zoomedId,props.subsystems):[]);const emptyText=computed(()=>props.mode===`recording`?`This request ran no project code that the last scan knows.`:`Nothing is reached from this entry.`);const zoomEmptyText=computed(()=>props.mode===`imports`?`No files in this subsystem are reached.`:props.mode===`calls`?`No functions in this subsystem are reached.`:`No functions in this subsystem ran.`);const columns=computed(()=>depthColumns(props.nodes));const plan=computed(()=>canvasLayout(props.nodes,props.edges));const stubs=computed(()=>props.nodes.filter(node=>node.unresolved).map(node=>{const position=plan.value.positions.get(node.id);return{id:node.id,count:node.unresolved,x:position.x+NODE.width,y:position.y+NODE.height-12}}));const arrowId=`usage-arrow-${useId()}`;const scroller=ref(null);const moreRight=ref(false);function measureScroll(){const element=scroller.value;moreRight.value=Boolean(element)&&element.scrollLeft+element.clientWidth<element.scrollWidth-1}let resizeObserver=null;watch(scroller,element=>{resizeObserver?.disconnect();resizeObserver=element&&typeof ResizeObserver===`function`?new ResizeObserver(measureScroll):null;resizeObserver?.observe(element);measureScroll()},{flush:`post`});watch(plan,()=>nextTick(measureScroll));onBeforeUnmount(()=>resizeObserver?.disconnect());function nodeStyle(node){const position=plan.value.positions.get(node.id);return{left:`${position.x}px`,top:`${position.y}px`,width:`${NODE.width}px`,height:`${NODE.height}px`}}const SHORT_JOIN=Object.freeze({stale:`changed`,none:`not scanned`});function badge(node,full=false){if(props.mode===`recording`&&node.join!==`exact`&&node.join!==`name-line`)return full?joinText(node.join,node.reason):SHORT_JOIN[node.join]||``;if(props.mode===`recording`)return node.count==null?`ran`:`×${node.count.toLocaleString()}`;if(node.certainty===`probable`)return full?`only via probable calls`:`probable`;return``}function rowCounts(node){if(props.mode===`recording`)return badge(node,true);const[out,into]=props.mode===`imports`?[`imports`,`imported by`]:[`calls`,`called by`];return[badge(node,true),`${out} ${node.outCount} → · ${into} ${node.inCount} ←`,node.unresolved&&countLabel(node.unresolved,`unresolved call`)].filter(Boolean).join(` · `)}function nodeLabel(node){return[node.title,node.subtitle,props.mode===`recording`?badge(node,true):rowCounts(node)].filter(Boolean).join(`, `)}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,{class:normalizeClass([`usage-web`,{"usage-web--compact":__props.compact}])},[!__props.zoomedId?(openBlock(),createElementBlock(Fragment,{key:0},[!layout.value.sections.length?(openBlock(),createElementBlock(`p`,_hoisted_1$7,toDisplayString(emptyText.value),1)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(layout.value.sections,section=>{return openBlock(),createElementBlock(`section`,{key:section.id||`all`,class:`usage-web__group`,"aria-label":section.title||`Subsystems`},[section.title?(openBlock(),createElementBlock(`h3`,_hoisted_3$7,toDisplayString(section.title),1)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_4$7,[(openBlock(true),createElementBlock(Fragment,null,renderList(section.cards,card=>{return openBlock(),createBlock(VCard,{key:card.id,class:normalizeClass([`usage-web__card`,{"usage-web__card--untouched":!reached(card)}]),variant:`outlined`,rounded:`lg`,disabled:!reached(card),"aria-label":`${card.title}: ${cardText(card).count}`,onClick:$event=>emit(`zoom`,card.id)},{default:withCtx(()=>[createVNode(VCardItem,null,createSlots({default:withCtx(()=>[createVNode(VCardTitle,{class:`text-title-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(card.title),1)]),_:2},1024),createVNode(VCardSubtitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(cardText(card).count),1)]),_:2},1024)]),_:2},[card.id===__props.startSubsystemId?{name:`append`,fn:withCtx(()=>[_cache[2]||(_cache[2]=createBaseVNode(`span`,{class:`usage-web__start text-label-medium`},`Starts here`,-1))]),key:`0`}:void 0]),1024),cardText(card).detail||cardText(card).plumbing||unref(crossingsFrom)(__props.crossings,card.id,__props.subsystems).length?(openBlock(),createBlock(VCardText,{key:0,class:`usage-web__card-body`},{default:withCtx(()=>[cardText(card).detail?(openBlock(),createElementBlock(`p`,_hoisted_5$7,toDisplayString(cardText(card).detail),1)):createCommentVNode(``,true),cardText(card).plumbing?(openBlock(),createBlock(VChip,{key:1,size:`small`,variant:`tonal`,class:`usage-web__plumbing`},{default:withCtx(()=>[createTextVNode(`Shared plumbing (`+toDisplayString(cardText(card).plumbing)+`)`,1)]),_:2},1024)):createCommentVNode(``,true),createBaseVNode(`ul`,_hoisted_6$6,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(crossingsFrom)(__props.crossings,card.id,__props.subsystems),crossing=>{return openBlock(),createElementBlock(`li`,{key:crossing.toSubsystemId,class:`text-body-small`},` → `+toDisplayString(crossing.title)+` · `+toDisplayString(unref(crossingText)(__props.mode,crossing)),1)}),128))])]),_:2},1024)):createCommentVNode(``,true)]),_:2},1032,[`class`,`disabled`,`aria-label`,`onClick`])}),128))])],8,_hoisted_2$7)}),128)),layout.value.untouched?(openBlock(),createBlock(VChip,{key:1,class:`usage-web__untouched`,variant:__props.showUntouched?`tonal`:`outlined`,"prepend-icon":__props.showUntouched?unref(mdiCheck):void 0,role:`switch`,"aria-checked":__props.showUntouched,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:showUntouched`,!__props.showUntouched))},{default:withCtx(()=>[createTextVNode(` Show untouched (`+toDisplayString(layout.value.untouched)+`) `,1)]),_:1},8,[`variant`,`prepend-icon`,`aria-checked`])):createCommentVNode(``,true)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`header`,_hoisted_7$5,[createVNode(VBtn,{variant:`text`,"prepend-icon":unref(mdiArrowLeft),onClick:_cache[1]||(_cache[1]=$event=>emit(`zoom`,``))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`All subsystems`,-1)])]),_:1},8,[`prepend-icon`]),createBaseVNode(`h3`,_hoisted_8$5,toDisplayString(zoomedTitle.value),1),renderSlot(_ctx.$slots,`zoom-actions`,{},void 0,true),__props.mode!==`imports`&&!__props.compact?(openBlock(),createElementBlock(`div`,_hoisted_9$5,[createVNode(VChip,{size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createBaseVNode(`svg`,{width:`24`,height:`8`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`4`,x2:`24`,y2:`4`,class:`usage-web__line usage-web__line--exact`})],-1),createTextVNode(`Exact`,-1)])]),_:1}),createVNode(VChip,{size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createBaseVNode(`svg`,{width:`24`,height:`8`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`4`,x2:`24`,y2:`4`,class:`usage-web__line usage-web__line--probable`})],-1),createTextVNode(`Probable`,-1)])]),_:1}),__props.mode===`calls`?(openBlock(),createBlock(VChip,{key:0,size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createBaseVNode(`svg`,{width:`24`,height:`10`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`5`,x2:`14`,y2:`5`,class:`usage-web__line usage-web__line--probable`}),createBaseVNode(`circle`,{cx:`18`,cy:`5`,r:`4`,class:`usage-web__stub`})],-1),createTextVNode(`Unresolved`,-1)])]),_:1})):createCommentVNode(``,true)])):createCommentVNode(``,true)]),leaving.value.length?(openBlock(),createElementBlock(`ul`,_hoisted_10$5,[(openBlock(true),createElementBlock(Fragment,null,renderList(leaving.value,crossing=>{return openBlock(),createElementBlock(`li`,{key:crossing.toSubsystemId,class:`text-body-small`},`→ `+toDisplayString(crossing.title)+` · `+toDisplayString(unref(crossingText)(__props.mode,crossing)),1)}),128))])):createCommentVNode(``,true),!__props.nodes.length?(openBlock(),createElementBlock(`p`,_hoisted_11$5,toDisplayString(zoomEmptyText.value),1)):__props.compact?(openBlock(),createBlock(VList,{key:2,class:`usage-web__rows`,density:`comfortable`,"aria-label":`Reached in this subsystem`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(columns.value,column=>{return openBlock(),createElementBlock(Fragment,{key:column.depth},[createVNode(VListSubheader,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(depthTitle)(column.depth)),1)]),_:2},1024),(openBlock(true),createElementBlock(Fragment,null,renderList(column.items,node=>{return openBlock(),createBlock(VListItem,{key:node.id,active:node.id===__props.selectedId,color:`primary`,rounded:`lg`,lines:`three`,title:node.title,onClick:$event=>emit(`select`,node)},{subtitle:withCtx(()=>[createBaseVNode(`span`,_hoisted_12$5,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(node.subtitle),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[7]||(_cache[7]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),createBaseVNode(`span`,_hoisted_13$5,toDisplayString(rowCounts(node)),1)]),_:2},1032,[`active`,`title`,`onClick`])}),128))],64)}),128))]),_:1})):(openBlock(),createElementBlock(`div`,_hoisted_14$5,[createBaseVNode(`div`,{ref_key:`scroller`,ref:scroller,class:`usage-web__scroll`,onScrollPassive:measureScroll},[createBaseVNode(`div`,{class:`usage-web__plane`,style:normalizeStyle({width:`${plan.value.width+stubRoom}px`,height:`${plan.value.height}px`})},[(openBlock(),createElementBlock(`svg`,{class:`usage-web__edges`,width:plan.value.width+stubRoom,height:plan.value.height,"aria-hidden":`true`},[createBaseVNode(`defs`,null,[(openBlock(),createElementBlock(Fragment,null,renderList([`exact`,`probable`],certainty=>{return createBaseVNode(`marker`,{id:`${arrowId}-${certainty}`,key:certainty,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`},[createBaseVNode(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,class:normalizeClass(`usage-web__arrow usage-web__arrow--${certainty}`)},null,2)],8,_hoisted_16$3)}),64))]),(openBlock(true),createElementBlock(Fragment,null,renderList(plan.value.paths,edge=>{return openBlock(),createElementBlock(`path`,{key:edge.key,d:edge.d,"marker-end":`url(#${arrowId}-${edge.certainty===`probable`?`probable`:`exact`})`,class:normalizeClass([`usage-web__line`,[`usage-web__line--${edge.certainty||`exact`}`,{"usage-web__line--dim":__props.selectedId&&edge.from!==__props.selectedId&&edge.to!==__props.selectedId}]])},null,10,_hoisted_17$3)}),128)),(openBlock(true),createElementBlock(Fragment,null,renderList(stubs.value,stub=>{return openBlock(),createElementBlock(`g`,{key:stub.id},[createBaseVNode(`line`,{x1:stub.x,y1:stub.y,x2:stub.x+14,y2:stub.y,class:`usage-web__line usage-web__line--probable`},null,8,_hoisted_18$3),createBaseVNode(`circle`,{cx:stub.x+19,cy:stub.y,r:`5`,class:`usage-web__stub`},[createBaseVNode(`title`,null,toDisplayString(unref(countLabel)(stub.count,`unresolved call`)),1)],8,_hoisted_19$3)])}),128))],8,_hoisted_15$3)),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.nodes,node=>{return openBlock(),createElementBlock(`button`,{key:node.id,type:`button`,class:normalizeClass([`usage-node`,{"usage-node--selected":node.id===__props.selectedId,"usage-node--probable":node.certainty===`probable`,"usage-node--plumbing":node.plumbing}]),style:normalizeStyle(nodeStyle(node)),"aria-pressed":node.id===__props.selectedId,"aria-label":nodeLabel(node),title:[node.title,node.subtitle,badge(node,true)].filter(Boolean).join(`
|
|
2
2
|
`),onClick:$event=>emit(`select`,node)},[createBaseVNode(`span`,_hoisted_21$2,[createBaseVNode(`span`,_hoisted_22$2,toDisplayString(node.title),1),badge(node)?(openBlock(),createElementBlock(`span`,_hoisted_23$2,toDisplayString(badge(node)),1)):createCommentVNode(``,true)]),createBaseVNode(`span`,_hoisted_24$2,toDisplayString(node.location||node.subtitle),1)],14,_hoisted_20$2)}),128))],4)],544),moreRight.value?(openBlock(),createElementBlock(`div`,_hoisted_25$2)):createCommentVNode(``,true)]))],64))],2)}}};var Vibe64UsageWebCanvas_default=_plugin_vue_export_helper_default(_sfc_main$7,[[`__scopeId`,`data-v-c0f68aba`]]);var ENTRY_PAGE=100;var REQUEST_PAGE=200;var RECORDED_FUNCTIONS=1500;var ROUTE_PAGES=5;var segment=value=>encodeURIComponent(String(value||``).trim());function queryOf(values){return Object.fromEntries(Object.entries(values).filter(([,value])=>value!==void 0&&value!==null&&value!==``&&value!==false))}function latestRead(load){const data=shallowRef(null);const loading=ref(false);const error=ref(``);const errorCode=ref(``);let sequence=0;let controller=null;async function run(...args){const current=++sequence;controller?.abort();controller=typeof AbortController===`function`?new AbortController:null;loading.value=true;error.value=``;errorCode.value=``;try{const value=await load(controller?.signal,...args);if(current===sequence)data.value=value;return current===sequence?value:null}catch(failure){if(current===sequence){error.value=String(failure?.message||`The usage map could not be read.`);errorCode.value=String(failure?.code||``)}return null}finally{if(current===sequence)loading.value=false}}function reset(){sequence+=1;controller?.abort();data.value=null;loading.value=false;error.value=``;errorCode.value=``}return{data,loading,error,errorCode,run,reset}}var byId=rows=>new Set(rows.map(row=>row.id));var union=(first=[],second=[])=>{const ids=byId(first);return[...first,...second.filter(row=>!ids.has(row.id))]};function requestPages(load){const read=latestRead(load);const data=shallowRef(null);let filter=null;async function run(next){filter=next;const page=await read.run(next,null);if(page)data.value={...page,filterKey:JSON.stringify(next)};return page}async function more(){const shown=data.value;if(!shown?.nextCursor)return null;const page=await read.run(filter,shown.nextCursor);if(!page||data.value!==shown)return null;data.value={...shown,...page,requests:union(shown.requests,page.requests),interactions:union(shown.interactions,page.interactions)};return page}async function refresh(next){const shown=data.value;if(!shown||shown.filterKey!==JSON.stringify(next))return run(next);if(read.loading.value)return null;const page=await read.run(next,null);if(!page||data.value!==shown)return null;const reaches=!page.nextCursor||byId(shown.requests).has(page.requests.at(-1)?.id);data.value=!reaches?{...page,filterKey:shown.filterKey}:{...shown,...page,requests:union(page.requests,shown.requests),interactions:union(page.interactions,shown.interactions),nextCursor:shown.requests.length>page.requests.length?shown.nextCursor:page.nextCursor};return page}return{data,loading:read.loading,error:read.error,errorCode:read.errorCode,run,more,refresh}}function useVibe64UsageWeb({sessionId}){const paths=usePaths();const client=getHttpWebClient();const session=computed(()=>segment(unref(sessionId)));const usagePath=computed(()=>`${paths.api(SYSTEM_GRAPH_API_SUFFIX,{surface:`app`})}/sessions/${session.value}/usage`);const recordingPath=computed(()=>`${paths.api(USAGE_RECORDING_API_SUFFIX,{surface:`app`})}/sessions/${session.value}`);const get=(path,query,signal)=>client.request(path,{method:`GET`,query:queryOf(query),signal});const entryItems=shallowRef([]);const entryKinds=shallowRef([]);const entryCursor=ref(null);const snapshot=shallowRef(null);let entryFilter={};const entryRead=latestRead((signal,filter,cursor)=>get(`${usagePath.value}/entries`,{q:filter.q,kind:filter.kind,cursor,limit:ENTRY_PAGE},signal));async function searchEntries(filter={}){entryFilter={q:String(filter.q||``).trim().slice(0,80),kind:filter.kind||``};const page=await entryRead.run(entryFilter,null);if(!page)return null;entryItems.value=page.entries;entryKinds.value=page.kinds;entryCursor.value=page.nextCursor;snapshot.value=page.snapshot;return page}async function moreEntries(){if(!entryCursor.value)return null;const page=await entryRead.run(entryFilter,entryCursor.value);if(!page)return null;entryItems.value=[...entryItems.value,...page.entries];entryCursor.value=page.nextCursor;return page}const web=latestRead((signal,query)=>get(`${usagePath.value}/web`,query,signal));const detail=latestRead((signal,functionId)=>get(`${usagePath.value}/function`,{functionId},signal));const recordings=latestRead(signal=>get(recordingPath.value,{},signal));const targets=latestRead(signal=>get(`${recordingPath.value}/targets`,{},signal));const requests=requestPages((signal,{recordingId,q,includeEmpty,newestFirst},cursor)=>get(`${recordingPath.value}/${segment(recordingId)}/requests`,{q,includeEmpty:includeEmpty?`true`:``,order:newestFirst?`newest`:``,cursor,limit:REQUEST_PAGE},signal));const result=latestRead(async(signal,{recordingId,requestId})=>{const requestsPath=`${recordingPath.value}/${segment(recordingId)}/requests`;const[ran,named]=await Promise.all([get(`${requestsPath}/${segment(requestId)}/functions`,{limit:RECORDED_FUNCTIONS},signal),get(requestsPath,{requestId,limit:1},signal).catch(()=>null)]);const functions=ran.functions||[];const join=await client.request(`${usagePath.value}/join`,{method:`POST`,body:{functions:functions.map(({path,hash,name,start})=>({path,hash,name,start}))},signal});return{recordingId,requestId,functions,total:ran.total??functions.length,truncated:ran.truncated===true,join,request:named?.requests?.find(row=>row.id===requestId)||null,interactions:named?.interactions||[]}});const routes=shallowRef([]);async function loadRoutes(){const loaded=[];let cursor=null;for(let page=0;page<ROUTE_PAGES;page+=1){const answer=await get(`${usagePath.value}/entries`,{kind:`route`,cursor,limit:200}).catch(()=>null);if(!answer)break;loaded.push(...answer.entries);cursor=answer.nextCursor;if(!cursor)break}routes.value=loaded;return loaded}return{entries:{items:entryItems,kinds:entryKinds,hasMore:computed(()=>Boolean(entryCursor.value)),loading:entryRead.loading,error:entryRead.error,errorCode:entryRead.errorCode,search:searchEntries,more:moreEntries},snapshot,web,detail,recordings,targets,requests,result,routes,loadRoutes}}var _hoisted_1$6={key:0,class:`usage-view__rail`};var _hoisted_2$6={class:`usage-view__main`};var _hoisted_3$6={class:`usage-view__header`};var _hoisted_4$6={key:0,class:`usage-view__picker-row`};var _hoisted_5$6={key:1,class:`usage-view__title`};var _hoisted_6$5={key:0,class:`usage-view__click text-body-medium`};var _hoisted_7$4={class:`usage-view__controls`};var _hoisted_8$4={class:`usage-view__content`};var _hoisted_9$4={key:0,class:`usage-view__state`,role:`status`};var _hoisted_10$4={key:2,class:`usage-view__skeleton`,"aria-busy":`true`,"aria-label":`Loading usage`};var _hoisted_11$4={key:3,class:`usage-view__state`,role:`status`};var _hoisted_12$4={class:`text-body-medium`};var _hoisted_13$4={key:1,class:`usage-view__note text-body-small`};var _hoisted_14$4={key:2,class:`usage-view__note text-body-small`};var _hoisted_15$2={key:1,class:`usage-view__state`,role:`status`};var _hoisted_16$2={key:1,class:`text-body-medium`};var _hoisted_17$2={key:2,class:`usage-view__state`,role:`status`};var _hoisted_18$2={key:3,class:`usage-view__state`,role:`status`};var _hoisted_19$2={key:5,class:`usage-view__skeleton`,"aria-busy":`true`,"aria-label":`Loading what ran`};var COMPACT_WIDTH=600;var WIDE_WIDTH=1040;var GRAPH_WIDTH=888;var SEARCH_DELAY_MS=200;var LIVE_REFRESH_MS=5e3;var _sfc_main$6={__name:`Vibe64UsageView`,props:{active:{type:Boolean,default:true},sessionId:{type:String,required:true},state:{type:Object,required:true},findRequest:{type:Object,default:null},snapshotKey:{type:String,default:``},refreshing:{type:Boolean,default:false}},emits:[`update:state`,`refresh`,`open-source-file`,`select-preview`],setup(__props,{expose:__expose,emit:__emit}){const LIVE_STATES=new Set([`starting`,`recording`,`stopping`]);const props=__props;const emit=__emit;const usage=useVibe64UsageWeb({sessionId:toRef(props,`sessionId`)});const root=ref(null);const compact=ref(false);const wide=ref(true);const listCanvas=ref(false);const search=ref(``);const kind=ref(``);const exactOnly=ref(false);const maxNodes=ref(300);const showUntouched=ref(false);const showPlumbing=ref(false);const selected=shallowRef(null);const pickerOpen=ref(false);const recordOpen=ref(false);const requestSearch=ref(``);const includeEmpty=ref(false);const mode=computed(()=>props.state.mode||`calls`);const snapshot=computed(()=>usage.snapshot.value||usage.web.data.value?.snapshot||null);const recordings=computed(()=>usage.recordings.data.value?.recordings||[]);const unavailable=computed(()=>unavailableRuntimes(usage.targets.data.value?.targets||[]));const notScanned=computed(()=>[usage.entries,usage.web,usage.result].some(read=>read.errorCode.value===NOT_SCANNED_CODE));const noEntries=computed(()=>notScanned.value||!usage.entries.items.value.length&&!usage.entries.loading.value&&!usage.entries.error.value&&!search.value&&!kind.value&&Boolean(usage.snapshot.value));const busy=computed(()=>[usage.web,usage.result,usage.requests].some(read=>read.loading.value));function update(patch){emit(`update:state`,{...props.state,view:`usage`,...patch})}function setMode(value){if(!value||value===mode.value)return;update({mode:value,subsystem:``})}let searchTimer;let loadedKey=``;const loadEntries=()=>usage.entries.search({q:search.value,kind:kind.value});watch([search,kind],()=>{clearTimeout(searchTimer);searchTimer=setTimeout(loadEntries,SEARCH_DELAY_MS)});watch([()=>props.active,()=>props.sessionId,()=>props.snapshotKey],([active,sessionId,key])=>{if(!active||!sessionId||loadedKey===`${sessionId}\n${key}`)return;loadedKey=`${sessionId}\n${key}`;loadEntries()},{immediate:true});function selectEntry(entry){pickerOpen.value=false;if(entry.id!==props.state.entry)update({entry:entry.id,subsystem:``})}let handledFind=null;watch(()=>props.findRequest,async request=>{if(!request||request===handledFind||request.entryId)return;handledFind=request;search.value=String(request.q||``).slice(0,80);kind.value=request.kind||``;await nextTick();clearTimeout(searchTimer);const page=await loadEntries();if(page?.entries.length===1&&!page.nextCursor)selectEntry(page.entries[0]);else if(compact.value)pickerOpen.value=true},{immediate:true});const railBindings=computed(()=>({entries:usage.entries.items.value,kinds:usage.entries.kinds.value,search:search.value,kind:kind.value,selectedId:props.state.entry,loading:usage.entries.loading.value,error:notScanned.value?``:usage.entries.error.value,hasMore:usage.entries.hasMore.value,refreshing:props.refreshing}));const railHandlers={"update:search":value=>{search.value=value},"update:kind":value=>{kind.value=value},select:selectEntry,more:()=>usage.entries.more(),retry:loadEntries,refresh:()=>emit(`refresh`)};const webQuery=computed(()=>props.state.entry&&mode.value!==`recording`?{entryId:props.state.entry,mode:mode.value,certainty:mode.value===`calls`&&exactOnly.value?`exact`:void 0,subsystemId:props.state.subsystem||void 0,maxNodes:maxNodes.value===300?void 0:maxNodes.value}:null);let webKey=``;function loadWeb(force=false){const key=JSON.stringify([webQuery.value,props.sessionId,props.snapshotKey]);if(!props.active||!webQuery.value||!force&&key===webKey)return;webKey=key;usage.web.run(webQuery.value)}watch([()=>props.state.entry,mode,()=>props.state.subsystem],()=>{maxNodes.value=300;closePanel()});watch([()=>JSON.stringify(webQuery.value),()=>props.active,()=>props.sessionId,()=>props.snapshotKey],()=>loadWeb(),{immediate:true});const webData=computed(()=>usage.web.data.value);const webEntry=computed(()=>webData.value?.entry||{});let handledPick=null;let pickedEntry=``;watch([()=>props.findRequest,webEntry],([request,entry])=>{if(request?.entryId&&request!==handledPick){handledPick=request;pickedEntry=request.entryId}if(!pickedEntry||entry.id!==pickedEntry)return;pickedEntry=``;kind.value=``;search.value=String(entry.title||``).slice(0,80)},{immediate:true});const webFresh=computed(()=>Boolean(webData.value&&webData.value.entry.id===props.state.entry&&webData.value.mode===mode.value&&(mode.value!==`calls`||webData.value.certainty===(exactOnly.value?`exact`:`all`))));const recordingActive=computed(()=>props.active&&mode.value===`recording`);const selectedRecording=computed(()=>recordings.value.find(recording=>recording.id===props.state.recording)||null);async function loadRecordings(){await Promise.all([usage.recordings.run(),usage.targets.run(),usage.routes.value.length?null:usage.loadRoutes()])}let recordingsKey=``;watch([recordingActive,()=>props.sessionId,()=>props.snapshotKey],([on,sessionId,key])=>{if(!on||recordingsKey===`${sessionId}\n${key}`)return;recordingsKey=`${sessionId}\n${key}`;loadRecordings()},{immediate:true});watch(recordings,list=>{if(mode.value===`recording`&&list.length&&!list.some(recording=>recording.id===props.state.recording))update({recording:list[0].id,request:``,subsystem:``})});const live=computed(()=>LIVE_STATES.has(selectedRecording.value?.state));const newestFirst=ref(false);watch(()=>selectedRecording.value?.id,id=>{if(id)newestFirst.value=live.value},{immediate:true});let requestTimer;const requestFilter=()=>({recordingId:props.state.recording,q:requestSearch.value.trim(),includeEmpty:includeEmpty.value,newestFirst:newestFirst.value});const loadRequests=(read=`run`)=>recordingActive.value&&selectedRecording.value?usage.requests[read](requestFilter()):null;watch(requestSearch,()=>{clearTimeout(requestTimer);requestTimer=setTimeout(loadRequests,SEARCH_DELAY_MS)});watch([recordingActive,()=>selectedRecording.value?.id,includeEmpty,newestFirst,()=>props.snapshotKey],()=>{loadRequests()},{immediate:true});let resultKey=``;function loadResult(force=false){const{recording,request}=props.state;const key=JSON.stringify([recording,request,props.sessionId,props.snapshotKey]);if(!recordingActive.value||!recording||!request||!force&&key===resultKey)return;resultKey=key;usage.result.run({recordingId:recording,requestId:request})}watch([recordingActive,()=>props.state.recording,()=>props.state.request,()=>props.snapshotKey],()=>loadResult(),{immediate:true});watch(()=>props.state.request,()=>closePanel());watch(()=>recordingActive.value&&live.value,(following,wasFollowing,onCleanup)=>{if(!following){if(wasFollowing)loadRequests(`refresh`);return}const timer=setInterval(()=>{usage.recordings.run();loadRequests(`refresh`)},LIVE_REFRESH_MS);onCleanup(()=>clearInterval(timer))});const resultFresh=computed(()=>{const data=usage.result.data.value;return Boolean(data&&data.recordingId===props.state.recording&&data.requestId===props.state.request)});const recorded=computed(()=>resultFresh.value?recordingWeb(usage.result.data.value.functions,usage.result.data.value.join):null);const changedSinceRecording=computed(()=>{const recordedScan=selectedRecording.value?.sourceIdentity;const currentScan=resultFresh.value?usage.result.data.value.join?.snapshot?.sourceIdentity:null;return Boolean(recordedScan&¤tScan&&recordedScan!==currentScan)});const requestRows=computed(()=>usage.requests.data.value?.requests||[]);const requestTotal=computed(()=>usage.requests.data.value?.total??null);const resultRead=computed(()=>resultFresh.value?usage.result.data.value:null);const selectedRequest=computed(()=>requestRows.value.find(request=>request.id===props.state.request)||(resultRead.value?.request?.id===props.state.request?resultRead.value.request:null));const selectedInteraction=computed(()=>{const id=selectedRequest.value?.interaction;return id?[...usage.requests.data.value?.interactions||[],...resultRead.value?.interactions||[]].find(item=>item.id===id)||null:null});const recordingBindings=computed(()=>({sessionId:props.sessionId,recordings:recordings.value,recordingId:props.state.recording,requests:requestRows.value,interactions:usage.requests.data.value?.interactions||[],total:requestTotal.value,hasMore:Boolean(usage.requests.data.value?.nextCursor)&&(requestTotal.value==null||requestRows.value.length<requestTotal.value),newestFirst:newestFirst.value,requestId:props.state.request,search:requestSearch.value,includeEmpty:includeEmpty.value,routes:usage.routes.value,unavailable:unavailable.value,loading:usage.recordings.loading.value,requestsLoading:usage.requests.loading.value,error:usage.recordings.error.value||usage.requests.error.value}));const recordingHandlers={deleted:()=>{update({recording:``,request:``,subsystem:``});loadRecordings()},"update:recordingId":id=>update({recording:id,request:``,subsystem:``}),"update:requestId":id=>{pickerOpen.value=false;update({request:id,subsystem:``})},"update:search":value=>{requestSearch.value=value},"update:includeEmpty":value=>{includeEmpty.value=value},more:()=>usage.requests.more(),retry:()=>{loadRecordings();loadRequests()}};function recordingStarted(event={}){const id=event.recording?.id;if(id)update({mode:`recording`,recording:id,request:``,subsystem:``});recordingsKey=``;loadRecordings()}const inSubsystem=(items,subsystemId)=>(items||[]).filter(item=>item.subsystemId===subsystemId);const webView=computed(()=>{const zoomed=props.state.subsystem;if(mode.value===`recording`){const data=recorded.value;if(!data)return null;const inside=zoomed?inSubsystem(data.nodes,zoomed):[];return{subsystems:data.subsystems,groups:usage.result.data.value.join?.groups||[],crossings:data.crossings,nodes:webNodes(`recording`,{nodes:inside.filter(node=>showPlumbing.value||!node.plumbing),edges:data.edges}),edges:data.edges,plumbing:inside.filter(node=>node.plumbing).length}}const data=webFresh.value?webData.value:null;if(!data)return null;const scoped=zoomed?{...data,files:inSubsystem(data.files,zoomed),functions:inSubsystem(data.functions,zoomed)}:{};return{subsystems:data.subsystems,groups:data.groups,crossings:data.crossings,nodes:zoomed?webNodes(mode.value,scoped):[],edges:data.edges||[],plumbing:0}});const canvasBindings=computed(()=>({mode:mode.value,subsystems:webView.value?.subsystems||[],groups:webView.value?.groups||[],crossings:webView.value?.crossings||[],zoomedId:props.state.subsystem,nodes:webView.value?.nodes||[],edges:webView.value?.edges||[],selectedId:selected.value?.id||``,showUntouched:showUntouched.value,compact:compact.value||listCanvas.value,startSubsystemId:mode.value===`recording`?``:webEntry.value.subsystemId||``}));const canvasHandlers={zoom:subsystemId=>update({subsystem:subsystemId}),select:selectNode,"update:showUntouched":value=>{showUntouched.value=value}};function selectNode(node){selected.value=node;if(node.functionId)usage.detail.run(node.functionId);else usage.detail.reset()}function closePanel(){selected.value=null;usage.detail.reset()}function selectFunction(fn){selectNode((webView.value?.nodes||[]).find(node=>node.functionId===fn.id)||{id:fn.id,functionId:fn.id,title:functionLabel(fn),subtitle:`${fn.file}:${fn.start.line}`,file:fn.file,start:fn.start})}function openSource(location){emit(`open-source-file`,{...location,presentation:`code`,origin:`system`,systemContext:{usage:{...props.state,view:`usage`}}})}const ranCounts=computed(()=>mode.value===`recording`&&recorded.value?new Map(recorded.value.nodes.filter(node=>node.functionId).map(node=>[node.functionId,node.count])):null);const panelBindings=computed(()=>({node:selected.value,ran:ranCounts.value,detail:selected.value?.functionId&&usage.detail.data.value?.function?.id===selected.value.functionId?usage.detail.data.value:null,loading:usage.detail.loading.value,error:usage.detail.error.value}));const panelHandlers={close:closePanel,select:selectFunction,"open-source":openSource,retry:()=>selected.value&&selectNode(selected.value)};const chosen=computed(()=>Boolean(mode.value===`recording`?selectedRequest.value:props.state.entry));const pickerLabel=computed(()=>{if(mode.value===`recording`){const request=selectedRequest.value;if(!request)return`Choose a request`;return isBackgroundRequest(request)?`Request: ${requestTitle(request,[],requestRows.value)}`:`Request: ${[request.method,requestTitle(request,usage.routes.value)].filter(Boolean).join(` `)}`}const entry=usage.entries.items.value.find(item=>item.id===props.state.entry)||(webEntry.value.id===props.state.entry?webEntry.value:null);return entry?`Entry: ${entry.title}`:`Choose an entry`});let observer=null;watch(root,element=>{observer?.disconnect();if(!element||typeof ResizeObserver!==`function`)return;observer=new ResizeObserver(()=>{const width=element.clientWidth;if(!width)return;compact.value=width<=COMPACT_WIDTH;wide.value=width>=WIDE_WIDTH;listCanvas.value=width<GRAPH_WIDTH});observer.observe(element)},{flush:`post`});onBeforeUnmount(()=>{observer?.disconnect();clearTimeout(searchTimer);clearTimeout(requestTimer)});__expose({compact,selected,pickerOpen,search,kind,exactOnly});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{ref_key:`root`,ref:root,class:normalizeClass([`usage-view`,{"usage-view--compact":compact.value,"usage-view--panel":selected.value&&wide.value}]),"aria-label":`Usage`},[!compact.value?(openBlock(),createElementBlock(`aside`,_hoisted_1$6,[mode.value===`recording`?(openBlock(),createBlock(Vibe64UsageRecordingResults_default,mergeProps({key:0},recordingBindings.value,toHandlers(recordingHandlers)),null,16)):(openBlock(),createBlock(Vibe64UsageEntryRail_default,mergeProps({key:1},railBindings.value,toHandlers(railHandlers)),null,16))])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$6,[createBaseVNode(`header`,_hoisted_3$6,[compact.value?(openBlock(),createElementBlock(`div`,_hoisted_4$6,[createVNode(Vibe64UsageEntryPicker_default,{modelValue:pickerOpen.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>pickerOpen.value=$event),label:pickerLabel.value,title:mode.value===`recording`?`Requests`:`Entry points`},{default:withCtx(()=>[mode.value===`recording`?(openBlock(),createBlock(Vibe64UsageRecordingResults_default,mergeProps({key:0},recordingBindings.value,toHandlers(recordingHandlers)),null,16)):(openBlock(),createBlock(Vibe64UsageEntryRail_default,mergeProps({key:1},railBindings.value,toHandlers(railHandlers)),null,16))]),_:1},8,[`modelValue`,`label`,`title`]),createVNode(VBtn,{class:`usage-view__record usage-view__record--icon`,variant:`tonal`,color:`primary`,icon:unref(mdiRecordCircleOutline),"aria-label":`Record`,title:`Record`,onClick:_cache[1]||(_cache[1]=$event=>recordOpen.value=true)},null,8,[`icon`])])):createCommentVNode(``,true),!compact.value?(openBlock(),createElementBlock(`div`,_hoisted_5$6,[createBaseVNode(`h3`,{class:normalizeClass([`usage-view__entry text-title-medium`,{"usage-view__entry--none":!chosen.value}])},[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(pickerLabel.value),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[16]||(_cache[16]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))],2),chosen.value&&selectedInteraction.value?(openBlock(),createElementBlock(`p`,_hoisted_6$5,toDisplayString(unref(interactionTitle)(selectedInteraction.value)),1)):createCommentVNode(``,true)])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_7$4,[createVNode(VBtnToggle,{"model-value":mode.value,class:`usage-view__modes`,mandatory:``,divided:``,rounded:`pill`,color:`primary`,variant:`outlined`,density:`comfortable`,role:`group`,"aria-label":`Usage mode`,"onUpdate:modelValue":setMode},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(USAGE_MODES),item=>{return openBlock(),createBlock(VBtn,{key:item.value,value:item.value},{default:withCtx(()=>[createTextVNode(toDisplayString(item.title),1)]),_:2},1032,[`value`])}),128))]),_:1},8,[`model-value`]),mode.value===`calls`?(openBlock(),createBlock(VChip,{key:0,variant:exactOnly.value?`tonal`:`outlined`,"prepend-icon":exactOnly.value?unref(mdiCheck):void 0,role:`switch`,"aria-checked":exactOnly.value,onClick:_cache[2]||(_cache[2]=$event=>exactOnly.value=!exactOnly.value)},{default:withCtx(()=>[..._cache[17]||(_cache[17]=[createTextVNode(` Exact only `,-1)])]),_:1},8,[`variant`,`prepend-icon`,`aria-checked`])):createCommentVNode(``,true),!compact.value?(openBlock(),createBlock(VBtn,{key:1,class:`usage-view__record`,variant:`tonal`,color:`primary`,"prepend-icon":unref(mdiRecordCircleOutline),title:`Record`,onClick:_cache[3]||(_cache[3]=$event=>recordOpen.value=true)},{default:withCtx(()=>[..._cache[18]||(_cache[18]=[createBaseVNode(`span`,{class:`usage-view__record-label`},`Record`,-1)])]),_:1},8,[`prepend-icon`])):createCommentVNode(``,true)])]),createVNode(VProgressLinear,{active:busy.value,indeterminate:``,color:`primary`,height:`2`,class:`usage-view__progress`},null,8,[`active`]),createBaseVNode(`div`,_hoisted_8$4,[snapshot.value?.stale?(openBlock(),createBlock(VAlert,{key:0,type:`info`,variant:`tonal`,density:`compact`,class:`usage-view__banner`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,loading:__props.refreshing,onClick:_cache[4]||(_cache[4]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[19]||(_cache[19]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`])]),default:withCtx(()=>[_cache[20]||(_cache[20]=createTextVNode(` Source changed since the last scan `,-1))]),_:1})):createCommentVNode(``,true),mode.value!==`recording`?(openBlock(),createElementBlock(Fragment,{key:1},[!__props.state.entry||notScanned.value?(openBlock(),createElementBlock(`div`,_hoisted_9$4,[noEntries.value?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[22]||(_cache[22]=createBaseVNode(`h3`,{class:`text-title-medium`},`No entry points found yet`,-1)),_cache[23]||(_cache[23]=createBaseVNode(`p`,{class:`text-body-medium`},`No entry points found yet. Refresh the architecture scan.`,-1)),createVNode(VBtn,{variant:`tonal`,loading:__props.refreshing,"prepend-icon":unref(mdiRefresh),onClick:_cache[5]||(_cache[5]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[21]||(_cache[21]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`,`prepend-icon`])],64)):(openBlock(),createElementBlock(Fragment,{key:1},[_cache[24]||(_cache[24]=createBaseVNode(`h3`,{class:`text-title-medium`},`Pick an entry point`,-1)),_cache[25]||(_cache[25]=createBaseVNode(`p`,{class:`text-body-medium`},`Choose a page, component, route, command or library export to see only what it reaches.`,-1))],64))])):unref(usage).web.error.value?(openBlock(),createBlock(VAlert,{key:1,type:`error`,variant:`tonal`,class:`usage-view__banner`},{append:withCtx(()=>[unref(usage).web.errorCode.value===`vibe64_usage_entry_not_found`?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,size:`small`,onClick:_cache[6]||(_cache[6]=$event=>update({entry:``,subsystem:``}))},{default:withCtx(()=>[..._cache[26]||(_cache[26]=[createTextVNode(`Choose another`,-1)])]),_:1})):(openBlock(),createBlock(VBtn,{key:1,variant:`text`,size:`small`,onClick:_cache[7]||(_cache[7]=$event=>loadWeb(true))},{default:withCtx(()=>[..._cache[27]||(_cache[27]=[createTextVNode(`Retry`,-1)])]),_:1}))]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(usage).web.errorCode.value===`vibe64_usage_entry_not_found`?`This entry point is not in the current scan.`:unref(usage).web.error.value)+` `,1)]),_:1})):!webFresh.value?(openBlock(),createElementBlock(`div`,_hoisted_10$4,[(openBlock(),createElementBlock(Fragment,null,renderList(4,card=>{return createVNode(VSkeletonLoader,{key:card,type:`card`,class:`usage-view__skeleton-card`})}),64))])):mode.value===`calls`&&!webEntry.value.hasCalls?(openBlock(),createElementBlock(`div`,_hoisted_11$4,[_cache[29]||(_cache[29]=createBaseVNode(`h3`,{class:`text-title-medium`},`Calls are not available here`,-1)),createBaseVNode(`p`,_hoisted_12$4,toDisplayString(snapshot.value?.callWebIdentity?`No functions are known for this entry.`:snapshot.value?.callWebProblem===`not-ignored`?unref(NOT_IGNORED_TEXT):`The last scan did not read calls for this project.`)+` Imports still shows the files it reaches.`,1),createVNode(VBtn,{variant:`tonal`,onClick:_cache[8]||(_cache[8]=$event=>setMode(`imports`))},{default:withCtx(()=>[..._cache[28]||(_cache[28]=[createTextVNode(`Show Imports`,-1)])]),_:1})])):(openBlock(),createElementBlock(Fragment,{key:4},[webData.value.truncated?(openBlock(),createBlock(VAlert,{key:0,type:`warning`,variant:`tonal`,density:`compact`,class:`usage-view__banner`},createSlots({default:withCtx(()=>[createTextVNode(` Showing the first `+toDisplayString(webData.value.limits.maxNodes.toLocaleString())+toDisplayString(maxNodes.value<unref(1e3)?``:`. Zoom into a subsystem to see the rest`)+` `,1)]),_:2},[maxNodes.value<unref(1e3)?{name:`append`,fn:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[9]||(_cache[9]=$event=>maxNodes.value=unref(1e3))},{default:withCtx(()=>[..._cache[30]||(_cache[30]=[createTextVNode(`Show more`,-1)])]),_:1})]),key:`0`}:void 0]),1024)):createCommentVNode(``,true),createVNode(Vibe64UsageWebCanvas_default,mergeProps(canvasBindings.value,toHandlers(canvasHandlers)),null,16),mode.value===`calls`&&__props.state.subsystem&&webData.value.unresolvedTotal>webData.value.unresolved.length?(openBlock(),createElementBlock(`p`,_hoisted_13$4,` Showing `+toDisplayString(webData.value.unresolved.length)+` of `+toDisplayString(webData.value.unresolvedTotal.toLocaleString())+` unresolved calls. `,1)):createCommentVNode(``,true),mode.value===`imports`&&webData.value.unresolvedImports?(openBlock(),createElementBlock(`p`,_hoisted_14$4,toDisplayString(unref(countLabel)(webData.value.unresolvedImports,`import`))+` could not be resolved to a project file. `,1)):createCommentVNode(``,true)],64))],64)):(openBlock(),createElementBlock(Fragment,{key:2},[unref(usage).recordings.error.value?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,class:`usage-view__banner`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:loadRecordings},{default:withCtx(()=>[..._cache[31]||(_cache[31]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(usage).recordings.error.value)+` `,1)]),_:1})):!recordings.value.length?(openBlock(),createElementBlock(`div`,_hoisted_15$2,[unref(usage).recordings.loading.value||!unref(usage).recordings.data.value?(openBlock(),createBlock(VSkeletonLoader,{key:0,type:`paragraph`})):unavailable.value.length?(openBlock(),createElementBlock(`p`,_hoisted_16$2,[_cache[32]||(_cache[32]=createTextVNode(` Recording not available for this project's runtimes (`,-1)),createBaseVNode(`code`,null,toDisplayString(unavailable.value.join("`, `")),1),_cache[33]||(_cache[33]=createTextVNode(`). Imports and Calls still work. `,-1))])):(openBlock(),createElementBlock(Fragment,{key:2},[_cache[34]||(_cache[34]=createBaseVNode(`h3`,{class:`text-title-medium`},`No recordings yet`,-1)),_cache[35]||(_cache[35]=createBaseVNode(`p`,{class:`text-body-medium`},`Record what runs, use the app or command, then pick a request to see only the code it ran.`,-1))],64))])):!__props.state.request?(openBlock(),createElementBlock(`div`,_hoisted_17$2,[..._cache[36]||(_cache[36]=[createBaseVNode(`h3`,{class:`text-title-medium`},`Pick a request`,-1),createBaseVNode(`p`,{class:`text-body-medium`},`Each request shows the subsystems and functions that ran for it.`,-1)])])):notScanned.value?(openBlock(),createElementBlock(`div`,_hoisted_18$2,[_cache[38]||(_cache[38]=createBaseVNode(`h3`,{class:`text-title-medium`},`Not scanned yet`,-1)),_cache[39]||(_cache[39]=createBaseVNode(`p`,{class:`text-body-medium`},`Refresh the architecture scan to see the subsystems and functions this request ran.`,-1)),createVNode(VBtn,{variant:`tonal`,loading:__props.refreshing,"prepend-icon":unref(mdiRefresh),onClick:_cache[10]||(_cache[10]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[37]||(_cache[37]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`,`prepend-icon`])])):unref(usage).result.error.value?(openBlock(),createBlock(VAlert,{key:4,type:`error`,variant:`tonal`,class:`usage-view__banner`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[11]||(_cache[11]=$event=>loadResult(true))},{default:withCtx(()=>[..._cache[40]||(_cache[40]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(usage).result.error.value)+` `,1)]),_:1})):!resultFresh.value?(openBlock(),createElementBlock(`div`,_hoisted_19$2,[(openBlock(),createElementBlock(Fragment,null,renderList(4,card=>{return createVNode(VSkeletonLoader,{key:card,type:`card`,class:`usage-view__skeleton-card`})}),64))])):(openBlock(),createElementBlock(Fragment,{key:6},[changedSinceRecording.value?(openBlock(),createBlock(VAlert,{key:0,type:`info`,variant:`tonal`,density:`compact`,class:`usage-view__banner`},{default:withCtx(()=>[..._cache[41]||(_cache[41]=[createTextVNode(` Source changed since this recording `,-1)])]),_:1})):createCommentVNode(``,true),unref(usage).result.data.value.truncated?(openBlock(),createBlock(VAlert,{key:1,type:`warning`,variant:`tonal`,density:`compact`,class:`usage-view__banner`},{default:withCtx(()=>[createTextVNode(` Showing the first `+toDisplayString(unref(usage).result.data.value.functions.length.toLocaleString())+` of `+toDisplayString(unref(usage).result.data.value.total.toLocaleString())+` functions that ran. `,1)]),_:1})):createCommentVNode(``,true),createVNode(Vibe64UsageWebCanvas_default,mergeProps(canvasBindings.value,toHandlers(canvasHandlers)),{"zoom-actions":withCtx(()=>[webView.value.plumbing?(openBlock(),createBlock(VChip,{key:0,size:`small`,variant:showPlumbing.value?`tonal`:`outlined`,"prepend-icon":showPlumbing.value?unref(mdiCheck):void 0,role:`switch`,"aria-checked":showPlumbing.value,onClick:_cache[12]||(_cache[12]=$event=>showPlumbing.value=!showPlumbing.value)},{default:withCtx(()=>[createTextVNode(` Show shared plumbing (`+toDisplayString(webView.value.plumbing)+`) `,1)]),_:1},8,[`variant`,`prepend-icon`,`aria-checked`])):createCommentVNode(``,true)]),_:1},16)],64))],64))])]),selected.value&&!compact.value&&!wide.value?(openBlock(),createElementBlock(`div`,{key:1,class:`usage-view__scrim`,"aria-hidden":`true`,onClick:closePanel})):createCommentVNode(``,true),selected.value&&!compact.value?(openBlock(),createElementBlock(`aside`,{key:2,class:normalizeClass([`usage-view__panel`,{"usage-view__panel--floating":!wide.value}])},[createVNode(Vibe64UsageFunctionPanel_default,mergeProps(panelBindings.value,toHandlers(panelHandlers)),null,16)],2)):createCommentVNode(``,true),compact.value?(openBlock(),createBlock(VBottomSheet,{key:3,"model-value":Boolean(selected.value),scrollable:``,"onUpdate:modelValue":_cache[13]||(_cache[13]=$event=>!$event&&closePanel())},{default:withCtx(()=>[selected.value?(openBlock(),createBlock(VCard,{key:0,class:`usage-view__sheet`},{default:withCtx(()=>[createVNode(Vibe64UsageFunctionPanel_default,mergeProps(panelBindings.value,toHandlers(panelHandlers)),null,16)]),_:1})):createCommentVNode(``,true)]),_:1},8,[`model-value`])):createCommentVNode(``,true),createVNode(unref(Vibe64UsageRecordDialog_default),{modelValue:recordOpen.value,"onUpdate:modelValue":_cache[14]||(_cache[14]=$event=>recordOpen.value=$event),"session-id":__props.sessionId,onStarted:recordingStarted,onSelectPreview:_cache[15]||(_cache[15]=$event=>emit(`select-preview`))},null,8,[`modelValue`,`session-id`])],2)}}};var Vibe64UsageView_default=_plugin_vue_export_helper_default(_sfc_main$6,[[`__scopeId`,`data-v-9d291ab3`]]);function useVibe64UsageState({props,architecture,onMapShown}){const route=useRoute();const router=useRouter();const usageState=ref(usageStateFromQuery(route?.query));const usageMounted=ref(usageState.value.view===`usage`);const usageFind=shallowRef(null);const usageSnapshotKey=computed(()=>[architecture.value?.sourceHash,architecture.value?.callWeb?.identity].filter(Boolean).join(`:`));const onSystemRoute=computed(()=>props.active&&/\/dashboard\/system\/?$/u.test(route?.path||``));watch(()=>usageState.value.view,view=>{if(view===`usage`)usageMounted.value=true;else onMapShown()});watch([usageState,onSystemRoute],([state,onRoute])=>{if(!onRoute||!router)return;const query=usageQueryFor(route.query,state);if(!sameQuery(query,route.query))router.replace({query})},{immediate:true});watch(()=>route?.query,query=>{if(!onSystemRoute.value||!query?.view)return;const next=usageStateFromQuery(query);if(!sameUsageState(next,usageState.value))usageState.value=next});let handledUsageOpen=null;watch(()=>props.usageOpenRequest,request=>{if(!request||request===handledUsageOpen)return;handledUsageOpen=request;usageState.value=usageStateFromQuery({view:`usage`,mode:request.mode||`recording`,entry:request.entryId,recording:request.recordingId,request:request.requestId});if(request.entryId&&usageState.value.mode!==`recording`)usageFind.value={entryId:request.entryId}},{immediate:true});let handledRestore=null;watch(()=>props.restoreRequest,request=>{if(!request?.usage||request===handledRestore)return;handledRestore=request;usageState.value=usageStateFromQuery({...request.usage,view:`usage`})},{immediate:true});return{usageState,usageMounted,usageFind,usageSnapshotKey}}var _hoisted_1$5=[`open`,`onToggle`];var _hoisted_2$5={class:`subsystem-tree__folder`,viewBox:`0 0 24 24`,"aria-hidden":`true`};var _hoisted_3$5=[`d`];var _hoisted_4$5=[`data-file-path`,`aria-pressed`,`title`,`onClick`,`onKeydown`];var _hoisted_5$5={class:`subsystem-tree__type`,"aria-hidden":`true`};var _hoisted_6$4=[`d`];var _hoisted_7$3={class:`subsystem-tree__name`};var _hoisted_8$3=[`title`];var _hoisted_9$3={viewBox:`0 0 24 24`,"aria-hidden":`true`};var _hoisted_10$3=[`d`];var _hoisted_11$3=[`title`];var _hoisted_12$3=[`title`];var _hoisted_13$3=[`title`];var _hoisted_14$3={key:0,class:`subsystem-tree__bar`};var _sfc_main$5={__name:`Vibe64SubsystemTreeBranch`,props:{items:{type:Array,required:true},depth:{type:Number,default:0},selectedId:{type:String,default:``},searching:Boolean,folderState:{type:Map,default:()=>new Map}},emits:[`select`,`inspect`],setup(__props){const icons=[[[`js`,`mjs`,`cjs`,`jsx`],mdiLanguageJavascript,`#aa8215`],[[`ts`,`tsx`,`mts`,`cts`],mdiLanguageTypescript,`#397fc3`],[[`vue`],mdiVuejs,`#38866c`],[[`py`,`pyi`],mdiLanguagePython,`#3e79a1`],[[`rs`],mdiLanguageRust,`#936344`],[[`go`],mdiLanguageGo,`#298998`],[[`java`],mdiLanguageJava,`#bc674d`],[[`kt`,`kts`],mdiLanguageKotlin,`#8163b0`],[[`cs`],mdiLanguageCsharp,`#7760ac`],[[`c`,`h`,`cc`,`cpp`,`hpp`],mdiLanguageCpp,`#4b7aaa`],[[`rb`],mdiLanguageRuby,`#b75757`],[[`php`],mdiLanguagePhp,`#7a72a6`],[[`css`,`scss`,`sass`,`less`],mdiLanguageCss3,`#4f86bc`],[[`html`,`htm`],mdiLanguageHtml5,`#bd7050`],[[`json`,`jsonc`],mdiCodeJson,`#938140`],[[`yaml`,`yml`,`toml`,`ini`,`conf`],mdiFileCogOutline,`#7b8190`],[[`sh`,`bash`,`zsh`,`ps1`],mdiConsoleLine,`#698171`],[[`png`,`jpg`,`jpeg`,`webp`,`gif`,`svg`,`ico`],mdiFileImageOutline,`#9a74a3`],[[`csv`,`tsv`,`sql`],mdiFileTableOutline,`#408b89`],[[`md`,`txt`,`rst`],mdiFileDocumentOutline,`#6d8592`]];function icon(name){const extension=name.includes(`.`)?name.split(`.`).at(-1).toLowerCase():``;const match=icons.find(([extensions])=>extensions.includes(extension));return match?{path:match[1],color:match[2]}:{path:mdiFileCodeOutline,color:`#698b80`}}return(_ctx,_cache)=>{const _component_Vibe64SubsystemTreeBranch=resolveComponent(`Vibe64SubsystemTreeBranch`,true);return openBlock(),createElementBlock(`ul`,{class:normalizeClass([`subsystem-tree`,{"subsystem-tree--branch":__props.depth>0}])},[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.items,item=>{return openBlock(),createElementBlock(`li`,{key:item.path||item.id,class:normalizeClass({"subsystem-tree__directory":item.kind===`directory`})},[item.kind===`directory`?(openBlock(),createElementBlock(`details`,{key:0,open:__props.searching||(__props.folderState.get(item.path)??__props.depth<1),onToggle:$event=>!__props.searching&&__props.folderState.set(item.path,$event.target.open)},[createBaseVNode(`summary`,null,[(openBlock(),createElementBlock(`svg`,_hoisted_2$5,[createBaseVNode(`path`,{d:unref(mdiFolderOutline)},null,8,_hoisted_3$5)])),createBaseVNode(`span`,null,toDisplayString(item.name),1),createBaseVNode(`small`,null,toDisplayString(item.count)+` file`+toDisplayString(item.count===1?``:`s`),1)]),createVNode(_component_Vibe64SubsystemTreeBranch,{items:item.children,"folder-state":__props.folderState,depth:__props.depth+1,searching:__props.searching,"selected-id":__props.selectedId,onSelect:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`select`,$event)),onInspect:_cache[1]||(_cache[1]=$event=>_ctx.$emit(`inspect`,$event))},null,8,[`items`,`folder-state`,`depth`,`searching`,`selected-id`])],40,_hoisted_1$5)):(openBlock(),createElementBlock(`button`,{key:1,type:`button`,class:normalizeClass([`subsystem-tree__file nodrag nopan`,{"subsystem-tree__file--selected":__props.selectedId===item.id,"subsystem-tree__file--main":item.programs?.some(program=>program.mainSource===item.file.path)}]),"data-zoom-kind":`file`,"data-file-path":item.file.path,"aria-pressed":__props.selectedId===item.id,style:normalizeStyle({"--file-volume":item.volume??0}),title:`${item.file.path}\n${item.reasons.join(` · `)}\nClick to open this file's interface.`,onClick:$event=>{_ctx.$emit(`select`,item.file);_ctx.$emit(`inspect`,item.file)},onKeydown:withKeys(withModifiers($event=>{_ctx.$emit(`select`,item.file);_ctx.$emit(`inspect`,item.file)},[`stop`,`prevent`]),[`enter`])},[createBaseVNode(`span`,_hoisted_5$5,[(openBlock(),createElementBlock(`svg`,{class:`subsystem-tree__document`,viewBox:`0 0 24 24`,style:normalizeStyle({color:icon(item.name).color})},[createBaseVNode(`path`,{d:icon(item.name).path},null,8,_hoisted_6$4)],4)),createBaseVNode(`small`,null,toDisplayString(item.name.includes(`.`)?item.name.split(`.`).at(-1):`file`),1)]),createBaseVNode(`span`,_hoisted_7$3,toDisplayString(item.name),1),(openBlock(true),createElementBlock(Fragment,null,renderList(item.programs?.filter(program=>program.mainSource===item.file.path),program=>{return openBlock(),createElementBlock(`span`,{key:program.id,class:`subsystem-tree__program subsystem-tree__program--main`,title:program.title},[(openBlock(),createElementBlock(`svg`,_hoisted_9$3,[createBaseVNode(`path`,{d:unref(mdiStarOutline)},null,8,_hoisted_10$3)])),createTextVNode(` Main · `+toDisplayString(program.title),1)],8,_hoisted_8$3)}),128)),item.programs?.some(program=>program.mainSource!==item.file.path)?(openBlock(),createElementBlock(`span`,{key:0,class:`subsystem-tree__program`,title:item.programs.filter(program=>program.mainSource!==item.file.path).map(program=>program.title).join(`
|
|
3
3
|
`)},`Part of · `+toDisplayString(item.programs.filter(program=>program.mainSource!==item.file.path).length===1?item.programs.find(program=>program.mainSource!==item.file.path).title:`${item.programs.filter(program=>program.mainSource!==item.file.path).length} Programs`),9,_hoisted_11$3)):createCommentVNode(``,true),item.reasons.length?(openBlock(),createElementBlock(`span`,{key:1,class:`subsystem-tree__entry`,title:item.reasons.join(` · `)},`Entry`,8,_hoisted_12$3)):createCommentVNode(``,true),createBaseVNode(`span`,{class:`subsystem-tree__volume`,title:item.volume==null?`Size unavailable`:`${item.file.sourceLines.toLocaleString()} source lines; bar relative to other files in this subsystem.`},[item.volume!=null?(openBlock(),createElementBlock(`span`,_hoisted_14$3,[createBaseVNode(`i`,{style:normalizeStyle({width:`${item.volume*100}%`})},null,4)])):createCommentVNode(``,true),createBaseVNode(`small`,null,toDisplayString(item.volume==null?`—`:item.file.sourceLines.toLocaleString()),1)],8,_hoisted_13$3)],46,_hoisted_4$5))],2)}),128))],2)}}};var Vibe64SubsystemTreeBranch_default=_plugin_vue_export_helper_default(_sfc_main$5,[[`__scopeId`,`data-v-e685eb18`]]);var _hoisted_1$4=[`aria-label`];var _hoisted_2$4={class:`subsystem-inspector__header`};var _hoisted_3$4={key:0,class:`subsystem-inspector__navigation nodrag nopan`,"aria-label":`In this subsystem`};var _hoisted_4$4={class:`subsystem-inspector__body`};var _hoisted_5$4={class:`subsystem-inspector__summary`};var _hoisted_6$3={key:0,class:`subsystem-inspector__description`};var _hoisted_7$2={key:1,class:`subsystem-inspector__hint`};var _hoisted_8$2={key:0,class:`subsystem-inspector__coverage`,role:`status`};var _hoisted_9$2=[`onClick`];var _hoisted_10$2={key:0,title:`Export analysis is partial. Unknown return information is omitted.`};var _hoisted_11$2={key:0,class:`subsystem-inspector__hint`,title:`No intended directory-level contract is recorded; observed imports and available exports are shown separately.`};var _hoisted_12$2={key:1,class:`subsystem-inspector__coverage`,role:`status`,title:`Unobserved imports do not prove an export is internal or unused.`};var _hoisted_13$2={key:2,class:`subsystem-inspector__search`};var _hoisted_14$2=[`open`,`onToggle`];var _hoisted_15$1=[`title`];var _hoisted_16$1={key:0};var _hoisted_17$1={class:`subsystem-inspector__signatures`};var _hoisted_18$1={key:0,class:`subsystem-inspector__declaration`};var _hoisted_19$1=[`title`,`onClick`];var _hoisted_20$1=[`title`];var _hoisted_21$1={key:0,class:`subsystem-inspector__returns`};var _hoisted_22$1={class:`subsystem-inspector__source`};var _hoisted_23$1={key:1,class:`subsystem-inspector__evidence`};var _hoisted_24$1={key:0,class:`subsystem-inspector__consumers nodrag nopan`};var _hoisted_25$1=[`title`];var _hoisted_26$1=[`onClick`];var _hoisted_27$1={key:1,class:`subsystem-inspector__no-imports`,title:`No imports are recorded in the current analysis. This does not prove the export is unused.`};var _hoisted_28$1={key:1,class:`subsystem-inspector__signature subsystem-inspector__signature--unresolved`};var _hoisted_29$1=[`title`];var _hoisted_30$1={key:0,class:`subsystem-inspector__returns`};var _hoisted_31$1={key:0,class:`subsystem-inspector__hint`};var _hoisted_32={key:1,class:`subsystem-inspector__hint`};var _hoisted_33={key:3,class:`subsystem-inspector__technical nodrag nopan`};var _hoisted_34={key:0};var _hoisted_35={key:4,class:`subsystem-inspector__technical nodrag nopan`};var _hoisted_36={key:0};var _hoisted_37={key:0};var _hoisted_38={key:2,class:`subsystem-inspector__section`};var _hoisted_39=[`onClick`];var _hoisted_40={class:`subsystem-inspector__file-tools nodrag nopan`};var _hoisted_41={class:`subsystem-inspector__search`};var _hoisted_42={class:`subsystem-inspector__sort`};var _hoisted_43={key:0,class:`subsystem-inspector__hint`};var _sfc_main$4={__name:`Vibe64SubsystemInspector`,props:{outline:{type:Object,required:true},embedded:Boolean},emits:[`close`,`inspect`,`open-program`],setup(__props){const props=__props;function preserveTextSelection(event){if(!event.detail)return;const selected=event.view?.getSelection();const control=event.target.closest(`button, a, summary`);if(control&&selected&&!selected.isCollapsed&&control.contains(selected.anchorNode)&&control.contains(selected.focusNode)){event.preventDefault();event.stopPropagation()}}const query=ref(``);const filesElement=ref(null);const interfaceElement=ref(null);const programElement=ref(null);const programsElement=ref(null);const folderState=ref(new Map);const symbolQuery=ref(``);const sortBy=ref(`name`);const selected=ref(null);const expandedGroups=ref(new Set);const signatureGroups=computed(()=>{const term=symbolQuery.value.trim().toLocaleLowerCase();const observed=props.outline.observedSymbols||[];const observedIds=new Set(observed.map(symbol=>symbol.source.symbolId));return[{key:`observed`,title:`Imported by other subsystems`,primary:true,symbols:observed,explanation:`These particular declarations are imported across this directory boundary. Imports do not prove runtime calls or intended API membership.`},{key:`declared`,title:`Declared API`,primary:!observed.length,symbols:props.outline.publicSymbols.filter(symbol=>!observedIds.has(symbol.source?.symbolId)),explanation:`Explicit package or module exports, including members with no observed consumers.`},{key:`candidates`,title:`Exports from externally used files`,primary:!observed.length&&!props.outline.publicSymbols.length,symbols:props.outline.boundarySymbols,explanation:`These files are imported by other subsystems, but imports of these particular exports are unproven. This is not a declared API.`},{key:`available`,title:`Other available exports`,primary:false,symbols:props.outline.availableSymbols||[],explanation:`Available under the language’s visibility rules. They may be internal, unused or useful to future consumers; current analysis does not decide intent.`}].filter(group=>group.symbols.length).map(group=>({...group,count:group.symbols.length,symbols:group.symbols.filter(symbol=>!term||`${symbol.qualifiedName||``} ${symbol.name||``} ${symbol.source?.path||``}`.toLocaleLowerCase().includes(term))}))});const measuredFiles=computed(()=>props.outline.files.filter(file=>Number.isSafeInteger(file.sourceLines)).length);const measuredLines=computed(()=>props.outline.files.reduce((total,file)=>total+(Number.isSafeInteger(file.sourceLines)?file.sourceLines:0),0));function signature(symbol){return(symbol.qualifiedName||symbol.name)+(Array.isArray(symbol.parameters)?`(${symbol.parameters.join(`, `)})`:``)}function basename(path){return path.split(`/`).pop()}const tree=computed(()=>{const term=query.value.trim().toLocaleLowerCase();const byName=(a,b)=>a.name.localeCompare(b.name,void 0,{numeric:true,sensitivity:`base`});function compare(a,b){if(a.kind!==b.kind)return a.kind===`file`?-1:1;if(a.kind===`file`){if(sortBy.value===`size`){const size=item=>Number.isSafeInteger(item.file.sourceLines)?item.file.sourceLines:-1;if(size(a)!==size(b))return size(b)-size(a)}if(sortBy.value===`type`){const extension=item=>item.name.includes(`.`)?item.name.split(`.`).at(-1).toLocaleLowerCase():``;const typeOrder=extension(a).localeCompare(extension(b));if(typeOrder)return typeOrder}}return byName(a,b)}function arrange(items){return items.flatMap(item=>{if(item.kind===`file`)return!term||item.file.path.toLocaleLowerCase().includes(term)?[item]:[];const children=arrange(item.children);return children.length?[{...item,children}]:[]}).sort(compare)}return arrange(props.outline.tree)});watch(()=>props.outline.owner.id,()=>{query.value=``;symbolQuery.value=``;selected.value=null;sortBy.value=`name`;folderState.value=new Map;expandedGroups.value=new Set});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{class:normalizeClass([`subsystem-inspector`,{"subsystem-inspector--embedded":__props.embedded}]),"aria-label":__props.outline.owner.opaque?`External package interface`:`Subsystem interface`,onClickCapture:preserveTextSelection},[createBaseVNode(`header`,_hoisted_2$4,[createBaseVNode(`div`,null,[createBaseVNode(`small`,null,toDisplayString(__props.outline.owner.opaque?`EXTERNAL DEPENDENCY`:__props.outline.owner.placementKind===`libraries`?`SHARED LIBRARY`:`SUBSYSTEM`),1),createBaseVNode(`h2`,null,toDisplayString(__props.outline.owner.title),1),createBaseVNode(`p`,null,toDisplayString(__props.outline.owner.root),1)]),!__props.embedded?(openBlock(),createElementBlock(`button`,{key:0,type:`button`,class:`subsystem-inspector__close`,"aria-label":`Back to architecture map`,onClick:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`close`))},`×`)):createCommentVNode(``,true)]),!__props.outline.owner.opaque?(openBlock(),createElementBlock(`nav`,_hoisted_3$4,[createBaseVNode(`button`,{type:`button`,onClick:_cache[1]||(_cache[1]=$event=>programElement.value?.scrollIntoView({block:`start`}))},`Explanation`),__props.outline.programs?.length?(openBlock(),createElementBlock(`button`,{key:0,type:`button`,onClick:_cache[2]||(_cache[2]=$event=>programsElement.value?.scrollIntoView({block:`start`}))},[_cache[10]||(_cache[10]=createTextVNode(`Programs `,-1)),createBaseVNode(`small`,null,toDisplayString(__props.outline.programs.length),1)])):createCommentVNode(``,true),createBaseVNode(`button`,{type:`button`,onClick:_cache[3]||(_cache[3]=$event=>interfaceElement.value?.scrollIntoView({block:`start`}))},`Interface`),createBaseVNode(`button`,{type:`button`,onClick:_cache[4]||(_cache[4]=$event=>filesElement.value?.scrollIntoView({block:`start`}))},[_cache[11]||(_cache[11]=createTextVNode(`Files `,-1)),createBaseVNode(`small`,null,toDisplayString(__props.outline.files.length),1)])])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_4$4,[createBaseVNode(`p`,_hoisted_5$4,toDisplayString(__props.outline.owner.opaque?`External package · source remains opaque`:`${__props.outline.files.length} file${__props.outline.files.length===1?``:`s`} · ${measuredFiles.value?measuredLines.value.toLocaleString()+` measured source lines`+(measuredFiles.value<__props.outline.files.length?` (${measuredFiles.value}/${__props.outline.files.length} files)`:``):`Source size unavailable`}`),1),!__props.outline.owner.opaque?(openBlock(),createElementBlock(`section`,{key:0,ref_key:`programElement`,ref:programElement,class:`subsystem-inspector__section`,"aria-label":`Subsystem explanation`},[_cache[12]||(_cache[12]=createBaseVNode(`h3`,null,`Explanation`,-1)),__props.outline.owner.description?(openBlock(),createElementBlock(`div`,_hoisted_6$3,[renderSlot(_ctx.$slots,`text`,{text:__props.outline.owner.description,sourcePath:`genesis/subsystems.md`},()=>[createTextVNode(toDisplayString(__props.outline.owner.description),1)],true)])):(openBlock(),createElementBlock(`p`,_hoisted_7$2,`No explanation in Genesis.`))],512)):createCommentVNode(``,true),!__props.outline.owner.opaque&&(__props.outline.programs?.length||__props.outline.programStatus!==`valid`)?(openBlock(),createElementBlock(`section`,{key:1,ref_key:`programsElement`,ref:programsElement,class:`subsystem-inspector__section`,"aria-label":`Subsystem Programs`},[createBaseVNode(`h3`,null,[_cache[13]||(_cache[13]=createTextVNode(`Programs `,-1)),createBaseVNode(`span`,null,toDisplayString(__props.outline.programs?.length||0),1)]),__props.outline.programStatus!==`valid`?(openBlock(),createElementBlock(`div`,_hoisted_8$2,[..._cache[14]||(_cache[14]=[createBaseVNode(`p`,null,`Program descriptions need refresh.`,-1)])])):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.outline.programs||[],program=>{return openBlock(),createElementBlock(`button`,{key:program.id,type:`button`,class:`subsystem-inspector__program nodrag nopan`,onClick:$event=>_ctx.$emit(`open-program`,program.id)},[createBaseVNode(`strong`,null,toDisplayString(program.title)+` →`,1),createBaseVNode(`span`,null,toDisplayString(program.description),1)],8,_hoisted_9$2)}),128))],512)):createCommentVNode(``,true),createBaseVNode(`section`,{ref_key:`interfaceElement`,ref:interfaceElement,class:`subsystem-inspector__section`,"aria-label":`Subsystem interface`},[createBaseVNode(`h3`,null,[_cache[15]||(_cache[15]=createTextVNode(`Interface `,-1)),__props.outline.publicEntries.some(entry=>entry.coverage!==`complete`)?(openBlock(),createElementBlock(`small`,_hoisted_10$2,`Partial`)):createCommentVNode(``,true)]),!__props.outline.publicEntries.length?(openBlock(),createElementBlock(`p`,_hoisted_11$2,`Intended API not declared.`)):createCommentVNode(``,true),__props.outline.dependencyCoverage!==`complete`&&!__props.outline.owner.opaque?(openBlock(),createElementBlock(`p`,_hoisted_12$2,`Import analysis `+toDisplayString(__props.outline.dependencyCoverage||`unavailable`)+`.`,1)):createCommentVNode(``,true),(__props.outline.exportCount||__props.outline.publicSymbols.length)>12?(openBlock(),createElementBlock(`label`,_hoisted_13$2,[_cache[16]||(_cache[16]=createTextVNode(`Find a signature`,-1)),withDirectives(createBaseVNode(`input`,{"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>symbolQuery.value=$event),type:`search`,placeholder:`Operation, component, value or type`},null,512),[[vModelText,symbolQuery.value]])])):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(signatureGroups.value,group=>{return openBlock(),createElementBlock(`details`,{key:group.key,class:`subsystem-inspector__surface nodrag nopan`,open:group.primary,onToggle:$event=>$event.target.open&&expandedGroups.value.add(group.key)},[createBaseVNode(`summary`,{title:group.explanation},toDisplayString(group.title)+` · `+toDisplayString(group.count),9,_hoisted_15$1),group.primary||expandedGroups.value.has(group.key)?(openBlock(),createElementBlock(`div`,_hoisted_16$1,[createBaseVNode(`div`,_hoisted_17$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(group.symbols.slice(0,200),symbol=>{return openBlock(),createElementBlock(Fragment,{key:`${symbol.source?.symbolId||symbol.importPaths?.join(`,`)}:${symbol.qualifiedName||symbol.name}:${symbol.start?.line||``}`},[symbol.source?(openBlock(),createElementBlock(`div`,_hoisted_18$1,[createBaseVNode(`button`,{type:`button`,class:`subsystem-inspector__signature nodrag nopan`,title:`Open ${symbol.source.path}:${symbol.source.line||``}`,onClick:$event=>_ctx.$emit(`inspect`,symbol.source)},[createBaseVNode(`small`,null,toDisplayString(symbol.kind||`Declaration`),1),createBaseVNode(`code`,{title:signature(symbol)},toDisplayString(signature(symbol)),9,_hoisted_20$1),symbol.returnType?(openBlock(),createElementBlock(`span`,_hoisted_21$1,`→ `+toDisplayString(symbol.returnType),1)):createCommentVNode(``,true),createBaseVNode(`span`,_hoisted_22$1,toDisplayString(basename(symbol.source.path))+` ↗`,1),symbol.declared||symbol.importPaths?.length?(openBlock(),createElementBlock(`span`,_hoisted_23$1,`Declared export`)):createCommentVNode(``,true)],8,_hoisted_19$1),symbol.consumers?.length?(openBlock(),createElementBlock(`details`,_hoisted_24$1,[createBaseVNode(`summary`,{title:symbol.consumerEvidence===`file`||group.key===`candidates`?`Show files that import the source file; use of this particular export is unproven.`:`Show files that import this declaration.`},toDisplayString(symbol.consumerEvidence===`file`||group.key===`candidates`?`Source file imported by`:`Imported by`)+` `+toDisplayString([...new Set(symbol.consumers.map(file=>file.subsystemId))].length)+` subsystem`+toDisplayString(new Set(symbol.consumers.map(file=>file.subsystemId)).size===1?``:`s`)+` · `+toDisplayString(symbol.consumers.length)+` file`+toDisplayString(symbol.consumers.length===1?``:`s`),9,_hoisted_25$1),(openBlock(true),createElementBlock(Fragment,null,renderList(symbol.consumers,file=>{return openBlock(),createElementBlock(`button`,{key:file.id,type:`button`,class:`subsystem-inspector__consumer`,onClick:$event=>_ctx.$emit(`inspect`,{path:file.path})},[createBaseVNode(`code`,null,toDisplayString(file.path),1),_cache[17]||(_cache[17]=createBaseVNode(`span`,{"aria-hidden":`true`},`→`,-1))],8,_hoisted_26$1)}),128))])):group.key===`available`?(openBlock(),createElementBlock(`p`,_hoisted_27$1,`No recorded imports`)):createCommentVNode(``,true)])):(openBlock(),createElementBlock(`div`,_hoisted_28$1,[createBaseVNode(`small`,null,toDisplayString(symbol.kind||`Declaration`),1),createBaseVNode(`code`,{title:signature(symbol)},toDisplayString(signature(symbol)),9,_hoisted_29$1),symbol.returnType?(openBlock(),createElementBlock(`span`,_hoisted_30$1,`→ `+toDisplayString(symbol.returnType),1)):createCommentVNode(``,true),createBaseVNode(`span`,null,toDisplayString(__props.outline.owner.opaque?`External package`:`Implementation location not resolved`),1)]))],64)}),128))]),group.symbols.length>200?(openBlock(),createElementBlock(`p`,_hoisted_31$1,`Showing 200 matches. Refine the search.`)):createCommentVNode(``,true),symbolQuery.value&&!group.symbols.length?(openBlock(),createElementBlock(`p`,_hoisted_32,`No declarations match this search.`)):createCommentVNode(``,true)])):createCommentVNode(``,true)],40,_hoisted_14$2)}),128)),__props.outline.programStatus!==`valid`||__props.outline.programDiagnostics?.length?(openBlock(),createElementBlock(`details`,_hoisted_33,[_cache[18]||(_cache[18]=createBaseVNode(`summary`,null,`Analysis details`,-1)),__props.outline.programStatus!==`valid`?(openBlock(),createElementBlock(`p`,_hoisted_34,`Genesis explanation index needs repair.`)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.outline.programDiagnostics||[],diagnostic=>{return openBlock(),createElementBlock(`p`,{key:diagnostic.code+diagnostic.message},toDisplayString(diagnostic.message),1)}),128))])):createCommentVNode(``,true),__props.outline.publicEntries.length?(openBlock(),createElementBlock(`details`,_hoisted_35,[createBaseVNode(`summary`,null,`Import paths · `+toDisplayString(__props.outline.publicEntries.length),1),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.outline.publicEntries,(entry,index)=>{return openBlock(),createElementBlock(`div`,{key:index},[createBaseVNode(`code`,null,toDisplayString(entry.importPath),1),createBaseVNode(`p`,null,[createTextVNode(toDisplayString(entry.conditions.join(` · `)||`Default conditions`),1),entry.target?(openBlock(),createElementBlock(`span`,_hoisted_36,` · `+toDisplayString(entry.target),1)):createCommentVNode(``,true)]),!entry.symbols.length?(openBlock(),createElementBlock(`p`,_hoisted_37,`Public declarations have not been resolved for this path.`)):createCommentVNode(``,true)])}),128))])):createCommentVNode(``,true)],512),__props.outline.operations.length?(openBlock(),createElementBlock(`section`,_hoisted_38,[createBaseVNode(`h3`,null,[_cache[19]||(_cache[19]=createTextVNode(`Receives UI calls `,-1)),createBaseVNode(`span`,null,toDisplayString(__props.outline.operations.length),1)]),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.outline.operations,call=>{return openBlock(),createElementBlock(`button`,{key:call.id,type:`button`,class:`subsystem-inspector__signature nodrag nopan`,onClick:$event=>_ctx.$emit(`inspect`,{path:call.file.path,symbol:call.controllerSymbol})},[createBaseVNode(`code`,null,toDisplayString([call.key?.protocol,call.key?.method,call.key?.operation].filter(Boolean).join(` · `)||call.id),1),createBaseVNode(`span`,null,[createTextVNode(toDisplayString(basename(call.file.path))+` ↗`,1),call.pages.length?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` · `+toDisplayString(call.pages.map(page=>page.title).join(`, `)),1)],64)):createCommentVNode(``,true)])],8,_hoisted_39)}),128))])):createCommentVNode(``,true),!__props.outline.owner.opaque?(openBlock(),createElementBlock(`section`,{key:3,ref_key:`filesElement`,ref:filesElement,class:`subsystem-inspector__section subsystem-inspector__files`},[createBaseVNode(`h3`,null,[_cache[20]||(_cache[20]=createTextVNode(`Files `,-1)),createBaseVNode(`span`,null,toDisplayString(__props.outline.files.length),1)]),_cache[24]||(_cache[24]=createBaseVNode(`p`,{class:`subsystem-inspector__hint`},`Click a file to open it. Bars compare source size.`,-1)),createBaseVNode(`div`,_hoisted_40,[createBaseVNode(`label`,_hoisted_41,[_cache[21]||(_cache[21]=createTextVNode(`Find a file`,-1)),withDirectives(createBaseVNode(`input`,{"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>query.value=$event),type:`search`,placeholder:`Name or path`},null,512),[[vModelText,query.value]])]),createBaseVNode(`label`,_hoisted_42,[_cache[23]||(_cache[23]=createTextVNode(`Sort`,-1)),withDirectives(createBaseVNode(`select`,{"onUpdate:modelValue":_cache[7]||(_cache[7]=$event=>sortBy.value=$event)},[..._cache[22]||(_cache[22]=[createBaseVNode(`option`,{value:`name`},`Name`,-1),createBaseVNode(`option`,{value:`type`},`File type`,-1),createBaseVNode(`option`,{value:`size`},`Size · largest first`,-1)])],512),[[vModelSelect,sortBy.value]])])]),createVNode(Vibe64SubsystemTreeBranch_default,{items:tree.value,"folder-state":folderState.value,searching:!!query.value.trim(),"selected-id":selected.value?.id||``,onSelect:_cache[8]||(_cache[8]=$event=>selected.value=$event),onInspect:_cache[9]||(_cache[9]=$event=>_ctx.$emit(`inspect`,$event))},null,8,[`items`,`folder-state`,`searching`,`selected-id`]),!tree.value.length?(openBlock(),createElementBlock(`p`,_hoisted_43,`No files match this search.`)):createCommentVNode(``,true)],512)):createCommentVNode(``,true)])],42,_hoisted_1$4)}}};var Vibe64SubsystemInspector_default=_plugin_vue_export_helper_default(_sfc_main$4,[[`__scopeId`,`data-v-2c200ec9`]]);var _hoisted_1$3={class:`program-inspector`,"aria-label":`Program explanation`};var _hoisted_2$3={key:0};var _hoisted_3$3={class:`program-inspector__preview`};var _hoisted_4$3={class:`program-explanation-dialog__header`};var _hoisted_5$3=[`id`];var _sfc_main$3={__name:`Vibe64ProgramInspector`,props:{program:{type:Object,required:true},architecture:{type:Object,required:true},owner:{type:Object,default:null},active:{type:Boolean,default:true}},emits:[`inspect`],setup(__props){const props=__props;const filesElement=ref(null);const explanationOpen=ref(false);const dialogTitleId=useId();const preview=computed(()=>props.program.description.trim().split(/\n\s*\n/u)[0]);watch([()=>props.program.id,()=>props.active],()=>{explanationOpen.value=false});const files=computed(()=>{const sources=new Set(props.program.sources);const indexed=props.architecture.files.filter(file=>sources.has(file.path));const largest=Math.max(1,...indexed.map(file=>file.sourceLines||0));return indexed.map(file=>({kind:`file`,id:file.id,name:file.path,file,programs:[props.program],reasons:[],volume:Number.isSafeInteger(file.sourceLines)?file.sourceLines/largest:null}))});const mainFiles=computed(()=>files.value.filter(item=>item.file.path===props.program.mainSource));const supportingFiles=computed(()=>files.value.filter(item=>item.file.path!==props.program.mainSource).sort((a,b)=>a.name.localeCompare(b.name)));return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$3,[createBaseVNode(`header`,null,[_cache[5]||(_cache[5]=createBaseVNode(`small`,null,`PROGRAM`,-1)),createBaseVNode(`h2`,null,toDisplayString(__props.program.title),1),createBaseVNode(`p`,null,toDisplayString(__props.owner?.title),1)]),createBaseVNode(`button`,{type:`button`,class:`program-inspector__anchor`,onClick:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`inspect`,{path:__props.program.mainSource}))},[_cache[6]||(_cache[6]=createBaseVNode(`small`,null,`Main source file`,-1)),createBaseVNode(`strong`,null,toDisplayString(__props.program.mainSource)+` →`,1)]),supportingFiles.value.length?(openBlock(),createElementBlock(`nav`,_hoisted_2$3,[createBaseVNode(`button`,{type:`button`,onClick:_cache[1]||(_cache[1]=$event=>filesElement.value?.scrollIntoView({block:`start`}))},`Supporting files `+toDisplayString(supportingFiles.value.length)+` ↓`,1)])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_3$3,[renderSlot(_ctx.$slots,`text`,{text:preview.value,sourcePath:__props.program.path},()=>[createTextVNode(toDisplayString(preview.value),1)],true)]),createVNode(VDialog,{modelValue:explanationOpen.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>explanationOpen.value=$event),"max-width":`800`,scrollable:``,class:`program-explanation-dialog`,"aria-labelledby":unref(dialogTitleId)},{activator:withCtx(({props:activatorProps})=>[createBaseVNode(`button`,mergeProps(activatorProps,{type:`button`,class:`program-inspector__read`,"aria-haspopup":`dialog`}),`Read full explanation`,16)]),default:withCtx(()=>[createVNode(VCard,null,{default:withCtx(()=>[createBaseVNode(`header`,_hoisted_4$3,[createBaseVNode(`h2`,{id:unref(dialogTitleId)},toDisplayString(__props.program.title),9,_hoisted_5$3),createBaseVNode(`button`,{type:`button`,"aria-label":`Close Program explanation`,onClick:_cache[2]||(_cache[2]=$event=>explanationOpen.value=false)},`×`)]),createVNode(VCardText,{class:`program-explanation-dialog__body`},{default:withCtx(()=>[createBaseVNode(`div`,null,[renderSlot(_ctx.$slots,`text`,{text:__props.program.description,sourcePath:__props.program.path},()=>[createTextVNode(toDisplayString(__props.program.description),1)],true)]),createBaseVNode(`div`,null,[renderSlot(_ctx.$slots,`text`,{text:__props.program.publicContract,sourcePath:__props.program.path},()=>[createTextVNode(toDisplayString(__props.program.publicContract),1)],true)])]),_:3})]),_:3})]),_:3},8,[`modelValue`,`aria-labelledby`]),createBaseVNode(`section`,{ref_key:`filesElement`,ref:filesElement},[createBaseVNode(`h3`,null,[_cache[7]||(_cache[7]=createTextVNode(`Source files `,-1)),createBaseVNode(`small`,null,toDisplayString(files.value.length),1)]),createVNode(Vibe64SubsystemTreeBranch_default,{items:[...mainFiles.value,...supportingFiles.value],onInspect:_cache[4]||(_cache[4]=$event=>_ctx.$emit(`inspect`,$event))},null,8,[`items`])],512)])}}};var Vibe64ProgramInspector_default=_plugin_vue_export_helper_default(_sfc_main$3,[[`__scopeId`,`data-v-4c61533d`]]);var _hoisted_1$2=[`title`];var _hoisted_2$2={class:`storyboard-page__meta`};var _hoisted_3$2=[`aria-label`];var _hoisted_4$2={key:1,class:`storyboard-page__routes`};var _hoisted_5$2={key:2,class:`storyboard-page__unregistered`};var _hoisted_6$2={key:3,class:`storyboard-page__unresolved`};var _sfc_main$2={__name:`Vibe64ArchitecturePageNode`,props:{data:{type:Object,required:true},selected:Boolean,compact:Boolean,context:Boolean},emits:[`show-usage`],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:normalizeClass([`storyboard-page`,{"storyboard-page--compact":__props.compact,"storyboard-page--root":!__props.data.parentId,"storyboard-page--selected":__props.selected,"architecture-context":__props.context}]),title:[__props.data.title,...__props.data.identities,__props.data.file].filter(Boolean).join(`
|
|
4
4
|
`)},[__props.data.parentId?(openBlock(),createBlock(unref(_sfc_main$f),{key:0,id:`parent`,type:`target`,position:unref(Position).Top},null,8,[`position`])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$2,[createBaseVNode(`span`,null,toDisplayString(__props.data.kind),1),createBaseVNode(`span`,null,toDisplayString(__props.data.surface),1),__props.data.file?(openBlock(),createElementBlock(`button`,{key:0,type:`button`,class:`storyboard-page__usage nodrag nopan`,"aria-label":`Show usage of ${__props.data.title}`,onClick:_cache[0]||(_cache[0]=withModifiers($event=>emit(`show-usage`,{q:__props.data.file}),[`stop`]))},`Show usage`,8,_hoisted_3$2)):createCommentVNode(``,true)]),createBaseVNode(`h2`,null,toDisplayString(__props.data.title),1),__props.data.identities.length?(openBlock(),createElementBlock(`div`,_hoisted_4$2,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.data.identities,identity=>{return openBlock(),createElementBlock(`span`,{key:identity},toDisplayString(identity),1)}),128))])):(openBlock(),createElementBlock(`p`,_hoisted_5$2,`No navigation identity recorded`)),__props.data.unresolvedCalls?(openBlock(),createElementBlock(`span`,_hoisted_6$2,toDisplayString(__props.data.unresolvedCalls)+` unresolved calls`,1)):createCommentVNode(``,true),__props.data.callCount?(openBlock(),createBlock(unref(_sfc_main$f),{key:4,id:`engine-out`,type:`source`,position:unref(Position).Right},null,8,[`position`])):createCommentVNode(``,true),__props.data.childCount?(openBlock(),createBlock(unref(_sfc_main$f),{key:5,id:`children`,type:`source`,position:unref(Position).Bottom},null,8,[`position`])):createCommentVNode(``,true)],10,_hoisted_1$2)}}};var Vibe64ArchitecturePageNode_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-d75eda23`]]);var _hoisted_1$1=[`title`];var _hoisted_2$1={class:`engine-subsystem__content`};var _hoisted_3$1={key:0,class:`engine-subsystem__start`};var _hoisted_4$1={class:`engine-subsystem__meta`};var _hoisted_5$1={key:0};var _hoisted_6$1={key:1,class:`engine-subsystem__directory`};var _hoisted_7$1={class:`engine-subsystem__description`};var _hoisted_8$1=[`title`];var _hoisted_9$1=[`title`];var _hoisted_10$1={key:0};var _hoisted_11$1={key:2,class:`engine-subsystem__receivers`};var _hoisted_12$1=[`title`];var _hoisted_13$1=[`title`];var _hoisted_14$1=[`aria-label`,`title`];var _sfc_main$1={__name:`Vibe64ArchitectureSubsystemNode`,props:{data:{type:Object,required:true},selected:Boolean,compact:Boolean,context:Boolean},emits:[`move`],setup(__props,{emit:__emit}){const emit=__emit;const ports=[[`top-in`,`target`,Position.Top],[`bottom-out`,`source`,Position.Bottom],[`top-out`,`source`,Position.Top],[`bottom-in`,`target`,Position.Bottom],[`left-in`,`target`,Position.Left],[`left-out`,`source`,Position.Left],[`right-in`,`target`,Position.Right],[`right-out`,`source`,Position.Right]].map(([id,type,position])=>({id,type,position}));return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:normalizeClass([`engine-subsystem`,{"engine-subsystem--compact":__props.compact,"engine-subsystem--library":__props.data.library,"engine-subsystem--support":__props.data.placementKind===`support`,"engine-subsystem--entry":__props.data.entryFiles.length,"engine-subsystem--cycle":__props.data.cycleLabel,"engine-subsystem--selected":__props.selected,"engine-subsystem--expanded":__props.data.expanded,"architecture-context":__props.context}]),title:`${__props.data.root}\n${__props.data.description||`Description not recorded.`}${__props.data.sourceLines!=null?`
|