@codeyam/codeyam-cli 0.1.0-staging.a890816 → 0.1.0-staging.ad44cd3
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/analyzer-template/.build-info.json +8 -8
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +10 -10
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +13 -7
- package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
- package/analyzer-template/packages/aws/package.json +2 -2
- package/analyzer-template/packages/database/package.json +3 -3
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +102 -0
- package/analyzer-template/packages/database/src/lib/loadEntities.ts +0 -6
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +0 -65
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +9 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +104 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +0 -6
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +0 -25
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
- package/analyzer-template/packages/github/package.json +1 -1
- package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
- package/analyzer-template/packages/ui-components/package.json +1 -1
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
- package/codeyam-cli/src/cli.js +9 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js +51 -0
- package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +56 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +3 -46
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +3916 -419
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/commands/editorIsolateArgs.js +25 -0
- package/codeyam-cli/src/commands/editorIsolateArgs.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +74 -35
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/telemetry.js +37 -0
- package/codeyam-cli/src/commands/telemetry.js.map +1 -0
- package/codeyam-cli/src/data/techStacks.js +77 -0
- package/codeyam-cli/src/data/techStacks.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
- package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js +137 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +1879 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js +100 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +304 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +194 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +261 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +594 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +435 -0
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +353 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1483 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +280 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js +143 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1857 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
- package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +227 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +493 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +26 -5
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/telemetry.test.js +159 -0
- package/codeyam-cli/src/utils/__tests__/telemetry.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
- package/codeyam-cli/src/utils/analysisRunner.js +3 -1
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +9 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
- package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +94 -18
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/buildFlags.js +4 -0
- package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
- package/codeyam-cli/src/utils/database.js +37 -2
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/devServerState.js +71 -0
- package/codeyam-cli/src/utils/devServerState.js.map +1 -0
- package/codeyam-cli/src/utils/editorApi.js +79 -0
- package/codeyam-cli/src/utils/editorApi.js.map +1 -0
- package/codeyam-cli/src/utils/editorAudit.js +355 -0
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
- package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
- package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
- package/codeyam-cli/src/utils/editorCapture.js +102 -0
- package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js +67 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js.map +1 -0
- package/codeyam-cli/src/utils/editorDevServer.js +197 -0
- package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js +50 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityHelpers.js +129 -0
- package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
- package/codeyam-cli/src/utils/editorJournal.js +225 -0
- package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js +152 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorMigration.js +224 -0
- package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
- package/codeyam-cli/src/utils/editorMockState.js +248 -0
- package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +137 -0
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarios.js +548 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js +422 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
- package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
- package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js +366 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +196 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
- package/codeyam-cli/src/utils/fileWatcher.js +38 -0
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/git.js +51 -0
- package/codeyam-cli/src/utils/git.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +37 -17
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
- package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
- package/codeyam-cli/src/utils/progress.js +2 -2
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/project.js +15 -5
- package/codeyam-cli/src/utils/project.js.map +1 -1
- package/codeyam-cli/src/utils/routePatternMatching.js +129 -0
- package/codeyam-cli/src/utils/routePatternMatching.js.map +1 -0
- package/codeyam-cli/src/utils/scenarioCoverage.js +74 -0
- package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
- package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
- package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
- package/codeyam-cli/src/utils/scenariosManifest.js +249 -0
- package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
- package/codeyam-cli/src/utils/serverState.js +30 -0
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +47 -16
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +8 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/slugUtils.js +25 -0
- package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
- package/codeyam-cli/src/utils/syncMocksMiddleware.js +2 -2
- package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/telemetry.js +106 -0
- package/codeyam-cli/src/utils/telemetry.js.map +1 -0
- package/codeyam-cli/src/utils/telemetryMiddleware.js +22 -0
- package/codeyam-cli/src/utils/telemetryMiddleware.js.map +1 -0
- package/codeyam-cli/src/utils/testRunner.js +1 -1
- package/codeyam-cli/src/utils/testRunner.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +21 -0
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +35 -0
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +40 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +628 -0
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +146 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js +65 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
- package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
- package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
- package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
- package/codeyam-cli/src/webserver/backgroundServer.js +18 -4
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CzTDWkF2.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-C76mRRiF.js → EntityItem-BFbq6iFk.js} +5 -5
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CobE682z.js → EntityTypeIcon-B6OMi58N.js} +9 -9
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-DuYodzo1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-CXo9EeCl.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DYCNb2It.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BU_OAEMP.js → LoadingDots-By5zI316.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-ceAyBX-H.js → LogViewer-CZgY3sxX.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-djPLI-WV.js → ReportIssueModal-CnYYwRDw.js} +4 -4
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-CDoF7ZpU.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-B76aig_2.js → ScenarioViewer-DrnfvaLL.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Df3UCi8k.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-DRKR9T0U.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{_index-C96V0n15.js → _index-ClR-g3tY.js} +4 -4
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BpKzcsJz.js → activity.(_tab)-DTH6ydEA.js} +8 -8
- package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-Duc5hnl7.js → addon-web-links-74hnHF59.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-D9hemwl6.js → agent-transcripts-B8CYhCO9.js} +7 -7
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-D_nMCFmP.js → book-open-CLaoh4ac.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BH2h1Ea2.js → chevron-down-BZ2DZxbW.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-C4pqxYJB.js → chunk-JZWAC4HX-BBXArFPl.js} +13 -21
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DyIKORY6.js → circle-check-CT4unAk-.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{copy-NDbZjXao.js → copy-zK0B6Nu-.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-DJB0YQJL.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-CkXFP_i-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor._tab-DPw7NZHc.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-CjC3_6JI.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-DBa7T2FK.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CrjR3zZW.js → entity._sha._-BqAN7hyG.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-BOi8kpwd.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-Dg1NhIms.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CJX6kkkV.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMvVHNXU.js → entity._sha_.edit._scenarioId-BhVjZhKg.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DTvKq3TY.js → entry.client-_gzKltPN.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-CV_17tZS.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-D-YXmMbR.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-DRvOjyO3.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-Blo6EK8G.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-10oVnAAH.js → index-BsX0F-9C.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-BcvgDzbZ.js → index-CCrgCshv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/labs-Byazq8Pv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BAXYRVEO.js → loader-circle-DVQ0oHR7.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/manifest-75b1b319.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-b-VmA2Vj.js +101 -0
- package/codeyam-cli/src/webserver/build/client/assets/{pause-DTAcYxBt.js → pause-DGcndCAa.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/root-F-k2uYj5.js +67 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-fKo7v0Zo.js → search-C0Uw0bcK.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/settings-OoNgHIfW.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-Bcemfu8a.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-BG4heKCG.js → terminal-BgMmG7R9.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DtSmdtM4.js → triangle-alert-Cs87hJYK.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BR3Rs7JY.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-C14nCb1q.js → useLastLogLine-BxxP_XF9.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-BermyNU5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useToast-a_QN_W9_.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
- package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-lv2ooewK.js +13 -0
- package/codeyam-cli/src/webserver/build/server/assets/index-Im3Smyei.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/init-BjuAFKGM.js +10 -0
- package/codeyam-cli/src/webserver/build/server/assets/progress-CHTtrxFG.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CNjF0B9B.js +551 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/editorProxy.js +755 -51
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
- package/codeyam-cli/src/webserver/idleDetector.js +73 -0
- package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
- package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +94 -4
- package/codeyam-cli/src/webserver/server.js +176 -12
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +218 -140
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
- package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
- package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
- package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
- package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
- package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
- package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
- package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
- package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
- package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
- package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
- package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
- package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
- package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
- package/codeyam-cli/templates/codeyam-editor-claude.md +84 -5
- package/codeyam-cli/templates/editor-step-hook.py +198 -22
- package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
- package/codeyam-cli/templates/expo-react-native/README.md +41 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app.json +18 -0
- package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
- package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
- package/codeyam-cli/templates/expo-react-native/global.css +3 -0
- package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
- package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
- package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
- package/codeyam-cli/templates/expo-react-native/package.json +38 -0
- package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
- package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +9 -4
- package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +21 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +5 -1
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +4 -1
- package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +127 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
- package/codeyam-cli/templates/{nextjs-prisma-sqlite/PRISMA_SETUP.md → nextjs-prisma-supabase/SUPABASE_SETUP.md} +37 -17
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
- package/codeyam-cli/templates/seed-adapters/supabase.ts +282 -0
- package/codeyam-cli/templates/{codeyam-dev-mode.md → skills/codeyam-dev-mode/SKILL.md} +3 -3
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +211 -0
- package/codeyam-cli/templates/{codeyam-memory.md → skills/codeyam-memory/SKILL.md} +215 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
- package/package.json +16 -10
- package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +10 -4
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/index.js +4 -2
- package/packages/analyze/src/lib/asts/index.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +104 -0
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/packages/database/src/lib/loadEntities.js +0 -6
- package/packages/database/src/lib/loadEntities.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +0 -25
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/packages/types/src/enums/ProjectFramework.js +2 -0
- package/packages/types/src/enums/ProjectFramework.js.map +1 -1
- package/scripts/npm-post-install.cjs +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-DmJveP3T.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-g3saevPb.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-DYFW3lDD.js +0 -25
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DLeucoVX.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BED4B6sP.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/Terminal-CcG8YTLx.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-C8OKAR5x.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CMT1jU2q.js +0 -21
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor-W_IGJ2Kd.js +0 -7
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-D6SEzMCu.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-cPo8LiG3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-DO4CZ16O.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-CFCTYk9I.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/globals-BZB_H1w2.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-8daa4147.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-FweZHj5U.js +0 -93
- package/codeyam-cli/src/webserver/build/client/assets/root-DiRdBreB.js +0 -67
- package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-B3aOzpCZ.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-ByhSyh0W.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-O-jkvSPx.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-9FIWuYfK.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/xterm-DMSzMhqy.js +0 -9
- package/codeyam-cli/src/webserver/build/server/assets/index-BzAbACSx.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-OdUocH6P.js +0 -362
- package/codeyam-cli/templates/codeyam-editor.md +0 -68
- package/scripts/finalize-analyzer.cjs +0 -13
- /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{r as a,j as e,w as Ae,u as De,f as Be,b as Oe}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as Fe,V as Ue,S as We}from"./useCustomSizes-ByhSyh0W.js";import{T as Je,D as Ve}from"./Terminal-CcG8YTLx.js";import{c as He}from"./cy-logo-cli-DcX-ZS3p.js";import{S as fe,u as Ge}from"./Spinner-Bb5uFQ5V.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-C14nCb1q.js";function Ye(m){const[l,g]=a.useState(null),[b,v]=a.useState(!1),M=a.useCallback(()=>{m&&(v(!0),fetch(`/api/editor-test-results?testFile=${encodeURIComponent(m)}`).then(k=>k.json()).then(k=>{g(k),v(!1)}).catch(()=>{g({testFilePath:m,status:"error",testCases:[],errorMessage:"Failed to fetch test results"}),v(!1)}))},[m]);return a.useEffect(()=>{m&&M()},[m,M]),{results:l,isRunning:b,runTests:M}}function J({imgSrc:m,name:l,isActive:g,onSelect:b}){return e.jsxs("button",{onClick:b,className:"flex flex-col items-center gap-1 cursor-pointer group",title:l,children:[e.jsx("div",{className:`w-32 h-32 rounded overflow-hidden border-2 transition-all bg-[#1a1a1a] ${g?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:m?e.jsx("img",{src:m,alt:l,className:"w-full h-full object-contain",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-32 ${g?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:l})]})}function ne({testFile:m,entityName:l}){const{results:g,isRunning:b,runTests:v}=Ye(m);if(b&&!g)return e.jsxs("div",{className:"px-2 pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-400",children:"Running tests..."})]});if(!g)return null;if(g.status==="error")return e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-red-400",children:g.errorMessage})});const M=l?g.testCases.filter(j=>{const y=`${l} > `;return j.fullName.startsWith(y)||j.fullName===l}):g.testCases;if(M.length===0)return null;const k=l?`${l} > `:"";return e.jsxs("div",{className:"px-2 pt-1 space-y-0.5",children:[M.map(j=>{var N;const y=k&&j.fullName.startsWith(k)?j.fullName.slice(k.length):j.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[j.status==="passed"?e.jsx("span",{className:"text-green-400 text-[10px]",children:"✓"}):j.status==="failed"?e.jsx("span",{className:"text-red-400 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-500 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${j.status==="passed"?"text-green-400":j.status==="failed"?"text-red-400":"text-gray-500"}`,children:y})]}),j.status==="failed"&&((N=j.failureMessages)==null?void 0:N.map((h,P)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-300/70 truncate max-w-full",title:h,children:h.split(`
|
|
2
|
-
`)[0]},P)))]},j.fullName)}),e.jsx("button",{onClick:v,disabled:b,className:"mt-1 text-[10px] text-[#00a0c4] hover:text-[#00c4ee] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:b?"Running...":"Re-run"})]})}function F({filePath:m,projectRoot:l}){if(!m)return null;const b=`vscode://file/${l?`${l}/${m}`:m}`;return e.jsxs("div",{className:"flex items-center gap-1 px-2 mt-0.5",children:[e.jsx("span",{className:"text-[9px] text-gray-500 truncate",children:m}),e.jsx("a",{href:b,title:"Open in editor",className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors",children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function Ke({scenarios:m,projectRoot:l,activeScenarioId:g,onScenarioSelect:b,zoomComponent:v,onZoomChange:M,analyzedEntities:k=[],glossaryFunctions:j=[],activeAnalyzedScenarioId:y,onAnalyzedScenarioSelect:N,entityImports:h}){const{appScenarios:P,componentGroups:f}=a.useMemo(()=>{const t=[],i=new Map;for(const w of m)if(w.componentName){const r=i.get(w.componentName)||[];r.push(w),i.set(w.componentName,r)}else t.push(w);const u=new Map([...i.entries()].sort(([w],[r])=>w.localeCompare(r)));return{appScenarios:t,componentGroups:u}},[m]),A=a.useMemo(()=>{const t=new Set((k||[]).filter(u=>u.entityType==="visual").map(u=>u.name)),i=new Map;for(const[u,w]of f)t.has(u)||i.set(u,w);return i},[f,k]),{visualEntities:T,libraryEntities:S}=a.useMemo(()=>{const t=k.filter(u=>u.entityType==="visual").sort((u,w)=>u.name.localeCompare(w.name)),i=k.filter(u=>u.entityType==="library"||u.entityType==="functionCall").sort((u,w)=>u.name.localeCompare(w.name));return{visualEntities:t,libraryEntities:i}},[k]),_=a.useMemo(()=>{const t=new Set(S.map(i=>i.name));return j.filter(i=>!t.has(i.name)).sort((i,u)=>i.name.localeCompare(u.name))},[j,S]),o=k.some(t=>t.isAnalyzing),p=a.useRef(null),d=a.useRef(0),E=a.useCallback(()=>{p.current&&(d.current=p.current.scrollTop)},[]);if(a.useEffect(()=>{p.current&&d.current>0&&(p.current.scrollTop=d.current)}),m.length===0&&k.length===0&&_.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No scenarios yet"}),e.jsx("p",{className:"text-xs",children:"Scenarios will appear here as Claude creates them alongside your code. Each scenario represents a different state of your app's data."})]})});if(v){const t=f.get(v)||[],i=new Set((h==null?void 0:h[v])||[]),u=i.size>0,w=u?T.filter(c=>i.has(c.name)):[],r=u?S.filter(c=>i.has(c.name)):[];return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-1",children:[e.jsxs("button",{onClick:()=>M(void 0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-400 hover:text-white transition-colors cursor-pointer",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M7.5 9L4.5 6L7.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"All scenarios"]}),e.jsx("div",{className:"px-3 py-1.5",children:e.jsx("span",{className:"text-xs font-semibold text-white uppercase tracking-wider",children:v})}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2",children:t.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-gray-500",children:"No scenarios for this component"}):t.map(c=>e.jsx(J,{imgSrc:c.screenshotPath?`/api/editor-scenario-image/${c.id}.png`:null,name:c.name,isActive:c.id===g,onSelect:()=>b(c)},c.id))}),w.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),w.map(c=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex items-center gap-2 px-2 py-1",children:e.jsx("button",{onClick:()=>M(c.name),className:"text-xs font-medium text-gray-300 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:c.name})}),e.jsx(F,{filePath:c.filePath,projectRoot:l}),(c.scenarios.length>0||c.pendingScenarios.length>0)&&e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:c.scenarios.map($=>e.jsx(J,{imgSrc:$.screenshotPath?`/api/screenshot/${$.screenshotPath}`:null,name:$.name,isActive:$.id===y,onSelect:()=>N==null?void 0:N({analysisId:c.analysisId,scenarioId:$.id,scenarioName:$.name,entitySha:c.sha,entityName:c.name})},$.id))})]},c.sha))]}),r.length>0&&e.jsxs("div",{className:"pt-2 mt-1",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),r.map(c=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:c.name})}),e.jsx(F,{filePath:c.filePath,projectRoot:l}),c.testFile&&e.jsx(ne,{testFile:c.testFile,entityName:c.name})]},c.sha))]})]})})}return e.jsx("div",{ref:p,onScroll:E,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-3",children:[P.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Page Scenarios"})}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:P.map(t=>e.jsx(J,{imgSrc:t.screenshotPath?`/api/editor-scenario-image/${t.id}.png`:null,name:t.name,isActive:t.id===g&&!y,onSelect:()=>b(t)},t.id))})]}),A.size>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),[...A.entries()].map(([t,i])=>{var u;return e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex items-center justify-between px-2 py-1",children:e.jsx("button",{onClick:()=>M(t),className:"text-xs font-medium text-gray-300 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:t})}),((u=i[0])==null?void 0:u.componentPath)&&e.jsx(F,{filePath:i[0].componentPath,projectRoot:l}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:i.map(w=>e.jsx(J,{imgSrc:w.screenshotPath?`/api/editor-scenario-image/${w.id}.png`:null,name:w.name,isActive:w.id===g&&!y,onSelect:()=>b(w)},w.id))})]},t)})]}),T.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),o&&m.length===0&&k.every(t=>t.scenarioCount===0)&&e.jsx("span",{className:"ml-2 text-[10px] text-gray-500",children:"— Entities are being analyzed..."})]}),T.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[e.jsx("button",{onClick:()=>M(t.name),className:"text-xs font-medium text-gray-300 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:t.name}),t.isAnalyzing&&t.scenarioCount===0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(F,{filePath:t.filePath,projectRoot:l}),(t.scenarios.length>0||t.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:[t.scenarios.map(i=>e.jsx(J,{imgSrc:i.screenshotPath?`/api/screenshot/${i.screenshotPath}`:null,name:i.name,isActive:i.id===y,onSelect:()=>N==null?void 0:N({analysisId:t.analysisId,scenarioId:i.id,scenarioName:i.name,entitySha:t.sha,entityName:t.name})},i.id)),t.pendingScenarios.map(i=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:i,children:i},i))]})]},t.sha))]}),(S.length>0||_.length>0)&&e.jsxs("div",{className:`pt-2 mt-1 ${T.length>0?"":"border-t border-[#3d3d3d]"}`,children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),S.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:t.name}),t.isAnalyzing&&t.scenarioCount===0&&e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(F,{filePath:t.filePath,projectRoot:l}),t.testFile?e.jsx(ne,{testFile:t.testFile,entityName:t.name}):e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-500",children:"No test file"})})]},t.sha)),_.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:t.name})}),e.jsx(F,{filePath:t.filePath,projectRoot:l}),e.jsx(ne,{testFile:t.testFile,entityName:t.name})]},t.name))]})]})})}const qe={feature:{label:"Feature",color:"bg-[#005c75]"},fix:{label:"Fix",color:"bg-amber-700"},refactor:{label:"Refactor",color:"bg-purple-700"},scaffold:{label:"Scaffold",color:"bg-green-700"},data:{label:"Data",color:"bg-blue-700"},milestone:{label:"Milestone",color:"bg-yellow-600"}};function Qe(m){try{return new Date(m).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function Xe(m){try{return new Date(m+"T00:00:00").toLocaleDateString([],{weekday:"long",month:"long",day:"numeric"})}catch{return m}}function Ze({isActive:m}){const[l,g]=a.useState([]),[b,v]=a.useState(!0),[M,k]=a.useState(new Set),j=a.useCallback(h=>{k(P=>{const f=new Set(P);return f.has(h)?f.delete(h):f.add(h),f})},[]),y=a.useCallback(async()=>{try{const h=await fetch("/api/editor-journal");if(h.ok){const P=await h.json();g(P.entries||[])}}catch{}finally{v(!1)}},[]);if(a.useEffect(()=>{y()},[y]),a.useEffect(()=>{m&&y()},[m,y]),a.useEffect(()=>{const h=new EventSource("/api/events");return h.addEventListener("message",P=>{try{const f=JSON.parse(P.data);f.type==="db-change"&&f.changeType==="journal"&&y()}catch{}}),()=>h.close()},[y]),b)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("span",{className:"text-gray-500 text-sm",children:"Loading journal..."})});if(l.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No journal entries yet"}),e.jsx("p",{className:"text-xs",children:"Journal entries will appear as you build. Claude records features, screenshots, and commits as the project evolves."})]})});const N=new Map;for(const h of[...l].reverse()){const P=N.get(h.date)||[];P.push(h),N.set(h.date,P)}return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx("div",{className:"p-3 space-y-4",children:[...N.entries()].map(([h,P])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1.5 sticky top-0 bg-[#1e1e1e] z-10",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:Xe(h)})}),e.jsx("div",{className:"space-y-2",children:P.map((f,A)=>{const T=qe[f.type]||{label:f.type,color:"bg-gray-600"},S=`${f.time}-${A}`,_=M.has(S);return e.jsxs("div",{className:"bg-[#2d2d2d] rounded-lg overflow-hidden",children:[e.jsxs("div",{className:`p-3 space-y-2 ${_?"":"max-h-[300px] overflow-y-auto"}`,children:[e.jsx("div",{className:"flex items-start gap-2",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white truncate",children:f.title}),e.jsx("span",{className:`${T.color} text-white text-[9px] font-bold px-1.5 py-0.5 rounded uppercase tracking-wider shrink-0`,children:T.label})]}),e.jsx("span",{className:"text-[10px] text-gray-500",children:Qe(f.time)})]})}),e.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:f.description}),f.screenshot&&e.jsx("div",{className:"rounded overflow-hidden border border-[#3d3d3d] bg-[#1e1e1e] flex items-center justify-center p-1",children:e.jsx("img",{src:`/api/editor-journal-image/${f.screenshot.replace("screenshots/","")}`,alt:f.title,className:"max-w-full max-h-full object-contain",loading:"lazy"})}),f.scenarioScreenshots&&f.scenarioScreenshots.length>0&&(()=>{const o=new Map;for(const d of f.scenarioScreenshots){const E=d.name.indexOf(" - "),t=E!==-1?d.name.slice(0,E):"App",i=o.get(t)||[];i.push(d),o.set(t,i)}const p=[...o.entries()].sort(([d],[E])=>d==="App"?-1:E==="App"?1:d.localeCompare(E));return e.jsx("div",{className:"space-y-1.5",children:p.map(([d,E])=>e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:d}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:E.map(t=>e.jsx("div",{className:"w-[4.5rem] h-[4.5rem] rounded overflow-hidden border border-[#3d3d3d] bg-[#1e1e1e] shrink-0 flex items-center justify-center",children:e.jsx("img",{src:`/api/editor-journal-image/${t.path.replace("screenshots/","")}`,alt:t.name,title:t.name,className:"max-w-full max-h-full object-contain",loading:"lazy"})},t.path))})]},d))})})(),f.commitSha&&e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[e.jsx("span",{className:"font-mono text-[#00a0c4] bg-[#00a0c4]/10 px-1.5 py-0.5 rounded",children:f.commitSha.slice(0,7)}),e.jsx("span",{className:"text-gray-500 truncate",children:f.commitMessage})]})]}),e.jsxs("button",{onClick:()=>j(S),className:"w-full py-1.5 text-[10px] text-gray-500 hover:text-gray-300 border-t border-[#3d3d3d] transition-colors cursor-pointer",children:["——— ",_?"Collapse":"Expand"," ———"]})]},S)})})]},h))})})}function D({imgSrc:m,name:l,isActive:g,onSelect:b}){return e.jsxs("button",{onClick:b,className:"flex flex-col items-center gap-1 cursor-pointer group",title:l,children:[e.jsx("div",{className:`w-24 h-24 rounded overflow-hidden border-2 transition-all bg-[#1a1a1a] ${g?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:m?e.jsx("img",{src:m,alt:l,className:"w-full h-full object-contain",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-24 ${g?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:l})]})}function et({hasProject:m,scenarios:l,analyzedEntities:g,activeScenarioId:b,onScenarioSelect:v,onAnalyzedScenarioSelect:M,onSwitchToBuild:k,zoomComponent:j,onZoomChange:y,entityImports:N}){const{pageGroups:h,componentGroups:P}=a.useMemo(()=>{const o=new Map,p=new Map;for(const E of l)if(E.componentName){const t=p.get(E.componentName)||[];t.push(E),p.set(E.componentName,t)}else{const t="Home",i=o.get(t)||[];i.push(E),o.set(t,i)}const d=new Map([...p.entries()].sort(([E],[t])=>E.localeCompare(t)));return{pageGroups:o,componentGroups:d}},[l]),f=a.useRef(null),A=a.useRef(0),T=a.useCallback(()=>{f.current&&(A.current=f.current.scrollTop)},[]);if(a.useEffect(()=>{f.current&&A.current>0&&(f.current.scrollTop=A.current)}),!m)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Ready to build something?"}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});const S=a.useMemo(()=>g.filter(o=>o.entityType==="visual").sort((o,p)=>o.name.localeCompare(p.name)),[g]);if(!(l.length>0||S.length>0))return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 px-8 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Your project is ready"}),e.jsx("p",{className:"text-sm text-gray-400 m-0 font-['IBM_Plex_Sans'] leading-relaxed max-w-[280px]",children:"Describe what you want to build in the Chat and your pages and components will appear here."}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});if(j){const o=h.get(j)||[],p=P.get(j)||[],d=S.find(r=>r.name===j),E=h.has(j),t=new Set((N==null?void 0:N[j])||[]),i=t.size>0,u=i?[...P.entries()].filter(([r])=>t.has(r)):[...P.entries()],w=i?S.filter(r=>t.has(r.name)):S;return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("button",{onClick:()=>y(void 0),className:"flex items-center gap-2 text-xs text-gray-400 hover:text-white transition-colors cursor-pointer bg-transparent border-none p-0",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M7.5 9L4.5 6L7.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"All"]}),e.jsx("h2",{className:"text-sm font-semibold text-white m-0 font-['IBM_Plex_Sans'] uppercase tracking-wider",children:j}),o.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:o.map(r=>e.jsx(D,{imgSrc:r.screenshotPath?`/api/editor-scenario-image/${r.id}.png`:null,name:r.name,isActive:r.id===b,onSelect:()=>v(r)},r.id))}),p.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(r=>e.jsx(D,{imgSrc:r.screenshotPath?`/api/editor-scenario-image/${r.id}.png`:null,name:r.name,isActive:r.id===b,onSelect:()=>v(r)},r.id))}),d&&(d.scenarios.length>0||d.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.scenarios.map(r=>e.jsx(D,{imgSrc:r.screenshotPath?`/api/screenshot/${r.screenshotPath}`:null,name:r.name,isActive:!1,onSelect:()=>M({analysisId:d.analysisId,scenarioId:r.id,scenarioName:r.name,entitySha:d.sha,entityName:d.name})},r.id)),d.pendingScenarios.map(r=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:r,children:r},r))]}),E&&u.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),u.map(([r,c])=>e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>y(r),className:"text-xs font-semibold text-gray-500 uppercase tracking-wider cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:r})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:c.map($=>e.jsx(D,{imgSrc:$.screenshotPath?`/api/editor-scenario-image/${$.id}.png`:null,name:$.name,isActive:$.id===b,onSelect:()=>v($)},$.id))})]},r))]}),E&&w.length>0&&e.jsxs("div",{className:`${u.length===0?"pt-2 mt-1 border-t border-[#3d3d3d]":"mt-2"}`,children:[u.length===0&&e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),w.map(r=>e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>y(r.name),className:"text-xs font-semibold text-gray-500 uppercase tracking-wider cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:r.name})}),(r.scenarios.length>0||r.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[r.scenarios.map(c=>e.jsx(D,{imgSrc:c.screenshotPath?`/api/screenshot/${c.screenshotPath}`:null,name:c.name,isActive:!1,onSelect:()=>M({analysisId:r.analysisId,scenarioId:c.id,scenarioName:c.name,entitySha:r.sha,entityName:r.name})},c.id)),r.pendingScenarios.map(c=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:c,children:c},c))]})]},r.sha))]}),o.length===0&&p.length===0&&!d&&e.jsx("div",{className:"text-xs text-gray-500",children:"No scenarios for this entity"})]})})}return e.jsx("div",{ref:f,onScroll:T,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium text-gray-300 m-0 font-['IBM_Plex_Sans']",children:"What do you want to work on next?"}),e.jsx("button",{onClick:k,className:"w-full py-3 border-2 border-dashed border-[#4d4d4d] rounded-lg text-sm text-gray-400 hover:border-[#005c75] hover:text-white transition-colors cursor-pointer bg-transparent",children:"+ New Page"}),[...h.entries()].map(([o,p])=>e.jsxs("div",{children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>y(o),className:"text-xs font-semibold text-gray-500 uppercase tracking-wider cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:o})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:p.map(d=>e.jsx(D,{imgSrc:d.screenshotPath?`/api/editor-scenario-image/${d.id}.png`:null,name:d.name,isActive:d.id===b,onSelect:()=>v(d)},d.id))})]},o)),P.size>0&&e.jsx("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),[...P.entries()].map(([o,p])=>e.jsxs("div",{children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>y(o),className:"text-xs font-semibold text-gray-500 uppercase tracking-wider cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:o})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:p.map(d=>e.jsx(D,{imgSrc:d.screenshotPath?`/api/editor-scenario-image/${d.id}.png`:null,name:d.name,isActive:d.id===b,onSelect:()=>v(d)},d.id))})]},o)),S.map(o=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 py-1",children:[e.jsx("button",{onClick:()=>y(o.name),className:"text-xs font-semibold text-gray-500 uppercase tracking-wider cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:o.name}),o.isAnalyzing&&o.scenarioCount===0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),(o.scenarios.length>0||o.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[o.scenarios.map(p=>e.jsx(D,{imgSrc:p.screenshotPath?`/api/screenshot/${p.screenshotPath}`:null,name:p.name,isActive:!1,onSelect:()=>M({analysisId:o.analysisId,scenarioId:p.id,scenarioName:p.name,entitySha:o.sha,entityName:o.name})},p.id)),o.pendingScenarios.map(p=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:p,children:p},p))]})]},o.sha))]})})}function tt({items:m,onNavigate:l}){return m.length===0?null:e.jsx("nav",{className:"flex items-center gap-1 text-xs",children:m.map((g,b)=>{const v=b===m.length-1;return e.jsxs("span",{className:"flex items-center gap-1",children:[b>0&&e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-gray-500",children:e.jsx("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),v?e.jsx("span",{className:"text-white font-medium",children:g.name}):e.jsx("button",{onClick:()=>l(g.componentName),className:"text-gray-400 hover:text-white transition-colors cursor-pointer",children:g.name})]},g.componentName||"app")})})}const dt=()=>[{title:"Editor - CodeYam"},{name:"description",content:"CodeYam Code + Data Editor"}],re=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}];function st({analysisId:m,scenarioId:l,scenarioName:g,entityName:b,projectSlug:v,onStateChange:M}){const{interactiveServerUrl:k,isStarting:j,isLoading:y}=Ge({analysisId:m,scenarioId:l,scenarioName:g,entityName:b,projectSlug:v,enabled:!0});return a.useEffect(()=>{M(k,j||y)},[k,j,y,M]),null}const xt=Ae(function(){const{projectSlug:l,projectRoot:g,hasProject:b,scenarios:v,analyzedEntities:M,glossaryFunctions:k,entityImports:j}=De(),y=Be(),[N,h]=Oe(),P=a.useRef(null),f=a.useRef(null),A=a.useRef(null),T=N.get("zoom")||void 0,S=N.get("scenario")||void 0;a.useEffect(()=>{if(!S)return;const s=v.find(x=>x.id===S);if(!s)return;const n=s.name.replace(/[^a-zA-Z0-9_]+/g,"_");fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:n,scenarioId:s.id})}).catch(()=>{})},[S,v]),a.useEffect(()=>{const s=new BroadcastChannel("codeyam-editor");return s.onmessage=n=>{var x;if(((x=n.data)==null?void 0:x.type)==="switch-scenario"&&n.data.scenarioId){const C=n.data.scenarioId,R=v.find(ae=>ae.id===C);if(!R)return;const Y=new URLSearchParams(N);Y.set("scenario",C),Y.delete("zoom"),h(Y),K(null),V(null);const ze=R.name.replace(/[^a-zA-Z0-9_]+/g,"_");fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:ze,scenarioId:C})}).then(()=>{W(ae=>ae+1),r(!1)}).catch(()=>{})}},()=>s.close()},[N,h,v]),a.useEffect(()=>{if(N.get("ref")!=="link"||!S)return;const s=new BroadcastChannel("codeyam-editor");s.postMessage({type:"switch-scenario",scenarioId:S}),s.close(),window.close()},[]);const[_,o]=a.useState(null),[p,d]=a.useState(null),[E,t]=a.useState(!1),[i,u]=a.useState(null),[w,r]=a.useState(!1),[c,$]=a.useState(!0),[z,K]=a.useState(null),[q,V]=a.useState(null),[Q,ie]=a.useState(!1),ge=a.useCallback((s,n)=>{V(x=>(s&&s!==x&&r(!1),s)),!n&&s&&r(!0),ie(n)},[]),le=a.useCallback(s=>{K(x=>(x&&x.analysisId===s.analysisId||(V(null),W(R=>R+1)),s)),ie(!0),r(!1);const n=new URLSearchParams(N);n.delete("scenario"),n.delete("zoom"),h(n)},[N,h]),[ve,ce]=a.useState(1440),[I,X]=a.useState({name:"Desktop",width:1440,height:900}),[je,Z]=a.useState(!1),[ee,be]=a.useState(null),[L,U]=a.useState("app"),Ne=a.useCallback(()=>{U("build"),oe(!0)},[]),[we,oe]=a.useState(!1),[ye,de]=a.useState(!1),Se=a.useCallback(s=>{de(s)},[]),[B,te]=a.useState(!1),Ce=a.useCallback(()=>{if(B){te(!1);return}typeof Notification<"u"&&Notification.permission==="default"?Notification.requestPermission().then(s=>{s==="granted"&&te(!0)}):te(!0)},[B]);a.useEffect(()=>{if(L==="build"){de(!1);const s=setTimeout(()=>{var n,x;(n=P.current)==null||n.scrollToBottom(),(x=P.current)==null||x.focus()},50);return()=>clearTimeout(s)}},[L]);const[H,ke]=a.useState(null);a.useEffect(()=>{const s=A.current;if(!s)return;const n=new ResizeObserver(x=>{const C=x[0];C&&ke({width:C.contentRect.width,height:C.contentRect.height})});return n.observe(s),()=>n.disconnect()},[]);const O=a.useMemo(()=>{if(!H)return 1;const s=I.width,n=I.height??900,x=H.width,C=H.height;return s<=x&&n<=C?1:Math.min(x/s,C/n)},[H,I]),[Pe,W]=a.useState(0),Ee=a.useCallback(()=>{W(s=>s+1)},[]),{customSizes:xe,addCustomSize:Me}=Fe(l),G=a.useMemo(()=>[...re,...xe],[xe]),me=a.useRef(!1);a.useEffect(()=>{let s=!1,n=null;const x=async()=>{try{const C=await fetch("/api/editor-dev-server");if(s)return;const R=await C.json();if(R.status==="error")o(null),d(null),t(!1),u(R.errorMessage||"Dev server crashed");else if(R.url)o(R.url),d(R.proxyUrl||null),t(!1),u(null),$(!0);else if(R.status==="starting")t(!0),u(null),$(!0);else if(R.status==="stopped")if(_)o(null),t(!1);else if(me.current)t(!1);else{me.current=!0;try{(await fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})})).ok?t(!0):$(!1)}catch{}}}catch{}};return x(),n=setInterval(()=>void x(),2e3),()=>{s=!0,n&&clearInterval(n)}},[_]),a.useEffect(()=>{const s=new EventSource("/api/events");let n=null;return s.addEventListener("message",x=>{try{const C=JSON.parse(x.data);(C.type==="db-change"||C.type==="unknown")&&(n&&clearTimeout(n),n=setTimeout(()=>{y.revalidate()},2e3))}catch{}}),()=>{n&&clearTimeout(n),s.close()}},[y]);const Ie=a.useMemo(()=>{const s=[{name:"App"}];return T&&s.push({name:T,componentName:T}),s},[T]),se=a.useCallback(s=>{const n=new URLSearchParams(N);if(s){n.set("zoom",s);const x=v.find(C=>C.componentName===s||C.componentName===null&&s==="Home");if(x){n.set("scenario",x.id);const C=x.name.replace(/[^a-zA-Z0-9_]+/g,"_");fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:C,scenarioId:x.id})}).catch(()=>{}),W(R=>R+1),r(!1)}else n.delete("scenario")}else n.delete("zoom"),n.delete("scenario");h(n)},[N,h,v]),he=a.useCallback(s=>{K(null),V(null);const n=new URLSearchParams(N);n.set("scenario",s.id),h(n);const x=s.name.replace(/[^a-zA-Z0-9_]+/g,"_");fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:x,scenarioId:s.id})}).catch(()=>{}),W(C=>C+1),r(!1)},[N,h]),Te=(s,n)=>{ce(s);const x=G.find(C=>C.width===s&&C.height===n);X({name:(x==null?void 0:x.name)||"Custom",width:s,height:n})},pe=s=>{ce(s.width),X({name:s.name,width:s.width,height:s.height})},$e=s=>{Me(s,I.width,I.height??900),Z(!1),X(n=>({...n,name:s}))},Le=()=>{z||r(!0)},_e=a.useCallback(()=>{u(null),t(!0),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restart"})}).catch(()=>{})},[]),Re=a.useCallback(()=>{u(null),t(!0),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})}).catch(()=>{})},[]),ue=a.useMemo(()=>{if(z&&q)return q;if(S){const n=v.find(x=>x.id===S);if(n!=null&&n.url){const x=p||_;return x?n.url.startsWith("/")?`${x}${n.url}`:n.url:null}}const s=p||_;if(!s)return null;if(T&&S){const n=v.find(C=>C.id===S),x=n?n.name.replace(/[^a-zA-Z0-9_]+/g,"_"):"Default";return`${s}/__codeyam__/${T}/${x}`}return s},[p,_,T,S,v,z,q]);return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[z&&e.jsx(st,{analysisId:z.analysisId,scenarioId:z.scenarioId,scenarioName:z.scenarioName,entityName:z.entityName,projectSlug:l,onStateChange:ge},z.analysisId),e.jsx("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:He,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:"Editor"}),T&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-gray-600"}),e.jsx(tt,{items:Ie,onNavigate:se})]}),e.jsx("span",{className:"bg-[#005c75] text-white text-[10px] font-bold px-2 py-0.5 rounded uppercase tracking-wider ml-auto",children:"Code + Data"})]})}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${re[re.length-1].width}px`,width:"100%"},children:e.jsx(Ue,{currentViewportWidth:ve,currentPresetName:I.name,onDevicePresetClick:pe,devicePresets:G,hideLabel:!0,onHoverChange:be,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(ee==null?void 0:ee.name)||I.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:I.name,onChange:s=>{const n=G.find(x=>x.name===s.target.value);n&&pe(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[G.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name)),I.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:I.width,onChange:s=>{const n=parseInt(s.target.value,10);!isNaN(n)&&n>0&&Te(n,I.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"x"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:I.height??900}),I.name==="Custom"&&e.jsx("button",{onClick:()=>Z(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{ref:A,className:"flex-1 flex items-center justify-center overflow-hidden p-8",style:{backgroundImage:`
|
|
3
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
5
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
6
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
7
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:ue?e.jsx("div",{style:{width:`${I.width*O}px`,height:`${(I.height??900)*O}px`},children:e.jsxs("div",{className:"relative bg-white origin-top-left",style:{width:`${I.width}px`,height:`${I.height??900}px`,transform:O<1?`scale(${O})`:void 0},children:[!w&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(fe,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Loading Preview"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Waiting for the app to render"})]})]})}),e.jsx("iframe",{ref:f,src:ue,className:"w-full h-full border-none",title:"Editor preview",onLoad:Le,style:{opacity:w?1:0}},Pe)]})}):e.jsx("div",{className:"bg-white rounded-lg shadow-sm flex flex-col items-center justify-center",style:{width:`${I.width*O}px`,height:`${(I.height??900)*O}px`},children:i?e.jsxs("div",{className:"flex flex-col gap-4 text-center px-8 max-w-[600px]",children:[e.jsx("h2",{className:"text-xl font-medium text-red-600 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Dev Server Failed"}),e.jsx("pre",{className:"text-xs text-left bg-gray-100 text-gray-800 p-4 rounded overflow-auto max-h-[300px] w-full font-mono whitespace-pre-wrap",children:i}),e.jsx("button",{onClick:_e,className:"mx-auto px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded hover:bg-[#004d63] transition-colors cursor-pointer",children:"Retry"})]}):E||Q?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(fe,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:Q?"Starting Interactive Mode":"Starting Dev Server"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:Q?"Loading component preview...":"Your dev server is starting up..."})]})]}):e.jsxs("div",{className:"flex flex-col gap-3 text-center px-8",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Code + Data Editor"}),e.jsx("p",{className:"text-sm text-[#888] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Describe what you want to build in the chat"})]})})})]}),e.jsxs("aside",{className:"w-[50%] min-w-[400px] max-w-[800px] bg-[#1e1e1e] border-r border-[#3d3d3d] shrink-0 flex flex-col overflow-hidden order-first",children:[e.jsxs("div",{className:"border-b border-[#3d3d3d] px-4 shrink-0 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsxs("button",{onClick:()=>U("app"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${L==="app"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["App",L==="app"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>{U("build"),oe(!0)},className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${L==="build"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Build",ye&&L!=="build"&&e.jsx("span",{className:"ml-1.5 inline-block w-2 h-2 rounded-full bg-amber-400 animate-pulse"}),L==="build"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>U("data"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${L==="data"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Data",L==="data"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>U("journal"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${L==="journal"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Journal",L==="journal"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]})]}),typeof Notification<"u"&&e.jsx("button",{onClick:Ce,className:`px-2 py-1 text-[10px] rounded transition-colors cursor-pointer ${B?"text-green-400 hover:text-green-300":"text-gray-500 hover:text-gray-300"}`,title:B?"Click to turn off notifications":"Click to get notified when Claude finishes",children:B?"Notifications On":"Notifications Off"})]}),e.jsxs("div",{className:"flex-1 overflow-hidden relative",children:[we&&e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:L==="build"?"visible":"hidden"},children:e.jsx(Je,{ref:P,entityName:"Editor",projectSlug:l,entityFilePath:null,scenarioName:null,onRefreshPreview:Ee,editorMode:!0,onIdleChange:Se,notificationsEnabled:B})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:L==="app"?"visible":"hidden"},children:e.jsx(et,{hasProject:b,scenarios:v,analyzedEntities:[],activeScenarioId:S,onScenarioSelect:he,onAnalyzedScenarioSelect:le,onSwitchToBuild:Ne,zoomComponent:T,onZoomChange:se,entityImports:j})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:L==="data"?"visible":"hidden"},children:e.jsx(Ke,{scenarios:v,projectRoot:g,activeScenarioId:S,onScenarioSelect:he,zoomComponent:T,onZoomChange:se,analyzedEntities:[],glossaryFunctions:k,activeAnalyzedScenarioId:z==null?void 0:z.scenarioId,onAnalyzedScenarioSelect:le,entityImports:j})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:L==="journal"?"visible":"hidden"},children:e.jsx(Ze,{isActive:L==="journal"})})]})]})]}),e.jsx(Ve,{serverUrl:_,isStarting:E,projectSlug:l,devServerError:i,onStartServer:c?Re:void 0}),je&&e.jsx(We,{width:I.width,height:I.height??900,onSave:$e,onCancel:()=>Z(!1)})]})});export{xt as default,dt as meta};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as W,j as e,w as ae,u as ne,r as l}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as ie,S as R}from"./Spinner-Bb5uFQ5V.js";import{u as re}from"./useLastLogLine-C14nCb1q.js";import{u as oe,V as le,S as ce}from"./useCustomSizes-ByhSyh0W.js";import{c as de}from"./cy-logo-cli-DcX-ZS3p.js";import{I as T}from"./InlineSpinner-Bu6c6aDe.js";import{T as he,D as xe}from"./Terminal-CcG8YTLx.js";import{S as me}from"./SafeScreenshot-BED4B6sP.js";import"./preload-helper-ckwbz45p.js";function ue({scenarios:w,currentScenarioId:i,entitySha:t,cacheBuster:o}){const c=W();return w.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:e.jsx("p",{className:"text-gray-500 text-sm",children:"No scenarios found"})}):e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:w.map(r=>{var j,m;const p=r.id===i,g=(m=(j=r.metadata)==null?void 0:j.screenshotPaths)==null?void 0:m[0];return e.jsxs("button",{onClick:()=>{c(`/entity/${t}/scenarios/${r.id}/dev`)},className:`w-full text-left rounded-lg overflow-hidden border transition-colors cursor-pointer flex ${p?"border-[#005c75] bg-[#1a3a44]":"border-[#3d3d3d] bg-[#252525] hover:border-[#555]"}`,children:[e.jsx("div",{className:"w-24 h-20 shrink-0 bg-[#1a1a1a]",children:e.jsx(me,{screenshotPath:g,cacheBuster:o,alt:r.name,className:"w-full h-full object-cover object-top"})}),e.jsxs("div",{className:"p-2.5 min-w-0 flex-1",children:[e.jsxs("div",{className:"text-white text-sm font-medium truncate",children:[p&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-[#005c75] mr-1.5 relative top-[-1px]"}),r.name]}),r.description&&e.jsx("div",{className:"text-gray-400 text-xs mt-1 line-clamp-2",children:r.description})]})]},r.id)})})}const P=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],ke=ae(function(){const{entity:i,scenario:t,analysis:o,projectSlug:c}=ne(),r=W(),p=l.useRef(null),g=l.useRef(null),[j,m]=l.useState(null),[E,M]=l.useState(1440),[n,N]=l.useState({name:"Desktop",width:1440,height:900}),[V,y]=l.useState(!1),[S,A]=l.useState(null),[d,k]=l.useState("chat"),[H,U]=l.useState(0),F=l.useCallback(()=>{U(s=>s+1)},[]),{customSizes:D,addCustomSize:q}=oe(c),f=l.useMemo(()=>[...P,...D],[D]),{interactiveServerUrl:v,isStarting:C,isLoading:$,showIframe:_,iframeKey:K,onIframeLoad:Y}=ie({analysisId:o==null?void 0:o.id,scenarioId:t==null?void 0:t.id,scenarioName:t==null?void 0:t.name,projectSlug:c,enabled:!0,refreshTrigger:H}),{lastLine:b}=re(c,C||$),G=()=>{r(`/entity/${i.sha}`)},J=(s,a)=>{M(s);const x=f.find(B=>B.width===s&&B.height===a);m(x||null),N({name:(x==null?void 0:x.name)||"Custom",width:s,height:a})},z=s=>{m(s),M(s.width),N({name:s.name,width:s.width,height:s.height})},O=s=>{q(s,n.width,n.height??900),y(!1),N(a=>({...a,name:s}))},Q=()=>{var a;k("chat"),(a=g.current)==null||a.sendInput("Create a new scenario for this entity based on the work we've just done. Create a name and description that reflects what the live preview is showing. Use the scenario data you've changed to create a new scenario in the database. If the data structure was fixed in any way you need to update that in the database as well and backfill all existing scenarios, then save to the database and capture a screenshot. Remember the database is at `.codeyam/db.sqlite3`, the scenarios table has all scenarios and the analyses table contains the scenariosDataStructure is its metadata.")},h=((o==null?void 0:o.scenarios)||[]).filter(s=>{var a;return!((a=s.metadata)!=null&&a.sameAsDefault)}),u=h.findIndex(s=>s.id===(t==null?void 0:t.id)),X=u+1,Z=h.length,L=u>0,I=u<h.length-1,ee=()=>{if(L){const s=h[u-1];r(`/entity/${i.sha}/scenarios/${s.id}/dev`)}},te=()=>{if(I){const s=h[u+1];r(`/entity/${i.sha}/scenarios/${s.id}/dev`)}},se=C||$||!_;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:de,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:i.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:ee,disabled:!L,className:`${L?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[X,"/",Z]}),e.jsx("button",{onClick:te,disabled:!I,className:`${I?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:t==null?void 0:t.name}),(t==null?void 0:t.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:t.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:t.description})]})]}),e.jsx("span",{className:"bg-[#005c75] text-white text-[10px] font-bold px-2 py-0.5 rounded uppercase tracking-wider ml-2",children:"Dev Mode"})]}),e.jsx("button",{onClick:G,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close dev mode",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${P[P.length-1].width}px`,width:"100%"},children:e.jsx(le,{currentViewportWidth:E,currentPresetName:n.name,onDevicePresetClick:z,devicePresets:f,hideLabel:!0,onHoverChange:A,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(S==null?void 0:S.name)||n.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:n.name,onChange:s=>{const a=f.find(x=>x.name===s.target.value);a&&z(a)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[f.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name)),n.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:n.width,onChange:s=>{const a=parseInt(s.target.value,10);!isNaN(a)&&a>0&&J(a,n.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"x"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:n.height??900}),n.name==="Custom"&&e.jsx("button",{onClick:()=>y(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
|
|
2
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
3
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
5
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
6
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:v?e.jsxs("div",{className:"relative bg-white w-full h-full",style:{maxWidth:`${n.width}px`,maxHeight:`${n.height}px`},children:[se&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(R,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Loading Preview"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Waiting for the dev server to be ready"}),b&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx(T,{}),b]})]})]})}),e.jsx("iframe",{ref:p,src:v,className:"w-full h-full border-none",title:`Dev mode preview: ${t==null?void 0:t.name}`,onLoad:Y,style:{opacity:_?1:0}},K)]}):e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 w-[500px] h-[300px] bg-white rounded-lg p-8 shadow-sm",children:[e.jsx("div",{className:"mb-4",children:e.jsx(R,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Dev Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment with live preview"}),b&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx(T,{}),b]})]})]})})]}),e.jsxs("aside",{className:"w-[50%] min-w-[400px] max-w-[800px] bg-[#1e1e1e] border-l border-[#3d3d3d] shrink-0 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"border-b border-[#3d3d3d] px-4 shrink-0 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsxs("button",{onClick:()=>k("chat"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${d==="chat"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Chat",d==="chat"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>k("scenarios"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${d==="scenarios"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Scenarios",d==="scenarios"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]})]}),d==="chat"&&e.jsx("button",{onClick:Q,disabled:!v,className:"px-3 py-1 text-[11px] font-medium rounded bg-[#005c75] text-white hover:bg-[#004a5c] transition-colors disabled:bg-gray-600 disabled:text-gray-400 disabled:cursor-not-allowed cursor-pointer",children:"Save Scenario"})]}),e.jsx("div",{style:{display:d==="chat"?"flex":"none"},className:"flex-1 overflow-hidden flex-col",children:e.jsx(he,{ref:g,entityName:i.name,entityType:i.entityType,entitySha:i.sha,entityFilePath:i.filePath||i.localFilePath,scenarioName:t==null?void 0:t.name,scenarioDescription:t==null?void 0:t.description,analysisId:o==null?void 0:o.id,projectSlug:c,onRefreshPreview:F})}),d==="scenarios"&&e.jsx(ue,{scenarios:h,currentScenarioId:t==null?void 0:t.id,entitySha:i.sha,cacheBuster:0})]})]}),e.jsx(xe,{serverUrl:v,isStarting:C,projectSlug:c}),V&&e.jsx(ce,{width:n.width,height:n.height??900,onSave:O,onCancel:()=>y(!1)})]})});export{ke as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{w as Y,u as q,a as G,b as J,r as l,j as e}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as O,S as P}from"./Spinner-Bb5uFQ5V.js";import{u as Q}from"./useLastLogLine-C14nCb1q.js";import{u as X,V as Z,S as ee}from"./useCustomSizes-ByhSyh0W.js";import{c as te}from"./cy-logo-cli-DcX-ZS3p.js";import{I as $}from"./InlineSpinner-Bu6c6aDe.js";const b=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],xe=Y(function(){const{entity:i,scenario:s,analysis:r,projectSlug:m}=q(),u=G();J();const[ne,w]=l.useState(null),[_,N]=l.useState(1440),[a,g]=l.useState({name:"Desktop",width:1440,height:900}),[z,p]=l.useState(!1),[f,B]=l.useState(null),{customSizes:S,addCustomSize:D}=X(m),x=l.useMemo(()=>[...b,...S],[S]),{interactiveServerUrl:y,isStarting:k,isLoading:C,showIframe:I,iframeKey:W,onIframeLoad:E}=O({analysisId:r==null?void 0:r.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:m,enabled:!0}),{lastLine:h}=Q(m,k||C),U=()=>{u(`/entity/${i.sha}`)},V=(t,n)=>{N(t);const o=x.find(M=>M.width===t&&M.height===n);w(o||null),g({name:(o==null?void 0:o.name)||"Custom",width:t,height:n})},L=t=>{w(t),N(t.width),g({name:t.name,width:t.width,height:t.height})},R=t=>{D(t,a.width,a.height??900),p(!1),g(n=>({...n,name:t}))},c=((r==null?void 0:r.scenarios)||[]).filter(t=>{var n;return!((n=t.metadata)!=null&&n.sameAsDefault)}),d=c.findIndex(t=>t.id===(s==null?void 0:s.id)),H=d+1,T=c.length,v=d>0,j=d<c.length-1,A=()=>{if(v){const t=c[d-1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},F=()=>{if(j){const t=c[d+1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},K=k||C||!I;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:te,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:i.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:A,disabled:!v,className:`${v?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[H,"/",T]}),e.jsx("button",{onClick:F,disabled:!j,className:`${j?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]})]}),e.jsx("button",{onClick:U,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close fullscreen",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${b[b.length-1].width}px`,width:"100%"},children:e.jsx(Z,{currentViewportWidth:_,currentPresetName:a.name,onDevicePresetClick:L,devicePresets:x,hideLabel:!0,onHoverChange:B,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(f==null?void 0:f.name)||a.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:a.name,onChange:t=>{const n=x.find(o=>o.name===t.target.value);n&&L(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[x.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),a.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:a.width,onChange:t=>{const n=parseInt(t.target.value,10);!isNaN(n)&&n>0&&V(n,a.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"×"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:a.height??900}),a.name==="Custom"&&e.jsx("button",{onClick:()=>p(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
|
|
2
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
3
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
5
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
6
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:y?e.jsxs("div",{className:"relative bg-white w-full h-full",style:{maxWidth:`${a.width}px`,maxHeight:`${a.height}px`},children:[K&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),e.jsx("iframe",{src:y,className:"w-full h-full border-none",title:`Interactive preview: ${s==null?void 0:s.name}`,onLoad:E,style:{opacity:I?1:0}},W)]}):e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 w-[500px] h-[300px] bg-white rounded-lg p-8 shadow-sm",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),z&&e.jsx(ee,{width:a.width,height:a.height??900,onSave:R,onCancel:()=>p(!1)})]})});export{xe as default};
|
package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{r as a,j as e,w as Z,u as ee,a as te,L as v}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{W as se,u as re,I as ae}from"./InteractivePreview-DYFW3lDD.js";import{u as ne}from"./Spinner-Bb5uFQ5V.js";import{c as oe}from"./executionFlowCoverage-BWhdfn70.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-C14nCb1q.js";import"./InlineSpinner-Bu6c6aDe.js";function ie({executionFlows:t,selections:r,onChange:n,disabled:i=!1}){const x=a.useCallback(s=>r.some(o=>o.flowId===s),[r]),p=a.useCallback(s=>{x(s.id)?n(r.filter(o=>o.flowId!==s.id)):n([...r,{flowId:s.id,flowName:s.name}])},[r,n,x]);return t.length===0?e.jsx("div",{className:"text-sm text-gray-500 py-2",children:"No execution flows found."}):e.jsx("div",{className:"space-y-3",children:t.map(s=>{const o=x(s.id),I=s.usedInScenarios.length>0;return e.jsxs("div",{className:"border-b border-gray-100 pb-3 last:border-0 last:pb-0",children:[e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:()=>p(s),disabled:i,className:"mt-0.5 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-mono text-sm font-medium text-gray-900",children:s.name}),!I&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:"uncovered"}),s.blocksOtherFlows&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-purple-100 text-purple-700 rounded",children:"blocking"}),s.impact==="high"&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-red-100 text-red-700 rounded",children:"high impact"})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 m-0",children:s.description})]})]}),o&&s.requiredValues.length>0&&e.jsxs("div",{className:"ml-6 mt-2 p-2 bg-gray-50 rounded text-xs",children:[e.jsx("span",{className:"text-gray-700 font-medium",children:"Required values:"}),e.jsx("ul",{className:"m-0 mt-1 pl-4 space-y-0.5",children:s.requiredValues.map((h,E)=>e.jsxs("li",{className:"text-gray-600",children:[e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.attributePath})," ",e.jsx("span",{className:"text-gray-400",children:h.comparison})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.value})]},E))})]})]},s.id)})})}const ge=({data:t})=>[{title:t!=null&&t.entity?`Create Scenario - ${t.entity.name} - CodeYam`:"Create Scenario - CodeYam"},{name:"description",content:"Create a new scenario"}];function ce(){var W;const{analysis:t,defaultScenario:r,entity:n,entitySha:i,projectSlug:x}=ee(),p=te(),{iframeRef:s}=re(),[o,I]=a.useState(""),[h,E]=a.useState(400),[b,P]=a.useState(!1),[U,R]=a.useState(!1),[G,$]=a.useState(!1),[M,L]=a.useState(null),[F,l]=a.useState(null),[d,H]=a.useState([]),D=a.useMemo(()=>{var c;return!((c=t==null?void 0:t.metadata)!=null&&c.executionFlows)||!(t!=null&&t.scenarios)?[]:oe(t.metadata.executionFlows,t.scenarios).executionFlows},[t]),{interactiveServerUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V}=ne({analysisId:t==null?void 0:t.id,scenarioId:r==null?void 0:r.id,scenarioName:r==null?void 0:r.name,projectSlug:x,enabled:!0}),Y=a.useCallback(async()=>{var m,c,T,z;if(!o.trim()&&d.length===0){L("Please describe how you want to change the scenario or select execution flows");return}R(!0),L(null),l("Generating scenario with AI...");try{const u=await fetch("/api/generate-scenario-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:o,existingScenarios:t.scenarios,scenariosDataStructure:(m=t.metadata)==null?void 0:m.scenariosDataStructure,flowSelections:d.length>0?d:void 0})}),N=await u.json();if(!u.ok||!N.success)throw new Error(N.error||"Failed to generate scenario data");console.log("[CreateScenario] AI generated scenario:",N.data);const g=N.data;if(!g.name||!g.data)throw new Error("AI response missing required fields (name or data)");l("Saving new scenario..."),$(!0);const X={name:g.name,description:g.description||o,metadata:{data:g.data,interactiveExamplePath:(c=r.metadata)==null?void 0:c.interactiveExamplePath}},Q=[...t.scenarios||[],X],O=await fetch("/api/save-scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysis:t,scenarios:Q})}),C=await O.json();if(!O.ok||!C.success)throw new Error(C.error||"Failed to save scenario");console.log("[CreateScenario] Scenario saved:",C);const f=(z=(T=C.analysis)==null?void 0:T.scenarios)==null?void 0:z.find(k=>k.name===g.name);if(!(f!=null&&f.id)){console.warn("[CreateScenario] Could not find saved scenario ID, navigating to entity page"),l("Scenario created! Redirecting..."),setTimeout(()=>void p(`/entity/${i}`),1e3);return}if(y){l("Capturing screenshot...");const k=await fetch("/api/capture-screenshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverUrl:y,scenarioId:f.id,projectId:t.projectId,viewportWidth:1440})}),A=await k.json();!k.ok||!A.success?(console.error("[CreateScenario] Capture failed:",A),l("Scenario created! (Screenshot capture failed)")):l("Scenario created and captured!")}else l("Scenario created!");setTimeout(()=>{p(`/entity/${i}/scenarios/${f.id}`)},1e3)}catch(u){console.error("[CreateScenario] Error:",u),L(u instanceof Error?u.message:String(u)),l(null)}finally{R(!1),$(!1)}},[o,d,t,r,i,y,p]),j=U||G,K=a.useCallback(()=>{P(!0)},[]),w=a.useCallback(m=>{if(!b)return;const c=m.clientX;c>=250&&c<=600&&E(c)},[b]),S=a.useCallback(()=>{P(!1)},[]);return a.useEffect(()=>(b?(document.addEventListener("mousemove",w),document.addEventListener("mouseup",S)):(document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)}),[b,w,S]),e.jsxs("div",{className:"h-screen bg-white flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-end h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 pb-[14px]",children:[e.jsx("button",{onClick:()=>void p(`/entity/${i}`),className:"no-underline shrink-0 bg-transparent border-none cursor-pointer p-0 flex items-center",title:"Back",children:e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h1",{className:"text-base font-semibold text-black m-0 leading-[20px] shrink-0",children:n==null?void 0:n.name}),e.jsx("span",{className:"text-xs text-[#9e9e9e] font-mono font-normal whitespace-nowrap overflow-hidden text-ellipsis min-w-0",title:n==null?void 0:n.filePath,children:n==null?void 0:n.filePath})]}),e.jsxs("div",{className:"flex items-end gap-8 shrink-0",children:[e.jsx(v,{to:`/entity/${i}/scenarios`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-medium border-b-2",style:{color:"#005C75",borderColor:"#005C75"},children:e.jsxs("span",{className:"flex items-center gap-2",children:["Scenarios",e.jsx("span",{className:"inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full bg-[#cbf3fa] text-[#005c75]",children:((W=t==null?void 0:t.scenarios)==null?void 0:W.length)||0})]})}),e.jsx(v,{to:`/entity/${i}/related`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Related Entities"}),e.jsx(v,{to:`/entity/${i}/code`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Code"}),e.jsx(v,{to:`/entity/${i}/data`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Data Structure"}),e.jsx(v,{to:`/entity/${i}/history`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"History"})]})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0 relative",children:[e.jsxs("aside",{className:"bg-white border-r border-gray-200 overflow-y-auto shrink-0 p-6 flex flex-col",style:{width:`${h}px`},children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Default Scenario Preview"}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"The preview on the right shows the Default Scenario. Select execution flows and/or describe how you'd like to change it."})]}),D.length>0&&e.jsxs("details",{className:"mb-4 border border-gray-200 rounded-lg",children:[e.jsxs("summary",{className:"px-3 py-2 text-sm font-medium text-gray-700 cursor-pointer hover:bg-gray-50 rounded-lg",children:["Select Execution Flows"," ",d.length>0&&e.jsxs("span",{className:"text-blue-600",children:["(",d.length," selected)"]})]}),e.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-gray-100",children:e.jsx(ie,{executionFlows:D,selections:d,onChange:H,disabled:j})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"prompt",className:"block text-sm font-medium text-gray-700 mb-2",children:"Describe your scenario"}),e.jsx("textarea",{id:"prompt",value:o,onChange:m=>I(m.target.value),placeholder:"e.g., Show an empty state with no items...",className:"w-full h-32 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-sm resize-none",disabled:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:()=>void Y(),disabled:j||!o.trim()&&d.length===0,className:"w-full px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium cursor-pointer transition-colors hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:j?"Creating...":"Create Scenario"}),F&&e.jsx("div",{className:"text-xs text-blue-600 bg-blue-50 px-2 py-1.5 rounded",children:F}),M&&e.jsx("div",{className:"text-xs text-red-600 bg-red-50 px-2 py-1.5 rounded",children:M})]})]}),e.jsxs("div",{onMouseDown:K,style:{width:"20px",position:"absolute",top:0,left:`${h-10}px`,bottom:0,cursor:"col-resize",touchAction:"none",userSelect:"none",zIndex:100,pointerEvents:"auto"},children:[e.jsx("div",{style:{position:"absolute",left:"10px",top:0,bottom:0,width:"1px",background:b?"#005c75":"rgba(0,0,0,0.1)",transition:"background 0.15s ease"}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:"10px",transform:"translate(-50%, -50%)",width:"8px",height:"40px",background:"#fff",border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",cursor:"col-resize"}})]}),e.jsx("main",{className:"flex-1 overflow-auto flex items-center justify-center min-w-0",style:{backgroundImage:`
|
|
2
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
3
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
5
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
6
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:e.jsx(ae,{scenarioId:r.id||r.name,scenarioName:r.name,iframeUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V,projectSlug:x,defaultWidth:1440,defaultHeight:900})})]})]})}const be=Z(function(){return e.jsx(se,{children:e.jsx(ce,{})})});export{be as default,ge as meta};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as l}from"./chunk-JZWAC4HX-C4pqxYJB.js";function C(e){switch(e){case"queued":return{text:"Queued",bgColor:"#cbf3fa",textColor:"#3098b4",icon:l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3098b4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12,6 12,12 16,14"})]})};case"analyzing":return{text:"Analyzing...",bgColor:"#ffdbf6",textColor:"#ff2ab5",icon:l.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[l.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),l.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]})};case"up-to-date":return{text:"Up to date",bgColor:"#e8ffe6",textColor:"#00925d",icon:null};case"incomplete":return{text:"Incomplete",bgColor:"#fdf9c9",textColor:"#c69538",icon:null};case"out-of-date":return{text:"Out of date",bgColor:"#fdf9c9",textColor:"#c69538",icon:null};case"not-analyzed":return{text:"Not analyzed",bgColor:"#f9f9f9",textColor:"#646464",icon:null}}}function A(e){if(!e)return"Never";const o=new Date(e),c=new Date;if(o.getDate()===c.getDate()&&o.getMonth()===c.getMonth()&&o.getFullYear()===c.getFullYear()){const t=o.getHours(),f=o.getMinutes(),u=t>=12?"pm":"am",d=t%12||12,i=f.toString().padStart(2,"0");return`Today, ${d}:${i} ${u}`}return o.toLocaleString("en-US",{month:"numeric",day:"numeric",year:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0})}function b(e,o=[],c=!1){var h,g;if(o.some(n=>{var a,s;return!!((a=n.entityShas)!=null&&a.includes(e.sha)||(s=n.entities)!=null&&s.some(r=>r.sha===e.sha))}))return c?"analyzing":"queued";if(!e.analyses||e.analyses.length===0)return"not-analyzed";const t=e.analyses[0];if(!(((h=t.status)==null?void 0:h.scenarios)&&t.status.scenarios.length>0&&t.status.scenarios.some(n=>n.screenshotFinishedAt||n.finishedAt))||t.entitySha!==e.sha)return"not-analyzed";const u=t.createdAt?new Date(t.createdAt).getTime():0,d=(g=e.metadata)!=null&&g.editedAt?new Date(e.metadata.editedAt).getTime():0,i=t.scenarios||[],p=i.some(n=>{var a,s,r;return((s=(a=n.metadata)==null?void 0:a.screenshotPaths)==null?void 0:s[0])||((r=n.metadata)==null?void 0:r.executionResult)});return u>=d?i.length>0&&p?i.every(a=>{var s,r,m;return((r=(s=a.metadata)==null?void 0:s.screenshotPaths)==null?void 0:r[0])||((m=a.metadata)==null?void 0:m.executionResult)})?"up-to-date":"incomplete":i.length>0?"incomplete":"not-analyzed":"out-of-date"}export{C as a,A as f,b as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as ne,r as u,j as e,w as le,u as ce,f as de}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as me}from"./useReportContext-O-jkvSPx.js";import{C as pe,a as he,F as fe,b as xe,E as ue,S as ye,u as ge}from"./EntityItem-C76mRRiF.js";import{g as T}from"./fileTableUtils-cPo8LiG3.js";import{C as ae}from"./chevron-down-BH2h1Ea2.js";import{S as ve}from"./search-fKo7v0Zo.js";import"./createLucideIcon-CMT1jU2q.js";import"./useToast-9FIWuYfK.js";import"./TruncatedFilePath-C8OKAR5x.js";import"./SafeScreenshot-BED4B6sP.js";import"./LibraryFunctionPreview-DLeucoVX.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-DtSmdtM4.js";import"./EntityTypeIcon-CobE682z.js";import"./EntityTypeBadge-g3saevPb.js";function be({entities:Q,page:N,itemsPerPage:b=50,currentRun:L,filter:S,entityType:_,queueState:o,isEntityPending:U,pendingEntityKeys:w,onGenerateSimulation:k,onGenerateAllSimulations:D,totalFilesCount:H,totalEntitiesCount:J,uncommittedFilesCount:W,showOnlyUncommitted:j,onToggleUncommitted:V}){const[I,X]=ne(),[B,M]=u.useState(new Set),[A,y]=u.useState(""),[g,x]=u.useState(!1),[E,$]=u.useState("all"),[z,Y]=u.useState("desc"),P=_||"all",R=u.useMemo(()=>{let s=Q;return P!=="all"&&(s=s.filter(i=>i.entityType===P)),S==="analyzed"&&(s=s.filter(i=>i.analyses&&i.analyses.length>0)),s},[Q,P,S]),te=u.useMemo(()=>{const s=new Map,i=new Map,p=new Map;R.forEach(a=>{var r,c;const t=`${a.filePath}::${a.name}`,n=i.get(t);if(!n)i.set(t,a),p.set(t,[]);else{const d=((r=n.metadata)==null?void 0:r.editedAt)||n.createdAt||"",l=((c=a.metadata)==null?void 0:c.editedAt)||a.createdAt||"";let m=!1;if(l>d)m=!0;else if(l===d){const h=n.createdAt||"";m=(a.createdAt||"")>h}m?(p.get(t).push(n),i.set(t,a)):p.get(t).push(a)}}),i.forEach((a,t)=>{var r;if(!(a.analyses&&a.analyses.length>0)&&((r=a.metadata)!=null&&r.previousVersionWithAnalyses)){const d=(p.get(t)||[]).find(l=>{var m;return l.sha===((m=a.metadata)==null?void 0:m.previousVersionWithAnalyses)});d&&d.analyses&&d.analyses.length>0&&(a.analyses=d.analyses)}}),Array.from(i.values()).sort((a,t)=>{var c,d,l,m;const n=!((c=a.metadata)!=null&&c.notExported)&&!((d=a.metadata)!=null&&d.namedExport),r=!((l=t.metadata)!=null&&l.notExported)&&!((m=t.metadata)!=null&&m.namedExport);return n&&!r?-1:!n&&r?1:0}).forEach(a=>{var d,l,m,h,f;const t=a.filePath??"No File Path";s.has(t)||s.set(t,{filePath:t,entities:[],totalCount:0,uncommittedCount:0,lastUpdated:null,previewScreenshots:[],previewScreenshotErrors:[],previewLibraryScenarios:[],state:"up-to-date",simulationCount:0});const n=s.get(t);n.entities.push(a),n.totalCount++,(d=a.metadata)!=null&&d.isUncommitted&&n.uncommittedCount++;const r=((h=(m=(l=a.analyses)==null?void 0:l[0])==null?void 0:m.scenarios)==null?void 0:h.length)||0;n.simulationCount+=r;const c=((f=a.metadata)==null?void 0:f.editedAt)||a.updatedAt;c&&(!n.lastUpdated||new Date(c)>new Date(n.lastUpdated))&&(n.lastUpdated=c)});const q=(o==null?void 0:o.jobs)||[],ee=a=>{const t=`${a.filePath||""}::${a.name}`;return(w==null?void 0:w.includes(t))||!1};s.forEach(a=>{const t=a.entities.map(n=>ee(n)?"queued":T(n,q));t.includes("analyzing")||t.includes("queued")?a.state="analyzing":t.includes("incomplete")?a.state="incomplete":t.includes("out-of-date")?a.state="out-of-date":t.includes("not-analyzed")?a.state="not-analyzed":a.state="up-to-date"}),s.forEach(a=>{var t,n,r,c,d;for(const l of a.entities){if(a.previewScreenshots.length+a.previewLibraryScenarios.length>=3)break;const h=((n=(t=l.analyses)==null?void 0:t[0])==null?void 0:n.scenarios)||[];if(l.entityType==="library"){const f=h.find(v=>{var F,O;return((F=v.metadata)==null?void 0:F.executionResult)||((O=v.metadata)==null?void 0:O.error)});f&&a.previewLibraryScenarios.push({scenario:f,entitySha:l.sha})}else{const f=h.find(v=>{var F,O;return(O=(F=v.metadata)==null?void 0:F.screenshotPaths)==null?void 0:O[0]});if(f){const v=(c=(r=f.metadata)==null?void 0:r.screenshotPaths)==null?void 0:c[0],F=!!((d=f.metadata)!=null&&d.error);v&&!a.previewScreenshots.includes(v)&&(a.previewScreenshots.push(v),a.previewScreenshotErrors.push(F))}}}});const G=Array.from(s.values());return G.sort((a,t)=>{if(S==="analyzed"){const c=Math.max(...a.entities.filter(l=>{var m,h;return(h=(m=l.analyses)==null?void 0:m[0])==null?void 0:h.createdAt}).map(l=>new Date(l.analyses[0].createdAt).getTime()),0),d=Math.max(...t.entities.filter(l=>{var m,h;return(h=(m=l.analyses)==null?void 0:m[0])==null?void 0:h.createdAt}).map(l=>new Date(l.analyses[0].createdAt).getTime()),0);return z==="desc"?d-c:c-d}if(a.uncommittedCount>0&&t.uncommittedCount===0)return-1;if(a.uncommittedCount===0&&t.uncommittedCount>0)return 1;const n=a.lastUpdated?new Date(a.lastUpdated).getTime():0,r=t.lastUpdated?new Date(t.lastUpdated).getTime():0;return z==="desc"?r-n:n-r}),G},[R,S,z,o,w]),C=u.useMemo(()=>{let s=te;if(E!=="all"&&(s=s.filter(i=>i.state===E)),A.trim()){const i=A.toLowerCase();s=s.filter(p=>p.filePath.toLowerCase().includes(i))}return s},[te,A,E]),se=(N-1)*b,oe=se+b,Z=C.slice(se,oe),K=Math.ceil(C.length/b),re=s=>{M(i=>{const p=new Set(i);return p.has(s)?p.delete(s):p.add(s),p})},ie=()=>{Y(s=>s==="desc"?"asc":"desc")};return e.jsxs("div",{children:[e.jsxs("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-3",children:[e.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Filters"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative w-[130px]",children:[e.jsxs("select",{value:P,onChange:s=>{const i=s.target.value,p=new URLSearchParams(I);i==="all"?p.delete("entityType"):p.set("entityType",i),p.set("page","1"),X(p)},className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"visual",children:"Visual"}),e.jsx("option",{value:"library",children:"Library"})]}),e.jsx(ae,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"relative w-[130px]",children:[e.jsxs("select",{value:E,onChange:s=>$(s.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:[e.jsx("option",{value:"all",children:"All States"}),e.jsx("option",{value:"analyzing",children:"Analyzing..."}),e.jsx("option",{value:"up-to-date",children:"Up to date"}),e.jsx("option",{value:"incomplete",children:"Incomplete"}),e.jsx("option",{value:"out-of-date",children:"Out of date"}),e.jsx("option",{value:"not-analyzed",children:"Not analyzed"})]}),e.jsx(ae,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(ve,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Search component",value:A,onChange:s=>y(s.target.value),className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-[10px] text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors"})]})]})]}),H!==void 0&&J!==void 0&&W!==void 0&&e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx("span",{style:{color:"#000000"},children:C.length})," ",C.length===1?"file":"files"]}),e.jsxs("div",{className:"relative group inline-flex items-center ml-1.5",children:[e.jsx("svg",{className:"w-3 h-3 text-gray-400 cursor-help",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:e.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),e.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:[e.jsx("span",{style:{color:"#000000"},children:C.reduce((s,i)=>s+i.totalCount,0)})," ",C.reduce((s,i)=>s+i.totalCount,0)===1?"entity":"entities"]}),e.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),j?e.jsxs("button",{onClick:V,className:"flex items-center gap-2 text-[#005c75] underline hover:text-[#004a5e] transition-colors ml-2 font-mono uppercase cursor-pointer",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[C.filter(s=>s.uncommittedCount>0).length," ","uncommitted"," ",C.filter(s=>s.uncommittedCount>0).length===1?"file":"files",e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})]}):e.jsxs("button",{onClick:V,className:"text-[#005c75] underline hover:text-[#004a5e] transition-colors ml-2 font-mono uppercase",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[W," uncommitted"," ",W===1?"file":"files"]})]}),Z.length>0&&e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("button",{onClick:()=>{M(new Set(Z.map(s=>s.filePath))),x(!0)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx(pe,{className:"w-3.5 h-3.5"}),"Expand All"]}),e.jsxs("button",{onClick:()=>{M(new Set),x(!1)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx(he,{className:"w-3.5 h-3.5"}),"Collapse All"]})]})]})}),e.jsx(fe,{showActions:!0,sortOrder:z,onSortChange:ie}),e.jsx("div",{className:"flex flex-col gap-[3px]",children:Z.map(s=>{const i=B.has(s.filePath),q=s.entities.filter(t=>(t.entityType==="visual"||t.entityType==="library")&&(T(t,(o==null?void 0:o.jobs)||[])==="not-analyzed"||T(t,(o==null?void 0:o.jobs)||[])==="out-of-date"||T(t,(o==null?void 0:o.jobs)||[])==="incomplete")).length>0,ee=t=>{var n;return((n=L==null?void 0:L.currentEntityShas)==null?void 0:n.includes(t))||!1},G=t=>{var n;return U!=null&&U(t)?!0:((n=o==null?void 0:o.jobs)==null?void 0:n.some(r=>{var c;return(c=r.entityShas)==null?void 0:c.includes(t.sha)}))||!1},a=t=>{k==null||k(t)};return e.jsx(xe,{filePath:s.filePath,isExpanded:i,onToggle:()=>re(s.filePath),simulationPreviews:e.jsx(ye,{entities:s.entities,maxPreviews:1}),entityCount:s.totalCount,state:s.state,lastModified:s.lastUpdated,uncommittedCount:s.uncommittedCount,isUncommitted:s.uncommittedCount>0,actionButton:q?e.jsx("button",{onClick:t=>{t.stopPropagation();const n=s.entities.filter(r=>(r.entityType==="visual"||r.entityType==="library")&&(T(r,(o==null?void 0:o.jobs)||[])==="not-analyzed"||T(r,(o==null?void 0:o.jobs)||[])==="out-of-date"||T(r,(o==null?void 0:o.jobs)||[])==="incomplete"));D==null||D(n)},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors cursor-pointer px-[15px] py-0 h-[28px]",children:s.state==="out-of-date"?"Re-analyze":"Analyze"}):void 0,children:s.entities.sort((t,n)=>{var m,h,f,v;const r=!((m=t.metadata)!=null&&m.notExported)&&!((h=t.metadata)!=null&&h.namedExport),c=!((f=n.metadata)!=null&&f.notExported)&&!((v=n.metadata)!=null&&v.namedExport);if(r&&!c)return-1;if(!r&&c)return 1;const d=t.entityType==="visual"||t.entityType==="library",l=n.entityType==="visual"||n.entityType==="library";return d&&!l?-1:!d&&l?1:t.name.localeCompare(n.name)}).map(t=>e.jsx(ue,{entity:t,isActivelyAnalyzing:ee(t.sha),isQueued:G(t),onGenerateSimulation:a},t.sha))},s.filePath)})}),K>1&&e.jsxs("div",{className:"flex justify-center items-center gap-4 mt-6 p-4",children:[N>1&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(I),page:String(N-1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"← Previous"}),e.jsxs("span",{children:["Page ",N," of ",K]}),N<K&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(I),page:String(N+1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"Next →"})]})]})}const De=()=>[{title:"Files & Entities - CodeYam"},{name:"description",content:"Browse your codebase files and entities"}],We=le(function(){var B,M,A;const{entities:N,currentCommit:b,page:L,filter:S,entityType:_,queueState:o,error:U}=ce();de(),ne();const[w,k]=u.useState(!1);me({source:"files-page"});const{handleGenerateSimulation:D,handleGenerateAllSimulations:H,isEntityPending:J,pendingEntityKeys:W}=ge((M=(B=b==null?void 0:b.metadata)==null?void 0:B.currentRun)==null?void 0:M.currentEntityShas,o),j=N||[],V=u.useMemo(()=>{const y=new Set([]);for(const g of j)y.add(g.filePath??"No File Path");return Array.from(y)},[j]),I=u.useMemo(()=>{let y=j;return w&&(y=y.filter(g=>{var x;return(x=g.metadata)==null?void 0:x.isUncommitted})),y.sort((g,x)=>{var E,$,z,Y,P,R;return(E=g.metadata)!=null&&E.isUncommitted&&!(($=x.metadata)!=null&&$.isUncommitted)?-1:!((z=g.metadata)!=null&&z.isUncommitted)&&((Y=x.metadata)!=null&&Y.isUncommitted)?1:new Date(((P=x.metadata)==null?void 0:P.editedAt)||0).getTime()-new Date(((R=g.metadata)==null?void 0:R.editedAt)||0).getTime()})},[j,w]),X=u.useMemo(()=>{var g;const y=new Set([]);for(const x of j)(g=x.metadata)!=null&&g.isUncommitted&&y.add(x.filePath??"No File Path");return Array.from(y)},[j]);return U?e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:U})]})}):j.length===0?e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Files & Entities"}),e.jsx("p",{className:"text-[15px] text-gray-500",children:"This is a list of all the files in your app."})]}),e.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:e.jsxs("div",{className:"max-w-md mx-auto",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-3",children:"No entities found"}),e.jsxs("p",{className:"text-[15px] text-gray-600 mb-6",children:["Your project hasn't been analyzed yet. Run"," ",e.jsx("code",{className:"px-2 py-1 bg-gray-100 rounded text-sm font-mono",children:"codeyam analyze"})," ","to extract entities from your codebase."]}),e.jsx("p",{className:"text-sm text-gray-500",children:"Entities include React components, functions, and other analyzable code elements."})]})})]})}):e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Files & Entities"}),e.jsx("p",{className:"text-[15px] text-gray-500",children:"This is a list of all the files in your app."})]}),e.jsx(be,{entities:I,page:L,itemsPerPage:50,currentRun:(A=b==null?void 0:b.metadata)==null?void 0:A.currentRun,filter:S,entityType:_,queueState:o,isEntityPending:J,pendingEntityKeys:W,onGenerateSimulation:D,onGenerateAllSimulations:H,totalFilesCount:V.length,totalEntitiesCount:j.length,uncommittedFilesCount:X.length,showOnlyUncommitted:w,onToggleUncommitted:()=>k(!w)})]})})});export{We as default,De as meta};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var un=Object.defineProperty;var hn=(e,t,n)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var G=(e,t,n)=>hn(e,typeof t!="symbol"?t+"":t,n);import{r as R,d as $t,g as pn,j as l,w as mn,u as gn,b as xn}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as yn}from"./useReportContext-O-jkvSPx.js";import{F as Vt,b as zt,E as Pt,S as Gt,u as vn,C as bn,a as wn}from"./EntityItem-C76mRRiF.js";import{L as Cn}from"./LogViewer-ceAyBX-H.js";import{g as Ht}from"./fileTableUtils-cPo8LiG3.js";import"./createLucideIcon-CMT1jU2q.js";import"./useToast-9FIWuYfK.js";import"./TruncatedFilePath-C8OKAR5x.js";import"./SafeScreenshot-BED4B6sP.js";import"./LibraryFunctionPreview-DLeucoVX.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-DtSmdtM4.js";import"./EntityTypeIcon-CobE682z.js";import"./EntityTypeBadge-g3saevPb.js";function Nn(e,t,n=10){var c;const r=new Map,i=d=>d.entityType==="visual"||d.entityType==="library";for(const d of e)i(d)&&r.set(d.sha,{entity:d,depth:0});const s=new Map;for(const d of t){const f=(c=d.metadata)==null?void 0:c.importedBy;if(f)for(const u of Object.keys(f))for(const h of Object.keys(f[u])){const{shas:b}=f[u][h];for(const g of b)s.has(d.sha)||s.set(d.sha,new Set),s.get(d.sha).add(g)}}const o=[],a=new Set;for(const d of e)o.push({sha:d.sha,depth:0}),a.add(d.sha);for(;o.length>0;){const{sha:d,depth:f}=o.shift();if(f>=n)continue;const u=s.get(d);if(u)for(const h of u){if(a.has(h))continue;a.add(h);const b=t.find(g=>g.sha===h);if(b){if(i(b)){const g=f+1,p=r.get(h);(!p||g<p.depth)&&r.set(h,{entity:b,depth:g})}o.push({sha:h,depth:f+1})}}}return Array.from(r.values()).sort((d,f)=>d.depth!==f.depth?d.depth-f.depth:d.entity.name.localeCompare(f.entity.name))}function Le(e){const t=new Map;for(const r of e)t.has(r.name)||t.set(r.name,[]),t.get(r.name).push(r);const n=[];for(const r of t.values())if(r.length===1)n.push(r[0]);else{const i=r.sort((s,o)=>{var d,f;const a=((d=s.metadata)==null?void 0:d.editedAt)||s.createdAt||"";return(((f=o.metadata)==null?void 0:f.editedAt)||o.createdAt||"").localeCompare(a)});n.push(i[0])}return n}function jn(e,t){const n=new Map,r=new Set(e.map(i=>i.path));for(const i of e)i.status==="renamed"&&i.oldPath&&r.add(i.oldPath);for(const i of e){const s=t.filter(c=>c.filePath===i.path||i.status==="renamed"&&i.oldPath&&c.filePath===i.oldPath),o=s.filter(c=>{var d,f;return r.has(c.filePath)&&((d=c.metadata)==null?void 0:d.isUncommitted)&&!((f=c.metadata)!=null&&f.isSuperseded)}),a=Le(o);n.set(i.path,{status:i,entities:s,editedEntities:a})}return n}function Sn(e,t,n){const r=new Map;if(!n){for(const s of e)if(s.status==="deleted")r.set(s.path,{status:s,entities:[]});else{const o=t.filter(c=>c.filePath===s.path||s.status==="renamed"&&s.oldPath&&c.filePath===s.oldPath),a=Le(o);r.set(s.path,{status:s,entities:a})}return r}const i=new Map;for(const s of n.fileComparisons){const o=new Set;for(const a of s.newEntities)o.add(a.name);for(const a of s.modifiedEntities)o.add(a.name);for(const a of s.deletedEntities)o.add(a.name);o.size>0&&i.set(s.filePath,o)}for(const s of e){const o=i.get(s.path);if(s.status==="deleted")r.set(s.path,{status:s,entities:[]});else{const a=o?t.filter(d=>(d.filePath===s.path||s.status==="renamed"&&s.oldPath&&d.filePath===s.oldPath)&&o.has(d.name)):[],c=Le(a);r.set(s.path,{status:s,entities:c})}}return r}function kn(e,t){const n=new Map,r=Ln(e,t);for(const i of r){const o=Nn([i],t).filter(({depth:a})=>a>0);n.set(i.sha,o)}return n}function Ln(e,t){const n=new Set(e.map(i=>i.path));for(const i of e)i.status==="renamed"&&i.oldPath&&n.add(i.oldPath);const r=t.filter(i=>{var s,o;return n.has(i.filePath)&&((s=i.metadata)==null?void 0:s.isUncommitted)&&!((o=i.metadata)!=null&&o.isSuperseded)});return Le(r)}function An(e,t,n){const[r,i]=R.useState(()=>new Set),[s,o]=R.useState(()=>new Set),a=R.useRef([]),c=R.useRef([]);return R.useEffect(()=>{(t.length!==a.current.length||t.some((p,C)=>p!==a.current[C]))&&(a.current=t,i(p=>{const C=new Set;return t.forEach(w=>{p.has(w)&&C.add(w)}),C}))},[t]),R.useEffect(()=>{(n.length!==c.current.length||n.some((p,C)=>p!==c.current[C]))&&(c.current=n,o(p=>{const C=new Set;return n.forEach(w=>{p.has(w)&&C.add(w)}),C}))},[n]),{expandedUncommitted:r,expandedBranch:s,setExpandedUncommitted:i,setExpandedBranch:o,toggleFile:(g,p,C)=>{C(w=>{const N=new Set(w);return N.has(g)?N.delete(g):N.add(g),N})},expandAllUncommitted:()=>{i(new Set(t))},collapseAllUncommitted:()=>{i(new Set)},expandAllBranch:()=>{o(new Set(n))},collapseAllBranch:()=>{o(new Set)}}}function En(e,t,n){const[r,i]=R.useState(null),[s,o]=R.useState(null),a=$t();R.useEffect(()=>{var u,h;((u=a.data)==null?void 0:u.oldContent)!==void 0&&((h=a.data)==null?void 0:h.newContent)!==void 0&&o({oldContent:a.data.oldContent,newContent:a.data.newContent,fileName:a.data.fileName})},[a.data]);const c=u=>{i({type:"file",path:u}),o(null);const h=new FormData;h.append("actionType","getDiff"),h.append("filePath",u),h.append("diffType","branch"),h.append("baseBranch",e),h.append("currentBranch",t||""),a.submit(h,{method:"post"})},d=(u,h)=>{i({type:"entity",path:u,entitySha:h}),o(null);const b=new FormData;b.append("actionType","getDiff"),b.append("filePath",u),b.append("diffType","branch"),b.append("baseBranch",e),b.append("currentBranch",t||""),b.append("entitySha",h),a.submit(b,{method:"post"})},f=()=>{i(null),o(null)};return{diffView:r,diffContent:s,isLoading:a.state==="loading"||a.state==="submitting",handleShowFileDiff:c,handleShowEntityDiff:d,handleCloseDiff:f}}var Ge={exports:{}};/*!
|
|
2
|
-
Copyright (c) 2018 Jed Watson.
|
|
3
|
-
Licensed under the MIT License (MIT), see
|
|
4
|
-
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var pt;function Bn(){return pt||(pt=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ge)),Ge.exports}var Fn=Bn();const U=pn(Fn);var mt=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Tn(e,t){return!!(e===t||mt(e)&&mt(t))}function Dn(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Tn(e[n],t[n]))return!1;return!0}function Mn(e,t){t===void 0&&(t=Dn);var n=null;function r(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var o=e.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}function Rn(e,t,n){let r=0,i;const s={},o=[];return e.forEach((a,c)=>{const d=t.some(f=>f>=c-n&&f<=c+n);!d&&i===void 0?(i={index:r,startLine:c,endLine:c,lines:1},o.push(i),s[c]=i.index,r++):!d&&i?(i.endLine=c,i.lines++,s[c]=i.index):i=void 0}),{lineBlocks:s,blocks:o}}function X(){}X.prototype={diff:function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.callback;typeof i=="function"&&(s=i,i={}),this.options=i;var o=this;function a(x){return s?(setTimeout(function(){s(void 0,x)},0),!0):x}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var c=n.length,d=t.length,f=1,u=c+d;i.maxEditLength&&(u=Math.min(u,i.maxEditLength));var h=(r=i.timeout)!==null&&r!==void 0?r:1/0,b=Date.now()+h,g=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(g[0],n,t,0);if(g[0].oldPos+1>=d&&p+1>=c)return a([{value:this.join(n),count:n.length}]);var C=-1/0,w=1/0;function N(){for(var x=Math.max(C,-f);x<=Math.min(w,f);x+=2){var v=void 0,y=g[x-1],m=g[x+1];y&&(g[x-1]=void 0);var A=!1;if(m){var E=m.oldPos-x;A=m&&0<=E&&E<c}var B=y&&y.oldPos+1<d;if(!A&&!B){g[x]=void 0;continue}if(!B||A&&y.oldPos+1<m.oldPos?v=o.addToPath(m,!0,void 0,0):v=o.addToPath(y,void 0,!0,1),p=o.extractCommon(v,n,t,x),v.oldPos+1>=d&&p+1>=c)return a(On(o,v.lastComponent,n,t,o.useLongestToken));g[x]=v,v.oldPos+1>=d&&(w=Math.min(w,x-1)),p+1>=c&&(C=Math.max(C,x+1))}f++}if(s)(function x(){setTimeout(function(){if(f>u||Date.now()>b)return s();N()||x()},0)})();else for(;f<=u&&Date.now()<=b;){var j=N();if(j)return j}},addToPath:function(t,n,r,i){var s=t.lastComponent;return s&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}},extractCommon:function(t,n,r,i){for(var s=n.length,o=r.length,a=t.oldPos,c=a-i,d=0;c+1<s&&a+1<o&&this.equals(n[c+1],r[a+1]);)c++,a++,d++;return d&&(t.lastComponent={count:d,previousComponent:t.lastComponent}),t.oldPos=a,c},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function On(e,t,n,r,i){for(var s=[],o;t;)s.push(t),o=t.previousComponent,delete t.previousComponent,t=o;s.reverse();for(var a=0,c=s.length,d=0,f=0;a<c;a++){var u=s[a];if(u.removed){if(u.value=e.join(r.slice(f,f+u.count)),f+=u.count,a&&s[a-1].added){var b=s[a-1];s[a-1]=s[a],s[a]=b}}else{if(!u.added&&i){var h=n.slice(d,d+u.count);h=h.map(function(p,C){var w=r[f+C];return w.length>p.length?w:p}),u.value=e.join(h)}else u.value=e.join(n.slice(d,d+u.count));d+=u.count,u.added||(f+=u.count)}}var g=s[c-1];return c>1&&typeof g.value=="string"&&(g.added||g.removed)&&e.equals("",g.value)&&(s[c-2].value+=g.value,s.pop()),s}var In=new X;function $n(e,t,n){return In.diff(e,t,n)}function Wt(e,t){if(typeof e=="function")t.callback=e;else if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var gt=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,xt=/\S/,Te=new X;Te.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!xt.test(e)&&!xt.test(t)};Te.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&>.test(t[n])&>.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function Vn(e,t,n){return n=Wt(n,{ignoreWhitespace:!0}),Te.diff(e,t,n)}function zn(e,t,n){return Te.diff(e,t,n)}var De=new X;De.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
6
|
-
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};function Ye(e,t,n){return De.diff(e,t,n)}function Pn(e,t,n){var r=Wt(n,{ignoreWhitespace:!0});return De.diff(e,t,r)}var Ut=new X;Ut.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};function Gn(e,t,n){return Ut.diff(e,t,n)}var qt=new X;qt.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Hn(e,t,n){return qt.diff(e,t,n)}function Ne(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ne=function(t){return typeof t}:Ne=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yt(Object(n),!0).forEach(function(r){Wn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ee(e){return Un(e)||qn(e)||Zn(e)||Jn()}function Un(e){if(Array.isArray(e))return Ue(e)}function qn(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Zn(e,t){if(e){if(typeof e=="string")return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}}function Ue(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
7
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _n=Object.prototype.toString,fe=new X;fe.useLongestToken=!0;fe.tokenize=De.tokenize;fe.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(s,o){return typeof o>"u"?n:o}:r;return typeof e=="string"?e:JSON.stringify(Ae(e,null,null,i),i," ")};fe.equals=function(e,t){return X.prototype.equals.call(fe,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Zt(e,t,n){return fe.diff(e,t,n)}function Ae(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(_n.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Ae(e[s],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Ne(e)==="object"&&e!==null){t.push(e),o={},n.push(o);var a=[],c;for(c in e)e.hasOwnProperty(c)&&a.push(c);for(a.sort(),s=0;s<a.length;s+=1)c=a[s],o[c]=Ae(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var Ee=new X;Ee.tokenize=function(e){return e.slice()};Ee.join=Ee.removeEmpty=function(e){return e};function Yn(e,t,n){return Ee.diff(e,t,n)}function Me(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.split(/\r\n|[\n\v\f\r\x85]/),r=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],i=[],s=0;function o(){var d={};for(i.push(d);s<n.length;){var f=n[s];if(/^(\-\-\-|\+\+\+|@@)\s/.test(f))break;var u=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(f);u&&(d.index=u[1]),s++}for(a(d),a(d),d.hunks=[];s<n.length;){var h=n[s];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(h))break;if(/^@@/.test(h))d.hunks.push(c());else{if(h&&t.strict)throw new Error("Unknown line "+(s+1)+" "+JSON.stringify(h));s++}}}function a(d){var f=/^(---|\+\+\+)\s+(.*)$/.exec(n[s]);if(f){var u=f[1]==="---"?"old":"new",h=f[2].split(" ",2),b=h[0].replace(/\\\\/g,"\\");/^".*"$/.test(b)&&(b=b.substr(1,b.length-2)),d[u+"FileName"]=b,d[u+"Header"]=(h[1]||"").trim(),s++}}function c(){var d=s,f=n[s++],u=f.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),h={oldStart:+u[1],oldLines:typeof u[2]>"u"?1:+u[2],newStart:+u[3],newLines:typeof u[4]>"u"?1:+u[4],lines:[],linedelimiters:[]};h.oldLines===0&&(h.oldStart+=1),h.newLines===0&&(h.newStart+=1);for(var b=0,g=0;s<n.length&&!(n[s].indexOf("--- ")===0&&s+2<n.length&&n[s+1].indexOf("+++ ")===0&&n[s+2].indexOf("@@")===0);s++){var p=n[s].length==0&&s!=n.length-1?" ":n[s][0];if(p==="+"||p==="-"||p===" "||p==="\\")h.lines.push(n[s]),h.linedelimiters.push(r[s]||`
|
|
8
|
-
`),p==="+"?b++:p==="-"?g++:p===" "&&(b++,g++);else break}if(!b&&h.newLines===1&&(h.newLines=0),!g&&h.oldLines===1&&(h.oldLines=0),t.strict){if(b!==h.newLines)throw new Error("Added line count did not match for hunk at line "+(d+1));if(g!==h.oldLines)throw new Error("Removed line count did not match for hunk at line "+(d+1))}return h}for(;s<n.length;)o();return i}function Xn(e,t,n){var r=!0,i=!1,s=!1,o=1;return function a(){if(r&&!s){if(i?o++:r=!1,e+o<=n)return o;s=!0}if(!i)return s||(r=!0),t<=e-o?-o++:(i=!0,a())}}function Jt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string"&&(t=Me(t)),Array.isArray(t)){if(t.length>1)throw new Error("applyPatch only works with a single input.");t=t[0]}var r=e.split(/\r\n|[\n\v\f\r\x85]/),i=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=t.hunks,o=n.compareLine||function(I,V,te,Z){return V===Z},a=0,c=n.fuzzFactor||0,d=0,f=0,u,h;function b(I,V){for(var te=0;te<I.lines.length;te++){var Z=I.lines[te],se=Z.length>0?Z[0]:" ",ae=Z.length>0?Z.substr(1):Z;if(se===" "||se==="-"){if(!o(V+1,r[V],se,ae)&&(a++,a>c))return!1;V++}}return!0}for(var g=0;g<s.length;g++){for(var p=s[g],C=r.length-p.oldLines,w=0,N=f+p.oldStart-1,j=Xn(N,d,C);w!==void 0;w=j())if(b(p,N+w)){p.offset=f+=w;break}if(w===void 0)return!1;d=p.offset+p.oldStart+p.oldLines}for(var x=0,v=0;v<s.length;v++){var y=s[v],m=y.oldStart+y.offset+x-1;x+=y.newLines-y.oldLines;for(var A=0;A<y.lines.length;A++){var E=y.lines[A],B=E.length>0?E[0]:" ",T=E.length>0?E.substr(1):E,F=y.linedelimiters&&y.linedelimiters[A]||`
|
|
9
|
-
`;if(B===" ")m++;else if(B==="-")r.splice(m,1),i.splice(m,1);else if(B==="+")r.splice(m,0,T),i.splice(m,0,F),m++;else if(B==="\\"){var k=y.lines[A-1]?y.lines[A-1][0]:null;k==="+"?u=!0:k==="-"&&(h=!0)}}}if(u)for(;!r[r.length-1];)r.pop(),i.pop();else h&&(r.push(""),i.push(`
|
|
10
|
-
`));for(var S=0;S<r.length-1;S++)r[S]=r[S]+i[S];return r.join("")}function Kn(e,t){typeof e=="string"&&(e=Me(e));var n=0;function r(){var i=e[n++];if(!i)return t.complete();t.loadFile(i,function(s,o){if(s)return t.complete(s);var a=Jt(o,i,t);t.patched(i,a,function(c){if(c)return t.complete(c);r()})})}r()}function Xe(e,t,n,r,i,s,o){o||(o={}),typeof o.context>"u"&&(o.context=4);var a=Ye(n,r,o);if(!a)return;a.push({value:"",lines:[]});function c(w){return w.map(function(N){return" "+N})}for(var d=[],f=0,u=0,h=[],b=1,g=1,p=function(N){var j=a[N],x=j.lines||j.value.replace(/\n$/,"").split(`
|
|
11
|
-
`);if(j.lines=x,j.added||j.removed){var v;if(!f){var y=a[N-1];f=b,u=g,y&&(h=o.context>0?c(y.lines.slice(-o.context)):[],f-=h.length,u-=h.length)}(v=h).push.apply(v,ee(x.map(function(S){return(j.added?"+":"-")+S}))),j.added?g+=x.length:b+=x.length}else{if(f)if(x.length<=o.context*2&&N<a.length-2){var m;(m=h).push.apply(m,ee(c(x)))}else{var A,E=Math.min(x.length,o.context);(A=h).push.apply(A,ee(c(x.slice(0,E))));var B={oldStart:f,oldLines:b-f+E,newStart:u,newLines:g-u+E,lines:h};if(N>=a.length-2&&x.length<=o.context){var T=/\n$/.test(n),F=/\n$/.test(r),k=x.length==0&&h.length>B.oldLines;!T&&k&&n.length>0&&h.splice(B.oldLines,0,"\"),(!T&&!k||!F)&&h.push("\")}d.push(B),f=0,u=0,h=[]}b+=x.length,g+=x.length}},C=0;C<a.length;C++)p(C);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:s,hunks:d}}function Ke(e){if(Array.isArray(e))return e.map(Ke).join(`
|
|
12
|
-
`);var t=[];e.oldFileName==e.newFileName&&t.push("Index: "+e.oldFileName),t.push("==================================================================="),t.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),t.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader));for(var n=0;n<e.hunks.length;n++){var r=e.hunks[n];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),t.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@"),t.push.apply(t,r.lines)}return t.join(`
|
|
13
|
-
`)+`
|
|
14
|
-
`}function _t(e,t,n,r,i,s,o){return Ke(Xe(e,t,n,r,i,s,o))}function Qn(e,t,n,r,i,s){return _t(e,e,t,n,r,i,s)}function er(e,t){return e.length!==t.length?!1:qe(e,t)}function qe(e,t){if(t.length>e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function tr(e){var t=Ze(e.lines),n=t.oldLines,r=t.newLines;n!==void 0?e.oldLines=n:delete e.oldLines,r!==void 0?e.newLines=r:delete e.newLines}function nr(e,t,n){e=bt(e,n),t=bt(t,n);var r={};(e.index||t.index)&&(r.index=e.index||t.index),(e.newFileName||t.newFileName)&&(wt(e)?wt(t)?(r.oldFileName=we(r,e.oldFileName,t.oldFileName),r.newFileName=we(r,e.newFileName,t.newFileName),r.oldHeader=we(r,e.oldHeader,t.oldHeader),r.newHeader=we(r,e.newHeader,t.newHeader)):(r.oldFileName=e.oldFileName,r.newFileName=e.newFileName,r.oldHeader=e.oldHeader,r.newHeader=e.newHeader):(r.oldFileName=t.oldFileName||e.oldFileName,r.newFileName=t.newFileName||e.newFileName,r.oldHeader=t.oldHeader||e.oldHeader,r.newHeader=t.newHeader||e.newHeader)),r.hunks=[];for(var i=0,s=0,o=0,a=0;i<e.hunks.length||s<t.hunks.length;){var c=e.hunks[i]||{oldStart:1/0},d=t.hunks[s]||{oldStart:1/0};if(Ct(c,d))r.hunks.push(Nt(c,o)),i++,a+=c.newLines-c.oldLines;else if(Ct(d,c))r.hunks.push(Nt(d,a)),s++,o+=d.newLines-d.oldLines;else{var f={oldStart:Math.min(c.oldStart,d.oldStart),oldLines:0,newStart:Math.min(c.newStart+o,d.oldStart+a),newLines:0,lines:[]};rr(f,c.oldStart,c.lines,d.oldStart,d.lines),s++,i++,r.hunks.push(f)}}return r}function bt(e,t){if(typeof e=="string"){if(/^@@/m.test(e)||/^Index:/m.test(e))return Me(e)[0];if(!t)throw new Error("Must provide a base reference or pass in a patch");return Xe(void 0,void 0,t,e)}return e}function wt(e){return e.newFileName&&e.newFileName!==e.oldFileName}function we(e,t,n){return t===n?t:(e.conflict=!0,{mine:t,theirs:n})}function Ct(e,t){return e.oldStart<t.oldStart&&e.oldStart+e.oldLines<t.oldStart}function Nt(e,t){return{oldStart:e.oldStart,oldLines:e.oldLines,newStart:e.newStart+t,newLines:e.newLines,lines:e.lines}}function rr(e,t,n,r,i){var s={offset:t,lines:n,index:0},o={offset:r,lines:i,index:0};for(St(e,s,o),St(e,o,s);s.index<s.lines.length&&o.index<o.lines.length;){var a=s.lines[s.index],c=o.lines[o.index];if((a[0]==="-"||a[0]==="+")&&(c[0]==="-"||c[0]==="+"))sr(e,s,o);else if(a[0]==="+"&&c[0]===" "){var d;(d=e.lines).push.apply(d,ee(oe(s)))}else if(c[0]==="+"&&a[0]===" "){var f;(f=e.lines).push.apply(f,ee(oe(o)))}else a[0]==="-"&&c[0]===" "?jt(e,s,o):c[0]==="-"&&a[0]===" "?jt(e,o,s,!0):a===c?(e.lines.push(a),s.index++,o.index++):Qe(e,oe(s),oe(o))}kt(e,s),kt(e,o),tr(e)}function sr(e,t,n){var r=oe(t),i=oe(n);if(Lt(r)&&Lt(i)){if(qe(r,i)&&At(n,r,r.length-i.length)){var s;(s=e.lines).push.apply(s,ee(r));return}else if(qe(i,r)&&At(t,i,i.length-r.length)){var o;(o=e.lines).push.apply(o,ee(i));return}}else if(er(r,i)){var a;(a=e.lines).push.apply(a,ee(r));return}Qe(e,r,i)}function jt(e,t,n,r){var i=oe(t),s=ir(n,i);if(s.merged){var o;(o=e.lines).push.apply(o,ee(s.merged))}else Qe(e,r?s:i,r?i:s)}function Qe(e,t,n){e.conflict=!0,e.lines.push({conflict:!0,mine:t,theirs:n})}function St(e,t,n){for(;t.offset<n.offset&&t.index<t.lines.length;){var r=t.lines[t.index++];e.lines.push(r),t.offset++}}function kt(e,t){for(;t.index<t.lines.length;){var n=t.lines[t.index++];e.lines.push(n)}}function oe(e){for(var t=[],n=e.lines[e.index][0];e.index<e.lines.length;){var r=e.lines[e.index];if(n==="-"&&r[0]==="+"&&(n="+"),n===r[0])t.push(r),e.index++;else break}return t}function ir(e,t){for(var n=[],r=[],i=0,s=!1,o=!1;i<t.length&&e.index<e.lines.length;){var a=e.lines[e.index],c=t[i];if(c[0]==="+")break;if(s=s||a[0]!==" ",r.push(c),i++,a[0]==="+")for(o=!0;a[0]==="+";)n.push(a),a=e.lines[++e.index];c.substr(1)===a.substr(1)?(n.push(a),e.index++):o=!0}if((t[i]||"")[0]==="+"&&s&&(o=!0),o)return n;for(;i<t.length;)r.push(t[i++]);return{merged:r,changes:n}}function Lt(e){return e.reduce(function(t,n){return t&&n[0]==="-"},!0)}function At(e,t,n){for(var r=0;r<n;r++){var i=t[t.length-n+r].substr(1);if(e.lines[e.index+r]!==" "+i)return!1}return e.index+=n,!0}function Ze(e){var t=0,n=0;return e.forEach(function(r){if(typeof r!="string"){var i=Ze(r.mine),s=Ze(r.theirs);t!==void 0&&(i.oldLines===s.oldLines?t+=i.oldLines:t=void 0),n!==void 0&&(i.newLines===s.newLines?n+=i.newLines:n=void 0)}else n!==void 0&&(r[0]==="+"||r[0]===" ")&&n++,t!==void 0&&(r[0]==="-"||r[0]===" ")&&t++}),{oldLines:t,newLines:n}}function Yt(e){return Array.isArray(e)?e.map(Yt).reverse():vt(vt({},e),{},{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(function(t){return{oldLines:t.newLines,oldStart:t.newStart,newLines:t.oldLines,newStart:t.oldStart,linedelimiters:t.linedelimiters,lines:t.lines.map(function(n){return n.startsWith("-")?"+".concat(n.slice(1)):n.startsWith("+")?"-".concat(n.slice(1)):n})}})})}function or(e){for(var t=[],n,r,i=0;i<e.length;i++)n=e[i],n.added?r=1:n.removed?r=-1:r=0,t.push([r,n.value]);return t}function ar(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.added?t.push("<ins>"):r.removed&&t.push("<del>"),t.push(lr(r.value)),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}function lr(e){var t=e;return t=t.replace(/&/g,"&"),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t=t.replace(/"/g,"""),t}const cr=Object.freeze(Object.defineProperty({__proto__:null,Diff:X,applyPatch:Jt,applyPatches:Kn,canonicalize:Ae,convertChangesToDMP:or,convertChangesToXML:ar,createPatch:Qn,createTwoFilesPatch:_t,diffArrays:Yn,diffChars:$n,diffCss:Hn,diffJson:Zt,diffLines:Ye,diffSentences:Gn,diffTrimmedLines:Pn,diffWords:Vn,diffWordsWithSpace:zn,formatPatch:Ke,merge:nr,parsePatch:Me,reversePatch:Yt,structuredPatch:Xe},Symbol.toStringTag,{value:"Module"})),dr=cr;var O;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ADDED=1]="ADDED",e[e.REMOVED=2]="REMOVED",e[e.CHANGED=3]="CHANGED"})(O||(O={}));var ue;(function(e){e.CHARS="diffChars",e.WORDS="diffWords",e.WORDS_WITH_SPACE="diffWordsWithSpace",e.LINES="diffLines",e.TRIMMED_LINES="diffTrimmedLines",e.SENTENCES="diffSentences",e.CSS="diffCss",e.JSON="diffJson"})(ue||(ue={}));const Et=e=>e===""?[]:e.replace(/\n$/,"").split(`
|
|
15
|
-
`),fr=(e,t,n=ue.CHARS)=>{const i=(typeof n=="string"?dr[n]:n)(e,t),s={left:[],right:[]};return i.forEach(({added:o,removed:a,value:c})=>{const d={};return o&&(d.type=O.ADDED,d.value=c,s.right.push(d)),a&&(d.type=O.REMOVED,d.value=c,s.left.push(d)),!a&&!o&&(d.type=O.DEFAULT,d.value=c,s.right.push(d),s.left.push(d)),d}),s},ur=(e,t,n=!1,r=ue.CHARS,i=0,s=[])=>{let o=[];typeof e=="string"&&typeof t=="string"?o=Ye(e,t,{newlineIsToken:!1,ignoreWhitespace:!1,ignoreCase:!1}):o=Zt(e,t);let a=i,c=i,d=[],f=0;const u=[],h=[],b=(g,p,C,w,N)=>Et(g).map((x,v)=>{const y={},m={};if(!(h.includes(`${p}-${v}`)||N&&v!==0)){if(C||w){let A=!0;if(w){c+=1,y.lineNumber=c,y.type=O.REMOVED,y.value=x||" ";const E=o[p+1];if(E!=null&&E.added){const B=Et(E.value)[v];if(B){const T=b(B,p,!0,!1,!0),{value:F,lineNumber:k,type:S}=T[0].right;if(h.push(`${p+1}-${v}`),m.lineNumber=k,y.value===F)A=!1,m.type=0,y.type=0,m.value=F;else if(m.type=S,n)m.value=F;else{const I=fr(x,F,r);m.value=I.right,y.value=I.left}}}}else a+=1,m.lineNumber=a,m.type=O.ADDED,m.value=x;A&&!N&&(u.includes(f)||u.push(f))}else c+=1,a+=1,y.lineNumber=c,y.type=O.DEFAULT,y.value=x,m.lineNumber=a,m.type=O.DEFAULT,m.value=x;return(s!=null&&s.includes(`L-${y.lineNumber}`)||s!=null&&s.includes(`R-${m.lineNumber}`)&&!u.includes(f))&&u.push(f),N||(f+=1),{right:m,left:y}}}).filter(Boolean);return o.forEach(({added:g,removed:p,value:C},w)=>{d=[...d,...b(C,w,g,p)]}),{lineInformation:d,diffLines:u}};function hr(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16",children:[l.jsx("title",{children:"expand"}),l.jsx("path",{d:"m8.177.677 2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25a.75.75 0 0 1-1.5 0V4H5.104a.25.25 0 0 1-.177-.427L7.823.677a.25.25 0 0 1 .354 0ZM7.25 10.75a.75.75 0 0 1 1.5 0V12h2.146a.25.25 0 0 1 .177.427l-2.896 2.896a.25.25 0 0 1-.354 0l-2.896-2.896A.25.25 0 0 1 5.104 12H7.25v-1.25Zm-5-2a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})]})}function pr(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function mr(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var gr=(function(){function e(n){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(mr(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=pr(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e})(),P="-ms-",Be="-moz-",D="-webkit-",Xt="comm",et="rule",tt="decl",xr="@import",Kt="@keyframes",yr="@layer",vr=Math.abs,Re=String.fromCharCode,br=Object.assign;function wr(e,t){return z(e,0)^45?(((t<<2^z(e,0))<<2^z(e,1))<<2^z(e,2))<<2^z(e,3):0}function Qt(e){return e.trim()}function Cr(e,t){return(e=t.exec(e))?e[0]:e}function M(e,t,n){return e.replace(t,n)}function Je(e,t){return e.indexOf(t)}function z(e,t){return e.charCodeAt(t)|0}function ge(e,t,n){return e.slice(t,n)}function _(e){return e.length}function nt(e){return e.length}function Ce(e,t){return t.push(e),e}function Nr(e,t){return e.map(t).join("")}var Oe=1,he=1,en=0,W=0,$=0,pe="";function Ie(e,t,n,r,i,s,o){return{value:e,root:t,parent:n,type:r,props:i,children:s,line:Oe,column:he,length:o,return:""}}function me(e,t){return br(Ie("",null,null,"",null,null,0),e,{length:-e.length},t)}function jr(){return $}function Sr(){return $=W>0?z(pe,--W):0,he--,$===10&&(he=1,Oe--),$}function q(){return $=W<en?z(pe,W++):0,he++,$===10&&(he=1,Oe++),$}function Y(){return z(pe,W)}function je(){return W}function ye(e,t){return ge(pe,e,t)}function xe(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tn(e){return Oe=he=1,en=_(pe=e),W=0,[]}function nn(e){return pe="",e}function Se(e){return Qt(ye(W-1,_e(e===91?e+2:e===40?e+1:e)))}function kr(e){for(;($=Y())&&$<33;)q();return xe(e)>2||xe($)>3?"":" "}function Lr(e,t){for(;--t&&q()&&!($<48||$>102||$>57&&$<65||$>70&&$<97););return ye(e,je()+(t<6&&Y()==32&&q()==32))}function _e(e){for(;q();)switch($){case e:return W;case 34:case 39:e!==34&&e!==39&&_e($);break;case 40:e===41&&_e(e);break;case 92:q();break}return W}function Ar(e,t){for(;q()&&e+$!==57;)if(e+$===84&&Y()===47)break;return"/*"+ye(t,W-1)+"*"+Re(e===47?e:q())}function Er(e){for(;!xe(Y());)q();return ye(e,W)}function Br(e){return nn(ke("",null,null,null,[""],e=tn(e),0,[0],e))}function ke(e,t,n,r,i,s,o,a,c){for(var d=0,f=0,u=o,h=0,b=0,g=0,p=1,C=1,w=1,N=0,j="",x=i,v=s,y=r,m=j;C;)switch(g=N,N=q()){case 40:if(g!=108&&z(m,u-1)==58){Je(m+=M(Se(N),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:m+=Se(N);break;case 9:case 10:case 13:case 32:m+=kr(g);break;case 92:m+=Lr(je()-1,7);continue;case 47:switch(Y()){case 42:case 47:Ce(Fr(Ar(q(),je()),t,n),c);break;default:m+="/"}break;case 123*p:a[d++]=_(m)*w;case 125*p:case 59:case 0:switch(N){case 0:case 125:C=0;case 59+f:w==-1&&(m=M(m,/\f/g,"")),b>0&&_(m)-u&&Ce(b>32?Ft(m+";",r,n,u-1):Ft(M(m," ","")+";",r,n,u-2),c);break;case 59:m+=";";default:if(Ce(y=Bt(m,t,n,d,f,i,a,j,x=[],v=[],u),s),N===123)if(f===0)ke(m,t,y,y,x,s,u,a,v);else switch(h===99&&z(m,3)===110?100:h){case 100:case 108:case 109:case 115:ke(e,y,y,r&&Ce(Bt(e,y,y,0,0,i,a,j,i,x=[],u),v),i,v,u,a,r?x:v);break;default:ke(m,y,y,y,[""],v,0,a,v)}}d=f=b=0,p=w=1,j=m="",u=o;break;case 58:u=1+_(m),b=g;default:if(p<1){if(N==123)--p;else if(N==125&&p++==0&&Sr()==125)continue}switch(m+=Re(N),N*p){case 38:w=f>0?1:(m+="\f",-1);break;case 44:a[d++]=(_(m)-1)*w,w=1;break;case 64:Y()===45&&(m+=Se(q())),h=Y(),f=u=_(j=m+=Er(je())),N++;break;case 45:g===45&&_(m)==2&&(p=0)}}return s}function Bt(e,t,n,r,i,s,o,a,c,d,f){for(var u=i-1,h=i===0?s:[""],b=nt(h),g=0,p=0,C=0;g<r;++g)for(var w=0,N=ge(e,u+1,u=vr(p=o[g])),j=e;w<b;++w)(j=Qt(p>0?h[w]+" "+N:M(N,/&\f/g,h[w])))&&(c[C++]=j);return Ie(e,t,n,i===0?et:a,c,d,f)}function Fr(e,t,n){return Ie(e,t,n,Xt,Re(jr()),ge(e,2,-2),0)}function Ft(e,t,n,r){return Ie(e,t,n,tt,ge(e,0,r),ge(e,r+1,-1),r)}function de(e,t){for(var n="",r=nt(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Tr(e,t,n,r){switch(e.type){case yr:if(e.children.length)break;case xr:case tt:return e.return=e.return||e.value;case Xt:return"";case Kt:return e.return=e.value+"{"+de(e.children,r)+"}";case et:e.value=e.props.join(",")}return _(n=de(e.children,r))?e.return=e.value+"{"+n+"}":""}function Dr(e){var t=nt(e);return function(n,r,i,s){for(var o="",a=0;a<t;a++)o+=e[a](n,r,i,s)||"";return o}}function Mr(e){return function(t){t.root||(t=t.return)&&e(t)}}function Rr(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Or=function(t,n,r){for(var i=0,s=0;i=s,s=Y(),i===38&&s===12&&(n[r]=1),!xe(s);)q();return ye(t,W)},Ir=function(t,n){var r=-1,i=44;do switch(xe(i)){case 0:i===38&&Y()===12&&(n[r]=1),t[r]+=Or(W-1,n,r);break;case 2:t[r]+=Se(i);break;case 4:if(i===44){t[++r]=Y()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Re(i)}while(i=q());return t},$r=function(t,n){return nn(Ir(tn(t),n))},Tt=new WeakMap,Vr=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Tt.get(r))&&!i){Tt.set(t,!0);for(var s=[],o=$r(n,s),a=r.props,c=0,d=0;c<o.length;c++)for(var f=0;f<a.length;f++,d++)t.props[d]=s[c]?o[c].replace(/&\f/g,a[f]):a[f]+" "+o[c]}}},zr=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function rn(e,t){switch(wr(e,t)){case 5103:return D+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return D+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return D+e+Be+e+P+e+e;case 6828:case 4268:return D+e+P+e+e;case 6165:return D+e+P+"flex-"+e+e;case 5187:return D+e+M(e,/(\w+).+(:[^]+)/,D+"box-$1$2"+P+"flex-$1$2")+e;case 5443:return D+e+P+"flex-item-"+M(e,/flex-|-self/,"")+e;case 4675:return D+e+P+"flex-line-pack"+M(e,/align-content|flex-|-self/,"")+e;case 5548:return D+e+P+M(e,"shrink","negative")+e;case 5292:return D+e+P+M(e,"basis","preferred-size")+e;case 6060:return D+"box-"+M(e,"-grow","")+D+e+P+M(e,"grow","positive")+e;case 4554:return D+M(e,/([^-])(transform)/g,"$1"+D+"$2")+e;case 6187:return M(M(M(e,/(zoom-|grab)/,D+"$1"),/(image-set)/,D+"$1"),e,"")+e;case 5495:case 3959:return M(e,/(image-set\([^]*)/,D+"$1$`$1");case 4968:return M(M(e,/(.+:)(flex-)?(.*)/,D+"box-pack:$3"+P+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+D+e+e;case 4095:case 3583:case 4068:case 2532:return M(e,/(.+)-inline(.+)/,D+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(_(e)-1-t>6)switch(z(e,t+1)){case 109:if(z(e,t+4)!==45)break;case 102:return M(e,/(.+:)(.+)-([^]+)/,"$1"+D+"$2-$3$1"+Be+(z(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Je(e,"stretch")?rn(M(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(z(e,t+1)!==115)break;case 6444:switch(z(e,_(e)-3-(~Je(e,"!important")&&10))){case 107:return M(e,":",":"+D)+e;case 101:return M(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+D+(z(e,14)===45?"inline-":"")+"box$3$1"+D+"$2$3$1"+P+"$2box$3")+e}break;case 5936:switch(z(e,t+11)){case 114:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return D+e+P+M(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return D+e+P+e+e}return e}var Pr=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case tt:t.return=rn(t.value,t.length);break;case Kt:return de([me(t,{value:M(t.value,"@","@"+D)})],i);case et:if(t.length)return Nr(t.props,function(s){switch(Cr(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return de([me(t,{props:[M(s,/:(read-\w+)/,":"+Be+"$1")]})],i);case"::placeholder":return de([me(t,{props:[M(s,/:(plac\w+)/,":"+D+"input-$1")]}),me(t,{props:[M(s,/:(plac\w+)/,":"+Be+"$1")]}),me(t,{props:[M(s,/:(plac\w+)/,P+"input-$1")]})],i)}return""})}},Gr=[Pr],Hr=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var C=p.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||Gr,s={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var C=p.getAttribute("data-emotion").split(" "),w=1;w<C.length;w++)s[C[w]]=!0;a.push(p)});var c,d=[Vr,zr];{var f,u=[Tr,Mr(function(p){f.insert(p)})],h=Dr(d.concat(i,u)),b=function(C){return de(Br(C),h)};c=function(C,w,N,j){f=N,b(C?C+"{"+w.styles+"}":w.styles),j&&(g.inserted[w.name]=!0)}}var g={key:n,sheet:new gr({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:s,registered:{},insert:c};return g.sheet.hydrate(a),g};function Wr(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ur={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},qr=/[A-Z]|^ms/g,Zr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sn=function(t){return t.charCodeAt(1)===45},Dt=function(t){return t!=null&&typeof t!="boolean"},He=Rr(function(e){return sn(e)?e:e.replace(qr,"-$&").toLowerCase()}),Mt=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Zr,function(r,i,s){return re={name:i,styles:s,next:re},i})}return Ur[t]!==1&&!sn(t)&&typeof n=="number"&&n!==0?n+"px":n};function Fe(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return re={name:i.name,styles:i.styles,next:re},i.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)re={name:o.name,styles:o.styles,next:re},o=o.next;var a=s.styles+";";return a}return Jr(e,t,n)}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function Jr(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Fe(e,t,n[i])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var a=o;t!=null&&t[a]!==void 0?r+=s+"{"+t[a]+"}":Dt(a)&&(r+=He(s)+":"+Mt(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)Dt(o[c])&&(r+=He(s)+":"+Mt(s,o[c])+";");else{var d=Fe(e,t,o);switch(s){case"animation":case"animationName":{r+=He(s)+":"+d+";";break}default:r+=s+"{"+d+"}"}}}return r}var Rt=/label:\s*([^\s;{]+)\s*(;|$)/g,re;function We(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";re=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,i+=Fe(n,t,s);else{var o=s;i+=o[0]}for(var a=1;a<e.length;a++)if(i+=Fe(n,t,e[a]),r){var c=s;i+=c[a]}Rt.lastIndex=0;for(var d="",f;(f=Rt.exec(i))!==null;)d+="-"+f[1];var u=Wr(i)+d;return{name:u,styles:i,next:re}}function on(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var _r=function(t,n,r){var i=t.key+"-"+n.name;t.registered[i]===void 0&&(t.registered[i]=n.styles)},Yr=function(t,n,r){_r(t,n);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+i:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function Ot(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function It(e,t,n){var r=[],i=on(e,r,n);return r.length<2?n:i+t(r)}var Xr=function(t){var n=Hr(t);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var r=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered,void 0);return Yr(n,u),n.key+"-"+u.name},i=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered),h="animation-"+u.name;return Ot(n,{name:u.name,styles:"@keyframes "+h+"{"+u.styles+"}"}),h},s=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var u=We(d,n.registered);Ot(n,u)},o=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return It(n.registered,r,Kr(d))};return{css:r,cx:o,injectGlobal:s,keyframes:i,hydrate:function(c){c.forEach(function(d){n.inserted[d]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:on.bind(null,n.registered),merge:It.bind(null,n.registered,r)}},Kr=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];if(i!=null){var s=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))s=e(i);else{s="";for(var o in i)i[o]&&o&&(s&&(s+=" "),s+=o)}break}default:s=i}s&&(n&&(n+=" "),n+=s)}}return n};const Qr=(e,t=!1,n="")=>{const{variables:r={},...i}=e,s={light:{diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",changedBackground:"#fffbdd",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f7f7f7",gutterBackgroundDark:"#f3f1f1",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1",codeFoldGutterBackground:"#dbedff",codeFoldBackground:"#f1f8ff",emptyLineBackground:"#fafbfc",gutterColor:"#212529",addedGutterColor:"#212529",removedGutterColor:"#212529",codeFoldContentColor:"#212529",diffViewerTitleBackground:"#fafbfc",diffViewerTitleColor:"#212529",diffViewerTitleBorderColor:"#eee",...r.light||{}},dark:{diffViewerBackground:"#2e303c",diffViewerColor:"#FFF",addedBackground:"#044B53",addedColor:"white",removedBackground:"#632F34",removedColor:"white",changedBackground:"#3e302c",wordAddedBackground:"#055d67",wordRemovedBackground:"#7d383f",addedGutterBackground:"#034148",removedGutterBackground:"#632b30",gutterBackground:"#2c2f3a",gutterBackgroundDark:"#262933",highlightBackground:"#2a3967",highlightGutterBackground:"#2d4077",codeFoldGutterBackground:"#262831",codeFoldBackground:"#262831",emptyLineBackground:"#363946",gutterColor:"#666c87",addedGutterColor:"#8c8c8c",removedGutterColor:"#8c8c8c",codeFoldContentColor:"#656a8b",diffViewerTitleBackground:"#2f323e",diffViewerTitleColor:"#757a9b",diffViewerTitleBorderColor:"#353846",...r.dark||{}}},o=t?s.dark:s.light,{css:a,cx:c}=Xr({key:"react-diff",nonce:n}),d=a({width:"auto",label:"content"}),f=a({label:"split-view"}),u=a({background:o.diffViewerTitleBackground,color:o.diffViewerTitleColor,padding:"0.5em 1em",display:"flex",alignItems:"center",gap:"0.5em",fontFamily:"monospace",fill:o.diffViewerTitleColor}),h=a({width:"100%",minWidth:"1000px",overflowX:"auto",tableLayout:"fixed",background:o.diffViewerBackground,pre:{margin:0,whiteSpace:"pre-wrap",lineHeight:"1.6em",width:"fit-content"},label:"diff-container",borderCollapse:"collapse"}),b=a({overflow:"hidden",width:"100%"}),g=a({color:o.diffViewerColor,whiteSpace:"pre-wrap",fontFamily:"monospace",lineBreak:"anywhere",textDecoration:"none",label:"content-text"}),p=a({userSelect:"none",label:"unselectable"}),C=a({background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",margin:0,label:"all-expand-button",":hover":{fill:o.addedGutterColor},":focus":{outline:`1px ${o.addedGutterColor} solid`}}),w=a({background:o.diffViewerTitleBackground,padding:"0.5em",lineHeight:"1.4em",height:"2.4em",overflow:"hidden",width:"50%",borderBottom:`1px solid ${o.diffViewerTitleBorderColor}`,label:"title-block",":last-child":{borderLeft:`1px solid ${o.diffViewerTitleBorderColor}`},[`.${g}`]:{color:o.diffViewerTitleColor}}),N=a({color:o.gutterColor,label:"line-number"}),j=a({background:o.removedBackground,color:o.removedColor,pre:{color:o.removedColor},[`.${N}`]:{color:o.removedGutterColor},label:"diff-removed"}),x=a({background:o.addedBackground,color:o.addedColor,pre:{color:o.addedColor},[`.${N}`]:{color:o.addedGutterColor},label:"diff-added"}),v=a({background:o.changedBackground,[`.${N}`]:{color:o.gutterColor},label:"diff-changed"}),y=a({padding:2,display:"inline-flex",borderRadius:4,wordBreak:"break-all",label:"word-diff"}),m=a({background:o.wordAddedBackground,textDecoration:"none",label:"word-added"}),A=a({background:o.wordRemovedBackground,textDecoration:"none",label:"word-removed"}),E=a({backgroundColor:o.codeFoldGutterBackground,label:"code-fold-gutter",minWidth:"50px",width:"50px"}),B=a({padding:""}),T=a({background:o.codeFoldBackground,cursor:"pointer",display:"inline",margin:0,border:"none",label:"code-fold-expand-button"}),F=a({color:o.codeFoldContentColor,fontFamily:"monospace",label:"code-fold-content"}),k=a({display:"block",width:"10px",height:"10px",backgroundColor:"#ddd",borderWidth:"1px",borderStyle:"solid",borderColor:o.diffViewerTitleBorderColor}),S=a({backgroundColor:o.wordAddedBackground}),I=a({backgroundColor:o.wordRemovedBackground}),V=a({backgroundColor:o.codeFoldBackground,height:40,fontSize:14,alignItems:"center",userSelect:"none",fontWeight:700,label:"code-fold",a:{textDecoration:"underline !important",cursor:"pointer",pre:{display:"inline"}}}),te=a({backgroundColor:o.emptyLineBackground,label:"empty-line"}),Z=a({width:28,paddingLeft:10,paddingRight:10,userSelect:"none",label:"marker",[`&.${x}`]:{pre:{color:o.addedColor}},[`&.${j}`]:{pre:{color:o.removedColor}}}),se=a({background:o.highlightBackground,label:"highlighted-line",[`.${m}, .${A}`]:{backgroundColor:"initial"}}),ae=a({label:"highlighted-gutter"}),$e=a({userSelect:"none",minWidth:50,width:"50px",padding:"0 10px",whiteSpace:"nowrap",label:"gutter",textAlign:"right",background:o.gutterBackground,"&:hover":{cursor:"pointer",background:o.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5},[`&.${x}`]:{background:o.addedGutterBackground},[`&.${j}`]:{background:o.removedGutterBackground},[`&.${ae}`]:{background:o.highlightGutterBackground,"&:hover":{background:o.highlightGutterBackground}}}),Ve=a({"&:hover":{background:o.gutterBackground,cursor:"initial"},label:"empty-gutter"}),ne=a({verticalAlign:"baseline",label:"line",textDecoration:"none"}),ve=a({}),ie={diffContainer:h,diffRemoved:j,diffAdded:x,diffChanged:v,splitView:f,marker:Z,highlightedGutter:ae,highlightedLine:se,gutter:$e,line:ne,lineContent:b,wordDiff:y,wordAdded:m,summary:u,block:k,blockAddition:S,blockDeletion:I,wordRemoved:A,noSelect:p,codeFoldGutter:E,codeFoldExpandButton:T,codeFoldContentContainer:B,codeFold:V,emptyGutter:Ve,emptyLine:te,lineNumber:N,contentText:g,content:d,column:ve,codeFoldContent:F,titleBlock:w,allExpandButton:C},le=Object.keys(i).reduce((ce,J)=>({...ce,[J]:a(i[J])}),{});return Object.keys(ie).reduce((ce,J)=>({...ce,[J]:le[J]?c(ie[J],le[J]):ie[J]}),{})};function es(){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16",children:[l.jsx("title",{children:"fold"}),l.jsx("path",{d:"M10.896 2H8.75V.75a.75.75 0 0 0-1.5 0V2H5.104a.25.25 0 0 0-.177.427l2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 2ZM8.75 15.25a.75.75 0 0 1-1.5 0V14H5.104a.25.25 0 0 1-.177-.427l2.896-2.896a.25.25 0 0 1 .354 0l2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25Zm-6.5-6.5a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})]})}var H;(function(e){e.LEFT="L",e.RIGHT="R"})(H||(H={}));class an extends R.Component{constructor(n){super(n);G(this,"styles");G(this,"resetCodeBlocks",()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1);G(this,"onBlockExpand",n=>{const r=this.state.expandedBlocks.slice();r.push(n),this.setState({expandedBlocks:r})});G(this,"computeStyles",Mn(Qr));G(this,"onLineNumberClickProxy",n=>this.props.onLineNumberClick?r=>this.props.onLineNumberClick(n,r):()=>{});G(this,"renderWordDiff",(n,r)=>n.map((i,s)=>{const o=r?r(i.value):typeof i.value=="string"?i.value:void 0;return i.type===O.ADDED?l.jsx("ins",{className:U(this.styles.wordDiff,{[this.styles.wordAdded]:i.type===O.ADDED}),children:o},s):i.type===O.REMOVED?l.jsx("del",{className:U(this.styles.wordDiff,{[this.styles.wordRemoved]:i.type===O.REMOVED}),children:o},s):l.jsx("span",{className:U(this.styles.wordDiff),children:o},s)}));G(this,"renderLine",(n,r,i,s,o,a)=>{const c=`${i}-${n}`,d=`${a}-${o}`,f=this.props.highlightLines.includes(c)||this.props.highlightLines.includes(d),u=r===O.ADDED,h=r===O.REMOVED,b=r===O.CHANGED;let g;const p=Array.isArray(s);p?g=this.renderWordDiff(s,this.props.renderContent):this.props.renderContent?g=this.props.renderContent(s):g=s;let C="div";return u&&!p?C="ins":h&&!p&&(C="del"),l.jsxs(l.Fragment,{children:[!this.props.hideLineNumbers&&l.jsx("td",{onClick:n&&this.onLineNumberClickProxy(c),className:U(this.styles.gutter,{[this.styles.emptyGutter]:!n,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedGutter]:f}),children:l.jsx("pre",{className:this.styles.lineNumber,children:n})}),!this.props.splitView&&!this.props.hideLineNumbers&&l.jsx("td",{onClick:o&&this.onLineNumberClickProxy(d),className:U(this.styles.gutter,{[this.styles.emptyGutter]:!o,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedGutter]:f}),children:l.jsx("pre",{className:this.styles.lineNumber,children:o})}),this.props.renderGutter?this.props.renderGutter({lineNumber:n,type:r,prefix:i,value:s,additionalLineNumber:o,additionalPrefix:a,styles:this.styles}):null,l.jsx("td",{className:U(this.styles.marker,{[this.styles.emptyLine]:!g,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedLine]:f}),children:l.jsxs("pre",{children:[u&&"+",h&&"-"]})}),l.jsx("td",{className:U(this.styles.content,{[this.styles.emptyLine]:!g,[this.styles.diffAdded]:u,[this.styles.diffRemoved]:h,[this.styles.diffChanged]:b,[this.styles.highlightedLine]:f,left:i===H.LEFT,right:i===H.RIGHT}),onMouseDown:()=>{const w=document.getElementsByClassName(i===H.LEFT?"right":"left");for(let N=0;N<w.length;N++)w.item(N).classList.add(this.styles.noSelect)},title:u&&!p?"Added line":h&&!p?"Removed line":void 0,children:l.jsx(C,{className:this.styles.contentText,children:g})})]})});G(this,"renderSplitView",({left:n,right:r},i)=>l.jsxs("tr",{className:this.styles.line,children:[this.renderLine(n.lineNumber,n.type,H.LEFT,n.value),this.renderLine(r.lineNumber,r.type,H.RIGHT,r.value)]},i));G(this,"renderInlineView",({left:n,right:r},i)=>{let s;return n.type===O.REMOVED&&r.type===O.ADDED?l.jsxs(R.Fragment,{children:[l.jsx("tr",{className:this.styles.line,children:this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,null)}),l.jsx("tr",{className:this.styles.line,children:this.renderLine(null,r.type,H.RIGHT,r.value,r.lineNumber,H.RIGHT)})]},i):(n.type===O.REMOVED&&(s=this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,null)),n.type===O.DEFAULT&&(s=this.renderLine(n.lineNumber,n.type,H.LEFT,n.value,r.lineNumber,H.RIGHT)),r.type===O.ADDED&&(s=this.renderLine(null,r.type,H.RIGHT,r.value,r.lineNumber)),l.jsx("tr",{className:this.styles.line,children:s},i))});G(this,"onBlockClickProxy",n=>()=>this.onBlockExpand(n));G(this,"renderSkippedLineIndicator",(n,r,i,s)=>{const{hideLineNumbers:o,splitView:a}=this.props,c=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(n,i,s):l.jsxs("span",{className:this.styles.codeFoldContent,children:["Expand ",n," lines ..."]}),d=l.jsx("td",{className:this.styles.codeFoldContentContainer,children:l.jsx("button",{type:"button",className:this.styles.codeFoldExpandButton,onClick:this.onBlockClickProxy(r),tabIndex:0,children:c})}),f=!a&&!o;return l.jsxs("tr",{className:this.styles.codeFold,children:[!o&&l.jsx("td",{className:this.styles.codeFoldGutter}),this.props.renderGutter?l.jsx("td",{className:this.styles.codeFoldGutter}):null,l.jsx("td",{className:U({[this.styles.codeFoldGutter]:f})}),f?l.jsxs(R.Fragment,{children:[l.jsx("td",{}),d]}):l.jsxs(R.Fragment,{children:[d,this.props.renderGutter?l.jsx("td",{}):null,l.jsx("td",{}),l.jsx("td",{}),o?null:l.jsx("td",{})]})]},`${i}-${s}`)});G(this,"renderDiff",()=>{const{oldValue:n,newValue:r,splitView:i,disableWordDiff:s,compareMethod:o,linesOffset:a}=this.props,{lineInformation:c,diffLines:d}=ur(n,r,s,o,a,this.props.alwaysShowLines),f=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:u,blocks:h}=Rn(c,d,f);return{diffNodes:c.map((g,p)=>{if(this.props.showDiffOnly){const C=u[p];if(C!==void 0){const w=h[C].endLine===p;if(!this.state.expandedBlocks.includes(C)&&w)return l.jsx(R.Fragment,{children:this.renderSkippedLineIndicator(h[C].lines,C,g.left.lineNumber,g.right.lineNumber)},p);if(!this.state.expandedBlocks.includes(C))return null}}return i?this.renderSplitView(g,p):this.renderInlineView(g,p)}),blocks:h,lineInformation:c}});G(this,"render",()=>{const{oldValue:n,newValue:r,useDarkTheme:i,leftTitle:s,rightTitle:o,splitView:a,compareMethod:c,hideLineNumbers:d,nonce:f}=this.props;if(typeof c=="string"&&c!==ue.JSON&&(typeof n!="string"||typeof r!="string"))throw Error('"oldValue" and "newValue" should be strings');this.styles=this.computeStyles(this.props.styles,i,f);const u=this.renderDiff();let h=3,b=4;d&&(h-=1,b-=1),this.props.renderGutter&&(h+=1,b+=1);let g=0,p=0;for(const x of u.lineInformation)x.left.type===O.ADDED&&p++,x.right.type===O.ADDED&&p++,x.left.type===O.REMOVED&&g++,x.right.type===O.REMOVED&&g++;const C=g+p,w=Math.round(p/C*100),N=[];for(let x=0;x<5;x++)w>x*20?N.push(l.jsx("span",{className:U(this.styles.block,this.styles.blockAddition)},x)):N.push(l.jsx("span",{className:U(this.styles.block,this.styles.blockDeletion)},x));const j=this.state.expandedBlocks.length===u.blocks.length;return l.jsxs("div",{children:[l.jsxs("div",{className:this.styles.summary,role:"banner",children:[l.jsx("button",{type:"button",className:this.styles.allExpandButton,onClick:()=>{this.setState({expandedBlocks:j?[]:u.blocks.map(x=>x.index)})},children:j?l.jsx(es,{}):l.jsx(hr,{})})," ",C,l.jsx("div",{style:{display:"flex",gap:"1px"},children:N}),this.props.summary?l.jsx("span",{children:this.props.summary}):null]}),l.jsx("table",{className:U(this.styles.diffContainer,{[this.styles.splitView]:a}),onMouseUp:()=>{const x=document.getElementsByClassName("right");for(let y=0;y<x.length;y++)x.item(y).classList.remove(this.styles.noSelect);const v=document.getElementsByClassName("left");for(let y=0;y<v.length;y++)v.item(y).classList.remove(this.styles.noSelect)},children:l.jsxs("tbody",{children:[l.jsxs("tr",{children:[this.props.hideLineNumbers?null:l.jsx("td",{width:"50px"}),!a&&!this.props.hideLineNumbers?l.jsx("td",{width:"50px"}):null,this.props.renderGutter?l.jsx("td",{width:"50px"}):null,l.jsx("td",{width:"28px"}),l.jsx("td",{width:"100%"}),a?l.jsxs(l.Fragment,{children:[this.props.hideLineNumbers?null:l.jsx("td",{width:"50px"}),this.props.renderGutter?l.jsx("td",{width:"50px"}):null,l.jsx("td",{width:"28px"}),l.jsx("td",{width:"100%"})]}):null]}),s||o?l.jsxs("tr",{children:[l.jsx("th",{colSpan:a?h:b,className:U(this.styles.titleBlock,this.styles.column),children:s?l.jsx("pre",{className:this.styles.contentText,children:s}):null}),a?l.jsx("th",{colSpan:h,className:U(this.styles.titleBlock,this.styles.column),children:o?l.jsx("pre",{className:this.styles.contentText,children:o}):null}):null]}):null,u.diffNodes]})})]})});this.state={expandedBlocks:[],noSelect:void 0}}}G(an,"defaultProps",{oldValue:"",newValue:"",splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:ue.CHARS,styles:{},hideLineNumbers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:""});function ts({diffView:e,diffContent:t,isLoading:n,entities:r,onClose:i}){var d;const[s,o]=R.useState(!1),[a,c]=R.useState(!1);return R.useEffect(()=>{c(!0)},[]),l.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-8 z-50",children:l.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-6xl w-full max-h-[90vh] flex flex-col",children:[l.jsxs("div",{className:"p-6 border-b border-[#e1e1e1] flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"font-['IBM_Plex_Sans'] text-2xl font-semibold text-[#232323]",children:e.type==="file"?"File Diff":"Entity Diff"}),l.jsx("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e] mt-1",children:e.path}),e.type==="entity"&&e.entitySha&&l.jsxs("p",{className:"font-['IBM_Plex_Mono'] text-sm text-[#8e8e8e]",children:["Entity:"," ",((d=r.find(f=>f.sha===e.entitySha))==null?void 0:d.name)||e.entitySha]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{onClick:()=>o(!s),className:"px-3 py-1.5 bg-[#efefef] text-[#3e3e3e] rounded-lg font-['IBM_Plex_Sans'] text-sm font-semibold hover:bg-[#e1e1e1] transition-colors cursor-pointer",title:s?"Show changes only":"Show full file",children:s?"Show Changes Only":"Show Full File"}),l.jsx("button",{onClick:i,className:"text-[#8e8e8e] hover:text-[#626262] transition-colors cursor-pointer",children:l.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:n?l.jsx("div",{className:"p-6 text-center",children:l.jsx("div",{className:"text-[#8e8e8e]",children:"Loading diff..."})}):t?l.jsx("div",{className:"diff-viewer-wrapper",children:a&&l.jsx(an,{oldValue:t.oldContent,newValue:t.newContent,splitView:!0,useDarkTheme:!1,showDiffOnly:!s,extraLinesSurroundingDiff:4,styles:{variables:{light:{diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f6f8fa",gutterBackgroundDark:"#f3f4f6",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1"}},contentText:{fontSize:"12px",lineHeight:"1.5"},line:{padding:"2px 10px",fontSize:"12px","&:hover":{background:"#f8f9fa"}},splitView:{display:"flex",width:"100%"},diffContainer:{width:"50%",overflowX:"auto"}}})}):l.jsx("div",{className:"p-6 text-center",children:l.jsx("div",{className:"text-[#8e8e8e]",children:"No diff available"})})}),l.jsx("div",{className:"p-6 border-t border-[#e1e1e1] flex justify-end gap-3",children:l.jsx("button",{onClick:i,className:"px-4 py-2 bg-[#efefef] text-[#3e3e3e] rounded-lg font-['IBM_Plex_Sans'] font-semibold hover:bg-[#e1e1e1] transition-colors cursor-pointer",children:"Close"})})]})})}function ns({files:e,currentBranch:t,defaultBranch:n,baseBranch:r,allBranches:i,expandedFiles:s,isEntityBeingAnalyzed:o,isEntityQueued:a,sortOrder:c,onToggleFile:d,onBranchChange:f,onGenerateSimulation:u,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}){const C=e.flatMap(([j,{entities:x}])=>{const v=x.filter(y=>o(y.sha)||a(y)).map(y=>y.sha);return v.length>0?[{entityShas:v}]:[]}),w=j=>{const x=j.map(v=>Ht(v,C));return x.includes("analyzing")||x.includes("queued")?"analyzing":x.includes("out-of-date")?"out-of-date":x.includes("not-analyzed")?"not-analyzed":"up-to-date"},N=R.useMemo(()=>[...e].sort((j,x)=>{const v=j[1].entities.reduce((E,B)=>{var F;const T=((F=B.metadata)==null?void 0:F.editedAt)||B.updatedAt;return T?E?new Date(T)>new Date(E)?T:E:T:E},null),y=x[1].entities.reduce((E,B)=>{var F;const T=((F=B.metadata)==null?void 0:F.editedAt)||B.updatedAt;return T?E?new Date(T)>new Date(E)?T:E:T:E},null);if(!v&&!y)return 0;if(!v)return 1;if(!y)return-1;const m=new Date(v).getTime(),A=new Date(y).getTime();return c==="desc"?A-m:m-A}),[e,c]);return l.jsx("div",{children:e.length>0?l.jsxs("div",{children:[l.jsx(Vt,{showActions:!0,sortOrder:c,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}),l.jsx("div",{className:"flex flex-col gap-[3px]",children:N.map(([j,{status:x,entities:v,isUncommitted:y}])=>{const m=s.has(j),A=w(v),E=v.reduce((k,S)=>{var V;const I=((V=S.metadata)==null?void 0:V.editedAt)||S.updatedAt;return I?k?new Date(I)>new Date(k)?I:k:I:k},null),T=v.filter(k=>k.entityType==="visual"||k.entityType==="library").length===0;let F;return T?F=l.jsx("span",{className:"text-[12px] text-gray-400",children:"Not Analyzable"}):A==="analyzing"?F=l.jsxs("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#ffdbf6",color:"#ff2ab5",height:"26px"},children:[l.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[l.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),l.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]}),"Analyzing..."]}):A==="up-to-date"?F=l.jsx("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#e8ffe6",color:"#00925d",height:"26px"},children:"Up to date"}):A==="out-of-date"?F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!o(S.sha)&&!a(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Re-Analyze"}):A==="not-analyzed"&&(F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!o(S.sha)&&!a(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Analyze File"})),l.jsx(zt,{filePath:j,isExpanded:m,onToggle:()=>d(j),fileStatus:x,isUncommitted:y,simulationPreviews:l.jsx(Gt,{entities:v,maxPreviews:1}),entityCount:v.length,state:A,lastModified:E,isNotAnalyzable:T,actionButton:F,children:v.sort((k,S)=>{const I=k.entityType==="visual"||k.entityType==="library",V=S.entityType==="visual"||S.entityType==="library";return I&&!V?-1:!I&&V?1:0}).map(k=>l.jsx(Pt,{entity:k,isActivelyAnalyzing:o(k.sha),isQueued:a(k),onGenerateSimulation:u},k.sha))},j)})})]}):l.jsxs("div",{className:"bg-[#efefef] rounded-[10px] flex flex-col items-center justify-center text-center",style:{height:"190px"},children:[l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-medium text-[16px] text-[#3e3e3e] leading-[24px] mb-2",children:"No Changes"}),l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-normal text-[14px] text-[#3e3e3e] leading-[18px]",children:"No files have been modified in this branch."})]})})}function rs({files:e,entityImpactMap:t,expandedFiles:n,isEntityBeingAnalyzed:r,isEntityQueued:i,projectSlug:s,baseBranch:o,currentBranch:a,sortOrder:c,onToggleFile:d,onShowFileDiff:f,onGenerateSimulation:u,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}){const C=R.useMemo(()=>{const j=[];return e.forEach(([x,{editedEntities:v}])=>{const y=v.filter(m=>r(m.sha)||i(m)).map(m=>m.sha);y.length>0&&j.push({entityShas:y})}),j},[e,r,i]),w=R.useMemo(()=>{const j=new Map;return e.forEach(([x,{editedEntities:v}])=>{const y=v.map(B=>Ht(B,C));let m;y.includes("analyzing")||y.includes("queued")?m="analyzing":y.includes("out-of-date")?m="out-of-date":y.includes("not-analyzed")?m="not-analyzed":m="up-to-date";const A=v.reduce((B,T)=>{var k;const F=((k=T.metadata)==null?void 0:k.editedAt)||T.updatedAt;return F&&(!B||new Date(F)>new Date(B))?F:B},null),E=v.filter(B=>B.entityType==="visual"||B.entityType==="library").length;j.set(x,{state:m,lastModified:A,analyzableCount:E})}),j},[e,C]),N=R.useMemo(()=>[...e].sort((j,x)=>{const v=w.get(j[0]),y=w.get(x[0]),m=v==null?void 0:v.lastModified,A=y==null?void 0:y.lastModified;if(!m&&!A)return 0;if(!m)return 1;if(!A)return-1;const E=new Date(m).getTime(),B=new Date(A).getTime();return c==="desc"?B-E:E-B}),[e,w,c]);return e.length===0?l.jsxs("div",{className:"bg-[#efefef] rounded-[10px] flex flex-col items-center justify-center text-center",style:{height:"190px"},children:[l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-medium text-[16px] text-[#3e3e3e] leading-[24px] mb-2",children:"No Uncommitted Changes"}),l.jsx("p",{className:"font-['IBM_Plex_Sans'] font-normal text-[14px] text-[#3e3e3e] leading-[18px]",children:"If you edit a file in your project, it will show up here."})]}):l.jsxs("div",{children:[l.jsx(Vt,{showActions:!0,sortOrder:c,onSortChange:h,onAnalyzeAll:b,analyzeAllDisabled:g,analyzeAllText:p}),l.jsx("div",{className:"flex flex-col gap-[3px]",children:N.map(([j,{status:x,editedEntities:v}])=>{const y=n.has(j),m=w.get(j),{state:A,lastModified:E,analyzableCount:B}=m,T=B===0;let F;return T?F=l.jsx("span",{className:"text-[12px] text-gray-400",children:"Not Analyzable"}):A==="analyzing"?F=l.jsxs("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#ffdbf6",color:"#ff2ab5",height:"26px"},children:[l.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[l.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),l.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]}),"Analyzing..."]}):A==="up-to-date"?F=l.jsx("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#e8ffe6",color:"#00925d",height:"26px"},children:"Up to date"}):A==="out-of-date"?F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!r(S.sha)&&!i(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Re-Analyze"}):A==="not-analyzed"&&(F=l.jsx("button",{onClick:k=>{k.stopPropagation(),v.filter(S=>(S.entityType==="visual"||S.entityType==="library")&&!r(S.sha)&&!i(S)).forEach(S=>u(S))},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors px-[15px] py-0 h-[28px]",children:"Analyze File"})),l.jsx(zt,{filePath:j,isExpanded:y,onToggle:()=>d(j),fileStatus:x,simulationPreviews:l.jsx(Gt,{entities:v,maxPreviews:1}),entityCount:v.length,state:A,lastModified:E,isNotAnalyzable:T,isUncommitted:!0,actionButton:F,children:v.sort((k,S)=>{const I=k.entityType==="visual"||k.entityType==="library",V=S.entityType==="visual"||S.entityType==="library";return I&&!V?-1:!I&&V?1:0}).map(k=>l.jsx(Pt,{entity:k,isActivelyAnalyzing:r(k.sha),isQueued:i(k),onGenerateSimulation:u},k.sha))},j)})})]})}function ss({activeTab:e,onTabChange:t,uncommittedCount:n,branchCount:r}){return l.jsx("div",{className:"border-b border-gray-200",children:l.jsxs("nav",{className:"flex gap-8 items-center",children:[l.jsxs("button",{onClick:()=>t("branch"),className:`relative pb-3 px-2 text-sm font-medium transition-colors cursor-pointer ${e==="branch"?"text-primary-100":"text-gray-500 hover:text-gray-700"}`,children:[l.jsxs("span",{className:"flex items-center gap-2",children:["Branch Changes",r>0&&l.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="branch"?"bg-[#cbf3fa] text-[#005c75]":"bg-[#e1e1e1] text-[#3e3e3e]"}`,children:r})]}),e==="branch"&&l.jsx("span",{className:"absolute -bottom-px left-0 right-0 h-0.5 bg-primary-100"})]}),l.jsxs("button",{onClick:()=>t("uncommitted"),className:`relative pb-3 px-2 text-sm font-medium transition-colors cursor-pointer ${e==="uncommitted"?"text-primary-100":"text-gray-500 hover:text-gray-700"}`,children:[l.jsxs("span",{className:"flex items-center gap-2",children:["Uncommitted Changes",n>0&&l.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${e==="uncommitted"?"bg-[#cbf3fa] text-[#005c75]":"bg-[#e1e1e1] text-[#3e3e3e]"}`,children:n})]}),e==="uncommitted"&&l.jsx("span",{className:"absolute -bottom-px left-0 right-0 h-0.5 bg-primary-100"})]})]})})}const bs=()=>[{title:"Git - CodeYam"},{name:"description",content:"Git status and impact analysis"}],ws=mn(function(){var ft,ut;const{entities:t,gitStatus:n,currentBranch:r,actualCurrentBranch:i,defaultBranch:s,allBranches:o,baseBranch:a,branchDiff:c,currentCommit:d,projectSlug:f,queueState:u}=gn();yn({source:"git-page"});const[h,b]=xn(),[g,p]=R.useState(null),[C,w]=R.useState("desc"),[N,j]=R.useState("branch"),x=h.get("expanded")==="true",v=()=>{w(L=>L==="desc"?"asc":"desc")},y=$t(),m=y.data;R.useEffect(()=>{r&&a&&r!==a&&y.state==="idle"&&!m&&y.load(`/api/branch-entity-diff?base=${encodeURIComponent(a)}&compare=${encodeURIComponent(r)}`)},[r,a,y,m]);const A=R.useMemo(()=>{const L=jn(n,t);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[n,t]),E=R.useMemo(()=>{const L=Sn(c,t,m);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[c,t,m]),B=R.useMemo(()=>kn(n,t),[n,t]),T=R.useMemo(()=>N==="uncommitted"?A:E,[N,A,E]),F=R.useMemo(()=>T.map(([L])=>L),[T]),{expandedUncommitted:k,setExpandedUncommitted:S,toggleFile:I,expandAllUncommitted:V,collapseAllUncommitted:te}=An(x,F,[]),{diffView:Z,diffContent:se,isLoading:ae,handleShowFileDiff:$e,handleCloseDiff:Ve}=En(a,r),ne=(ft=d==null?void 0:d.metadata)==null?void 0:ft.currentRun,ve=new Set((ne==null?void 0:ne.currentEntityShas)||[]),ie=new Set(u.jobs.flatMap(L=>L.entityShas||[])),le=new Set(((ut=u.currentlyExecuting)==null?void 0:ut.entityShas)||[]),{isAnalyzing:ce,handleGenerateSimulation:J,handleGenerateAllSimulations:ln,isEntityBeingAnalyzed:rt,isEntityPending:st}=vn(ne==null?void 0:ne.currentEntityShas,u),it=L=>st(L)||ie.has(L.sha)||le.has(L.sha),cn=L=>{L===(i||r)?h.delete("viewBranch"):h.set("viewBranch",L),b(h)},ot=L=>{L===s?h.delete("compare"):h.set("compare",L),b(h)},at=()=>{const K=T.flatMap(([Q,ht])=>ht.editedEntities||ht.entities||[]).filter(Q=>!ve.has(Q.sha)&&!ie.has(Q.sha)&&!le.has(Q.sha)&&!st(Q));ln(K)},dn=A.length,fn=E.length,ze=T.flatMap(([L,K])=>K.editedEntities||K.entities||[]),be=ze.filter(L=>L.entityType==="visual"||L.entityType==="library"),Pe=be.length>0&&be.every(L=>ve.has(L.sha)),lt=be.length>0&&!Pe&&be.every(L=>ie.has(L.sha)||le.has(L.sha)),ct=ce||Pe||lt,dt=Pe?"Analyzing...":lt?"Queued...":ce?"Analyzing...":"Analyze All";return l.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:l.jsxs("div",{className:"px-20 py-12",children:[l.jsxs("div",{className:"mb-8",children:[l.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Git Changes"}),l.jsxs("p",{className:"text-[15px] text-gray-500",children:["This is a list of all the files that are affected by your local changes. ",l.jsx("strong",{children:"Analyze a file to get simulations."})]})]}),l.jsx("div",{className:"mb-6",children:l.jsx(ss,{activeTab:N,onTabChange:j,uncommittedCount:dn,branchCount:fn})}),r&&N==="branch"&&l.jsx("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-3",children:r===s?l.jsxs("div",{className:"text-gray-700",children:["You are currently on the primary branch,"," ",l.jsx("span",{className:"text-cyblack-75",children:s}),"."]}):l.jsxs("div",{className:"flex gap-6 items-center",children:[l.jsxs("div",{className:"shrink-0",children:[l.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Changes in Branch:"}),o.length>0?l.jsxs("div",{className:"relative w-50",children:[l.jsx("select",{value:r,onChange:L=>cn(L.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-2.5 pr-6 text-[13px] h-9.75 w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:o.map(L=>l.jsx("option",{value:L,children:L},L))}),l.jsx("svg",{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}):l.jsx("span",{className:"text-gray-900 font-medium text-[12px]",children:r})]}),l.jsxs("div",{className:"flex-shrink-0",children:[l.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Compared To:"}),l.jsxs("div",{className:"relative w-[200px]",children:[l.jsx("select",{value:a,onChange:L=>ot(L.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:o.filter(L=>L!==r).map(L=>l.jsx("option",{value:L,children:L},L))}),l.jsx("svg",{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),l.jsx("div",{className:"flex-1 mt-6",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("svg",{className:"absolute left-3 w-4 h-4 text-gray-400 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),l.jsx("input",{type:"text",placeholder:"Search component",className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-[10px] text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors"})]})})]})}),l.jsx("div",{className:"mb-3",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx("span",{style:{color:"#000000"},children:T.length})," ","modified ",T.length===1?"file":"files"]}),l.jsxs("div",{className:"relative group inline-flex items-center ml-1.5",children:[l.jsx("svg",{className:"w-3 h-3 text-gray-400 cursor-help",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),l.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:l.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",l.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),l.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),l.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:[l.jsx("span",{style:{color:"#000000"},children:ze.length})," ",ze.length===1?"entity":"entities"]})]}),T.length>0&&l.jsxs("div",{className:"flex gap-6",children:[l.jsxs("button",{onClick:V,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx(bn,{className:"w-3.5 h-3.5"}),"Expand All"]}),l.jsxs("button",{onClick:te,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-mono uppercase transition-all cursor-pointer px-3 py-1 rounded flex items-center gap-1.5",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[l.jsx(wn,{className:"w-3.5 h-3.5"}),"Collapse All"]})]})]})}),l.jsxs("div",{className:"overflow-hidden",children:[N==="branch"&&r&&l.jsx(ns,{files:E,currentBranch:r,defaultBranch:s,baseBranch:a,allBranches:o,expandedFiles:k,isEntityBeingAnalyzed:rt,isEntityQueued:it,sortOrder:C,onToggleFile:L=>I(L,k,S),onBranchChange:ot,onGenerateSimulation:J,onSortChange:v,onAnalyzeAll:at,analyzeAllDisabled:ct,analyzeAllText:dt}),N==="uncommitted"&&l.jsx(rs,{files:A,entityImpactMap:B,expandedFiles:k,isEntityBeingAnalyzed:rt,isEntityQueued:it,projectSlug:f,baseBranch:a,currentBranch:r,sortOrder:C,onToggleFile:L=>I(L,k,S),onShowFileDiff:$e,onGenerateSimulation:J,onSortChange:v,onAnalyzeAll:at,analyzeAllDisabled:ct,analyzeAllText:dt})]}),Z&&l.jsx(ts,{diffView:Z,diffContent:se,isLoading:ae,entities:t,onClose:Ve}),g&&f&&l.jsx(Cn,{projectSlug:f,onClose:()=>p(null)})]})})});export{ws as default,bs as meta};
|