@codeyam/codeyam-cli 0.1.0-staging.b8a55ba → 0.1.0-staging.d0ad4ae
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 +7 -7
- package/analyzer-template/common/execAsync.ts +1 -1
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +7 -4
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +14 -1
- package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +29 -10
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +120 -19
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +2 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +91 -35
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +110 -74
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +11 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
- package/analyzer-template/packages/ai/src/lib/deepEqual.ts +30 -0
- package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +24 -17
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +214 -39
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +54 -1
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +72 -6
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +12 -5
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +39 -23
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +32 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +14 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/isAsyncFunction.ts +67 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +73 -69
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +6 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +3 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +22 -6
- package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +9 -5
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +49 -11
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.ts +102 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +399 -52
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +128 -2
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +114 -70
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +34 -129
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +155 -79
- package/analyzer-template/packages/aws/codebuild/index.ts +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts +11 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js +29 -18
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts +8 -18
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js +8 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js.map +1 -1
- package/analyzer-template/packages/aws/package.json +1 -1
- package/analyzer-template/packages/aws/src/lib/codebuild/waitForBuild.ts +43 -19
- package/analyzer-template/packages/aws/src/lib/ecs/ecsDefineContainer.ts +3 -3
- package/analyzer-template/packages/aws/src/lib/ecs/ecsTaskFactory.ts +17 -69
- package/analyzer-template/packages/aws/src/lib/s3/uploadFileToS3.ts +8 -1
- package/analyzer-template/packages/generate/index.ts +3 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +17 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +193 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.ts +73 -0
- package/analyzer-template/packages/generate/src/lib/scenarioComponentForServer.ts +114 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.d.ts +3 -0
- package/analyzer-template/packages/github/dist/generate/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.js +3 -0
- package/analyzer-template/packages/github/dist/generate/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts +9 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts +20 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts +8 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js +10 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js +3 -0
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +6 -0
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/src/lib/loadOrCreateCommit.ts +14 -0
- package/analyzer-template/packages/github/src/lib/syncPrimaryBranch.ts +2 -0
- package/analyzer-template/packages/process/index.ts +2 -0
- package/analyzer-template/packages/process/package.json +12 -0
- package/analyzer-template/packages/process/tsconfig.json +8 -0
- package/analyzer-template/packages/types/src/types/Entity.ts +2 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +6 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +6 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/playwright/capture.ts +37 -18
- package/analyzer-template/playwright/waitForServer.ts +21 -6
- package/analyzer-template/project/constructMockCode.ts +781 -140
- package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +3 -6
- package/analyzer-template/project/orchestrateCapture.ts +10 -3
- package/analyzer-template/project/reconcileMockDataKeys.ts +28 -100
- package/analyzer-template/project/runAnalysis.ts +5 -0
- package/analyzer-template/project/serverOnlyModules.ts +127 -2
- package/analyzer-template/project/start.ts +5 -3
- package/analyzer-template/project/startScenarioCapture.ts +6 -0
- package/analyzer-template/project/writeMockDataTsx.ts +50 -22
- package/analyzer-template/project/writeScenarioClientWrapper.ts +21 -0
- package/analyzer-template/project/writeScenarioComponents.ts +162 -100
- package/analyzer-template/project/writeScenarioFiles.ts +26 -0
- package/analyzer-template/project/writeSimpleRoot.ts +11 -35
- package/analyzer-template/scripts/comboWorkerLoop.cjs +1 -0
- package/analyzer-template/scripts/defaultCmd.sh +9 -0
- package/background/src/lib/local/createLocalAnalyzer.js +1 -29
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/local/execAsync.js +1 -1
- package/background/src/lib/local/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/common/execAsync.js +1 -1
- package/background/src/lib/virtualized/common/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +718 -127
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js +3 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +7 -4
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +25 -61
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +4 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/serverOnlyModules.js +106 -3
- package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +5 -3
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +7 -0
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +52 -23
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js +15 -0
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js.map +1 -0
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +136 -83
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioFiles.js +19 -0
- package/background/src/lib/virtualized/project/writeScenarioFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +11 -34
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/src/cli.js +5 -1
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +1 -1
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +177 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -0
- package/codeyam-cli/src/commands/status.js +23 -1
- package/codeyam-cli/src/commands/status.js.map +1 -1
- package/codeyam-cli/src/commands/test-startup.js +1 -1
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/wipe.js +108 -0
- package/codeyam-cli/src/commands/wipe.js.map +1 -0
- package/codeyam-cli/src/utils/database.js +91 -5
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/git.js +79 -0
- package/codeyam-cli/src/utils/git.js.map +1 -0
- package/codeyam-cli/src/utils/queue/job.js +104 -0
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
- package/codeyam-cli/src/utils/wipe.js +128 -0
- package/codeyam-cli/src/utils/wipe.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +66 -17
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-wXL1Z2Aq.js → EntityItem-Cmysw5OP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-CzGX-miz.js → EntityTypeBadge-DLqD3qNt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CXFKsCOD.js → EntityTypeIcon-CAneekK2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-D-9pXIaY.js → InteractivePreview-Cu16OUmx.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CBQPrpT0.js → LibraryFunctionPreview-CVtiBnY5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-D1CdlbrV.js → LoadingDots-B0GLXMsr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-wDPcZNKx.js → LogViewer-xgeCVgSM.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-4lcOlid-.js → ReportIssueModal-DcAUIpD_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-BfmDgXxG.js → SafeScreenshot-DuDvi0jm.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-BMKg0SAF.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-6J7zDUD5.js → TruncatedFilePath-DyFZkK0l.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-DSmTpjmK.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BF_aK4y6.js +32 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BYimnrHg.js → chevron-down-Cx24_aWc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-CXRTFQ3F.js +51 -0
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CaVsIRxt.js → circle-check-BOARzkeR.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-CgUsG7ib.js → createLucideIcon-BdhJEx6B.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-DW_hdGUc.js → dev.empty-RJCf3Tvw.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-zUEpfPsu.js → entity._sha._-D0-YwkBh.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-EylcgScH.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-D_3ero5o.js → entity._sha_.create-scenario-DMe7kvgo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CfLCUi9S.js → entity._sha_.edit._scenarioId-C1H_a_Y3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DKJyZfAY.js → entry.client-CS2cb_eZ.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DAtOlaWE.js → fileTableUtils-DMJ7zii9.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-ClR0d32A.js → files-BW7Cyeyi.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-D62Lxxmv.js → git-CZu4fif0.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/globals-wHVy_II5.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-CzNNiTkw.js → index-B1h680n5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-BosqDOlH.js → index-lzqtyFU8.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-CNp9QFCX.js → loader-circle-B7B9V-bu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{manifest-09d684be.js → manifest-2d191949.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-FHgpM6gc.js +56 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-DDGjYAMJ.js → search-CxXUmBSd.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{settings-DgTyB-Wg.js → settings-6D8k8Jp5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CDJZnWhN.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CBc5dE1s.js → triangle-alert-B6LgvRJg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BMIGFP-m.js → useCustomSizes-Dv18q8LD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useInteractiveMode-Dk_FQqWJ.js → useInteractiveMode-0ToGk4K3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BqPPNjAl.js → useLastLogLine-aSv48UbS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DsJbgMY9.js → useReportContext-1BX144Eg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-DWHcCcl1.js → useToast-mBRpZPiu.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-CV6i1S1A.js → index-pU0o5t1o.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-YzfkRwdn.js +178 -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/templates/codeyam-setup-skill.md +138 -3
- package/codeyam-cli/templates/debug-codeyam.md +7 -2
- package/package.json +5 -5
- package/packages/ai/src/lib/astScopes/processExpression.js +13 -1
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/checkAllAttributes.js +24 -9
- package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +94 -18
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +2 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +51 -23
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +70 -54
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +11 -0
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js +86 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js.map +1 -0
- package/packages/ai/src/lib/deepEqual.js +32 -0
- package/packages/ai/src/lib/deepEqual.js.map +1 -0
- package/packages/ai/src/lib/findMatchingAttribute.js +20 -16
- package/packages/ai/src/lib/findMatchingAttribute.js.map +1 -1
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +168 -41
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +42 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js +59 -3
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +6 -6
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +32 -23
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +20 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +15 -0
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/index.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js +52 -0
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js.map +1 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +59 -50
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +6 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +2 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +14 -4
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeEntity.js +7 -6
- package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +44 -10
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js +85 -0
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +314 -52
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +97 -2
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +88 -52
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +26 -98
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +141 -75
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- package/packages/generate/index.js +3 -0
- package/packages/generate/index.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- package/packages/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/packages/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/packages/github/src/lib/loadOrCreateCommit.js +10 -0
- package/packages/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/packages/github/src/lib/syncPrimaryBranch.js +3 -0
- package/packages/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/packages/process/index.js +3 -0
- package/packages/process/index.js.map +1 -0
- package/packages/process/src/GlobalProcessManager.js.map +1 -0
- package/{background/src/lib/process → packages/process/src}/ProcessManager.js +1 -1
- package/packages/process/src/ProcessManager.js.map +1 -0
- package/packages/process/src/index.js.map +1 -0
- package/packages/process/src/managedExecAsync.js.map +1 -0
- package/analyzer-template/process/INTEGRATION_COMPLETE.md +0 -333
- package/analyzer-template/process/INTEGRATION_EXAMPLE.md +0 -525
- package/analyzer-template/process/README.md +0 -507
- package/background/src/lib/process/GlobalProcessManager.js.map +0 -1
- package/background/src/lib/process/ProcessManager.js.map +0 -1
- package/background/src/lib/process/index.js.map +0 -1
- package/background/src/lib/process/managedExecAsync.js.map +0 -1
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +0 -238
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +0 -1
- package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js +0 -7
- package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CUxUNEEC.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/_index-DHImXdXq.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-2mG6mjVb.js +0 -32
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JMJ3UQ3L-BambyYE_.js +0 -51
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DyB90fWk.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-C6vQASxy.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-BxJUvKau.js +0 -56
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CoNWGt0K.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BDlyhfrv.js +0 -175
- /package/analyzer-template/{process → packages/process/src}/GlobalProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/ProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/index.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/managedExecAsync.ts +0 -0
- /package/{background/src/lib/process → packages/process/src}/GlobalProcessManager.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/index.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/managedExecAsync.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./chunk-
|
|
1
|
+
import{j as l}from"./chunk-EPOLDU6W-CXRTFQ3F.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};
|
package/codeyam-cli/src/webserver/build/client/assets/{files-ClR0d32A.js → files-BW7Cyeyi.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ne,r as y,j as e,w as le,u as ce,f as de}from"./chunk-JMJ3UQ3L-BambyYE_.js";import{u as me}from"./useReportContext-DsJbgMY9.js";import{F as he,a as fe,E as pe,S as xe,u as ue}from"./EntityItem-wXL1Z2Aq.js";import{g as E}from"./fileTableUtils-DAtOlaWE.js";import{C as ae}from"./chevron-down-BYimnrHg.js";import{S as ye}from"./search-DDGjYAMJ.js";import"./useToast-DWHcCcl1.js";import"./TruncatedFilePath-6J7zDUD5.js";import"./SafeScreenshot-BfmDgXxG.js";import"./LibraryFunctionPreview-CBQPrpT0.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-CBc5dE1s.js";import"./createLucideIcon-CgUsG7ib.js";import"./EntityTypeIcon-CXFKsCOD.js";import"./EntityTypeBadge-CzGX-miz.js";function ve({entities:G,page:h,itemsPerPage:g=50,currentRun:z,filter:T,entityType:Q,queueState:i,isEntityPending:j,pendingEntityKeys:F,onGenerateSimulation:M,onGenerateAllSimulations:k,totalFilesCount:Y,totalEntitiesCount:_,uncommittedFilesCount:L,showOnlyUncommitted:H,onToggleUncommitted:I}){const[U,O]=ne(),[R,x]=y.useState(new Set),[p,v]=y.useState(""),[J,D]=y.useState(!1),[A,V]=y.useState("all"),[C,B]=y.useState("desc"),W=Q||"all",ee=y.useMemo(()=>{let s=G;return W!=="all"&&(s=s.filter(o=>o.entityType===W)),T==="analyzed"&&(s=s.filter(o=>o.analyses&&o.analyses.length>0)),s},[G,W,T]),te=y.useMemo(()=>{const s=new Map,o=new Map,f=new Map;ee.forEach(a=>{var r,l;const t=`${a.filePath}::${a.name}`,n=o.get(t);if(!n)o.set(t,a),f.set(t,[]);else{const d=((r=n.metadata)==null?void 0:r.editedAt)||n.createdAt||"",c=((l=a.metadata)==null?void 0:l.editedAt)||a.createdAt||"";let m=!1;if(c>d)m=!0;else if(c===d){const u=n.createdAt||"";m=(a.createdAt||"")>u}m?(f.get(t).push(n),o.set(t,a)):f.get(t).push(a)}}),o.forEach((a,t)=>{var r;if(!(a.analyses&&a.analyses.length>0)&&((r=a.metadata)!=null&&r.previousVersionWithAnalyses)){const d=(f.get(t)||[]).find(c=>{var m;return c.sha===((m=a.metadata)==null?void 0:m.previousVersionWithAnalyses)});d&&d.analyses&&d.analyses.length>0&&(a.analyses=d.analyses)}}),Array.from(o.values()).sort((a,t)=>{var l,d,c,m;const n=!((l=a.metadata)!=null&&l.notExported)&&!((d=a.metadata)!=null&&d.namedExport),r=!((c=t.metadata)!=null&&c.notExported)&&!((m=t.metadata)!=null&&m.namedExport);return n&&!r?-1:!n&&r?1:0}).forEach(a=>{var d,c,m,u,b;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=((u=(m=(c=a.analyses)==null?void 0:c[0])==null?void 0:m.scenarios)==null?void 0:u.length)||0;n.simulationCount+=r;const l=((b=a.metadata)==null?void 0:b.editedAt)||a.updatedAt;l&&(!n.lastUpdated||new Date(l)>new Date(n.lastUpdated))&&(n.lastUpdated=l)});const K=(i==null?void 0:i.jobs)||[],q=a=>{const t=`${a.filePath||""}::${a.name}`;return(F==null?void 0:F.includes(t))||!1};s.forEach(a=>{const t=a.entities.map(n=>q(n)?"queued":E(n,K));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,l,d;for(const c of a.entities){if(a.previewScreenshots.length+a.previewLibraryScenarios.length>=3)break;const u=((n=(t=c.analyses)==null?void 0:t[0])==null?void 0:n.scenarios)||[];if(c.entityType==="library"){const b=u.find(N=>{var P,S;return((P=N.metadata)==null?void 0:P.executionResult)||((S=N.metadata)==null?void 0:S.error)});b&&a.previewLibraryScenarios.push({scenario:b,entitySha:c.sha})}else{const b=u.find(N=>{var P,S;return(S=(P=N.metadata)==null?void 0:P.screenshotPaths)==null?void 0:S[0]});if(b){const N=(l=(r=b.metadata)==null?void 0:r.screenshotPaths)==null?void 0:l[0],P=!!((d=b.metadata)!=null&&d.error);N&&!a.previewScreenshots.includes(N)&&(a.previewScreenshots.push(N),a.previewScreenshotErrors.push(P))}}}});const $=Array.from(s.values());return $.sort((a,t)=>{if(T==="analyzed"){const l=Math.max(...a.entities.filter(c=>{var m,u;return(u=(m=c.analyses)==null?void 0:m[0])==null?void 0:u.createdAt}).map(c=>new Date(c.analyses[0].createdAt).getTime()),0),d=Math.max(...t.entities.filter(c=>{var m,u;return(u=(m=c.analyses)==null?void 0:m[0])==null?void 0:u.createdAt}).map(c=>new Date(c.analyses[0].createdAt).getTime()),0);return C==="desc"?d-l:l-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 C==="desc"?r-n:n-r}),$},[ee,T,C,i,F]),w=y.useMemo(()=>{let s=te;if(A!=="all"&&(s=s.filter(o=>o.state===A)),p.trim()){const o=p.toLowerCase();s=s.filter(f=>f.filePath.toLowerCase().includes(o))}return s},[te,p,A]),se=(h-1)*g,ie=se+g,X=w.slice(se,ie),Z=Math.ceil(w.length/g),re=s=>{x(o=>{const f=new Set(o);return f.has(s)?f.delete(s):f.add(s),f})},oe=()=>{B(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:W,onChange:s=>{const o=s.target.value,f=new URLSearchParams(U);o==="all"?f.delete("entityType"):f.set("entityType",o),f.set("page","1"),O(f)},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:A,onChange:s=>V(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(ye,{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:p,onChange:s=>v(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"})]})]})]}),Y!==void 0&&_!==void 0&&L!==void 0&&e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"flex items-center justify-between text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-gray-900",children:[w.length," ",w.length===1?"file":"files"]}),e.jsx("span",{className:"text-gray-300",children:"|"}),e.jsxs("div",{className:"flex items-center gap-1 group relative",children:[e.jsxs("span",{className:"text-gray-900",children:[w.reduce((s,o)=>s+o.totalCount,0)," ",w.reduce((s,o)=>s+o.totalCount,0)===1?"entity":"entities"]}),e.jsxs("svg",{className:"w-3.5 h-3.5 text-[#001f3f]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeWidth:"2"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 16v-4m0-4h.01"})]}),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:"text-gray-300",children:"|"}),H?e.jsxs("button",{onClick:I,className:"flex items-center gap-2 font-medium text-[#005c75] underline hover:text-[#004a5e] transition-colors",children:[w.filter(s=>s.uncommittedCount>0).length," ","uncommitted"," ",w.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:I,className:"font-medium text-[#005c75] underline hover:text-[#004a5e] transition-colors",children:[L," uncommitted"," ",L===1?"file":"files"]})]}),X.length>0&&e.jsxs("div",{className:"flex gap-6",children:[e.jsx("button",{onClick:()=>{x(new Set(X.map(s=>s.filePath))),D(!0)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Expand All"}),e.jsx("button",{onClick:()=>{x(new Set),D(!1)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Collapse All"})]})]})}),e.jsx(he,{showActions:!0,sortOrder:C,onSortChange:oe}),e.jsx("div",{className:"flex flex-col gap-[3px]",children:X.map(s=>{const o=R.has(s.filePath),K=s.entities.filter(t=>(t.entityType==="visual"||t.entityType==="library")&&(E(t,(i==null?void 0:i.jobs)||[])==="not-analyzed"||E(t,(i==null?void 0:i.jobs)||[])==="out-of-date"||E(t,(i==null?void 0:i.jobs)||[])==="incomplete")).length>0,q=t=>{var n;return((n=z==null?void 0:z.currentEntityShas)==null?void 0:n.includes(t))||!1},$=t=>{var n;return j!=null&&j(t)?!0:((n=i==null?void 0:i.jobs)==null?void 0:n.some(r=>{var l;return(l=r.entityShas)==null?void 0:l.includes(t.sha)}))||!1},a=t=>{M==null||M(t)};return e.jsx(fe,{filePath:s.filePath,isExpanded:o,onToggle:()=>re(s.filePath),simulationPreviews:e.jsx(xe,{entities:s.entities,maxPreviews:1}),entityCount:s.totalCount,state:s.state,lastModified:s.lastUpdated,uncommittedCount:s.uncommittedCount,isUncommitted:s.uncommittedCount>0,actionButton:K?e.jsx("button",{onClick:t=>{t.stopPropagation();const n=s.entities.filter(r=>(r.entityType==="visual"||r.entityType==="library")&&(E(r,(i==null?void 0:i.jobs)||[])==="not-analyzed"||E(r,(i==null?void 0:i.jobs)||[])==="out-of-date"||E(r,(i==null?void 0:i.jobs)||[])==="incomplete"));k==null||k(n)},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors cursor-pointer px-[15px] py-0 h-[28px]",children:"Analyze"}):void 0,children:s.entities.sort((t,n)=>{const r=t.entityType==="visual"||t.entityType==="library",l=n.entityType==="visual"||n.entityType==="library";return r&&!l?-1:!r&&l?1:0}).map(t=>e.jsx(pe,{entity:t,isActivelyAnalyzing:q(t.sha),isQueued:$(t),onGenerateSimulation:a},t.sha))},s.filePath)})}),Z>1&&e.jsxs("div",{className:"flex justify-center items-center gap-4 mt-6 p-4",children:[h>1&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(U),page:String(h-1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"← Previous"}),e.jsxs("span",{children:["Page ",h," of ",Z]}),h<Z&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(U),page:String(h+1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"Next →"})]})]})}const Le=()=>[{title:"CodeYam - Files & Entities"},{name:"description",content:"Browse your codebase files and entities"}],De=le(function(){var U,O,R;const{entities:h,currentCommit:g,page:z,filter:T,entityType:Q,queueState:i}=ce();de(),ne();const[j,F]=y.useState(!1);me({source:"files-page"});const{handleGenerateSimulation:M,handleGenerateAllSimulations:k,isEntityPending:Y,pendingEntityKeys:_}=ue((O=(U=g==null?void 0:g.metadata)==null?void 0:U.currentRun)==null?void 0:O.currentEntityShas,i),L=y.useMemo(()=>{if(!h)return[];const x=new Set([]);for(const p of h)x.add(p.filePath??"No File Path");return Array.from(x)},[h]),H=y.useMemo(()=>{if(!h)return[];let x=h;return j&&(x=x.filter(p=>{var v;return(v=p.metadata)==null?void 0:v.isUncommitted})),x.sort((p,v)=>{var J,D,A,V,C,B;return(J=p.metadata)!=null&&J.isUncommitted&&!((D=v.metadata)!=null&&D.isUncommitted)?-1:!((A=p.metadata)!=null&&A.isUncommitted)&&((V=v.metadata)!=null&&V.isUncommitted)?1:new Date(((C=v.metadata)==null?void 0:C.editedAt)||0).getTime()-new Date(((B=p.metadata)==null?void 0:B.editedAt)||0).getTime()})},[h,j]),I=y.useMemo(()=>{var p;if(!h)return[];const x=new Set([]);for(const v of h)(p=v.metadata)!=null&&p.isUncommitted&&x.add(v.filePath??"No File Path");return Array.from(x)},[h]);return h?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-3xl font-semibold text-gray-900 mb-2",children:"Files & Entities"}),e.jsx("p",{className:"text-gray-600",children:"This is a list of all the files in your app."})]}),e.jsx(ve,{entities:H,page:z,itemsPerPage:50,currentRun:(R=g==null?void 0:g.metadata)==null?void 0:R.currentRun,filter:T,entityType:Q,queueState:i,isEntityPending:Y,pendingEntityKeys:_,onGenerateSimulation:M,onGenerateAllSimulations:k,totalFilesCount:L.length,totalEntitiesCount:h.length,uncommittedFilesCount:I.length,showOnlyUncommitted:j,onToggleUncommitted:()=>F(!j)})]})}):e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-3xl font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:"Unable to retrieve entities"})]})})});export{De as default,Le as meta};
|
|
1
|
+
import{b as ne,r as y,j as e,w as le,u as ce,f as de}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as me}from"./useReportContext-1BX144Eg.js";import{F as he,a as fe,E as pe,S as xe,u as ue}from"./EntityItem-Cmysw5OP.js";import{g as E}from"./fileTableUtils-DMJ7zii9.js";import{C as ae}from"./chevron-down-Cx24_aWc.js";import{S as ye}from"./search-CxXUmBSd.js";import"./useToast-mBRpZPiu.js";import"./TruncatedFilePath-DyFZkK0l.js";import"./SafeScreenshot-DuDvi0jm.js";import"./LibraryFunctionPreview-CVtiBnY5.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-B6LgvRJg.js";import"./createLucideIcon-BdhJEx6B.js";import"./EntityTypeIcon-CAneekK2.js";import"./EntityTypeBadge-DLqD3qNt.js";function ve({entities:G,page:h,itemsPerPage:g=50,currentRun:z,filter:T,entityType:Q,queueState:i,isEntityPending:j,pendingEntityKeys:F,onGenerateSimulation:M,onGenerateAllSimulations:k,totalFilesCount:Y,totalEntitiesCount:_,uncommittedFilesCount:L,showOnlyUncommitted:H,onToggleUncommitted:I}){const[U,O]=ne(),[R,x]=y.useState(new Set),[p,v]=y.useState(""),[J,D]=y.useState(!1),[A,V]=y.useState("all"),[C,B]=y.useState("desc"),W=Q||"all",ee=y.useMemo(()=>{let s=G;return W!=="all"&&(s=s.filter(o=>o.entityType===W)),T==="analyzed"&&(s=s.filter(o=>o.analyses&&o.analyses.length>0)),s},[G,W,T]),te=y.useMemo(()=>{const s=new Map,o=new Map,f=new Map;ee.forEach(a=>{var r,l;const t=`${a.filePath}::${a.name}`,n=o.get(t);if(!n)o.set(t,a),f.set(t,[]);else{const d=((r=n.metadata)==null?void 0:r.editedAt)||n.createdAt||"",c=((l=a.metadata)==null?void 0:l.editedAt)||a.createdAt||"";let m=!1;if(c>d)m=!0;else if(c===d){const u=n.createdAt||"";m=(a.createdAt||"")>u}m?(f.get(t).push(n),o.set(t,a)):f.get(t).push(a)}}),o.forEach((a,t)=>{var r;if(!(a.analyses&&a.analyses.length>0)&&((r=a.metadata)!=null&&r.previousVersionWithAnalyses)){const d=(f.get(t)||[]).find(c=>{var m;return c.sha===((m=a.metadata)==null?void 0:m.previousVersionWithAnalyses)});d&&d.analyses&&d.analyses.length>0&&(a.analyses=d.analyses)}}),Array.from(o.values()).sort((a,t)=>{var l,d,c,m;const n=!((l=a.metadata)!=null&&l.notExported)&&!((d=a.metadata)!=null&&d.namedExport),r=!((c=t.metadata)!=null&&c.notExported)&&!((m=t.metadata)!=null&&m.namedExport);return n&&!r?-1:!n&&r?1:0}).forEach(a=>{var d,c,m,u,b;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=((u=(m=(c=a.analyses)==null?void 0:c[0])==null?void 0:m.scenarios)==null?void 0:u.length)||0;n.simulationCount+=r;const l=((b=a.metadata)==null?void 0:b.editedAt)||a.updatedAt;l&&(!n.lastUpdated||new Date(l)>new Date(n.lastUpdated))&&(n.lastUpdated=l)});const K=(i==null?void 0:i.jobs)||[],q=a=>{const t=`${a.filePath||""}::${a.name}`;return(F==null?void 0:F.includes(t))||!1};s.forEach(a=>{const t=a.entities.map(n=>q(n)?"queued":E(n,K));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,l,d;for(const c of a.entities){if(a.previewScreenshots.length+a.previewLibraryScenarios.length>=3)break;const u=((n=(t=c.analyses)==null?void 0:t[0])==null?void 0:n.scenarios)||[];if(c.entityType==="library"){const b=u.find(N=>{var P,S;return((P=N.metadata)==null?void 0:P.executionResult)||((S=N.metadata)==null?void 0:S.error)});b&&a.previewLibraryScenarios.push({scenario:b,entitySha:c.sha})}else{const b=u.find(N=>{var P,S;return(S=(P=N.metadata)==null?void 0:P.screenshotPaths)==null?void 0:S[0]});if(b){const N=(l=(r=b.metadata)==null?void 0:r.screenshotPaths)==null?void 0:l[0],P=!!((d=b.metadata)!=null&&d.error);N&&!a.previewScreenshots.includes(N)&&(a.previewScreenshots.push(N),a.previewScreenshotErrors.push(P))}}}});const $=Array.from(s.values());return $.sort((a,t)=>{if(T==="analyzed"){const l=Math.max(...a.entities.filter(c=>{var m,u;return(u=(m=c.analyses)==null?void 0:m[0])==null?void 0:u.createdAt}).map(c=>new Date(c.analyses[0].createdAt).getTime()),0),d=Math.max(...t.entities.filter(c=>{var m,u;return(u=(m=c.analyses)==null?void 0:m[0])==null?void 0:u.createdAt}).map(c=>new Date(c.analyses[0].createdAt).getTime()),0);return C==="desc"?d-l:l-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 C==="desc"?r-n:n-r}),$},[ee,T,C,i,F]),w=y.useMemo(()=>{let s=te;if(A!=="all"&&(s=s.filter(o=>o.state===A)),p.trim()){const o=p.toLowerCase();s=s.filter(f=>f.filePath.toLowerCase().includes(o))}return s},[te,p,A]),se=(h-1)*g,ie=se+g,X=w.slice(se,ie),Z=Math.ceil(w.length/g),re=s=>{x(o=>{const f=new Set(o);return f.has(s)?f.delete(s):f.add(s),f})},oe=()=>{B(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:W,onChange:s=>{const o=s.target.value,f=new URLSearchParams(U);o==="all"?f.delete("entityType"):f.set("entityType",o),f.set("page","1"),O(f)},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:A,onChange:s=>V(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(ye,{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:p,onChange:s=>v(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"})]})]})]}),Y!==void 0&&_!==void 0&&L!==void 0&&e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"flex items-center justify-between text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-gray-900",children:[w.length," ",w.length===1?"file":"files"]}),e.jsx("span",{className:"text-gray-300",children:"|"}),e.jsxs("div",{className:"flex items-center gap-1 group relative",children:[e.jsxs("span",{className:"text-gray-900",children:[w.reduce((s,o)=>s+o.totalCount,0)," ",w.reduce((s,o)=>s+o.totalCount,0)===1?"entity":"entities"]}),e.jsxs("svg",{className:"w-3.5 h-3.5 text-[#001f3f]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeWidth:"2"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 16v-4m0-4h.01"})]}),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:"text-gray-300",children:"|"}),H?e.jsxs("button",{onClick:I,className:"flex items-center gap-2 font-medium text-[#005c75] underline hover:text-[#004a5e] transition-colors",children:[w.filter(s=>s.uncommittedCount>0).length," ","uncommitted"," ",w.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:I,className:"font-medium text-[#005c75] underline hover:text-[#004a5e] transition-colors",children:[L," uncommitted"," ",L===1?"file":"files"]})]}),X.length>0&&e.jsxs("div",{className:"flex gap-6",children:[e.jsx("button",{onClick:()=>{x(new Set(X.map(s=>s.filePath))),D(!0)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Expand All"}),e.jsx("button",{onClick:()=>{x(new Set),D(!1)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Collapse All"})]})]})}),e.jsx(he,{showActions:!0,sortOrder:C,onSortChange:oe}),e.jsx("div",{className:"flex flex-col gap-[3px]",children:X.map(s=>{const o=R.has(s.filePath),K=s.entities.filter(t=>(t.entityType==="visual"||t.entityType==="library")&&(E(t,(i==null?void 0:i.jobs)||[])==="not-analyzed"||E(t,(i==null?void 0:i.jobs)||[])==="out-of-date"||E(t,(i==null?void 0:i.jobs)||[])==="incomplete")).length>0,q=t=>{var n;return((n=z==null?void 0:z.currentEntityShas)==null?void 0:n.includes(t))||!1},$=t=>{var n;return j!=null&&j(t)?!0:((n=i==null?void 0:i.jobs)==null?void 0:n.some(r=>{var l;return(l=r.entityShas)==null?void 0:l.includes(t.sha)}))||!1},a=t=>{M==null||M(t)};return e.jsx(fe,{filePath:s.filePath,isExpanded:o,onToggle:()=>re(s.filePath),simulationPreviews:e.jsx(xe,{entities:s.entities,maxPreviews:1}),entityCount:s.totalCount,state:s.state,lastModified:s.lastUpdated,uncommittedCount:s.uncommittedCount,isUncommitted:s.uncommittedCount>0,actionButton:K?e.jsx("button",{onClick:t=>{t.stopPropagation();const n=s.entities.filter(r=>(r.entityType==="visual"||r.entityType==="library")&&(E(r,(i==null?void 0:i.jobs)||[])==="not-analyzed"||E(r,(i==null?void 0:i.jobs)||[])==="out-of-date"||E(r,(i==null?void 0:i.jobs)||[])==="incomplete"));k==null||k(n)},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors cursor-pointer px-[15px] py-0 h-[28px]",children:"Analyze"}):void 0,children:s.entities.sort((t,n)=>{const r=t.entityType==="visual"||t.entityType==="library",l=n.entityType==="visual"||n.entityType==="library";return r&&!l?-1:!r&&l?1:0}).map(t=>e.jsx(pe,{entity:t,isActivelyAnalyzing:q(t.sha),isQueued:$(t),onGenerateSimulation:a},t.sha))},s.filePath)})}),Z>1&&e.jsxs("div",{className:"flex justify-center items-center gap-4 mt-6 p-4",children:[h>1&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(U),page:String(h-1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"← Previous"}),e.jsxs("span",{children:["Page ",h," of ",Z]}),h<Z&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(U),page:String(h+1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"Next →"})]})]})}const Le=()=>[{title:"CodeYam - Files & Entities"},{name:"description",content:"Browse your codebase files and entities"}],De=le(function(){var U,O,R;const{entities:h,currentCommit:g,page:z,filter:T,entityType:Q,queueState:i}=ce();de(),ne();const[j,F]=y.useState(!1);me({source:"files-page"});const{handleGenerateSimulation:M,handleGenerateAllSimulations:k,isEntityPending:Y,pendingEntityKeys:_}=ue((O=(U=g==null?void 0:g.metadata)==null?void 0:U.currentRun)==null?void 0:O.currentEntityShas,i),L=y.useMemo(()=>{if(!h)return[];const x=new Set([]);for(const p of h)x.add(p.filePath??"No File Path");return Array.from(x)},[h]),H=y.useMemo(()=>{if(!h)return[];let x=h;return j&&(x=x.filter(p=>{var v;return(v=p.metadata)==null?void 0:v.isUncommitted})),x.sort((p,v)=>{var J,D,A,V,C,B;return(J=p.metadata)!=null&&J.isUncommitted&&!((D=v.metadata)!=null&&D.isUncommitted)?-1:!((A=p.metadata)!=null&&A.isUncommitted)&&((V=v.metadata)!=null&&V.isUncommitted)?1:new Date(((C=v.metadata)==null?void 0:C.editedAt)||0).getTime()-new Date(((B=p.metadata)==null?void 0:B.editedAt)||0).getTime()})},[h,j]),I=y.useMemo(()=>{var p;if(!h)return[];const x=new Set([]);for(const v of h)(p=v.metadata)!=null&&p.isUncommitted&&x.add(v.filePath??"No File Path");return Array.from(x)},[h]);return h?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-3xl font-semibold text-gray-900 mb-2",children:"Files & Entities"}),e.jsx("p",{className:"text-gray-600",children:"This is a list of all the files in your app."})]}),e.jsx(ve,{entities:H,page:z,itemsPerPage:50,currentRun:(R=g==null?void 0:g.metadata)==null?void 0:R.currentRun,filter:T,entityType:Q,queueState:i,isEntityPending:Y,pendingEntityKeys:_,onGenerateSimulation:M,onGenerateAllSimulations:k,totalFilesCount:L.length,totalEntitiesCount:h.length,uncommittedFilesCount:I.length,showOnlyUncommitted:j,onToggleUncommitted:()=>F(!j)})]})}):e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-3xl font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:"Unable to retrieve entities"})]})})});export{De as default,Le as meta};
|
|
@@ -1,4 +1,4 @@
|
|
|
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,c as $t,G as pn,j as l,w as mn,u as gn,b as xn}from"./chunk-
|
|
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,c as $t,G as pn,j as l,w as mn,u as gn,b as xn}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as yn}from"./useReportContext-1BX144Eg.js";import{F as Vt,a as zt,E as Pt,S as Gt,u as vn}from"./EntityItem-Cmysw5OP.js";import{L as bn}from"./LogViewer-xgeCVgSM.js";import{g as Ht}from"./fileTableUtils-DMJ7zii9.js";import"./useToast-mBRpZPiu.js";import"./TruncatedFilePath-DyFZkK0l.js";import"./SafeScreenshot-DuDvi0jm.js";import"./LibraryFunctionPreview-CVtiBnY5.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-B6LgvRJg.js";import"./createLucideIcon-BdhJEx6B.js";import"./EntityTypeIcon-CAneekK2.js";import"./EntityTypeBadge-DLqD3qNt.js";function wn(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 Cn(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 Nn(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 jn(e,t){const n=new Map,r=Sn(e,t);for(const i of r){const o=wn([i],t).filter(({depth:a})=>a>0);n.set(i.sha,o)}return n}function Sn(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 kn(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 Ln(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
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
@@ -12,4 +12,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
12
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
13
|
`)+`
|
|
14
14
|
`}function _t(e,t,n,r,i,s,o){return Ke(Xe(e,t,n,r,i,s,o))}function Xn(e,t,n,r,i,s){return _t(e,e,t,n,r,i,s)}function Kn(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 Qn(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 er(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:[]};tr(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 tr(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]==="+"))nr(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),Qn(e)}function nr(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(Kn(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=rr(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 rr(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 sr(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 ir(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(or(r.value)),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}function or(e){var t=e;return t=t.replace(/&/g,"&"),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t=t.replace(/"/g,"""),t}const ar=Object.freeze(Object.defineProperty({__proto__:null,Diff:X,applyPatch:Jt,applyPatches:Yn,canonicalize:Ae,convertChangesToDMP:sr,convertChangesToXML:ir,createPatch:Xn,createTwoFilesPatch:_t,diffArrays:Jn,diffChars:On,diffCss:Pn,diffJson:Zt,diffLines:Ye,diffSentences:zn,diffTrimmedLines:Vn,diffWords:In,diffWordsWithSpace:$n,formatPatch:Ke,merge:er,parsePatch:Me,reversePatch:Yt,structuredPatch:Xe},Symbol.toStringTag,{value:"Module"})),lr=ar;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
|
-
`),cr=(e,t,n=ue.CHARS)=>{const i=(typeof n=="string"?lr[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},dr=(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=cr(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 fr(){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 ur(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 hr(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 pr=(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(hr(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=ur(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",mr="@import",Kt="@keyframes",gr="@layer",xr=Math.abs,Re=String.fromCharCode,yr=Object.assign;function vr(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 br(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 wr(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 yr(Ie("",null,null,"",null,null,0),e,{length:-e.length},t)}function Cr(){return $}function Nr(){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 jr(e){for(;($=Y())&&$<33;)q();return xe(e)>2||xe($)>3?"":" "}function Sr(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 kr(e,t){for(;q()&&e+$!==57;)if(e+$===84&&Y()===47)break;return"/*"+ye(t,W-1)+"*"+Re(e===47?e:q())}function Lr(e){for(;!xe(Y());)q();return ye(e,W)}function Ar(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+=jr(g);break;case 92:m+=Sr(je()-1,7);continue;case 47:switch(Y()){case 42:case 47:Ce(Er(kr(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&&Nr()==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+=Lr(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=xr(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 Er(e,t,n){return Ie(e,t,n,Xt,Re(Cr()),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 Br(e,t,n,r){switch(e.type){case gr:if(e.children.length)break;case mr: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 Fr(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 Tr(e){return function(t){t.root||(t=t.return)&&e(t)}}function Dr(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Mr=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)},Rr=function(t,n){var r=-1,i=44;do switch(xe(i)){case 0:i===38&&Y()===12&&(n[r]=1),t[r]+=Mr(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},Or=function(t,n){return nn(Rr(tn(t),n))},Tt=new WeakMap,Ir=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=Or(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]}}},$r=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(vr(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 Vr=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 wr(t.props,function(s){switch(br(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""})}},zr=[Vr],Pr=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||zr,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=[Ir,$r];{var f,u=[Br,Tr(function(p){f.insert(p)})],h=Fr(d.concat(i,u)),b=function(C){return de(Ar(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 pr({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 Gr(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 Hr={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},Wr=/[A-Z]|^ms/g,Ur=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sn=function(t){return t.charCodeAt(1)===45},Dt=function(t){return t!=null&&typeof t!="boolean"},He=Dr(function(e){return sn(e)?e:e.replace(Wr,"-$&").toLowerCase()}),Mt=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Ur,function(r,i,s){return re={name:i,styles:s,next:re},i})}return Hr[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 qr(e,t,n)}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function qr(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=Gr(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 Zr=function(t,n,r){var i=t.key+"-"+n.name;t.registered[i]===void 0&&(t.registered[i]=n.styles)},Jr=function(t,n,r){Zr(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 _r=function(t){var n=Pr(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 Jr(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,Yr(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)}},Yr=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 Xr=(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}=_r({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 Kr(){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",Tn(Xr));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}=dr(n,r,s,o,a,this.props.alwaysShowLines),f=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:u,blocks:h}=Dn(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(Kr,{}):l.jsx(fr,{})})," ",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 Qr({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 es({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-medium 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-medium 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 ts({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-medium 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-medium 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 ns({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-[#005C75]":"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-[-1px] left-0 right-0 h-[2px] bg-[#005C75]"})]}),l.jsxs("button",{onClick:()=>t("uncommitted"),className:`relative pb-3 px-2 text-sm font-medium transition-colors cursor-pointer ${e==="uncommitted"?"text-[#005C75]":"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-[-1px] left-0 right-0 h-[2px] bg-[#005C75]"})]})]})})}const ys=()=>[{title:"Git - CodeYam"},{name:"description",content:"Git status and impact analysis"}],vs=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=Cn(n,t);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[n,t]),E=R.useMemo(()=>{const L=Nn(c,t,m);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[c,t,m]),B=R.useMemo(()=>jn(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}=kn(x,F,[]),{diffView:Z,diffContent:se,isLoading:ae,handleShowFileDiff:$e,handleCloseDiff:Ve}=Ln(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-[#f9f9f9] 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-3xl font-semibold text-gray-900 mb-2",children:"Git Changes"}),l.jsxs("p",{className:"text-gray-600",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(ns,{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:l.jsxs("div",{className:"flex gap-6 items-center",children:[l.jsxs("div",{className:"flex-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-[200px]",children:[l.jsx("select",{value:r,onChange:L=>cn(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.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 text-[13px]",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-gray-900",children:[T.length," modified"," ",T.length===1?"file":"files"]}),l.jsx("span",{className:"text-gray-300",children:"|"}),l.jsxs("div",{className:"flex items-center gap-1 group relative",children:[l.jsxs("span",{className:"text-gray-900",children:[ze.length," ",ze.length===1?"entity":"entities"]}),l.jsxs("svg",{className:"w-3.5 h-3.5 text-[#001f3f]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10",strokeWidth:"2"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 16v-4m0-4h.01"})]}),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"})]})})]})]}),T.length>0&&l.jsxs("div",{className:"flex gap-6",children:[l.jsx("button",{onClick:V,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Expand All"}),l.jsx("button",{onClick:te,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Collapse All"})]})]})}),l.jsxs("div",{className:"overflow-hidden",children:[N==="branch"&&r&&l.jsx(es,{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(ts,{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(Qr,{diffView:Z,diffContent:se,isLoading:ae,entities:t,onClose:Ve}),g&&f&&l.jsx(bn,{projectSlug:f,onClose:()=>p(null)})]})})});export{vs as default,ys as meta};
|
|
15
|
+
`),cr=(e,t,n=ue.CHARS)=>{const i=(typeof n=="string"?lr[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},dr=(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=cr(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 fr(){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 ur(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 hr(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 pr=(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(hr(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=ur(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",mr="@import",Kt="@keyframes",gr="@layer",xr=Math.abs,Re=String.fromCharCode,yr=Object.assign;function vr(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 br(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 wr(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 yr(Ie("",null,null,"",null,null,0),e,{length:-e.length},t)}function Cr(){return $}function Nr(){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 jr(e){for(;($=Y())&&$<33;)q();return xe(e)>2||xe($)>3?"":" "}function Sr(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 kr(e,t){for(;q()&&e+$!==57;)if(e+$===84&&Y()===47)break;return"/*"+ye(t,W-1)+"*"+Re(e===47?e:q())}function Lr(e){for(;!xe(Y());)q();return ye(e,W)}function Ar(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+=jr(g);break;case 92:m+=Sr(je()-1,7);continue;case 47:switch(Y()){case 42:case 47:Ce(Er(kr(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&&Nr()==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+=Lr(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=xr(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 Er(e,t,n){return Ie(e,t,n,Xt,Re(Cr()),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 Br(e,t,n,r){switch(e.type){case gr:if(e.children.length)break;case mr: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 Fr(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 Tr(e){return function(t){t.root||(t=t.return)&&e(t)}}function Dr(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Mr=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)},Rr=function(t,n){var r=-1,i=44;do switch(xe(i)){case 0:i===38&&Y()===12&&(n[r]=1),t[r]+=Mr(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},Or=function(t,n){return nn(Rr(tn(t),n))},Tt=new WeakMap,Ir=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=Or(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]}}},$r=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(vr(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 Vr=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 wr(t.props,function(s){switch(br(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""})}},zr=[Vr],Pr=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||zr,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=[Ir,$r];{var f,u=[Br,Tr(function(p){f.insert(p)})],h=Fr(d.concat(i,u)),b=function(C){return de(Ar(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 pr({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 Gr(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 Hr={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},Wr=/[A-Z]|^ms/g,Ur=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sn=function(t){return t.charCodeAt(1)===45},Dt=function(t){return t!=null&&typeof t!="boolean"},He=Dr(function(e){return sn(e)?e:e.replace(Wr,"-$&").toLowerCase()}),Mt=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Ur,function(r,i,s){return re={name:i,styles:s,next:re},i})}return Hr[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 qr(e,t,n)}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function qr(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=Gr(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 Zr=function(t,n,r){var i=t.key+"-"+n.name;t.registered[i]===void 0&&(t.registered[i]=n.styles)},Jr=function(t,n,r){Zr(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 _r=function(t){var n=Pr(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 Jr(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,Yr(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)}},Yr=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 Xr=(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}=_r({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 Kr(){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",Tn(Xr));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}=dr(n,r,s,o,a,this.props.alwaysShowLines),f=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:u,blocks:h}=Dn(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(Kr,{}):l.jsx(fr,{})})," ",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 Qr({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 es({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-medium 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-medium 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 ts({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-medium 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-medium 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 ns({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 ys=()=>[{title:"Git - CodeYam"},{name:"description",content:"Git status and impact analysis"}],vs=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=Cn(n,t);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[n,t]),E=R.useMemo(()=>{const L=Nn(c,t,m);return Array.from(L.entries()).sort((K,Q)=>K[0].localeCompare(Q[0]))},[c,t,m]),B=R.useMemo(()=>jn(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}=kn(x,F,[]),{diffView:Z,diffContent:se,isLoading:ae,handleShowFileDiff:$e,handleCloseDiff:Ve}=Ln(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-[#f9f9f9] 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-3xl font-semibold text-gray-900 mb-2",children:"Git Changes"}),l.jsxs("p",{className:"text-gray-600",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(ns,{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 text-[13px]",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-gray-900",children:[T.length," modified"," ",T.length===1?"file":"files"]}),l.jsx("span",{className:"text-gray-300",children:"|"}),l.jsxs("div",{className:"flex items-center gap-1 group relative",children:[l.jsxs("span",{className:"text-gray-900",children:[ze.length," ",ze.length===1?"entity":"entities"]}),l.jsxs("svg",{className:"w-3.5 h-3.5 text-[#001f3f]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10",strokeWidth:"2"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 16v-4m0-4h.01"})]}),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"})]})})]})]}),T.length>0&&l.jsxs("div",{className:"flex gap-6",children:[l.jsx("button",{onClick:V,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Expand All"}),l.jsx("button",{onClick:te,className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Collapse All"})]})]})}),l.jsxs("div",{className:"overflow-hidden",children:[N==="branch"&&r&&l.jsx(es,{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(ts,{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(Qr,{diffView:Z,diffContent:se,isLoading:ae,entities:t,onClose:Ve}),g&&f&&l.jsx(bn,{projectSlug:f,onClose:()=>p(null)})]})})});export{vs as default,ys as meta};
|