@p4code/cli 0.9.12 → 0.9.13
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/dist/bin.mjs +1 -1
- package/dist/{binCli-D9zhTalS.mjs → binCli-D22yxtxv.mjs} +273 -36
- package/dist/client/.vite/manifest.json +2046 -2046
- package/dist/client/assets/{2NI2N5EU-DOvURDwM.js → 2NI2N5EU-DBKJSvEQ.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-CArKQR6u.js → 4UO7MD6I-1JuY3zN7.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-D3yJKYTq.js → 5B3SVYGG-CwgmePuE.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-C7D6qJvm.js → 5GK6JWQ2-D9VJsozU.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-DDTV444t.js → 5N7A7DKN-CFgZoUw5.js} +2 -2
- package/dist/client/assets/{5OC2THR4-CYaAiBA5.js → 5OC2THR4-Cx6keXWX.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-jYzQX9YI.js → 5S6HY5KT-Ce1reKKv.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-CZSZgyOb.js → 6IMQ5BUJ-D7X0q9kf.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-D_TpeHsd.js → 6OLKWJ4F-YLfMA9aH.js} +2 -2
- package/dist/client/assets/{74OO7NKP-VJq-BY7c.js → 74OO7NKP-Wm5pZPTC.js} +2 -2
- package/dist/client/assets/{75O6YZUN-BCik3Y9V.js → 75O6YZUN-D2He6_fp.js} +2 -2
- package/dist/client/assets/{77XECAW3-Ce_-nZaY.js → 77XECAW3-CV_JLSeU.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-C1hL61qL.js → ABYRPUBD-D0xOVN1A.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-DaczVYX9.js +2 -0
- package/dist/client/assets/{AnimatedHeight-DEeywxgS.js → AnimatedHeight-yuTG4G03.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-835o12nS.js → AuthSurfaceShell-CCBOJP5G.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-DlIE2g50.js → BB2UYUI2-BdXGRPif.js} +2 -2
- package/dist/client/assets/{BUM34MOA-D9NQPxww.js → BUM34MOA-isqGnSvm.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-BsiY6pPC.js → CEQABKGZ-DE0PWXRq.js} +2 -2
- package/dist/client/assets/{CXAC5362-t7YfF0UQ.js → CXAC5362-0Zr5tv4C.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-C3xHekTe.js → ChatGptUsageButton-w6RkBCUH.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-Cw9bEYxG.js → ChatMarkdown-CFUfXlYp.js} +5 -5
- package/dist/client/assets/{CheckboxIndicator-XdXpYxXy.js → CheckboxIndicator-lkbFKbE7.js} +2 -2
- package/dist/client/assets/{ClippedText-C-unQqBz.js → ClippedText-Bf8FSQkX.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-Bl5OcEqH.js → CodexSetupSection.logic-SHExnMKR.js} +2 -2
- package/dist/client/assets/{ComboboxClear-CBRGIQSm.js → ComboboxClear-B0HJXjbz.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-DVAwRoGV.js → ComboboxGroupLabel-CMc5xUrd.js} +2 -2
- package/dist/client/assets/{CommandBlock-D6NTupaO.js → CommandBlock-CluJmhVo.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-BqLNVkse.js → ComposerPromptEditor-DR1WsmjD.js} +4 -4
- package/dist/client/assets/{CompositeRoot-DBS-Yo_S.js → CompositeRoot-BMHKb-nN.js} +2 -2
- package/dist/client/assets/{ConnectAgentSurface-TBgGDnVI.js → ConnectAgentSurface-CNWdh9ck.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-CR_qWdCU.js → ConnectionStatusDot-CpmZ8NE5.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-DkTzG_pM.js → DRLTVNUE-Dttc5MrD.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-BBRUtn6A.js → DYY6UVD2-DTrZAR1D.js} +2 -2
- package/dist/client/assets/{DevicePanel-BS7y97f_.js → DevicePanel-CRFuAv_j.js} +2 -2
- package/dist/client/assets/{DeviceSetup-TIKLCkls.js → DeviceSetup-DRzepax4.js} +2 -2
- package/dist/client/assets/{DialogTitle-DzoEjZ6h.js → DialogTitle-pLX9Mw1n.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-y1CrEDvy.js → DiffCommentAnnotation-6V9nI3Cm.js} +2 -2
- package/dist/client/assets/{DiffFileTree-BM7RDTEn.js → DiffFileTree-CBEjDul5.js} +2 -2
- package/dist/client/assets/{DiffPanel-CAK_DAYa.js → DiffPanel-CM5Rvb_z.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-D2t5zRbN.js → DiffWorkerPoolProvider-f4-YQsHo.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-_id3IQO6.js → EmbeddedDesign-DSEjf0KK.js} +2 -2
- package/dist/client/assets/{EnvironmentMachineIcon-oObSi9GI.js → EnvironmentMachineIcon-B6wAZat7.js} +2 -2
- package/dist/client/assets/{ExpandableText-BLwIQ2BJ.js → ExpandableText-Cjat32hh.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-B469NSHv.js → FNOVOB4O-LisHSqAM.js} +2 -2
- package/dist/client/assets/{FieldControl-Btl-j-6W.js → FieldControl-DwBVFJAI.js} +2 -2
- package/dist/client/assets/{FileDiff-CGLKzg3V.js → FileDiff-Bj9kBLN2.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-DJ-LkCJ7.js → FilePreviewPanel-z6NirC2y.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-DPTJODig.js → FoldedSettingsSection-DIlgxayr.js} +2 -2
- package/dist/client/assets/{FormContext-Be16jmaZ.js → FormContext-DcnLkh-4.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-BUMQl9WF.js → HDGCDEEZ-Bn1jLSys.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-C08sJAK2.js → HSJLKHB7-CHpiqxlA.js} +2 -2
- package/dist/client/assets/{Icons-2l7Ym4KO.js → Icons-Be1TL1sN.js} +2 -2
- package/dist/client/assets/Input-BZ1XdBC0.js +2 -0
- package/dist/client/assets/JZOYTAAL-BZEjBuKj.js +1 -0
- package/dist/client/assets/{K3MD6TGW-D4RWgVJJ.js → K3MD6TGW-D5oCFPkP.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-B8UDebPA.js → K7RP3OMA-ZIPW--CU.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-CCfOv-KZ.js → KeybindingsSettings.logic-Ctmq4InP.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-DwRY1EjH.js → LHDIQX7Q-BkDTNH4X.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-BTGUp3oJ.js → LUXOKEGN-BMFFLlMk.js} +2 -2
- package/dist/client/assets/{LinkMachineSelect-DoHeQGoj.js → LinkMachineSelect-DGm4EDKi.js} +2 -2
- package/dist/client/assets/{MathTypeset-DZCUnfpK.js → MathTypeset-DpXMOBGY.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-C-bkdj1S.js → N3JZAHOW-CV9TIlCo.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-COfmKsf1.js → NUIALGQ3-WBqakHka.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-CbIPjHEJ.js → NoProjectsHero-BfU7AxbB.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-BPK2EL3_.js → O65XPQGZ-CYhr2tYZ.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-qzVUZXbW.js → O7XIQ6OM-D2JMbFqc.js} +2 -2
- package/dist/client/assets/{OFQON5FD-DJVnaZou.js → OFQON5FD-B1aTfx9o.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-DwBbHN5Q.js → P4ConnectAccountPages-J205rNHS.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-D7VczA30.js → P4ConnectSidebarSignIn-Bc4xlsJh.js} +2 -2
- package/dist/client/assets/{PJQHF43J-CTXALHLE.js → PJQHF43J-Dm3RMjWi.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-D8g6TJ8z.js → PanelLayoutControls-BQZYES2T.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-CUoKY0yE.js → PierreEntryIcon-CHy821MU.js} +2 -2
- package/dist/client/assets/{PopoverHandle-tRSwNzqr.js → PopoverHandle-BkzqaTB6.js} +2 -2
- package/dist/client/assets/{PreviewPanel-cYx50TF6.js → PreviewPanel-D8V2zDl4.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-G0FTRG0c.js → ProjectDefaultsSettings-6UkudkKP.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-in-OyDkg.js → ProjectFavicon-LcyFYpHB.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-JCPOaZup.js → ProjectIconPickerDialog-D03-Jrsi.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-DdbScW3Y.js → ProjectMonogram-C8FlNLaU.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-CCw2XmNz.js → ProviderAuthTerminal-DMTbKboR.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-DWqfDVY9.js → ProviderModelPicker-CpWE-Lfx.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-_viBEB9w.js → ProviderSettingsForm-DrCFln8c.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-D3ntjIAg.js → PullRequestCodeTab-CjBrGNWY.js} +2 -2
- package/dist/client/assets/{RHNBAITX-BR5h8H8U.js → RHNBAITX-C7mnxleL.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-Bx9Jebzp.js → ReadOnlySourcePreview-BasbTHVd.js} +2 -2
- package/dist/client/assets/{RedactedSensitiveText-DM7Kme26.js → RedactedSensitiveText-DACYfm7e.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-BeYcnW7D.js → RenderErrorBoundary-CIVNp8r9.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-DfUtjUb_.js → SLD4V6NK-BkeVs7gb.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-BcF7IiOl.js → ScheduledTasksSettings-DpYigye5.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-CD9C3Bhs.js → ScopedSwitch-D1uscoF8.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-D5JbJL5g.js → ScrollAreaCorner-DBtks1xb.js} +2 -2
- package/dist/client/assets/{SecretInput-ttyiYbVY.js → SecretInput-ZW3hnCoN.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-BV1xykNQ.js → SelectScrollUpArrow-Bq-GYRhT.js} +2 -2
- package/dist/client/assets/{SelfImproveSettingsSection-Dm8NhqV7.js → SelfImproveSettingsSection-CDIhJO4P.js} +2 -2
- package/dist/client/assets/{SettingsPanels-BsyJETg8.js → SettingsPanels-Co5mks6X.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-DS-Semyc.js → SettingsPanels.logic-H5v8FTnu.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice--a-aNSRR.js → SettingsScopeNotice-gFtgpybO.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-ntSLLOvm.js → SidebarStageBackdrop-DSuAw8Ob.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-C5JeZecU.js → T3PCR2KE-D6MHoseG.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-B11aaxW8.js → TKWO2OVW-gZK7dLQZ.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-2800Jt5F.js → TSHNXIZL-BKUmF3Cu.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-CTXEQSgi.js → ThemeEditorPanel-lI_9CbBH.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-DIUp50A3.js → ThreadTerminalDrawer-CD3plt2C.js} +2 -2
- package/dist/client/assets/{TooltipViewport-rDmof6w5.js → TooltipViewport-Be_gbUW1.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-BG1U9EIM.js → UQJE5E4I-D6av033t.js} +2 -2
- package/dist/client/assets/{USNYFO5S-d4iGw5HU.js → USNYFO5S-Cy6sDMEU.js} +2 -2
- package/dist/client/assets/{Virtualizer-CzClYBap.js → Virtualizer-B_IsUzcr.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-V2MwjUCO.js → WEVWDWVA-Cq1fZcng.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-Dpau2BKr.js → WorkspaceBreadcrumb-DbQW7iNE.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-C3u06BW-.js → WorkspacePageContainer-BxI-x0oV.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-MBEFb20_.js → WorkspacePageHeader-Bc_F6Uog.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-D_mIa6o9.js → X5RFHQXM-DdtKPA-W.js} +2 -2
- package/dist/client/assets/{X62E3GBT-Cwvyi_iR.js → X62E3GBT-C7OjB5pB.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-sfA1U_fe.js → XBNEOJTC-_Tbl2Kwh.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-CZoP6AAo.js → YHV2MVVZ-CA4YS5f4.js} +2 -2
- package/dist/client/assets/{YURCZMG2-DYo6rqon.js → YURCZMG2-DSnhUUsH.js} +2 -2
- package/dist/client/assets/{YVG2LODB-D8sTsTwc.js → YVG2LODB-D-qFsH5t.js} +2 -2
- package/dist/client/assets/_chat-Cnc6rxt6.js +47 -0
- package/dist/client/assets/{_chat.design-Nh4vxHDS.js → _chat.design-SX7SShjI.js} +2 -2
- package/dist/client/assets/{_chat.index-YNITFXX3.js → _chat.index-Bz1lJLpv.js} +2 -2
- package/dist/client/assets/{_chat.new-B16PAbQN.js → _chat.new-BEqc5oJc.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-DEHC0db5.js → _chat.pull-requests-A3IwVYWs.js} +2 -2
- package/dist/client/assets/{alert-UH7IbYie.js → alert-BOVMKHDy.js} +2 -2
- package/dist/client/assets/{alert-dialog-D3mCT6Vy.js → alert-dialog-Du3fYY3I.js} +2 -2
- package/dist/client/assets/{assetUrls-BNjjSBLP.js → assetUrls-CYjvy6P4.js} +2 -2
- package/dist/client/assets/{assets-CrCgj2yM.js → assets-JgE2I_Ix.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-CW_ylkPy.js → browserHistoryStore-CdncPjG8.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-Dlnk6CC2.js → browserLinkTarget-Bf9H9UVe.js} +2 -2
- package/dist/client/assets/{checkbox-Bqcsvpsf.js → checkbox-d50pgAVe.js} +2 -2
- package/dist/client/assets/{color-picker-DAcpRn0k.js → color-picker-zcQshxaE.js} +2 -2
- package/dist/client/assets/{combobox-CoLp0McG.js → combobox-BrCd1kH5.js} +2 -2
- package/dist/client/assets/{command-cKnhWwdw.js → command-DFkhX6wm.js} +2 -2
- package/dist/client/assets/{connect-rbXRyqde.js → connect-DkH09d_M.js} +2 -2
- package/dist/client/assets/connect-agent-DJHm1Ubj.js +2 -0
- package/dist/client/assets/{design-BJbd-4a9.js → design-DrpehYJf.js} +2 -2
- package/dist/client/assets/{device-BqGYZxfg.js → device-Nh7DArH7.js} +2 -2
- package/dist/client/assets/{dialog-CjB1WWbE.js → dialog-BpR3dRVS.js} +2 -2
- package/dist/client/assets/{diffRendering-JsGpyVJ1.js → diffRendering-BuOJdnZ8.js} +2 -2
- package/dist/client/assets/{dist-D4GndTOF.js → dist-CMJL98Oz.js} +3 -3
- package/dist/client/assets/{draft-input-1ySc55QI.js → draft-input-CzfhM72Z.js} +2 -2
- package/dist/client/assets/{duoViewer-DvlUJy5A.js → duoViewer-ChrCWcjO.js} +2 -2
- package/dist/client/assets/{dynamic-B8PD-aHj.js → dynamic-CVt07u2H.js} +2 -2
- package/dist/client/assets/{embeddedScripts-ByokzHX1.js → embeddedScripts-BWqMWwOU.js} +2 -2
- package/dist/client/assets/{empty-CMnFXg8W.js → empty-Cy-8us9l.js} +2 -2
- package/dist/client/assets/{entities-CTJ1ube2.js → entities-aKdRyfsJ.js} +2 -2
- package/dist/client/assets/{fileLinks-lUzqPrjb.js → fileLinks-BgHa8yE4.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-B6sjoSXU.js → fileTreeExpansion-CBn1SzSX.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-Bt5vSiss.js → getDiffFileInput-IQ1TDM4E.js} +2 -2
- package/dist/client/assets/{guideRunStore-DFawhaj_.js → guideRunStore-DfNfJUIu.js} +2 -2
- package/dist/client/assets/{htmlRender-DJLbbd4O.js → htmlRender-lwQ3HyqS.js} +2 -2
- package/dist/client/assets/{index-CxLeDuff.js → index-BXvrSYK3.js} +3 -3
- package/dist/client/assets/{input-CSgYZgdv.js → input-FUjAUGXY.js} +2 -2
- package/dist/client/assets/{input-group-a-sGQMiV.js → input-group-BdZ_CKvG.js} +2 -2
- package/dist/client/assets/{kbd-D3uRVBMx.js → kbd-CGgmav-Q.js} +2 -2
- package/dist/client/assets/{keybindings-B9X0TLvu.js → keybindings-DuCyi9aT.js} +2 -2
- package/dist/client/assets/{lazy-C_hQh3dP.js → lazy-Bs2SFpYS.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-GMfIUG8o.js → lazyRouteComponent-CYNRqeNP.js} +2 -2
- package/dist/client/assets/{link-BmkuqfGQ.js → link-DW1IQk5s.js} +2 -2
- package/dist/client/assets/{linkedPrompt-BNxBPorU.js → linkedPrompt-yo2xi4Z8.js} +2 -2
- package/dist/client/assets/{main-DIEsHSIy.js → main-C0z861OK.js} +7 -7
- package/dist/client/assets/{mediaReference-CVS-Yvam.js → mediaReference-BQ9J-tjl.js} +2 -2
- package/dist/client/assets/{mediaSource-DQsJoeCH.js → mediaSource-BLpxwEw3.js} +2 -2
- package/dist/client/assets/{number-field-Bw2BDGyn.js → number-field-Pve745k3.js} +2 -2
- package/dist/client/assets/{observeResize-Br7VOcTc.js → observeResize-CZuDzlcZ.js} +2 -2
- package/dist/client/assets/{onboarding-D6kvYnD1.js → onboarding-CE8pzS12.js} +2 -2
- package/dist/client/assets/{openFileInPreview-52PEk4wb.js → openFileInPreview-Dns9tPaB.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-B1qTw64E.js → p4ProjectFile-jwYvYDE-.js} +2 -2
- package/dist/client/assets/{pair-Das8G2kV.js → pair-OPslYcM9.js} +2 -2
- package/dist/client/assets/{pendingSendStore-B1MXHU-Y.js → pendingSendStore-CLwMM17y.js} +2 -2
- package/dist/client/assets/{phoneViewer-iWL9Ocv_.js → phoneViewer-CkTxyA9N.js} +2 -2
- package/dist/client/assets/{pierre-icons-CyZxWykW.js → pierre-icons-DY8ZeGCr.js} +2 -2
- package/dist/client/assets/{popover-Cpc0L75h.js → popover-hYAmvSJj.js} +2 -2
- package/dist/client/assets/{preview-DRZGCh-w.js → preview-CI9HEdfV.js} +2 -2
- package/dist/client/assets/{preview-CDQ5ceMi.js → preview-YhZE3kRt.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-Dd2KfilQ.js → previewMiniPlayerStore-DUPe1gGI.js} +2 -2
- package/dist/client/assets/{primary-YDhFfOF8.js → primary-BlS2rEKe.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-kvnCGEBC.js → primaryCloudLinkState-CyPf4N0F.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-DvEcN38K.js → projectFilesQueryState-BdWJ4WwI.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-lOSI5meb.js → projectScriptEditor-C0FBhCbn.js} +2 -2
- package/dist/client/assets/{providerSkills-CRmME5qO.js → providerSkills-Ca_7EbAx.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-CXEtJJcn.js → pullRequestDetail.logic-DYx7bEwE.js} +2 -2
- package/dist/client/assets/{pullRequestIcons-D8Koo716.js → pullRequestIcons-csprKuju.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-CpLjLBJR.js → pullRequestReviewStore-_uEYgfaW.js} +2 -2
- package/dist/client/assets/{pullRequests-DKqH-UAm.js → pullRequests-B85p5Xnw.js} +2 -2
- package/dist/client/assets/{queries-eqpX-CHf.js → queries-B0FvRKmk.js} +2 -2
- package/dist/client/assets/{query-D5Kb9u_z.js → query-B2_Td0ad.js} +2 -2
- package/dist/client/assets/{radio-group-DpxVKrML.js → radio-group-IyWHDcIP.js} +2 -2
- package/dist/client/assets/{renderScheduler-B1rJHKDM.js → renderScheduler-DR2WAtIH.js} +2 -2
- package/dist/client/assets/{rightPanelStore-DQ1c3-Lt.js → rightPanelStore-rZSIb-5z.js} +2 -2
- package/dist/client/assets/{runtime-DCbEdU32.js → runtime-BK2Lh1vB.js} +3 -3
- package/dist/client/assets/{runtime-DeVKKxNz.js → runtime-BVmDVuJ-.js} +3 -3
- package/dist/client/assets/{runtimeModeConfig-CZCsG9b4.js → runtimeModeConfig-DFxXOIlV.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-gN3n5v-e.js → scheduledTasksSettings.logic-W9AQpJk4.js} +2 -2
- package/dist/client/assets/{scroll-area-C9Jh_pl0.js → scroll-area-Cf7uLi_s.js} +2 -2
- package/dist/client/assets/{select-oshTwPZM.js → select-vBkqTMKL.js} +2 -2
- package/dist/client/assets/selfImproveFindings-4GGN9cRm.js +2 -0
- package/dist/client/assets/{server-Ct4-BCZx.js → server-DwkxciXh.js} +2 -2
- package/dist/client/assets/{session-Bb7JWdWO.js → session-BIwsf8Q4.js} +2 -2
- package/dist/client/assets/{session-logic-D0Wb0fc2.js → session-logic-D8FbVFDm.js} +2 -2
- package/dist/client/assets/{settings-CQtFOh_t.js → settings-C58Y7hMl.js} +2 -2
- package/dist/client/assets/{settings.appearance-CqHPJVJ2.js → settings.appearance-C9ZmuG-n.js} +2 -2
- package/dist/client/assets/settings.archived-BxqS4kuW.js +2 -0
- package/dist/client/assets/{settings.computer-use-CDrWkvkD.js → settings.computer-use-CeIs-8zf.js} +2 -2
- package/dist/client/assets/{settings.connections-CHXX5kH0.js → settings.connections-CEr4PdrJ.js} +2 -2
- package/dist/client/assets/{settings.data-controls-Bd79f82M.js → settings.data-controls-BbzJxjBi.js} +2 -2
- package/dist/client/assets/{settings.decisions-B-i781li.js → settings.decisions-DagsCV4K.js} +2 -2
- package/dist/client/assets/{settings.designs-DpX9xXFH.js → settings.designs-DEThhuEj.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-Du6_cMwQ.js → settings.diagnostics-DdsecwWn.js} +2 -2
- package/dist/client/assets/{settings.general-6bgZAoM7.js → settings.general-RgU1jNmB.js} +2 -2
- package/dist/client/assets/{settings.integrations-Ct8ruO3E.js → settings.integrations-CO-aLXSC.js} +2 -2
- package/dist/client/assets/{settings.keybindings-DzB2I9OY.js → settings.keybindings-CU8fBQaI.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-C-RX63iR.js → settings.open-source-licenses-rG8Neftl.js} +2 -2
- package/dist/client/assets/{settings.plugins-CqpVlMrk.js → settings.plugins-Dr0VpcPy.js} +2 -2
- package/dist/client/assets/{settings.projects-DosfFxrs.js → settings.projects-hxwk8_7r.js} +3 -3
- package/dist/client/assets/{settings.providers-DKgzTRpw.js → settings.providers-D5-Kj1jY.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-Ca4XxyAg.js → settings.scheduled-tasks-DwUd14Xj.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-BkSOnsJ3.js → settings.snap-shot-CTMJRtJe.js} +2 -2
- package/dist/client/assets/{settings.source-control-uZ0ges0j.js → settings.source-control-BHD5KE8W.js} +2 -2
- package/dist/client/assets/{settings.storage-BkURtSS0.js → settings.storage-Bhd9ragP.js} +2 -2
- package/dist/client/assets/{settingsLayout-krWuVpsF.js → settingsLayout-WhjsCfB6.js} +2 -2
- package/dist/client/assets/{sidebar-PSpwc3Zu.js → sidebar-O52WtiJv.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-D02jVAL6.js → sidebarProjectGrouping-BYVdJp_w.js} +2 -2
- package/dist/client/assets/{skeleton-DIPW_H7N.js → skeleton-PlPtYr_f.js} +2 -2
- package/dist/client/assets/{sourceControl-B9aMMjp2.js → sourceControl-BkJeQRrv.js} +2 -2
- package/dist/client/assets/{sourceControlClients-XtdH6kjx.js → sourceControlClients-CtMx7u86.js} +2 -2
- package/dist/client/assets/{spinner-BeAnBYcY.js → spinner-BZ5ohCyO.js} +2 -2
- package/dist/client/assets/{terminal-links-CYEBYRi6.js → terminal-links-UI2UJn0y.js} +2 -2
- package/dist/client/assets/{terminalSessions-C2k3TT8f.js → terminalSessions-C1xOLG3i.js} +2 -2
- package/dist/client/assets/{textarea-DBTtAB2q.js → textarea-DIg__-Gi.js} +2 -2
- package/dist/client/assets/{themePalette-Uk7bx8zb.js → themePalette-BMlBfFUx.js} +2 -2
- package/dist/client/assets/{toast-Dkj3G-UM.js → toast-BZ96uuab.js} +2 -2
- package/dist/client/assets/{toggle-DYYe3Gb8.js → toggle-DJ8KOwn5.js} +2 -2
- package/dist/client/assets/{toggle-group-hQw0fxkT.js → toggle-group-2e3XGJdx.js} +2 -2
- package/dist/client/assets/{tooltip-BeHmtauD.js → tooltip-BPiLl1TV.js} +2 -2
- package/dist/client/assets/{uiStateStore-Cd96D_GT.js → uiStateStore-4i21PZUL.js} +2 -2
- package/dist/client/assets/{usage-ChIGOn5O.js → usage-uuNPbJve.js} +2 -2
- package/dist/client/assets/{usageAccess-DTKEwCKL.js → usageAccess-CsMv6eC9.js} +2 -2
- package/dist/client/assets/{usageFormat-D1mf8I5d.js → usageFormat-DhefL58S.js} +2 -2
- package/dist/client/assets/{usageShortcuts-C0jTsdR4.js → usageShortcuts-CREc0FBr.js} +2 -2
- package/dist/client/assets/{use-atom-command-D4TeQyNE.js → use-atom-command-CdV5BZYB.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-Cod6bMX5.js → useAriaLabelledBy-CYRfRdAq.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-CJ3yJ6tD.js → useHandleNewThread-BsnMrEPr.js} +2 -2
- package/dist/client/assets/{useLocation-DNv7cb59.js → useLocation-DHd-KBb-.js} +2 -2
- package/dist/client/assets/{useNavigate-PfhtEZbl.js → useNavigate-AZUCIeU4.js} +2 -2
- package/dist/client/assets/{useNavigateBack-DUje4FcE.js → useNavigateBack-C7DkQuEE.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-evKe5nuS.js → useP4ConnectAuthPrompt-u1GHgwlc.js} +2 -2
- package/dist/client/assets/{useParams-CzC0HF0R.js → useParams-rbhXoEw9.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-BUDWSxLm.js → usePermissionStatus-DHzE_VGG.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-Cxt5UQ0d.js → usePullRequestActions-Cv12eqOn.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-B4MJ2axN.js → useRegisterFieldControl-D4FG4i3_.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-ujoqpGuE.js → useScopedModelAvailability-D6cbxQLl.js} +2 -2
- package/dist/client/assets/{useSettings-Cg0O7Ek7.js → useSettings-B09a3zie.js} +2 -2
- package/dist/client/assets/utils-C5GGWTfe.js +37 -0
- package/dist/client/assets/{vcsRefInvalidation-B5V_HlR9.js → vcsRefInvalidation-B66hRx4g.js} +2 -2
- package/dist/client/assets/{welcome-DqtsIjdN.js → welcome-D2-tjFV3.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-CmxAcIV2.mjs → renderer-CuqsXHrO.mjs} +2 -2
- package/dist/{runtime-CAtWuL14.mjs → runtime-CWPUW_8Y.mjs} +24 -7
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-C6RQ4Ag-.js +0 -2
- package/dist/client/assets/Input--rtZ2Jji.js +0 -2
- package/dist/client/assets/JZOYTAAL-PmkwTnld.js +0 -1
- package/dist/client/assets/_chat-DNoJniWX.js +0 -47
- package/dist/client/assets/connect-agent-CsvW078q.js +0 -2
- package/dist/client/assets/selfImproveFindings-DUmfxmCO.js +0 -2
- package/dist/client/assets/settings.archived-DDtPGPcJ.js +0 -2
- package/dist/client/assets/utils-CcBaVOX5.js +0 -37
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{D as i,Fs as a,Is as o,Nf as s,Ns as c,Qn as l,Qo as u,Rd as d,Wf as f,Xn as p,av as m,dT as h,dr as g,eb as _,er as v,ev as y,fr as b,hn as x,ir as S,j as C,nr as w,or as T,pd as E,rr as ee,sh as D,t as O}from"./utils-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{D as i,Fs as a,Is as o,Nf as s,Ns as c,Qn as l,Qo as u,Rd as d,Wf as f,Xn as p,av as m,dT as h,dr as g,eb as _,er as v,ev as y,fr as b,hn as x,ir as S,j as C,nr as w,or as T,pd as E,rr as ee,sh as D,t as O}from"./utils-C5GGWTfe.js";import{L as te,R as ne,W as re}from"./runtime-BVmDVuJ-.js";import{s as ie}from"./vcsRefInvalidation-B66hRx4g.js";import{W as ae}from"./entities-aKdRyfsJ.js";import{Mn as k,On as A,d as oe,f as se,u as ce,zn as j}from"./runtime-BK2Lh1vB.js";import{U as le,b as ue,g as de,h as fe,l as pe,w as me}from"./TooltipViewport-Be_gbUW1.js";import{J as M,Y as N,n as he,tt as ge}from"./ChatMarkdown-CFUfXlYp.js";import{t as _e}from"./spinner-BZ5ohCyO.js";import{i as ve,m as ye}from"./toast-BZ96uuab.js";import{J as be,K as xe,O as Se,S as Ce,s as we}from"./useSettings-B09a3zie.js";import{i as Te,n as P}from"./session-BIwsf8Q4.js";import{t as Ee}from"./use-atom-command-CdV5BZYB.js";import{a as De}from"./fileLinks-BgHa8yE4.js";import{u as Oe}from"./providerSkills-Ca_7EbAx.js";import{t as ke}from"./toastHelpers-DxXYm50b.js";import{o as F}from"./queries-B0FvRKmk.js";import{H as I,V as Ae,l as je,ot as Me,st as Ne}from"./diffRendering-BuOJdnZ8.js";import{A as Pe,B as L,G as Fe,K as Ie,T as Le,a as R,j as Re,l as ze,t as Be}from"./Virtualizer-B_IsUzcr.js";import{B as z,G as Ve,H as He,J as B,K as Ue,Q as We,U as Ge,V as Ke,W as qe,q as Je}from"./getDiffFileInput-IQ1TDM4E.js";import{c as Ye,i as Xe,n as Ze,o as Qe,s as $e,t as et}from"./DiffWorkerPoolProvider-f4-YQsHo.js";import{n as tt}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{S as nt,_ as rt,b as it,c as V,d as at,f as H,g as ot,h as U,i as st,l as ct,m as W,o as lt,p as ut,r as dt,s as G,t as ft,u as pt,v as mt,x as K,y as ht}from"./DiffCommentAnnotation-6V9nI3Cm.js";import{t as gt}from"./mediaReference-BQ9J-tjl.js";import{a as _t,n as vt,t as yt}from"./tooltip-BPiLl1TV.js";import{i as bt,n as xt,r as St,t as Ct}from"./fileCommentAnnotations-BgdL_7u9.js";import{r as wt,t as Tt}from"./ReadOnlySourcePreview-BasbTHVd.js";import{a as Et,c as Dt,i as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./fileTreeExpansion-CBn1SzSX.js";import{t as Pt}from"./pierre-icons-DY8ZeGCr.js";import{t as Ft}from"./scroll-area-Cf7uLi_s.js";import{C as It,D as Lt,E as Rt,M as zt,N as Bt,S as Vt,T as Ht,b as Ut,j as Wt,k as Gt,v as Kt,w as qt,x as Jt}from"./ComposerPromptEditor-DR1WsmjD.js";import{t as Yt}from"./assets-JgE2I_Ix.js";import{i as Xt,n as Zt,t as Qt}from"./assetUrls-CYjvy6P4.js";import{w as $t}from"./browserHistoryStore-CdncPjG8.js";import{i as en,r as tn}from"./openFileInPreview-Dns9tPaB.js";import{t as nn}from"./preview-CI9HEdfV.js";import{t as rn}from"./PierreEntryIcon-CHy821MU.js";import{n as an}from"./composerTrigger-BGi0iyhl.js";import{r as on,t as sn}from"./input-group-BdZ_CKvG.js";import{f as cn,i as ln,l as un,n as dn,o as fn,t as pn,u as mn}from"./projectFilesQueryState-BdWJ4WwI.js";import{Eo as hn,_o as gn,xo as _n}from"./main-C0z861OK.js";import{E as vn,f as yn,m as bn,p as xn}from"./_chat-Cnc6rxt6.js";var Sn={compositeOverBg:z,contrastRatio:Ke,deriveMutedFg:He,hoverWouldEraseText:Ge,isDarkSurface:qe,isFullyTransparent:Ve,pickReadableForeground:Ue,relativeLuminance:Je,surfacesMatch:B},q=e(t(),1);function Cn(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&Et(e.matchingPaths,t.matchingPaths)}function wn(e){let t=At(e,e=>({isOpen:e.isSearchOpen(),matchingPaths:e.getSearchMatchingPaths(),value:e.getSearchValue()}),Cn);return(0,q.useMemo)(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:t=>{e.openSearch(t)},setValue:t=>{e.setSearch(t)}}),[e,t])}var Tn=100,En=`insert`,Dn=`backspace`,On=`delete`,kn=class e{#e=[];#t=[];#n;#r=!1;constructor(e){this.#n=Math.max(1,e?.maxEntries??Tn)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}getState(){return{undoStack:this.#e.map(jn),redoStack:this.#t.map(jn),maxEntries:this.#n,canCoalesce:this.#r}}getLiveState(){return Object.defineProperties({},{undoStack:{enumerable:!0,get:()=>this.#e},redoStack:{enumerable:!0,get:()=>this.#t},maxEntries:{enumerable:!0,get:()=>this.#n},canCoalesce:{enumerable:!0,get:()=>this.#r}})}static fromState(t){let n=new e({maxEntries:t.maxEntries});return n.#e=t.undoStack,n.#t=t.redoStack,n.#r=t.canCoalesce,n}clear(){this.#e.length=0,this.#t.length=0,this.#r=!1}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#r=!0,this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#r?this.peekUndo():void 0}replaceLastUndo(e){this.#e.length===0?this.push(e):(this.#e[this.#e.length-1]=e,this.clearRedo(),this.#r=!0)}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),this.#r=!1,e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),this.#r=!1,e}};function An(e){return{...e,forwardEdits:e.forwardEdits.map(e=>({...e})),inverseEdits:e.inverseEdits.map(e=>({...e})),selectionsBefore:e.selectionsBefore?.map(Mn),selectionsAfter:e.selectionsAfter?.map(Mn),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:e.lineAnnotationsAfter?.slice()}}function jn(e){return{...An(e),lineAnnotationsBefore:e.lineAnnotationsBefore?.map(e=>({...e})),lineAnnotationsAfter:e.lineAnnotationsAfter?.map(e=>({...e}))}}function Mn(e){return{...e,start:{...e.start},end:{...e.end}}}function Nn(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[],u;if(i?.length===c.length){let t=[];for(let n of i){if(n.start.line!==n.end.line||n.start.character!==n.end.character)break;t.push(e.offsetAt(n.start))}if(t.length===c.length){t.sort((e,t)=>e-t);let e=!0,n=!0;for(let r=0;r<c.length;r++){let i=c[r];if(i.text.length>0||i.start===i.end){e=!1,n=!1;break}e&&=t[r]===i.end,n&&=t[r]===i.start}u=e?Dn:n?On:void 0}}for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice(),coalescingMode:u}}function Pn(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=Ln(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
|
|
2
2
|
`)&&!a.text.includes(`
|
|
3
3
|
`),u=o.start===o.end&&o.text.length>0&&!o.text.includes(`
|
|
4
4
|
`)&&s.text.length===0;if(l&&u){if(o.start!==a.end||(n??=En,n!==En||e.coalescingMode!==void 0&&e.coalescingMode!==En||t.coalescingMode!==void 0&&t.coalescingMode!==En))return!1;continue}let d=i.text.length===0&&i.end>i.start&&a.text.length>0,f=o.text.length===0&&o.end>o.start&&s.text.length>0;if(d&&f){let r;if(c===i.end)r=On;else if(c+(o.end-o.start)!==i.start)return!1;else r=Dn;if(n??=r,n!==r||e.coalescingMode!==void 0&&e.coalescingMode!==r||t.coalescingMode!==void 0&&t.coalescingMode!==r)return!1}else return!1}return n!==void 0}function Fn(e,t){let n=[],r=[],i;for(let a=0;a<e.forwardEdits.length;a++){let o=e.forwardEdits[a],s=e.inverseEdits[a],c=t.forwardEdits[a],l=t.inverseEdits[a],u=Ln(c.start,e.forwardEdits);o.text.length>0?(i??=En,n.push({start:o.start,end:o.end,text:o.text+c.text}),r.push(s.text)):u===o.end?(i??=On,n.push({start:o.start,end:u+(c.end-c.start),text:``}),r.push(s.text+l.text)):(i??=Dn,n.push({start:Math.min(o.start,u),end:o.end,text:``}),r.push(l.text+s.text))}return{forwardEdits:n,inverseEdits:In(n,r),versionBefore:e.versionBefore,versionAfter:t.versionAfter,selectionsBefore:e.selectionsBefore?.slice(),selectionsAfter:t.selectionsAfter?.slice(),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice(),coalescingMode:i}}function In(e,t){let n=[];for(let r=0,i=0;r<e.length;r++){let a=e[r],o=a.start+i;n.push({start:o,end:o+a.text.length,text:t[r]}),i+=a.text.length-(a.end-a.start)}return n}function Ln(e,t){let n=e;for(let e of t){let t=e.end-e.start,r=e.text.length,i=r-t;n<e.start||(n>=e.start+r?n-=i:n=e.start+Math.min(n-e.start,t))}return n}var Rn=new WeakMap;function zn(e){return Rn.get(e)}function Bn(e,t){Rn.set(e,t)}var Vn=class e{#e;#t;#n;#r;#i;#a;constructor(e,t,n=`text`,r=0,i=new kn,a){if(this.#e=new URL(e,`file://`).toString(),this.#t=n,this.#n=r,this.#r=new mt(t),this.#i=i,a!=null)this.#a=a;else{let e=this.#r.getLineText(0,!0);this.#a=e.endsWith(`\r
|
|
@@ -31,4 +31,4 @@ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJe
|
|
|
31
31
|
`)&&(i=n,a=[t.offsetAt(e.start),t.offsetAt(e.end)])}}let o=([e,n],r)=>{let i=Lr(t,e,n);this.#Wt([i]),this.#Pe(Y(i).line),this.#gt(!0),this.#pe=r},s=new st({textDocument:t,containerElement:n,defaultQuery:i,mode:e,initialMatch:a,scrollToMatch:o,applyReplace:e=>{if(e.length===0)return;let n=t.applyEdits(e.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),!0,this.#se);n!==void 0&&this.#dn(n,void 0,this.#pn(n),{skipSearchRefresh:!0})},onUpdate:(e,n)=>{if(e.length===0){this.#ce=void 0,this.#Wt(this.#se??[]);return}if(this.#ce=e,n?.syncSelection===!1){this.#Wt(this.#se??[]);let n=this.#se?.at(-1);if(n!==void 0){let r=t.offsetAt(n.start),i=t.offsetAt(n.end);for(let t of e)if(t[0]===r&&t[1]===i)return t}return}let r=this.#se?.at(-1),i=0,a;r!==void 0&&(i=t.offsetAt(r.start));for(let t of e)if(t[0]>=i){a=t;break}return a===void 0?this.#Wt(this.#se??[]):o(a,!0),a},onClose:()=>{this.#G=void 0,this.#pe=!1,this.#ce=void 0,this.#Wt(this.#se??[])}});this.#G=s,this.#pe=!1}#en(){let e=this.#n?.document,t=this.#se;return e===void 0||t===void 0?``:Qr(e,t)}#tn(){let e=this.#n?.document,t=this.#se;return e===void 0||t===void 0?[]:Zr(e,t)}#nn(e,t,n){e!==null&&(e.setData(`text`,t),n.length>1&&e.setData(eo,JSON.stringify(n)))}#rn(){let e=this.#n?.document,t=this.#se;if(e===void 0||t===void 0||t.length===0)return``;if(t.some(e=>J(e))){let n=ri(e,t);return this.#in(n.edits,n.nextSelectionOffsets),n.text}let n=Qr(e,t);return this.#an(``,void 0,!0),n}#in(e,t){let n=this.#n?.document,r=this.#se;if(n===void 0||r===void 0||e.length===0)return;let i=n.applyResolvedEdits(e,!0,r,void 0,!0);if(i===void 0)return;let a=t.map(e=>{let t=n.positionAt(e);return{start:t,end:t,direction:0}});n.setLastUndoSelectionsAfter(a),this.#dn(i,a,this.#pn(i))}#an(e,t=this.#se,n=!1,r=`selection`){if(t===void 0)return;let i=this.#n?.document,a=t.at(-1);if(i===void 0||a===void 0)return;let{nextSelections:o,change:s}=Array.isArray(e)&&e.length===t.length?Er(i,t,e,this.#R,n,r):Cr(i,t,{start:i.offsetAt(a.start),end:i.offsetAt(a.end),text:Array.isArray(e)?e.join(i.eol):e},this.#R,void 0,n);s!==void 0&&this.#dn(s,o,this.#pn(s))}#on(e=!1){let t=this.#se,n=this.#n?.document;if(t===void 0||n===void 0)return;let{nextSelections:r,change:i}=Pr(n,t,e,this.#R,this.#r.tabSize);i!==void 0&&this.#dn(i,r,this.#pn(i))}#sn(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=jr(t,e,this.#Le?(e,t)=>{let n=this.#Sn(e);for(let e=0;e+1<n.length;e++){let r=n[e],i=n[e+1];if(t>=r&&t<=i)return r}return 0}:void 0,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#cn(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Mr(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#ln(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Ar(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#un(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=kr(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#dn(e,t,n,r){this.#xe!=null&&this.#Rt(!0);let i=this.#n?.document;if(i!==void 0&&this.#W!==void 0)for(let t of this.#W)t.anchorOffset=Rr(t.anchorOffset,e.changes),t.focusOffset=Rr(t.focusOffset,e.changes),t.caret.anchor=i.positionAt(t.anchorOffset),t.caret.focus=i.positionAt(t.focusOffset);if(e.lineDelta!==0||this.#Le)for(let t of this.#m.keys())t>=e.startLine&&this.#m.delete(t);if(this.#h.size>0){if(e.lineDelta===0&&(e.changedLineRanges.length===1||e.changedLineChanges?.every(([,,e])=>e===0)===!0))for(let[t,n]of e.changedLineRanges)for(let e=t;e<=n;e++)this.#h.delete(e);else for(let t of this.#h.keys())t>=e.startLine&&this.#h.delete(t)}this.#_=void 0;let a=this.#V,o;if(a!==void 0&&t!==void 0&&t.length>0){let n=t.at(-1),r=a.startingLine+a.totalLines;if(n.end.line>=r){let t=n.end.line-a.startingLine+1,i=this.#H===void 0||this.#H===1/0?1/0:this.#H*qa;e.startLine<=r&&t<=i&&this.#Me(n.end.line)?(n.end.line>r&&(o=!0),a={...a,totalLines:t},this.#V=a):o=!0}}if(this.#I&&this.#i!=null&&this.#w!=null?this.#ct(e,n,a,o):i!=null&&(this.#P?.(i,n),n!=null&&(this.#R=n)),t!=null&&this.#Wt(t),this.#M?.__acknowledgeDocumentUpdate(),this.#De(),this.#Vt(e,r?.editSource??`user`),this.#Bt(),this.#fn(e.changes,n??this.#R),r?.skipSearchRefresh!==!0&&this.#G!==void 0&&this.#ce!==void 0&&this.#G.updateMatches({syncSelection:!1}),t!=null&&r?.skipFocus!==!0){let e=t.at(-1);if(e!==void 0&&this.#Pe(Y(e).line),this.#A!==void 0)requestAnimationFrame(()=>{this.#A?.scrollIntoView({block:`nearest`,inline:`nearest`})});else if(t.length>0){let e=Y(t.at(-1));this.#vt(e.line,e.character)}this.focus({preventScroll:!0})}}#fn(e,t){let n=this.getFile(),r=this.#F;n!=null&&r!=null&&r(e,n,t)}#pn(e){if(this.#R!=null){let t=$n(e,this.#R);if(t!=null)return this.#n?.document?.setLastUndoLineAnnotations(this.#R,t),t}}#mn(){let e=this.#w;if(e===void 0)return[];let t=[];for(let n of e.children){let e=n,r=e.dataset.lineType,i=W(e);if(i===void 0||r===void 0||!Fr(r))continue;let a=i-1,o=t.at(-1);o!==void 0&&a<=o[1]+1?o[1]=Math.max(o[1],a):t.push([a,a])}return t}#hn(e){let t=this.#V;return t==null||e>=t.startingLine&&e<t.startingLine+t.totalLines}#gn(e){let t=this.#g.get(e);if(t!==void 0)return t??void 0;let n=this.#V;if(!this.#hn(e))return;let r=this.#w;if(r!==void 0){if(n!==void 0){let{startingLine:i}=n,{children:a}=r;for(let n=e-i;n<=a.length;n++){let r=a[n];if(r===void 0)break;let i=W(r),o=r.dataset.lineType;if(i!==void 0&&i===e+1&&o!==void 0&&Fr(o)){t=r;break}}}return t??=r.querySelector(`[data-line="${e+1}"]`+(this.#Fe===`unified`?`:not([data-line-type="change-deletion"])`:``)),t!==void 0&&this.#g.set(e,t),t??void 0}}#_n(){if(this.#C===void 0)return 0;if(this.#f===void 0){let e=this.#w?.parentElement?.style.getPropertyValue(`--diffs-column-number-width`);this.#f=e!==void 0&&e.length>2&&e.endsWith(`px`)?parseInt(e.slice(0,-2),10):this.#C.offsetWidth}return this.#f}#vn(){if(this.#w===void 0)return 0;if(this.#p===void 0){let e=this.#w.parentElement?.style.getPropertyValue(`--diffs-column-content-width`);this.#p=e!==void 0&&e.length>2&&e.endsWith(`px`)?parseFloat(e.slice(0,-2)):this.#w.offsetWidth}return this.#p}#yn(e){let t=this.#m.get(e);if(t!==void 0)return t;let n=this.#gn(e);if(n===void 0)return-1;let r=n.offsetTop+this.#r.paddingTop;return r+=this.#$e?.top??0,this.#m.set(e,r),r}#bn(e,t){if(this.#_!==void 0&&this.#_[0]===e&&this.#_[1]===t)return[this.#_[2],this.#_[3]];let n=this.#n?.document?.getLineText(e),r=this.#_n()+this.#r.ch;if(n===void 0||n.length===0||t<=0)return[r+(this.#$e?.left??0),0];let i=Fa(n,Math.min(t,n.length)),a=n.slice(0,i),o=La(a,this.#r.tabSize),s=0,c=0;if(s=o===-1?r+this.#r.measureTextWidth(a):r+o*this.#r.ch,this.#Le){let t=this.#vn();if(2*this.#r.ch+this.#r.measureTextWidth(n)>t){let t=this.#xn(e);if(t==null)return[s+(this.#$e?.left??0),0];for(let e=0;e+1<t.length;e++){let a=t[e];if(i<=t[e+1]){c=e;let t=n.slice(a,i),o=La(t,this.#r.tabSize);s=o===-1?r+this.#r.measureTextWidth(t):r+o*this.#r.ch;break}}}s+=this.#$e?.left??0}return this.#_===void 0?this.#_=[e,t,s,c]:(this.#_[0]=e,this.#_[1]=t,this.#_[2]=s,this.#_[3]=c),[s,c]}#xn(e){let t=this.#h.get(e);if(t!==void 0)return t;this.#h.size>=Ja&&this.#h.clear();let n=this.#n?.document?.getLineText(e);if(n===void 0||n.length===0){let t=new Uint32Array([0]);return this.#h.set(e,t),t}let r=this.#w;if(r==null||!r.isConnected)return;let i=U(`div`,{style:{position:`absolute`,top:`0`,left:`0`,width:`100%`,boxSizing:`border-box`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,font:`inherit`,paddingInline:`1ch`,tabSize:this.#r.tabSize.toString()},textContent:n},r),a=i.firstChild,o=document.createRange(),s=[];try{let t=i.getBoundingClientRect();if(t.width===0)return;let r=Ia(n),c=t.left+this.#r.ch,l=r===void 0?n.length:r.length-1,u=e=>r===void 0?e:r[e],d=e=>{o.setStart(a,u(e)),o.setEnd(a,u(e+1));let t=o.getClientRects();return t.item(t.length-1)??o.getBoundingClientRect()};s.push(0);let f=d(0).top,p=1;for(;p<l;){let e=p,t=l;for(;e<t;){let n=e+t>>1;d(n).top>f?t=n:e=n+1}if(e>=l)break;let{left:n,top:r}=d(e),i=Le()&&n-c>this.#r.ch/2;s.push(u(i?e-1:e)),f=r,p=e+1}let m=new Uint32Array(s.length+1);for(let e=0;e<s.length;e++)m[e]=s[e];return m[s.length]=n.length,this.#h.set(e,m),m}finally{i.remove()}}#Sn(e){let t=this.#xn(e);if(t!==void 0)return t;let n=this.#n?.document?.getLineText(e)?.length??0;return Uint32Array.of(0,n)}#Cn({startContainer:e,endContainer:t}){let n=this.#w;return n!==void 0&&n.contains(e)&&n.contains(t)}#wn(e){let t=this.#n?.document?.lineCount??0;return e<0||e>=t?!1:this.#gn(e)!==void 0}};function no({type:e,editStateKey:t,owner:n,initialState:r,previousSession:i}){if(r!=null&&r.type!==e)throw TypeError(`Editor: initialState: a ${r.type} state cannot initialize a ${e} editor`);let a=r;return t==null?a??i??(e===`file`?{type:`file`}:{type:`file-diff`}):Yn.activate(e,t,n,a)}function ro(e){return e instanceof HTMLElement?Number(e.dataset.bufferSize??1):1}function io(e,t){return t!==void 0&&Number.isInteger(t.line)&&Number.isInteger(t.character)&&t.line>=0&&t.line<e.lineCount&&t.character>=0&&t.character<=e.getLineLength(t.line)}function ao(e,t){let n=e.charCodeAt(t-1),r=e.charCodeAt(t);return t>0&&t<e.length&&n>=55296&&n<=56319&&r>=56320&&r<=57343}var Q=n(),oo=e=>{if(typeof e!=`object`||!e)return null;let t=e;return typeof t.getAttribute==`function`?t.getAttribute(`data-item-path`):null};function so(e){let t=[],n=[];return{isDragInProgress:()=>n.length>0,handleSelectionChange(e){t=e},handleDragStart(e){if(e.dataTransfer===null)return;let r=null;for(let t of e.composedPath())if(r=oo(t),r!==null)break;if(r===null)return;let i=t.includes(r)?t:[r],a=i.map(e=>xn(e)).filter(e=>e!==null);a.length!==0&&(n=i,e.dataTransfer.setData(yn,a.join(` `)))},handleDragEnd(){if(n.length!==0){for(let t of n)e.deselect(t);n=[]}}}}function co(e){return e.split(`/`).filter(Boolean).length}function lo(e,t){let n=new Set(e),r=new Set(t),i=[],a=[],o=e.filter(e=>!r.has(e)).toSorted((e,t)=>co(e)-co(t));for(let e of o){if(i.some(t=>e.startsWith(t)))continue;let t=e.endsWith(`/`);a.push({type:`remove`,path:e,...t?{recursive:!0}:{}}),t&&i.push(e)}let s=t.filter(e=>!n.has(e)).toSorted((e,t)=>co(e)-co(t));for(let e of s)a.push({type:`add`,path:e});return a}function uo(e,t){let[n,r]=(0,q.useState)(new Map),[i,a]=(0,q.useState)(new Map),[o,s]=(0,q.useState)(0),[c,l]=(0,q.useState)(new Set),d=(0,q.useRef)(new Map),f=(0,q.useRef)(new Set),p=(0,q.useRef)(new Set),m=(0,q.useRef)(!0),g=(0,q.useRef)(0),_=(0,q.useRef)([]),v=(0,q.useCallback)(function n(i,o=!1){let c=d.current.get(i);if(c)return o?c.then(()=>n(i,!0)):c;if(!o&&f.current.has(i))return Promise.resolve();f.current.add(i),p.current.add(i);let v=ae.listEntries({environmentId:e,input:{cwd:t,directoryPath:i}});s(e=>e+1),o||l(e=>new Set(e).add(i));let y=(async()=>{g.current>=4?await new Promise(e=>_.current.push(e)):g.current++;try{return m.current?await te(u,v,{refresh:!0,reportFailure:!1,reportDefect:!1}):void 0}finally{let e=_.current.shift();e?e():g.current--}})().then(e=>{if(m.current&&e){if(e._tag===`Success`)r(t=>new Map(t).set(i,e.value.entries.filter(e=>e.path.slice(0,Math.max(0,e.path.lastIndexOf(`/`)))===i))),a(e=>{let t=new Map(e);return t.delete(i),t});else{f.current.delete(i);let t=h(e.cause);a(e=>new Map(e).set(i,t instanceof Error?t.message:`Unable to load folder.`))}}}).finally(()=>{d.current.delete(i),m.current&&(s(e=>e-1),o||l(e=>{let t=new Set(e);return t.delete(i),t}))});return d.current.set(i,y),y},[t,e]);(0,q.useEffect)(()=>(m.current=!0,v(``),()=>{m.current=!1}),[v]);let y=(0,q.useMemo)(()=>{let e=[],t=r=>{for(let i of n.get(r)??[])e.push(i),i.kind===`directory`&&t(i.path)};return t(``),e},[n]),b=(0,q.useMemo)(()=>new Set([``,...y.filter(e=>e.kind===`directory`).map(e=>e.path)]),[y]);return{entries:y,load:v,refresh:(0,q.useCallback)(()=>{let e=[...p.current].filter(e=>b.has(e)),t=0,n=async()=>{for(;t<e.length&&m.current;){let n=e[t++];n!==void 0&&await v(n,!0)}};for(let t=0;t<Math.min(4,e.length);t++)n()},[v,b]),isPending:o>0,loadingDirectories:c,ready:n.has(``),error:[...i].find(([e])=>b.has(e))?.[1]??null}}var $=e(r(),1);function fo(e){return e.kind===`directory`?`${e.path}/`:e.path}function po(e){let t=(0,Q.c)(12),n;t[0]===e.onRefresh?n=t[1]:(n=(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Refresh workspace files`,onClick:e.onRefresh}),t[0]=e.onRefresh,t[1]=n);let r;t[2]===e.isPending?r=t[3]:(r=(0,$.jsx)(hn,{refreshing:e.isPending}),t[2]=e.isPending,t[3]=r);let i;t[4]!==n||t[5]!==r?(i=(0,$.jsx)(_t,{render:n,children:r}),t[4]=n,t[5]=r,t[6]=i):i=t[6];let a=e.isPending?`Refreshing…`:`Refresh files`,o;t[7]===a?o=t[8]:(o=(0,$.jsx)(vt,{children:a}),t[7]=a,t[8]=o);let s;return t[9]!==i||t[10]!==o?(s=(0,$.jsxs)(yt,{children:[i,o]}),t[9]=i,t[10]=o,t[11]=s):s=t[11],s}function mo(e){let t=(0,Q.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):(n=t=>e.onValueChange(t.target.value),r=t=>{t.key===`Escape`&&(e.onClose(),t.currentTarget.blur())},t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==e.ariaLabel||t[4]!==e.name||t[5]!==e.value||t[6]!==n||t[7]!==r?(i=(0,$.jsx)(sn,{variant:`ghost`,className:`h-7 min-w-0 flex-1`,children:(0,$.jsx)(on,{type:`search`,name:e.name,size:`sm`,value:e.value,"aria-label":e.ariaLabel,placeholder:`Search files`,spellCheck:!1,onChange:n,onKeyDown:r})}),t[3]=e.ariaLabel,t[4]=e.name,t[5]=e.value,t[6]=n,t[7]=r,t[8]=i):i=t[8],i}function ho({environmentId:e,cwd:t,projectName:n,selectedPath:r,selectedPathRevealId:i,onOpenFile:a,onRefreshSelectedFile:o,workspaceMutationId:s}){let{resolvedTheme:c}=xe(),l=x(),u=Oe(e),{entries:d,load:f,refresh:p,ready:m,error:h,isPending:g,loadingDirectories:_}=uo(e,t),[v,y]=(0,q.useState)(``),[S,C]=(0,q.useState)(!1),w=F({environmentId:e,cwd:t,query:v.slice(0,256)},200),T=(0,q.useMemo)(()=>{let e=new Map(d.map(e=>[e.path,e]));if(v.trim()&&!w.isPending)for(let t of w.entries){e.has(t.path)||e.set(t.path,t);let n=t.path.split(`/`);for(let t=1;t<n.length;t++){let r=n.slice(0,t).join(`/`);e.has(r)||e.set(r,{path:r,kind:`directory`})}}return[...e.values()]},[d,w.entries,w.isPending,v]),E=(0,q.useMemo)(()=>new Map(T.map(e=>[e.path,e.kind])),[T]),ee=(0,q.useRef)(E),D=(0,q.useMemo)(()=>T.map(fo),[T]),O=(0,q.useMemo)(()=>T.filter(e=>e.kind===`directory`).map(fo),[T]),te=(0,q.useRef)(null),ne=(0,q.useRef)(!1),re=(0,q.useRef)(null),ie=(0,q.useRef)(null),ae=(0,q.useRef)(null),k=async(n,r)=>{let i=be();if(!i){r.close();return}let a=n.path.replace(/\/$/,``),o=an(a),s=ae.current,c=s!==null&&performance.now()-s.at<1e3,d=r.anchorElement.getBoundingClientRect(),f=c?{x:s.x,y:s.y}:{x:d.left,y:d.bottom},p={environmentId:e,filePath:a,workspaceRoot:t},m=u.buildItems(p);try{let e=await i.contextMenu.show([...m,{id:`copy-mention`,label:`Copy mention`},{id:`add-to-chat`,label:`Add to chat`}],f);if(e===null)return;if(m.some(t=>t.id===e)||e.startsWith(`editor:`)){await u.activate(e,p);return}if(e===`copy-mention`){try{await ye(o),ve.add({type:`success`,title:`Mention copied`,description:a})}catch(e){ve.add({type:`error`,title:`Failed to copy mention`,description:e instanceof Error?e.message:`An error occurred.`})}return}if(e===`add-to-chat`){let e=l?.current;if(!e){ve.add({type:`error`,title:`Unable to add to chat`,description:`Open a chat for this project and try again.`});return}e.insertTextAtEnd(`${o} `,{ensureLeadingBoundary:!0})||ve.add({type:`error`,title:`Unable to add to chat`,description:`The chat isn't ready to accept input right now.`})}}finally{r.close()}},A=(0,q.useRef)(k);(0,q.useEffect)(()=>{A.current=k});let oe=(0,q.useRef)(_),se=(0,q.useRef)(null),ce=(0,q.useMemo)(()=>so({deselect:e=>se.current?.getItem(e)?.deselect()}),[]),{model:j}=Mt({composition:{contextMenu:{triggerMode:`right-click`,onOpen:(e,t)=>{A.current(e,t)}}},dragAndDrop:{canDrop:()=>!1},density:`compact`,fileTreeSearchMode:`hide-non-matches`,flattenEmptyDirectories:!0,initialExpansion:`closed`,icons:Pt,onSelectionChange:e=>{if(ce.handleSelectionChange(e),ne.current||ce.isDragInProgress())return;let t=e.at(-1)?.replace(/\/$/,``);t&&ee.current.get(t)===`file`&&(re.current=t,a(t))},paths:[],renderRowDecoration:({item:e,row:t})=>t.kind===`directory`&&t.isExpanded&&oe.current.has(e.path.replace(/\/$/,``))?{icon:`p4-tree-icon-loading`,title:`Loading…`}:null,search:!1,onSearchChange:e=>y(e??``),unsafeCSS:jt});(0,q.useEffect)(()=>{oe.current!==_&&(oe.current=_,j.setComposition(j.getComposition()))},[_,j]);let le=wn(j),ue=At(j,e=>Nt(e,O)),me=()=>{let e=!(S||ue);C(e),kt(j,O,e)},M=()=>{y(``),le.close()},N=(0,q.useRef)(new Set);(0,q.useEffect)(()=>{let e=new Set(O);for(let t of N.current)e.has(t)||N.current.delete(t);let t=()=>{if(!j.isSearchOpen())for(let e of O){let t=j.getItem(e);t?.isDirectory()&&`isExpanded`in t&&t.isExpanded()?N.current.has(e)||(N.current.add(e),f(e.replace(/\/$/,``))):(t?.isDirectory()&&N.current.has(e)&&C(!1),N.current.delete(e))}};return t(),j.subscribe(t)},[O,f,j]),(0,q.useEffect)(()=>{j.setGitStatus(T.filter(e=>e.ignored).map(e=>({path:fo(e),status:`ignored`})))},[T,j]),(0,q.useEffect)(()=>{if(!r)return;let e=new AbortController;return(async()=>{let t=r.split(`/`);for(let n=0;n<t.length&&!e.signal.aborted;n++)await f(t.slice(0,n).join(`/`))})(),()=>{e.abort()}},[f,r]);let he=e=>{y(e),e.trim().length===0?le.close():le.setValue(e)},ge=()=>{p(),v.trim()&&w.refresh(),o?.()};vn({mutationId:s,refresh:()=>{p(),v.trim()&&w.refresh()},resourceKey:`files:${e}:${t}`}),(0,q.useEffect)(()=>{if(!m||te.current===D)return;ee.current=E;let e=te.current;if(te.current=D,e===null){j.resetPaths(D);return}let t=lo(e,D);t.length>0&&j.batch(t)},[m,E,j,D]),(0,q.useEffect)(()=>{S&&!v.trim()&&kt(j,O,!0)},[O,S,j,v]),(0,q.useEffect)(()=>{if(!r){ie.current=null;return}let e=E.get(r);if(e===void 0){ie.current=null;return}let t={path:r,revealId:i},n=ie.current;if(n?.path===t.path&&n.revealId===t.revealId)return;let a=e===`directory`?`${r}/`:r,o=j.getItem(a);if(!o)return;if(j.getSelectedPaths().some(e=>e.replace(/\/$/,``)===r)&&re.current===r){re.current=null,ie.current=t;return}re.current=null,ie.current=t,ne.current=!0,y(``),j.closeSearch();for(let e of j.getSelectedPaths())j.getItem(e)?.deselect();let s=r.split(`/`),c=``;for(let e of s.slice(0,-1)){c=c?`${c}/${e}`:e;let t=j.getItem(`${c}/`)??j.getItem(c);t&&`expand`in t&&t.expand()}`expand`in o&&o.expand(),o.select(),j.scrollToPath(a,{focus:!0,offset:`center`}),queueMicrotask(()=>{ne.current=!1})},[E,j,r,i]);let _e=(0,q.useRef)(null);return(0,q.useEffect)(()=>{se.current=j},[j]),(0,q.useEffect)(()=>{let e=_e.current;if(e===null)return;let t=e=>ce.handleDragStart(e),n=()=>ce.handleDragEnd();return e.addEventListener(`dragstart`,t,!0),e.addEventListener(`dragend`,n),()=>{e.removeEventListener(`dragstart`,t,!0),e.removeEventListener(`dragend`,n)}},[ce]),(0,$.jsxs)(`div`,{ref:_e,className:`flex min-h-0 flex-1 flex-col bg-background`,"data-file-browser-panel":`${e}:${t}`,onContextMenuCapture:e=>{ae.current={x:e.clientX,y:e.clientY,at:e.timeStamp}},children:[(0,$.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 in-data-[preview-panel-mode=inline]:mb-1 in-data-[preview-panel-mode=inline]:h-9 in-data-[preview-panel-mode=inline]:min-h-9 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[(0,$.jsx)(po,{isPending:g,onRefresh:ge}),(0,$.jsx)(mo,{name:`project-files-search`,ariaLabel:`Search ${n} files`,value:le.value,onValueChange:he,onClose:M}),O.length>0?(0,$.jsx)(b,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":S||ue?`Collapse all folders`:`Expand all folders`,onClick:me,children:(0,$.jsx)(pe,{className:`size-3.5`,icon:ue?fe:de})}):null]}),h||w.error?(0,$.jsxs)(`button`,{type:`button`,onClick:ge,className:`p-4 text-left text-xs leading-relaxed text-destructive`,children:[h??w.error,` Click to retry.`]}):null,v.trim()&&w.truncated&&!w.isPending?(0,$.jsx)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground`,children:`More matches available. Refine your search.`}):null,(!m||w.isPending)&&(0,$.jsx)(`div`,{role:`status`,className:`px-3 py-1 text-xs text-muted-foreground`,children:`Loading files…`}),(0,$.jsx)(Dt,{model:j,"aria-label":`${n} files`,className:`min-h-0 flex-1 overflow-hidden`,style:Ot(c)})]})}function go(e,t){let n=A(t),r=k(t)?`\\`:`/`,i=t.split(/[\\/]/).filter(Boolean),a=t.startsWith(`\\\\`)?`\\\\`:n&&r===`/`?`/`:``;return[...n?[]:[{label:e,path:``,kind:`project`}],...i.map((e,t)=>({label:e,path:a+i.slice(0,t+1).join(r),kind:t===i.length-1?`file`:`directory`}))]}function _o(e,t){let n,r=t?`${t}/`:``;return e.flatMap(e=>{if(!e.path.startsWith(r))return[];let t=e.path.slice(r.length);return!t||t.includes(`/`)?[]:[{...e,label:t}]}).toSorted((e,t)=>e.kind===t.kind?(n??=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),n.compare(e.label,t.label)):e.kind===`directory`?-1:1)}function vo(e){if(!e)return null;let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function yo(e,t){return e.slice(e.lastIndexOf(`/`)+1)||t}function bo(e){let t=(0,Q.c)(12),n=e.current?`font-medium text-foreground`:`text-muted-foreground`,r;t[0]===n?r=t[1]:(r=O(`block max-w-40 truncate rounded-sm px-0.5`,n),t[0]=n,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{className:r}),t[2]=r,t[3]=i);let a;t[4]!==e.label||t[5]!==i?(a=(0,$.jsx)(_t,{render:i,children:e.label}),t[4]=e.label,t[5]=i,t[6]=a):a=t[6];let o;t[7]===e.pathLabel?o=t[8]:(o=(0,$.jsx)(vt,{side:`top`,children:e.pathLabel}),t[7]=e.pathLabel,t[8]=o);let s;return t[9]!==a||t[10]!==o?(s=(0,$.jsxs)(yt,{children:[a,o]}),t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function xo(e){let t=(0,Q.c)(40),n=mn(e.environmentId,e.cwd,e.directoryPath,e.workspaceMutationId),{resolvedTheme:r}=xe(),i;t[0]===n.data?.entries?i=t[1]:(i=n.data?.entries??[],t[0]=n.data?.entries,t[1]=i);let a=i,o=n.data?.truncated??!1,s;t[2]!==a||t[3]!==e.directoryPath?(s=_o(a,e.directoryPath),t[2]=a,t[3]=e.directoryPath,t[4]=s):s=t[4];let c=s,u=n.data!==null,f,p,m,h,g;if(t[5]!==e){let n=vo(e.directoryPath),r=e.directoryPath!==e.rootPath&&n!==null&&(e.rootPath===``||n===e.rootPath||n.startsWith(`${e.rootPath}/`));f=w,p=`start`,m=`bottom`,h=t=>{t.key===`ArrowLeft`&&r&&n!==null&&(t.preventDefault(),t.stopPropagation(),e.onDirectoryChange(n))},g=r&&n!==null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(v,{closeOnClick:!1,onClick:()=>e.onDirectoryChange(n),children:[(0,$.jsx)(E,{}),(0,$.jsxs)(`span`,{className:`truncate`,children:[`Back to `,yo(n,e.projectName)]})]}),(0,$.jsx)(T,{})]}):null,t[5]=e,t[6]=f,t[7]=p,t[8]=m,t[9]=h,t[10]=g}else f=t[6],p=t[7],m=t[8],h=t[9],g=t[10];let _;t[11]!==c||t[12]!==u||t[13]!==n.data||t[14]!==n.error||t[15]!==n.isPending||t[16]!==n.refresh||t[17]!==o||t[18]!==e||t[19]!==r?(_=n.isPending&&n.data===null?(0,$.jsxs)(v,{disabled:!0,children:[(0,$.jsx)(_e,{}),`Loading folder…`]}):n.error&&n.data===null?(0,$.jsxs)(v,{closeOnClick:!1,onClick:n.refresh,children:[(0,$.jsx)(hn,{refreshing:n.isPending}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Retry loading folder`})]}):!u&&!o?(0,$.jsx)(v,{disabled:!0,children:`This folder is no longer available.`}):c.length===0?(0,$.jsx)(v,{disabled:!0,children:o?`No entries from this folder are available in the partial workspace index.`:`This folder is empty.`}):(0,$.jsx)(ee,{value:e.currentFilePath,onValueChange:t=>{e.onOpenChange(!1),e.onOpenFile(t)},children:c.map(t=>{let n=t.kind===`file`&&t.path===e.currentFilePath,i=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(rn,{pathValue:t.path,kind:t.kind,theme:r}),(0,$.jsxs)(yt,{children:[(0,$.jsx)(_t,{render:(0,$.jsx)(`span`,{className:O(`min-w-0 flex-1 truncate`,t.ignored&&`text-muted-foreground`)}),children:t.label}),(0,$.jsx)(vt,{side:`right`,children:t.path})]})]});return t.kind===`directory`?(0,$.jsxs)(v,{closeOnClick:!1,onClick:()=>e.onDirectoryChange(t.path),children:[i,(0,$.jsx)(d,{})]},t.path):(0,$.jsx)(S,{value:t.path,closeOnClick:!0,"aria-current":n?`page`:void 0,children:(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:i})},t.path)})}),t[11]=c,t[12]=u,t[13]=n.data,t[14]=n.error,t[15]=n.isPending,t[16]=n.refresh,t[17]=o,t[18]=e,t[19]=r,t[20]=_):_=t[20];let y;t[21]!==e.directoryPath||t[22]!==_?(y=(0,$.jsx)(l,{children:_},e.directoryPath),t[21]=e.directoryPath,t[22]=_,t[23]=y):y=t[23];let b;t[24]!==n.data||t[25]!==n.error||t[26]!==n.isPending||t[27]!==n.refresh?(b=n.error&&n.data!==null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{}),(0,$.jsxs)(v,{closeOnClick:!1,onClick:n.refresh,children:[(0,$.jsx)(hn,{refreshing:n.isPending}),`Refresh failed — retry`]})]}):null,t[24]=n.data,t[25]=n.error,t[26]=n.isPending,t[27]=n.refresh,t[28]=b):b=t[28];let x;t[29]===o?x=t[30]:(x=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{}),(0,$.jsx)(v,{disabled:!0,children:`Some workspace entries are not shown.`})]}):null,t[29]=o,t[30]=x);let C;return t[31]!==f||t[32]!==p||t[33]!==m||t[34]!==h||t[35]!==g||t[36]!==y||t[37]!==b||t[38]!==x?(C=(0,$.jsxs)(f,{align:p,side:m,onKeyDown:h,children:[g,y,b,x]}),t[31]=f,t[32]=p,t[33]=m,t[34]=h,t[35]=g,t[36]=y,t[37]=b,t[38]=x,t[39]=C):C=t[39],C}function So(e){let t=(0,Q.c)(35),[n,r]=(0,q.useState)(!1),[i,a]=(0,q.useState)(e.crumb.path),o;t[0]===e.crumb.path?o=t[1]:(o=()=>{r(!1),a(e.crumb.path)},t[0]=e.crumb.path,t[1]=o);let s;t[2]!==e.crumb.path||t[3]!==e.relativePath?(s=[e.crumb.path,e.relativePath],t[2]=e.crumb.path,t[3]=e.relativePath,t[4]=s):s=t[4],(0,q.useEffect)(o,s);let c;t[5]===e.crumb.path?c=t[6]:(c=t=>{r(t),t&&a(e.crumb.path)},t[5]=e.crumb.path,t[6]=c);let l=c,u=`Browse ${e.crumb.label}`,d;t[7]===u?d=t[8]:(d=(0,$.jsx)(g,{render:(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:`relative block max-w-40 cursor-pointer rounded-sm px-0.5 text-left text-muted-foreground outline-none pointer-coarse:after:-inset-y-3 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-popup-open:bg-accent data-popup-open:text-foreground`})}),t[7]=u,t[8]=d);let f;t[9]===e.crumb.label?f=t[10]:(f=(0,$.jsx)(`span`,{className:`block truncate`,children:e.crumb.label}),t[9]=e.crumb.label,t[10]=f);let m;t[11]!==d||t[12]!==f?(m=(0,$.jsx)(_t,{render:d,children:f}),t[11]=d,t[12]=f,t[13]=m):m=t[13];let h=e.crumb.path||e.projectName,_;t[14]===h?_=t[15]:(_=(0,$.jsx)(vt,{side:`top`,children:h}),t[14]=h,t[15]=_);let v;t[16]!==m||t[17]!==_?(v=(0,$.jsxs)(yt,{children:[m,_]}),t[16]=m,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==i||t[20]!==l||t[21]!==n||t[22]!==e.crumb.path||t[23]!==e.cwd||t[24]!==e.environmentId||t[25]!==e.onOpenFile||t[26]!==e.projectName||t[27]!==e.relativePath||t[28]!==e.workspaceMutationId?(y=n?(0,$.jsx)(xo,{cwd:e.cwd,currentFilePath:e.relativePath,directoryPath:i,environmentId:e.environmentId,onDirectoryChange:a,onOpenChange:l,onOpenFile:e.onOpenFile,projectName:e.projectName,rootPath:e.crumb.path,workspaceMutationId:e.workspaceMutationId}):null,t[19]=i,t[20]=l,t[21]=n,t[22]=e.crumb.path,t[23]=e.cwd,t[24]=e.environmentId,t[25]=e.onOpenFile,t[26]=e.projectName,t[27]=e.relativePath,t[28]=e.workspaceMutationId,t[29]=y):y=t[29];let b;return t[30]!==l||t[31]!==n||t[32]!==y||t[33]!==v?(b=(0,$.jsxs)(p,{open:n,onOpenChange:l,children:[v,y]}),t[30]=l,t[31]=n,t[32]=y,t[33]=v,t[34]=b):b=t[34],b}function Co(e){let t=(0,Q.c)(12),n;t[0]===e.relativePath?n=t[1]:(n=A(e.relativePath),t[0]=e.relativePath,t[1]=n);let r=n,i;t[2]!==e.projectName||t[3]!==e.relativePath?(i=go(e.projectName,e.relativePath),t[2]=e.projectName,t[3]=e.relativePath,t[4]=i):i=t[4];let a=i,o;if(t[5]!==a||t[6]!==r||t[7]!==e){let n;t[9]!==r||t[10]!==e?(n=(t,n)=>(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center`,"data-current-file-crumb":t.kind===`file`,children:[n>0?(0,$.jsx)(d,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}):null,t.kind===`file`?(0,$.jsx)(`span`,{"aria-current":`page`,children:(0,$.jsx)(bo,{current:!0,label:t.label,pathLabel:t.path})}):r?(0,$.jsx)(bo,{label:t.label,pathLabel:t.path}):(0,$.jsx)(So,{...e,crumb:t})]},t.path||`project`),t[9]=r,t[10]=e,t[11]=n):n=t[11],o=a.map(n),t[5]=a,t[6]=r,t[7]=e,t[8]=o}else o=t[8];return o}function wo(e){let t=(0,Q.c)(16),n;t[0]===e.relativePath?n=t[1]:(n=e.relativePath.lastIndexOf(`/`),t[0]=e.relativePath,t[1]=n);let r;t[2]===e.relativePath?r=t[3]:(r=e.relativePath.lastIndexOf(`\\`),t[2]=e.relativePath,t[3]=r);let i=Math.max(n,r),a;t[4]!==i||t[5]!==e.cwd||t[6]!==e.relativePath?(a=i>=0?De(e.relativePath.slice(0,i),e.cwd):e.cwd,t[4]=i,t[5]=e.cwd,t[6]=e.relativePath,t[7]=a):a=t[7];let o=a,s;t[8]===e.text?s=t[9]:(s=zt(e.text),t[8]=e.text,t[9]=s);let c;return t[10]!==o||t[11]!==e.cwd||t[12]!==e.onTaskListChange||t[13]!==e.threadRef||t[14]!==s?(c=(0,$.jsx)(he,{text:s,cwd:e.cwd,imageBaseDir:o,threadRef:e.threadRef,className:`mx-auto max-w-4xl px-6 py-5`,onTaskListChange:e.onTaskListChange}),t[10]=o,t[11]=e.cwd,t[12]=e.onTaskListChange,t[13]=e.threadRef,t[14]=s,t[15]=c):c=t[15],c}function To({root:e,editor:t,onDismiss:n}){n(),t.setSelections([]);let r=e.querySelector(`diffs-container`)?.shadowRoot?.activeElement;r instanceof HTMLElement&&r.blur()}function Eo(e){return e.querySelector(`diffs-container`)?.shadowRoot?.activeElement?.hasAttribute(`data-content`)===!0}function Do({root:e,editor:t,isBlocked:n,onDismiss:r}){let i=i=>{n()||i.composedPath().includes(e)||To({root:e,editor:t,onDismiss:r})},a=i=>{i.key===`Escape`&&!n()&&Eo(e)&&(i.preventDefault(),i.stopImmediatePropagation(),To({root:e,editor:t,onDismiss:r}))};return document.addEventListener(`pointerdown`,i,!0),document.addEventListener(`keydown`,a,!0),()=>{document.removeEventListener(`pointerdown`,i,!0),document.removeEventListener(`keydown`,a,!0)}}function Oo(e){let t=e.renderedLine===void 0?e.fileTop+e.estimatedLine.top:e.scrollTop+e.renderedLine.top-e.viewportTop,n=e.renderedLine?.height??e.estimatedLine.height,r=Math.max(0,t-Math.max(0,(e.viewportHeight-n)/2));return Math.min(r,Math.max(0,e.scrollHeight-e.viewportHeight))}function ko(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(36)}`}function Ao(e,t,n){return`${e}:${t}:${ko(n)}`}function jo(e,t){return e===null||e===`.`||j(e,t)===`.`?null:e}var Mo=e=>/\.(?:md|mdx)$/i.test(e);function No(e){switch(e.failure){case`path_not_file`:return`The path is a directory or special file, not a regular file.`;case`binary_file`:return`The file is binary and cannot be displayed as text.`;case`workspace_path_outside_root`:return`The requested path is outside the workspace.`;case`resolved_path_outside_root`:return`The path resolves to a location outside the workspace.`;case`operation_failed`:return e.operation===`realpath-workspace-root`?`The workspace folder could not be accessed.`:`The file could not be accessed or read. It may be missing or inaccessible.`;default:return e.message}}function Po(e){return e.attachmentOpen||e.relativePath&&A(e.relativePath)?!1:e.explorerOpen||e.relativePath===null}function Fo(e,t,n){return t<0||e[t]!==`[`||!/[ xX]/.test(e[t+1]??``)||e[t+2]!==`]`?e:`${e.slice(0,t+1)}${n?`x`:` `}${e.slice(t+2)}`}function Io(e){return e.draft?{_tag:`draft-workspace-file`,cwd:e.workspaceRoot,path:e.absolutePath}:{_tag:e.kind,threadId:e.threadRef.threadId,path:e.absolutePath}}var Lo=class{options;timer=null;latestContents=``;latestRevision=0;confirmedRevision=0;lastChangeAt=0;saving=!1;disposed=!1;constructor(e){this.options=e}change(e){this.disposed||(this.latestContents=e,this.latestRevision+=1,this.lastChangeAt=Date.now(),this.options.onPendingChange(!0),this.schedule(this.options.debounceMs))}dispose(){this.disposed=!0,this.clearTimer(),this.latestRevision>0&&this.persistLatest()}schedule(e){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.persistLatest()},e)}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}async persistLatest(){if(this.saving||this.latestRevision===this.confirmedRevision||this.options.canPersist?.()===!1)return;this.saving=!0;let e=this.latestContents,t=this.latestRevision,n=(await this.options.persist(e))._tag===`Success`,r=!1;if(n&&(this.confirmedRevision=t,r=this.options.onConfirmed(e)!==!1),this.saving=!1,t===this.latestRevision){r&&this.options.onPendingChange(!1);return}let i=Math.max(0,this.options.debounceMs-(Date.now()-this.lastChangeAt));this.disposed?this.persistLatest():this.schedule(i)}},Ro=500;function zo(e){let t=(0,Q.c)(17),{environmentId:n,cwd:r,relativePath:i,onPendingChange:a}=e,o=Te(n,y),s=Ee(ae.writeFile),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,q.createRef)(),t[0]=c):c=t[0];let l=c,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>l.current?.change(e),t[1]=u):u=t[1];let d;t[2]!==r||t[3]!==n||t[4]!==a||t[5]!==i||t[6]!==s?(d={change:u,setup:()=>{let e=new Lo({debounceMs:Ro,canPersist:()=>P(n,y),onPendingChange:e=>a(i,e),persist:e=>s({environmentId:n,input:{cwd:r,relativePath:i,contents:e}}),onConfirmed:e=>pn(n,r,i,e)});return l.current=e,()=>{l.current=null,e.dispose()}}},t[2]=r,t[3]=n,t[4]=a,t[5]=i,t[6]=s,t[7]=d):d=t[7];let f=d,p;t[8]===f?p=t[9]:(p=[f],t[8]=f,t[9]=p),(0,q.useEffect)(f.setup,p);let m,h;return t[10]!==o||t[11]!==r||t[12]!==n||t[13]!==i||t[14]!==f?(m=()=>{if(!o)return;let e=!1;return queueMicrotask(()=>{if(e)return;let t=fn(n,r,i);t&&f.change(t.contents)}),()=>{e=!0}},h=[o,r,n,i,f],t[10]=o,t[11]=r,t[12]=n,t[13]=i,t[14]=f,t[15]=m,t[16]=h):(m=t[15],h=t[16]),(0,q.useEffect)(m,h),f}var Bo=`p4code.fileExplorerOpen`,Vo=`p4code.renderMarkdown`,Ho=`p4code.renderBrowserFile`,Uo=`p4code.renderTable`;function Wo(e){let t=(0,Q.c)(28),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`workspace-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=Zt(e.environmentId,r),[a,o]=(0,q.useState)(null),s;t[5]!==i._tag||t[6]!==i.url||t[7]!==e.workspaceMutationId?(s=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[5]=i._tag,t[6]=i.url,t[7]=e.workspaceMutationId,t[8]=s):s=t[8];let c=s,l=i._tag===`Success`?`${i.url}${c}`:null,u=e.alt,d;t[9]!==e.absolutePath||t[10]!==e.workspaceRoot?(d=gt(e.absolutePath,e.workspaceRoot),t[9]=e.absolutePath,t[10]=e.workspaceRoot,t[11]=d):d=t[11];let f;t[12]!==e.environmentId||t[13]!==r?(f={environmentId:e.environmentId,resource:r},t[12]=e.environmentId,t[13]=r,t[14]=f):f=t[14];let p;t[15]!==l||t[16]!==e.alt||t[17]!==d||t[18]!==f?(p={kind:`image`,name:u,src:l,reference:d,asset:f},t[15]=l,t[16]=e.alt,t[17]=d,t[18]=f,t[19]=p):p=t[19];let m=p;if(i._tag===`Failure`||l!==null&&a===l){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load workspace image.`}),t[20]=e):e=t[20];let n;return t[21]===m?n=t[22]:(n=(0,$.jsx)(N,{source:m,children:e}),t[21]=m,t[22]=n),n}let h;return t[23]!==m||t[24]!==i._tag||t[25]!==l||t[26]!==e.alt?(h=i._tag===`Success`&&l!==null?(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,$.jsx)(N,{source:m,children:(0,$.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:l,alt:e.alt,onError:()=>o(l)})})}):(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(_e,{size:`lg`})}),t[23]=m,t[24]=i._tag,t[25]=l,t[26]=e.alt,t[27]=h):h=t[27],h}function Go(e){let t=(0,Q.c)(19),n=gt(e.absolutePath,e.workspaceRoot).relativePath===void 0?`media-file`:`workspace-file`,r;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot||t[4]!==n?(r=Io({kind:n,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n,t[5]=r):r=t[5];let i=r,a=Zt(e.environmentId,i),o;t[6]!==a._tag||t[7]!==a.url||t[8]!==e.workspaceMutationId?(o=e.workspaceMutationId===null?``:`${a._tag===`Success`&&a.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[6]=a._tag,t[7]=a.url,t[8]=e.workspaceMutationId,t[9]=o):o=t[9];let s=o;if(a._tag===`Failure`){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load file preview.`}),t[10]=e):e=t[10],e}if(a._tag!==`Success`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(_e,{size:`lg`})}),t[11]=e):e=t[11],e}let c=`${a.url}${s}`,l=`${e.environmentId}:${i._tag}:${e.threadRef.threadId}:${e.absolutePath}:${e.workspaceMutationId}`,u=e.title,d;t[12]===e.absolutePath?d=t[13]:(d=Gt(e.absolutePath),t[12]=e.absolutePath,t[13]=d);let f;return t[14]!==e.title||t[15]!==c||t[16]!==l||t[17]!==d?(f=(0,$.jsx)(Lt,{src:c,documentKey:l,title:u,pdf:d}),t[14]=e.title,t[15]=c,t[16]=l,t[17]=d,t[18]=f):f=t[18],f}function Ko(e){let t=(0,Q.c)(36),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`media-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=Zt(e.environmentId,r),a=Qt(e.environmentId,r),o=e.workspaceMutationId,s;t[5]!==e.environmentId||t[6]!==r?(s=JSON.stringify([e.environmentId,r]),t[5]=e.environmentId,t[6]=r,t[7]=s):s=t[7];let c;t[8]===a?c=t[9]:(c=()=>{a().catch(qo)},t[8]=a,t[9]=c);let l;t[10]!==e.workspaceMutationId||t[11]!==s||t[12]!==c?(l={mutationId:o,resourceKey:s,refresh:c},t[10]=e.workspaceMutationId,t[11]=s,t[12]=c,t[13]=l):l=t[13],vn(l);let u;t[14]!==i._tag||t[15]!==i.url||t[16]!==e.workspaceMutationId?(u=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[14]=i._tag,t[15]=i.url,t[16]=e.workspaceMutationId,t[17]=u):u=t[17];let d=u,f=i._tag===`Success`?`${i.url}${d}`:null,p=i._tag===`Failure`,m=e.name,h=e.workspaceMutationId,g=e.name,_;t[18]!==e.absolutePath||t[19]!==e.workspaceRoot?(_=gt(e.absolutePath,e.workspaceRoot),t[18]=e.absolutePath,t[19]=e.workspaceRoot,t[20]=_):_=t[20];let v;t[21]!==e.environmentId||t[22]!==r?(v={environmentId:e.environmentId,resource:r},t[21]=e.environmentId,t[22]=r,t[23]=v):v=t[23];let y;t[24]!==f||t[25]!==e.name||t[26]!==_||t[27]!==v?(y={kind:`video`,name:g,src:f,reference:_,asset:v},t[24]=f,t[25]=e.name,t[26]=_,t[27]=v,t[28]=y):y=t[28];let b;return t[29]!==f||t[30]!==e.name||t[31]!==e.workspaceMutationId||t[32]!==a||t[33]!==y||t[34]!==p?(b=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4`,children:(0,$.jsx)(M,{src:f,sourceFailed:p,label:m,revision:h,preload:`metadata`,className:`flex h-full min-h-0 w-full max-w-5xl items-center justify-center`,onRetry:a,actionsSource:y})}),t[29]=f,t[30]=e.name,t[31]=e.workspaceMutationId,t[32]=a,t[33]=y,t[34]=p,t[35]=b):b=t[35],b}function qo(){}function Jo(e){let t=(0,Q.c)(27),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`media-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=Zt(e.environmentId,r),a=Qt(e.environmentId,r),[o,s]=(0,q.useState)(null),c=e.workspaceMutationId,l;t[5]!==e.environmentId||t[6]!==r?(l=JSON.stringify([e.environmentId,r]),t[5]=e.environmentId,t[6]=r,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=()=>{a().catch(Xo)},t[8]=a,t[9]=u);let d;t[10]!==e.workspaceMutationId||t[11]!==l||t[12]!==u?(d={mutationId:c,resourceKey:l,refresh:u},t[10]=e.workspaceMutationId,t[11]=l,t[12]=u,t[13]=d):d=t[13],vn(d);let f;t[14]!==i._tag||t[15]!==i.url||t[16]!==e.workspaceMutationId?(f=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[14]=i._tag,t[15]=i.url,t[16]=e.workspaceMutationId,t[17]=f):f=t[17];let p=f,m=i._tag===`Success`?`${i.url}${p}`:null;if(i._tag===`Failure`||m!==null&&o===m){let e;return t[18]===a?e=t[19]:(e=(0,$.jsx)(Ht,{message:`Unable to load audio.`,onRetry:()=>{s(null),a().catch(Yo)}}),t[18]=a,t[19]=e),e}if(m===null){let e;return t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rt,{}),t[20]=e):e=t[20],e}let h;t[21]===m?h=t[22]:(h=()=>s(m),t[21]=m,t[22]=h);let g;return t[23]!==e.name||t[24]!==h||t[25]!==m?(g=(0,$.jsx)(Wt,{src:m,name:e.name,onError:h}),t[23]=e.name,t[24]=h,t[25]=m,t[26]=g):g=t[26],g}function Yo(){}function Xo(){}function Zo(e,t){let n=1;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);r===10?n+=1:r===13&&(n+=1,e.charCodeAt(t+1)===10&&(t+=1))}return Math.min(Math.max(1,t),n)}function Qo(e,t){let n=e.shadowRoot??e;for(let e of n.querySelectorAll(`[${Jt}]`))e.removeAttribute(Jt);t!==null&&(n.querySelector(`[data-line="${t}"]`)?.setAttribute(Jt,``),n.querySelector(`[data-column-number="${t}"]`)?.setAttribute(Jt,``))}var $o=30,es=20,ts=2;function ns(e,t,n){let r=(0,Q.c)(5),[i]=(0,q.useState)(rs),a;return r[0]!==e||r[1]!==t||r[2]!==n||r[3]!==i?(a=(r,a,o)=>{if(e===null)return;let s=i.get(e),c=s??{frameId:null,cancelGuard:null,handledRequestId:null,latestRequestId:null};s||i.set(e,c);let l=()=>{c.frameId!==null&&(cancelAnimationFrame(c.frameId),c.frameId=null),c.cancelGuard?.()};if(o===`unmount`){l();return}let u=a.file?.contents;if(Qo(r,t===null||u===void 0?null:Zo(u,t)),!(a instanceof Xe))return;if(c.latestRequestId!==n&&(l(),c.latestRequestId=n,c.handledRequestId=null),t===null){r.style.minHeight=``;return}let d=r.closest(`.file-preview-virtualizer`);if(!d||(r.style.minHeight=`${Math.ceil(Math.max(a.height,d.clientHeight))}px`,c.handledRequestId===n||c.frameId!==null))return;let f=e=>{let t=a.getLinePosition(e);if(!t)return null;let n=d.getBoundingClientRect(),i=d.scrollTop+r.getBoundingClientRect().top-n.top,o=(r.shadowRoot??r).querySelector(`[data-line="${e}"]`)?.getBoundingClientRect();return Oo({scrollTop:d.scrollTop,scrollHeight:d.scrollHeight,viewportTop:n.top,viewportHeight:d.clientHeight,fileTop:i,estimatedLine:t,...o&&o.height>0?{renderedLine:{top:o.top,height:o.height}}:{}})},p=e=>{let t=es,n=null,r=()=>{n!==null&&(cancelAnimationFrame(n),n=null),d.removeEventListener(`wheel`,r),d.removeEventListener(`touchstart`,r),d.removeEventListener(`pointerdown`,r,!0),window.removeEventListener(`keydown`,r,!0),c.cancelGuard===r&&(c.cancelGuard=null)};d.addEventListener(`wheel`,r,{passive:!0}),d.addEventListener(`touchstart`,r,{passive:!0}),d.addEventListener(`pointerdown`,r,{passive:!0,capture:!0}),window.addEventListener(`keydown`,r,!0);let i=()=>{if(n=null,--t,t<=0||!d.isConnected){r();return}let a=f(e);a!==null&&Math.abs(d.scrollTop-a)>ts&&(d.scrollTop=a),n=requestAnimationFrame(i)};n=requestAnimationFrame(i),c.cancelGuard=r},m=e=>{c.frameId=requestAnimationFrame(()=>{if(c.frameId=null,c.latestRequestId!==n||!r.isConnected)return;let i=a.file?.contents,o=i===void 0?null:Zo(i,t),s=o===null?null:f(o);o===null||s===null?e<$o&&m(e+1):(Qo(r,o),d.scrollTop=s,c.handledRequestId=n,p(o))})};m(0)},r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a):a=r[4],a}function rs(){return new Map}var is=(e,t,n)=>new to(e,t,n);function as(e,t,n,r){return{name:n,contents:r,cacheKey:`editor:${e}:${Ao(t,n,r)}`}}function os(e,t){if(e?.isWorkingPool()!==!0||(t.lang??_n(t.name))===`text`)return!1;let n=1;for(let e=t.contents.indexOf(`
|
|
32
32
|
`);e!==-1;e=t.contents.indexOf(`
|
|
33
33
|
`,e+1))n+=1;return n<=Ne}function ss(e){let t=(0,Q.c)(15),n=R(),[r,i]=(0,q.useState)(null),a;t[0]!==e||t[1]!==n?(a=os(n,e),t[0]=e,t[1]=n,t[2]=a):a=t[2];let o=!a||r===e,s,c;t[3]!==e||t[4]!==o||t[5]!==n?(s=()=>{o||n===void 0||n.primeFileHighlightCache(e).catch(()=>i(e))},c=[e,o,n],t[3]=e,t[4]=o,t[5]=n,t[6]=s,t[7]=c):(s=t[6],c=t[7]),(0,q.useEffect)(s,c);let l;t[8]!==e||t[9]!==o||t[10]!==n?(l=(t,r)=>{o||r===`unmount`||t?.cacheKey!==e.cacheKey||n?.getFileResultCache(e)!==void 0&&i(e)},t[8]=e,t[9]=o,t[10]=n,t[11]=l):l=t[11];let u=l,d;return t[12]!==u||t[13]!==o?(d={ready:o,onPostRender:u},t[12]=u,t[13]=o,t[14]=d):d=t[14],d}function cs(e){let t=(0,Q.c)(68),{environmentId:n,cwd:r,relativePath:a,composerDraftTarget:o,contents:s,resolvedTheme:c,revealRequestId:l,wordWrap:u,onPostRender:d,onPendingChange:f}=e,p=i(hs),m=i(ms),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[0]=h):h=t[0];let[g,_]=(0,q.useState)(h),[v,y]=(0,q.useState)(null),b=v?.revealRequestId===l?v.range:null,x;t[1]===l?x=t[2]:(x=e=>{y({revealRequestId:l,range:e})},t[1]=l,t[2]=x);let S=x,w=(0,q.useRef)(null),T=(0,q.useRef)(null),E;t[3]!==r||t[4]!==n||t[5]!==f||t[6]!==a?(E={environmentId:n,cwd:r,relativePath:a,onPendingChange:f},t[3]=r,t[4]=n,t[5]=f,t[6]=a,t[7]=E):E=t[7];let ee=zo(E),D;t[8]!==s||t[9]!==r||t[10]!==n||t[11]!==a?(D=()=>as(n,r,a,s),t[8]=s,t[9]=r,t[10]=n,t[11]=a,t[12]=D):D=t[12];let[O,te]=(0,q.useState)(D),[ne,re]=(0,q.useState)(null);s!==(ne??O.contents)&&(te(as(n,r,a,s)),re(null));let{ready:ie,onPostRender:ae}=ss(O),k=(0,q.useRef)(null),A;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(A={onAttach:e=>{k.current=e},onComplete:()=>{k.current=null}},t[13]=A):A=t[13];let oe=A,se;t[14]!==p||t[15]!==o||t[16]!==r||t[17]!==n||t[18]!==a||t[19]!==ee?(se=e=>{let{file:t,lineAnnotations:i}=e;if(t.contents===ln(n,r,a)||(re(t.contents),un(n,r,a,t.contents),ee.change(t.contents),!i))return;let s=bt(i);_(e=>e===i?e:s);for(let e of s)for(let n of e.metadata.entries)n.kind===`comment`&&p(o,C({id:n.id,filePath:a,startLine:n.startLine,endLine:n.endLine,text:n.text,contents:t.contents}))},t[14]=p,t[15]=o,t[16]=r,t[17]=n,t[18]=a,t[19]=ee,t[20]=se):se=t[20];let ce=se,j;t[21]!==o||t[22]!==m||t[23]!==S?(j=e=>{S(null),m(o,e),_(t=>t.flatMap(t=>{let n=t.metadata.entries.filter(t=>t.id!==e);return n.length>0?[{...t,metadata:{entries:n}}]:[]}))},t[21]=o,t[22]=m,t[23]=S,t[24]=j):j=t[24];let le=j,ue;t[25]!==p||t[26]!==o||t[27]!==s||t[28]!==g||t[29]!==a||t[30]!==S?(ue=(e,t)=>{S(null);let n=g.flatMap(ps).find(t=>t.id===e);n&&p(o,C({id:n.id,filePath:a,startLine:n.startLine,endLine:n.endLine,text:t,contents:s})),_(n=>n.map(n=>({...n,metadata:{entries:n.metadata.entries.map(n=>n.id===e?{...n,kind:`comment`,text:t}:n)}})))},t[25]=p,t[26]=o,t[27]=s,t[28]=g,t[29]=a,t[30]=S,t[31]=ue):ue=t[31];let de=ue,fe;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>{k.current?.setSelections([]),k.current?.blur();let{startLine:t,endLine:n}=St(e),r={id:xt(),kind:`draft`,startLine:t,endLine:n,text:``};_(e=>{let t=e.flatMap(ds),i=t.findIndex(e=>e.lineNumber===n);return i<0?[...t,{lineNumber:n,metadata:{entries:[r]}}]:t.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,r]}}:e)})},t[32]=fe):fe=t[32];let pe=fe,me;t[33]===g?me=t[34]:(me=g.some(ls),t[33]=g,t[34]=me);let M=me,N,he;t[35]!==M||t[36]!==S?(N=()=>{let e=w.current;if(e)return Do({root:e,editor:{setSelections:e=>k.current?.setSelections(e)},isBlocked:()=>M,onDismiss:()=>S(null)})},he=[M,S],t[35]=M,t[36]=S,t[37]=N,t[38]=he):(N=t[37],he=t[38]),(0,q.useEffect)(N,he);let ge;t[39]===S?ge=t[40]:(ge=e=>{S(e),e&&pe(e)},t[39]=S,t[40]=ge);let _e=ge,ve;t[41]!==ae||t[42]!==d||t[43]!==b?(ve=(e,t,n)=>{d(e,t,n),ae(t.file,n),T.current!==null&&(cancelAnimationFrame(T.current),T.current=null),n!==`unmount`&&(T.current=requestAnimationFrame(()=>{T.current=null,e.isConnected&&t.setSelectedLines(b,{notify:!1})}))},t[41]=ae,t[42]=d,t[43]=b,t[44]=ve):ve=t[44];let ye=ve,be;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(be={overscrollSize:600,intersectionObserverMargin:1200},t[45]=be):be=t[45];let xe=!M,Se=!M,Ce=u?`wrap`:`scroll`,we;t[46]===c?we=t[47]:(we=je(c),t[46]=c,t[47]=we);let Te;t[48]!==_e||t[49]!==ye||t[50]!==c||t[51]!==S||t[52]!==xe||t[53]!==Se||t[54]!==Ce||t[55]!==we?(Te={disableFileHeader:!0,enableGutterUtility:xe,enableLineSelection:Se,onGutterUtilityClick:S,onLineSelectionChange:S,onLineSelectionEnd:_e,overflow:Ce,theme:we,preferredHighlighter:gn,themeType:c,unsafeCSS:Vt,onPostRender:ye},t[48]=_e,t[49]=ye,t[50]=c,t[51]=S,t[52]=xe,t[53]=Se,t[54]=Ce,t[55]=we,t[56]=Te):Te=t[56];let P;t[57]!==le||t[58]!==de?(P=e=>(0,$.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,$.jsx)(ft,{kind:e.kind,rangeLabel:Ct(e.startLine,e.endLine),text:e.text,onCancel:()=>le(e.id),onComment:t=>de(e.id,t),onDelete:()=>le(e.id)},e.id))}),t[57]=le,t[58]=de,t[59]=P):P=t[59];let Ee;return t[60]!==ie||t[61]!==O||t[62]!==ce||t[63]!==g||t[64]!==b||t[65]!==Te||t[66]!==P?(Ee=(0,$.jsx)(ze,{createEditor:is,children:(0,$.jsx)(`div`,{ref:w,className:`flex min-h-0 flex-1`,children:(0,$.jsx)(Be,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:be,children:(0,$.jsx)(wt,{file:O,edit:ie,editorOptions:oe,onEditChange:ce,options:Te,selectedLines:b,lineAnnotations:g,renderAnnotation:P,className:`min-h-full`})})})}),t[60]=ie,t[61]=O,t[62]=ce,t[63]=g,t[64]=b,t[65]=Te,t[66]=P,t[67]=Ee):Ee=t[67],Ee}function ls(e){return e.metadata.entries.some(us)}function us(e){return e.kind===`draft`}function ds(e){let t=e.metadata.entries.filter(fs);return t.length>0?[{...e,metadata:{entries:t}}]:[]}function fs(e){return e.kind!==`draft`}function ps(e){return e.metadata.entries}function ms(e){return e.removeReviewComment}function hs(e){return e.addReviewComment}function gs(e){let t=(0,Q.c)(18),{environmentId:n,cwd:r,relativePath:i,contents:a,threadRef:o,readOnly:s,onPendingChange:c}=e,l;t[0]!==r||t[1]!==n||t[2]!==c||t[3]!==i?(l={environmentId:n,cwd:r,relativePath:i,onPendingChange:c},t[0]=r,t[1]=n,t[2]=c,t[3]=i,t[4]=l):l=t[4];let u=zo(l),d;t[5]!==a||t[6]!==r||t[7]!==n||t[8]!==s||t[9]!==i||t[10]!==u?(d=s?void 0:e=>{let{markerOffset:t,checked:o}=e,s=dn(n,r,i)?.contents??a,c=Fo(s,t,o);c!==s&&(un(n,r,i,c),u.change(c))},t[5]=a,t[6]=r,t[7]=n,t[8]=s,t[9]=i,t[10]=u,t[11]=d):d=t[11];let f;return t[12]!==a||t[13]!==r||t[14]!==i||t[15]!==d||t[16]!==o?(f=(0,$.jsx)(Ft,{className:`min-h-0 flex-1`,children:(0,$.jsx)(wo,{text:a,cwd:r,relativePath:i,threadRef:o,onTaskListChange:d})}),t[12]=a,t[13]=r,t[14]=i,t[15]=d,t[16]=o,t[17]=f):f=t[17],f}function _s(e,t){return e===`markdown`?t?`Show markdown source`:`Show rendered markdown`:e===`table`?t?`Show source`:`Show table`:t?`Show HTML source`:`Show rendered page`}function vs(){try{return c(Bo,_)??!0}catch(e){return console.error(e),!0}}function ys(e){let t=(0,Q.c)(155),{environmentId:n,cwd:r,projectName:i,relativePath:a,attachment:c,threadRef:l,composerDraftTarget:u,keybindings:d,availableEditors:p,revealLine:h,revealRequestId:g,onOpenFile:v,onPendingChange:b,selectedFilePending:x,workspaceMutationId:S}=e,C;t[0]!==c||t[1]!==r||t[2]!==a?(C=c===void 0?jo(a,r):a,t[0]=c,t[1]=r,t[2]=a,t[3]=C):C=t[3];let w=C,T=typeof u==`string`,{resolvedTheme:E}=xe(),ee=we(xs),[te,ae]=(0,q.useState)(null),k=te??ee,j=Te(n,m),de=Se(),fe=ge(n),M=Ce(n),N=$t(n),he;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(he={reportFailure:!1},t[4]=he):he=t[4];let ye=Xt(Yt.createUrl,he),be;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(be={reportFailure:!1},t[5]=be):be=t[5];let P=Ee(nn.open,be),Oe;t[6]===w?Oe=t[7]:(Oe=w!==null&&se(w),t[6]=w,t[7]=Oe);let F=Oe,I;t[8]!==F||t[9]!==w?(I=w!==null&&!F&&ce(w),t[8]=F,t[9]=w,t[10]=I):I=t[10];let Ae=I,je;t[11]!==F||t[12]!==w?(je=w!==null&&!F&&oe(w),t[11]=F,t[12]=w,t[13]=je):je=t[13];let Me=je,Ne=Me||F||Ae,Pe;t[14]===w?Pe=t[15]:(Pe=w!==null&&Gt(w),t[14]=w,t[15]=Pe);let L=Pe,Fe;t[16]!==L||t[17]!==w?(Fe=w!==null&&!L&&tn(w),t[16]=L,t[17]=w,t[18]=Fe):Fe=t[18];let Ie=Fe,Le;t[19]!==c||t[20]!==w?(Le=c!==void 0||w!==null&&A(w),t[19]=c,t[20]=w,t[21]=Le):Le=t[21];let R=Le,Re=ie(n),{canReadFiles:ze}=Re,Be=Te(n,y),z=cn(n,r,w,c===void 0&&w!==null),Ve=z.readError?.resolvedPath??z.readError?.operationPath,He=z.isNotFile&&!R,B=He?null:w,[Ue,We]=(0,q.useState)(vs),Ge=c!==void 0,Ke;t[22]!==Ue||t[23]!==B||t[24]!==Ge?(Ke=Po({relativePath:B,explorerOpen:Ue,attachmentOpen:Ge}),t[22]=Ue,t[23]=B,t[24]=Ge,t[25]=Ke):Ke=t[25];let qe=Ke,[Je,Ye]=o(Vo,!1,_),[Xe,Ze]=o(Ho,!0,_),[Qe,$e]=o(Uo,!0,_),[tt,nt]=(0,q.useState)(null),rt=(0,q.useRef)(null),it;t[26]===B?it=t[27]:(it=B?Mo(B):!1,t[26]=B,t[27]=it);let V=it,at;t[28]!==c||t[29]!==B?(at=B&&c===void 0?Bt({name:B}):null,t[28]=c,t[29]=B,t[30]=at):at=t[30];let H=at,ot=h===null||tt?.path===w&&tt.requestId===g,U=V&&Je&&ot,st=L||Ie&&Xe&&ot,ct=H!==null&&Qe&&ot,W=V?`markdown`:H?`table`:Ie?`html`:null,lt=B!==null&&c===void 0&&W!==null,ut=B!==null&&z.data!==null&&!(V&&U)&&!(H&&ct)&&!st,dt=V?U:H?ct:st,G=V?Ye:H?$e:Ze,ft;t[31]!==c||t[32]!==j||t[33]!==F||t[34]!==N||t[35]!==B?(ft=j&&B!==null&&c===void 0&&!F&&N&&tn(B),t[31]=c,t[32]=j,t[33]=F,t[34]=N,t[35]=B,t[36]=ft):ft=t[36];let pt=ft,mt;t[37]!==c||t[38]!==r||t[39]!==w?(mt=w&&c===void 0?De(w,r):null,t[37]=c,t[38]=r,t[39]=w,t[40]=mt):mt=t[40];let K=mt,ht=ns(w,h,g),gt=c===void 0&&w!==null&&(He||!Ne&&!L)&&!x,_t=`file:${n}:${r}:${w??``}`,vt;t[41]!==z.refresh||t[42]!==gt||t[43]!==_t||t[44]!==S?(vt={enabled:gt,mutationId:S,refresh:z.refresh,resourceKey:_t},t[41]=z.refresh,t[42]=gt,t[43]=_t,t[44]=S,t[45]=vt):vt=t[45],vn(vt);let yt;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(yt=()=>{(rt.current?.querySelector(`[data-current-file-crumb='true']`))?.scrollIntoView({block:`nearest`,inline:`end`})},t[46]=yt):yt=t[46];let bt;t[47]===w?bt=t[48]:(bt=[w],t[47]=w,t[48]=bt),(0,q.useEffect)(yt,bt);let xt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(xt=()=>{We(bs)},t[49]=xt):xt=t[49];let St=xt,Ct;t[50]!==K||t[51]!==j||t[52]!==ze||t[53]!==ye||t[54]!==r||t[55]!==M||t[56]!==P||t[57]!==l?(Ct=()=>{ze&&j&&K&&M&&(async()=>{let e=await en({threadRef:l,filePath:K,workspaceRoot:r,httpBaseUrl:M,createAssetUrl:ye,openPreview:P});if(e._tag===`Success`||ne(e))return;let t=re(e);ve.add(ke({type:`error`,title:`Unable to open file in browser`,description:t instanceof Error?t.message:`An error occurred.`}))})()},t[50]=K,t[51]=j,t[52]=ze,t[53]=ye,t[54]=r,t[55]=M,t[56]=P,t[57]=l,t[58]=Ct):Ct=t[58];let wt=Ct;if(c===void 0&&!ze){if(Re.isPending){let e;return t[59]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(_e,{className:`size-4`}),`Checking file access...`]}),t[59]=e):e=t[59],e}let e=Re.error??`This connection cannot read host files.`,n;return t[60]===e?n=t[61]:(n=(0,$.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:e}),t[60]=e,t[61]=n),n}let Et;t[62]!==K||t[63]!==c||t[64]!==p||t[65]!==pt||t[66]!==lt||t[67]!==r||t[68]!==n||t[69]!==Ue||t[70]!==wt||t[71]!==R||t[72]!==d||t[73]!==v||t[74]!==B||t[75]!==de||t[76]!==i||t[77]!==w||t[78]!==fe||t[79]!==dt||t[80]!==W||t[81]!==g||t[82]!==G||t[83]!==ut||t[84]!==k||t[85]!==S?(Et=w&&c===void 0?(0,$.jsxs)(`div`,{className:It,"data-surface-subheader":!0,children:[(0,$.jsx)(Ft,{radius:`none`,ref:rt,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1`,"data-file-breadcrumbs":!0,children:(0,$.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center text-xs`,children:(0,$.jsx)(Co,{cwd:r,environmentId:n,onOpenFile:v,projectName:i,relativePath:w,workspaceMutationId:S})})}),K&&(n===de||fe.mode!==`local-exec`)?(0,$.jsx)(bn,{environmentId:n,keybindings:d,availableEditors:p,openInCwd:K,compact:!0}):null,lt&&W?(0,$.jsx)(qt,{label:_s(W,dt),pressed:dt,onPress:()=>{let e=!dt;G(e),nt(e&&w!==null?{path:w,requestId:g}:null)},children:(0,$.jsx)(pe,{className:`size-3.5`,icon:dt?ue:W===`table`?le:me})}):null,ut?(0,$.jsx)(qt,{label:k?`Disable word wrap`:`Enable word wrap`,pressed:k,onPress:()=>ae(!k),children:(0,$.jsx)(D,{className:`size-3.5`})}):null,pt?(0,$.jsx)(qt,{label:`Open file in preview browser`,onPress:wt,children:(0,$.jsx)(f,{className:`size-3.5`})}):null,!R&&B!==null?(0,$.jsx)(qt,{label:Ue?`Hide file explorer`:`Show file explorer`,pressed:Ue,onPress:St,children:(0,$.jsx)(s,{className:`size-3.5`})}):null]}):null,t[62]=K,t[63]=c,t[64]=p,t[65]=pt,t[66]=lt,t[67]=r,t[68]=n,t[69]=Ue,t[70]=wt,t[71]=R,t[72]=d,t[73]=v,t[74]=B,t[75]=de,t[76]=i,t[77]=w,t[78]=fe,t[79]=dt,t[80]=W,t[81]=g,t[82]=G,t[83]=ut,t[84]=k,t[85]=S,t[86]=Et):Et=t[86];let Dt;t[87]!==c||t[88]!==Be||t[89]!==Re.isPending||t[90]!==R||t[91]!==w?(Dt=w&&!c&&!R&&!Be&&!Re.isPending?(0,$.jsx)(`div`,{className:`shrink-0 border-b px-3 py-1.5 text-2xs text-muted-foreground`,children:`Read-only connection. Unsaved edits are kept until write access returns.`}):null,t[87]=c,t[88]=Be,t[89]=Re.isPending,t[90]=R,t[91]=w,t[92]=Dt):Dt=t[92];let Ot;t[93]!==c||t[94]!==z.data||t[95]!==Ne||t[96]!==B||t[97]!==st?(Ot=B&&c===void 0&&!Ne&&!st&&z.data?.truncated?(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-warning/20 bg-warning-surface px-3 py-1.5 text-2xs text-warning-foreground`,children:[`Preview limited to the first 1 MB of a `,z.data.byteLength.toLocaleString(),` byte file.`]}):null,t[93]=c,t[94]=z.data,t[95]=Ne,t[96]=B,t[97]=st,t[98]=Ot):Ot=t[98];let kt=B?`flex`:`hidden`,At;t[99]===kt?At=t[100]:(At=O(`min-w-0 flex-1 flex-col overflow-hidden`,kt),t[99]=kt,t[100]=At);let jt;t[101]!==K||t[102]!==c||t[103]!==Ve||t[104]!==Be||t[105]!==u||t[106]!==r||t[107]!==T||t[108]!==n||t[109]!==z.data||t[110]!==z.error||t[111]!==z.readError||t[112]!==Ae||t[113]!==He||t[114]!==R||t[115]!==Me||t[116]!==V||t[117]!==F||t[118]!==ht||t[119]!==b||t[120]!==w||t[121]!==st||t[122]!==U||t[123]!==ct||t[124]!==E||t[125]!==g||t[126]!==H||t[127]!==l||t[128]!==k||t[129]!==S?(jt=He?null:w&&c?(0,$.jsx)(Kt,{name:c.name,mimeType:c.mimeType,sizeBytes:c.sizeBytes,asset:{environmentId:n,attachmentId:c.id},htmlRender:c.htmlRender===!0,threadRef:l},`${n}:${c.id}`):w&&F&&K?(0,$.jsx)(Ko,{environmentId:n,threadRef:l,draft:T,absolutePath:K,workspaceRoot:r,name:w,workspaceMutationId:S},`${n}:${l.threadId}:${K}`):w&&Ae&&K?(0,$.jsx)(Jo,{environmentId:n,threadRef:l,draft:T,absolutePath:K,workspaceRoot:r,name:w,workspaceMutationId:S},`${n}:${l.threadId}:${K}`):w&&Me&&K?(0,$.jsx)(Wo,{environmentId:n,threadRef:l,draft:T,absolutePath:K,workspaceRoot:r,alt:w,workspaceMutationId:S},K):w&&st&&K?(0,$.jsx)(Go,{environmentId:n,threadRef:l,draft:T,absolutePath:K,workspaceRoot:r,title:w,workspaceMutationId:S},K):w&&z.error&&z.data===null?(0,$.jsx)(`div`,{role:`alert`,className:`scrollbar-gutter-both flex min-h-0 flex-1 flex-col overflow-auto`,children:(0,$.jsxs)(`div`,{className:`my-auto flex shrink-0 flex-col gap-3 px-6 py-6 text-center text-xs leading-relaxed`,children:[(0,$.jsx)(`p`,{className:`text-destructive`,children:z.readError?No(z.readError):z.error}),Ve?(0,$.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Attempted path`,(0,$.jsx)(`code`,{className:`block break-all font-mono text-foreground select-all`,children:Ve})]}):null,R?null:(0,$.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Workspace folder:`,` `,(0,$.jsx)(`code`,{className:`break-all font-mono select-all`,children:z.readError?.cwd??r}),`. Check the link's path or locate the file in Files.`]})]})}):w&&z.data===null?(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(_e,{size:`lg`})}):w&&z.data?V&&U?(0,$.jsx)(gs,{environmentId:n,cwd:r,relativePath:w,threadRef:l,contents:z.data.contents,readOnly:R||!Be,onPendingChange:b},w):H&&ct?(0,$.jsx)(Ut,{name:w,text:z.data.contents,delimiter:H},w):z.data.truncated||R||!Be?(0,$.jsx)(Tt,{name:w,text:z.data.contents,cacheKey:Ao(r,w,z.data.contents),onPostRender:ht}):(0,$.jsx)(et,{children:(0,$.jsx)(cs,{environmentId:n,cwd:r,relativePath:w,composerDraftTarget:u,contents:z.data.contents,resolvedTheme:E,revealRequestId:g,wordWrap:k,onPostRender:ht,onPendingChange:b},`${w}:${E}`)}):null,t[101]=K,t[102]=c,t[103]=Ve,t[104]=Be,t[105]=u,t[106]=r,t[107]=T,t[108]=n,t[109]=z.data,t[110]=z.error,t[111]=z.readError,t[112]=Ae,t[113]=He,t[114]=R,t[115]=Me,t[116]=V,t[117]=F,t[118]=ht,t[119]=b,t[120]=w,t[121]=st,t[122]=U,t[123]=ct,t[124]=E,t[125]=g,t[126]=H,t[127]=l,t[128]=k,t[129]=S,t[130]=jt):jt=t[130];let Mt;t[131]!==At||t[132]!==jt?(Mt=(0,$.jsx)(`div`,{className:At,children:jt}),t[131]=At,t[132]=jt,t[133]=Mt):Mt=t[133];let Nt;t[134]!==r||t[135]!==n||t[136]!==z.refresh||t[137]!==Ne||t[138]!==L||t[139]!==v||t[140]!==B||t[141]!==i||t[142]!==w||t[143]!==g||t[144]!==qe||t[145]!==S?(Nt=qe?(0,$.jsx)(`aside`,{className:O(`flex min-h-0 shrink-0 bg-background`,B?`w-[min(22rem,46%)] min-w-64 border-l border-border/60`:`min-w-0 flex-1`),children:(0,$.jsx)(ho,{environmentId:n,cwd:r,projectName:i,selectedPath:w,selectedPathRevealId:g,onOpenFile:v,workspaceMutationId:S,...B&&!Ne&&!L?{onRefreshSelectedFile:z.refresh}:{}},`${n}:${r}`)}):null,t[134]=r,t[135]=n,t[136]=z.refresh,t[137]=Ne,t[138]=L,t[139]=v,t[140]=B,t[141]=i,t[142]=w,t[143]=g,t[144]=qe,t[145]=S,t[146]=Nt):Nt=t[146];let Pt;t[147]!==Mt||t[148]!==Nt?(Pt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[Mt,Nt]}),t[147]=Mt,t[148]=Nt,t[149]=Pt):Pt=t[149];let Lt;return t[150]!==Et||t[151]!==Dt||t[152]!==Ot||t[153]!==Pt?(Lt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[Et,Dt,Ot,Pt]}),t[150]=Et,t[151]=Dt,t[152]=Ot,t[153]=Pt,t[154]=Lt):Lt=t[154],Lt}function bs(e){let t=!e;try{a(Bo,t,_)}catch(e){console.error(e)}return t}function xs(e){return e.wordWrap}export{ys as default};
|
|
34
|
-
//# sourceMappingURL=FilePreviewPanel-
|
|
34
|
+
//# sourceMappingURL=FilePreviewPanel-z6NirC2y.js.map
|
package/dist/client/assets/{FoldedSettingsSection-DPTJODig.js → FoldedSettingsSection-DIlgxayr.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Rd as i,t as a}from"./utils-
|
|
2
|
-
//# sourceMappingURL=FoldedSettingsSection-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Rd as i,t as a}from"./utils-C5GGWTfe.js";import{G as o,d as s,f as c}from"./settingsLayout-WhjsCfB6.js";import{ho as l,mo as u,po as d}from"./main-C0z861OK.js";var f=n(),p=e(t(),1),m=e(r(),1);function h(e){let t=(0,f.c)(50),{id:n,title:r,summary:h,control:g,headerPlacement:_,children:v}=e,y=_===void 0?`inside`:_,[b,x]=(0,p.useState)(!1),S=c(),C=s(n),[w,T]=(0,p.useState)(null);if(S===n&&w!==n&&(T(n),b||x(!0)),y===`outside`){let e=b&&`rotate-90`,s;t[0]===e?s=t[1]:(s=a(`size-4 shrink-0 transition-transform duration-150 motion-reduce:transition-none`,e),t[0]=e,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,m.jsx)(i,{"aria-hidden":!0,className:s}),t[2]=s,t[3]=c);let f;t[4]!==c||t[5]!==r?(f=(0,m.jsx)(`h2`,{children:(0,m.jsxs)(l,{className:`flex min-h-7 items-center gap-2 rounded-md text-sm font-normal text-foreground/70 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[r,c]})}),t[4]=c,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==g||t[8]!==f?(p=(0,m.jsxs)(`div`,{"data-settings-scroll-target":!0,className:`flex min-h-7 items-start justify-between gap-4 px-3 sm:px-4`,children:[f,g]}),t[7]=g,t[8]=f,t[9]=p):p=t[9];let h;t[10]===v?h=t[11]:(h=(0,m.jsx)(u,{children:(0,m.jsx)(o,{children:v})}),t[10]=v,t[11]=h);let _;t[12]!==p||t[13]!==h?(_=(0,m.jsxs)(`div`,{className:`space-y-2.5`,children:[p,h]}),t[12]=p,t[13]=h,t[14]=_):_=t[14];let y;t[15]!==b||t[16]!==_?(y=(0,m.jsx)(d,{open:b,onOpenChange:x,children:_}),t[15]=b,t[16]=_,t[17]=y):y=t[17];let S;return t[18]!==n||t[19]!==y||t[20]!==C?(S=(0,m.jsx)(`section`,{id:n,ref:C,tabIndex:-1,className:`outline-none`,children:y}),t[18]=n,t[19]=y,t[20]=C,t[21]=S):S=t[21],S}let E;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,m.jsx)(o,{divided:!1}),t[22]=E):E=t[22];let D=b&&`rotate-90`,O;t[23]===D?O=t[24]:(O=a(`size-4 shrink-0 text-muted-foreground transition-transform duration-150 motion-reduce:transition-none`,D),t[23]=D,t[24]=O);let k;t[25]===O?k=t[26]:(k=(0,m.jsx)(i,{"aria-hidden":!0,className:O}),t[25]=O,t[26]=k);let A;t[27]===r?A=t[28]:(A=(0,m.jsx)(`span`,{className:`shrink-0 text-sm font-medium`,children:r}),t[27]=r,t[28]=A);let j;t[29]===h?j=t[30]:(j=h?(0,m.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:h}):null,t[29]=h,t[30]=j);let M;t[31]!==k||t[32]!==A||t[33]!==j?(M=(0,m.jsxs)(l,{className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring rounded-md`,children:[k,A,j]}),t[31]=k,t[32]=A,t[33]=j,t[34]=M):M=t[34];let N;t[35]===g?N=t[36]:(N=g?(0,m.jsx)(`div`,{className:`flex shrink-0 items-center`,children:g}):null,t[35]=g,t[36]=N);let P;t[37]!==M||t[38]!==N?(P=(0,m.jsxs)(`div`,{className:`flex items-center gap-4 px-3 sm:px-4`,children:[M,N]}),t[37]=M,t[38]=N,t[39]=P):P=t[39];let F;t[40]===v?F=t[41]:(F=(0,m.jsx)(u,{children:(0,m.jsx)(`div`,{className:`border-t border-border/50 [&>*+*]:border-t [&>*+*]:border-border/50`,children:v})}),t[40]=v,t[41]=F);let I;t[42]!==b||t[43]!==P||t[44]!==F?(I=(0,m.jsxs)(d,{open:b,onOpenChange:x,render:E,children:[P,F]}),t[42]=b,t[43]=P,t[44]=F,t[45]=I):I=t[45];let L;return t[46]!==n||t[47]!==I||t[48]!==C?(L=(0,m.jsx)(`section`,{id:n,ref:C,tabIndex:-1,className:`outline-none`,children:I}),t[46]=n,t[47]=I,t[48]=C,t[49]=L):L=t[49],L}export{h as t};
|
|
2
|
+
//# sourceMappingURL=FoldedSettingsSection-DIlgxayr.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{Ao as n}from"./utils-
|
|
2
|
-
//# sourceMappingURL=FormContext-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{Ao as n}from"./utils-C5GGWTfe.js";var r=e(t()),i=r.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:n,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function a(){return r.useContext(i)}export{a as t};
|
|
2
|
+
//# sourceMappingURL=FormContext-DcnLkh-4.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./6OLKWJ4F-
|
|
1
|
+
import{a as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./6OLKWJ4F-YLfMA9aH.js";import{f as g,g as _,s as v,t as y,y as b}from"./77XECAW3-CV_JLSeU.js";import{t as x}from"./5B3SVYGG-CwgmePuE.js";import{r as S,t as C}from"./DKTLEL5E-DciMwFJ1.js";import{t as w}from"./5THPTBWS-Ce_hS451.js";import{PeleError as T,_ as E,m as D}from"./lazy-Bs2SFpYS.js";var O=1e4;function k(e,t,n,r,i){let a=e.packet?.[t];return typeof a==`number`&&a>=r?Math.min(a,i):n}function A(e){return new T(e,`semantic`,{type:`packet`})}function j(e,t,n){let r=Math.floor(k(t,`bitsPerRow`,32,1,4096)),i=[],a=-1,o=[],s=1;for(let t of e.blocks){let{start:e,end:n,bits:c}=t;if(e!==void 0&&n!==void 0&&n<e)throw A(`Packet block ${e} - ${n} is invalid. End must be greater than start.`);if(e??=a+1,e!==a+1)throw A(`Packet block ${e} - ${n??e} is not contiguous. It should start from ${a+1}.`);if(c===0)throw A(`Packet block ${e} is invalid. Cannot have a zero bit field.`);for(n??=e+(c??1)-1,c??=n-e+1,a=n;o.length<=r+1&&i.length<O;){let a=s*r-1;if(n<=a){o.push({start:e,end:n,bits:c,label:t.label}),n===a&&(i.push(o),o=[],s++);break}o.push({start:e,end:a,bits:a-e,label:t.label}),i.push(o),o=[],s++,e=a+1,c=n-e}}return o.length>0&&i.push(o),{type:`packet`,title:e.title||n,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,bitsPerRow:r,rows:i}}var M=[{name:`packet-beta`,pattern:`packet-beta`},o(`packet`),{name:`-`,pattern:`-`,longer:[f]},{name:`+`,pattern:`+`},{name:`:`,pattern:`:`},e,m,d,{name:`INT`,pattern:/0|[1-9][0-9]*(?!\.)/y},c,s,h,f,u,p];function N(e){let o=new a(l(e,M,`packet`),M,`packet`),s={$type:`Packet`,blocks:[]},c=()=>{if(o.kind!==-1)for(o.kind!==10&&o.fail(`a line break or the end of input`);o.kind===10;)o.i++};for(;o.kind===10;)o.i++;for(o.accept(0)||o.expect(1);o.kind!==-1;)switch(o.kind){case 10:o.i++;break;case 5:s.accDescr=t(o.take()),c();break;case 6:s.accTitle=i(o.take()),c();break;case 7:s.title=n(o.take()),c();break;case 8:case 3:{let e={$type:`PacketBlock`,label:``};o.accept(3)?e.bits=Number(o.expect(8)):(e.start=Number(o.take()),o.accept(2)&&(e.end=Number(o.expect(8)))),o.expect(4),e.label=r(o.expect(9)),s.blocks.push(e),c();break}default:o.fail(`a field, a title, or a line break`)}return s}function P(e,t,n){return C(n,r=>F(e,t,n,r))}function F(e,t,n,r){let i=n.fontSize??16,a=Math.round(i*.875),o=Math.round(i*.625),s=n.measurer??E(n.fontFamily),c=n.padding??8,l=t.packet??{},u=k(t,`rowHeight`,32,1,400),d=k(t,`bitWidth`,32,1,400),f=k(t,`paddingX`,5,0,400),p=k(t,`paddingY`,5,0,400),m=l.showBits!==!1,h=l.bitOrder===`descending`,C=e.bitsPerRow,T=e.rows;if(r){let t=Math.max(1,Math.floor(((n.maxWidth??320)-2*c)/Math.min(d,18)));C=Math.min(C,Math.max(8,2**Math.floor(Math.log2(t))));let r=e.rows[e.rows.length-1],i=r?.[r.length-1]?.end??0;Math.ceil((i+1)/C)>1e4&&(C=e.bitsPerRow),d=Math.min(d,Math.max(18,((n.maxWidth??320)-2*c)/C));let a=e=>e.bits===e.end-e.start,o=[];for(let t of e.rows)for(let n of t){let t=o[o.length-1];t&&a(t)&&a(n)&&t.label===n.label&&n.start===t.end+1&&n.start%e.bitsPerRow===0?(t.end=n.end,t.bits=t.end-t.start):o.push({...n})}T=[];for(let e of o)for(let t=e.start;t<=e.end;){let n=Math.min(e.end,(Math.floor(t/C)+1)*C-1),r=Math.floor(t/C);(T[r]??(T[r]=[])).push({...e,start:t,end:n}),t=n+1}}let O=new Map;if(r)for(let e of T)for(let t of e){let e=Math.max(1,(t.end-t.start+1)*d-Math.min(f,d-1)-6),n=x(D(t.label).trim(),s,a,e);O.set(t,n)}let A=m?o+4:0,j=T.map(e=>{let t=u;if(r)for(let n of e)t=Math.max(t,O.get(n).height+10);return t}),M=[],N=0;for(let e of j)M.push(N),N+=A+e+p;T.length&&(N-=p);let P=Math.min(f,d-1),F=T.length>0?C*d-P:0,I=v(e.title,!1,s,i,r?S(n):4e3,1),L=I.height>0?I.height+(N>0?12:0):0,R=new Map,z=(e,t)=>{let n=R.get(e);return n||R.set(e,n=new Map),n.has(t)||n.set(t,w(D(e).trim(),t,a,Math.round(i*.5),s)),n.get(t)},B=c+Math.max(0,(I.width-F)/2),V=``,H=``;T.forEach((e,t)=>{let n=c+M[t]+A,i=j[t];for(let t of e){let e=t.end-t.start+1,o=t.start%C,s=B+(h?C-o-e:o)*d,c=e*d-P,l=r?void 0:z(t.label,c-6);if(V+=`<g class="pele-node" data-id="${t.start}-${t.end}"><rect x="${g(s)}" y="${g(n)}" width="${g(c)}" height="${g(i)}" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/>`+(r?y(O.get(t),s+c/2,n+i/2,``):l&&l.size<=i?`<text x="${g(s+c/2)}" y="${g(n+i/2+l.size*.35)}"${l.size===a?``:` font-size="${g(l.size)}"`}>${b(l.text)}</text>`:``)+`</g>`,!m)continue;let u=h?t.end:t.start,f=h?t.start:t.end;H+=e===1?`<text x="${g(s+c/2)}" y="${g(n-4)}" text-anchor="middle">${u}</text>`:`<text x="${g(s)}" y="${g(n-4)}">${u}</text><text x="${g(s+c)}" y="${g(n-4)}" text-anchor="end">${f}</text>`}});let U=Math.ceil(Math.max(F,I.width)+2*c),W=Math.ceil(N+L+2*c),G=(V?`<g class="pele-packet-fields" font-size="${a}" text-anchor="middle">${V}</g>`:``)+(H?`<g class="pele-packet-bits" font-size="${o}" fill="var(--_m)">${H}</g>`:``)+y(I,U/2,W-c-I.height/2,` class="pele-title" font-weight="var(--_tw)"`);return{svg:_(`packet`,U,W,i,n,e,G),width:U,height:W,links:[]}}var I={type:`packet`,parse:(e,t,n)=>j(N(e),t,n),render:P};export{I as packet};
|
|
3
|
-
//# sourceMappingURL=HDGCDEEZ-
|
|
3
|
+
//# sourceMappingURL=HDGCDEEZ-Bn1jLSys.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,f as r,g as i,h as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./6OLKWJ4F-
|
|
1
|
+
import{a as e,c as t,d as n,f as r,g as i,h as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./6OLKWJ4F-YLfMA9aH.js";import{f as h,g,m as _,r as v,s as y,t as b}from"./77XECAW3-CV_JLSeU.js";import{a as x,i as S,s as C}from"./N3JZAHOW-CV9TIlCo.js";import{o as w,r as ee}from"./DKTLEL5E-DciMwFJ1.js";import{PeleError as T,_ as te}from"./lazy-Bs2SFpYS.js";function E(e){throw new T(e,`semantic`,{type:`architecture`})}var D=class{type=`architecture`;title;accTitle;accDescr;nodes=new Map;groups=new Map;edges=[];layoutHints=[];registered=new Map;register(e,t,n){this.registered.has(t)&&E(`The ${e} id [${t}] is already in use by another ${this.registered.get(t)}`),n!==void 0&&(t===n&&E(`The ${e} [${t}] cannot be placed within itself`),this.registered.has(n)||E(`The ${e} [${t}]'s parent does not exist. Please make sure the parent is created before this ${e}`),this.registered.get(n)===`node`&&E(`The ${e} [${t}]'s parent is not a group`)),this.registered.set(t,e===`group`?`group`:`node`)}addService({id:e,icon:t,iconText:n,title:r,in:i}){this.register(`service`,e,i),this.nodes.set(e,{id:e,type:`service`,icon:t,iconText:n,title:r,in:i})}addJunction({id:e,in:t}){this.register(`junction`,e,t),this.nodes.set(e,{id:e,type:`junction`,in:t})}addGroup({id:e,icon:t,title:n,in:r}){this.register(`group`,e,r),this.groups.set(e,{id:e,icon:t,title:n,in:r})}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:c}){let l=[[`left`,e,o],[`right`,t,s]];for(let[e,t]of l)this.registered.has(t)||E(`The ${e}-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);for(let[e,t]of l)this.nodes.has(t)||E(`The ${e}-hand id [${t}] is a group. Add {group} to a service inside it instead.`);let u=this.nodes.get(e).in;if(u!==void 0&&u===this.nodes.get(t).in)for(let[e,t,n]of l)n&&E(`The ${e}-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);this.edges.push({lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:c})}addLayoutHint(e){e.members.length<2&&E(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;for(let n of e.members)this.registered.get(n)!==`node`&&E(`align ${e.direction} references [${n}], which is not a service or junction`),t.has(n)&&E(`align ${e.direction} lists [${n}] more than once`),t.add(n);this.layoutHints.push(e)}};function O(e,t){e.accDescr&&(t.accDescr=e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`)),e.accTitle&&(t.accTitle=e.accTitle.replace(/^\s+/g,``)),e.title&&(t.title=e.title);for(let n of e.groups)t.addGroup(n);for(let n of e.services)t.addService(n);for(let n of e.junctions)t.addJunction(n);for(let n of e.edges)t.addEdge(n);for(let n of e.alignments)t.addLayoutHint({direction:n.direction,members:[...n.members]})}var k={name:`ID`,pattern:/[\w]([-\w]*\w)?/y};function A(e){return{name:e,pattern:e,longer:[k]}}var j=[A(`architecture-beta`),A(`junction`),A(`service`),A(`column`),A(`group`),A(`align`),A(`row`),{name:`--`,pattern:`--`,longer:[d]},A(`in`),{name:`:`,pattern:`:`},{name:`-`,pattern:`-`,longer:[d]},{name:`ARROW_DIRECTION`,pattern:/L|R|T|B/y},{name:`ARROW_GROUP`,pattern:/\{group\}/y},{name:`ARROW_INTO`,pattern:/<|>/y},e,p,u,s,k,o,m,d,l,f,{name:`ARCH_ICON`,pattern:/\([\w-:]+\)/y},{name:`ARCH_TITLE`,pattern:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/y}];function M(e){let t=e.slice(1,-1).trim();return(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))&&(t=t.slice(1,-1).replace(/\\"/g,`"`).replace(/\\'/g,`'`)),t.trim()}function N(e){let o=new a(c(e,j,`architecture`),j,`architecture`),s={$type:`Architecture`,groups:[],services:[],junctions:[],edges:[],alignments:[]},l=e=>o.kinds[o.i]===e,u=()=>{if(o.kind!==-1)for(o.kind!==19&&o.fail(`a line break or the end of input`);o.kind===19;)o.i++};for(;o.kind===19;)o.i++;for(o.expect(0);o.kind!==-1;){switch(o.kind){case 19:o.i++;continue;case 14:s.accDescr=t(o.take());break;case 15:s.accTitle=i(o.take());break;case 16:s.title=n(o.take());break;case 4:{o.i++;let e={$type:`Group`,id:o.expect(18)};l(24)&&(e.icon=o.take().slice(1,-1)),l(25)&&(e.title=M(o.take())),o.accept(8)&&(e.in=o.expect(18)),s.groups.push(e);break}case 2:{o.i++;let e={$type:`Service`,id:o.expect(18)};l(17)?e.iconText=r(o.take()):l(24)&&(e.icon=o.take().slice(1,-1)),l(25)&&(e.title=M(o.take())),o.accept(8)&&(e.in=o.expect(18)),s.services.push(e);break}case 1:{o.i++;let e={$type:`Junction`,id:o.expect(18)};o.accept(8)&&(e.in=o.expect(18)),s.junctions.push(e);break}case 18:{let e=o.take(),t=o.accept(12);o.expect(9);let n=o.expect(11),r=o.accept(13),i;o.accept(7)||(l(10)||o.fail(`'--' or '-'`),o.i++,i=M(o.expect(25)),o.expect(10));let a=o.accept(13),c=o.expect(11);o.expect(9);let u=o.expect(18),d=o.accept(12);s.edges.push({$type:`Edge`,lhsId:e,lhsGroup:t,lhsDir:n,lhsInto:r,title:i,rhsInto:a,rhsDir:c,rhsId:u,rhsGroup:d});break}case 5:{o.i++,!l(6)&&!l(3)&&o.fail(`'row' or 'column'`);let e=o.take(),t=[o.expect(18),o.expect(18)];for(;l(18);)t.push(o.take());s.alignments.push({$type:`Alignment`,direction:e,members:t});break}default:o.fail(`a group, a service, a junction, an edge, an alignment, a title, or a line break`)}u()}return s}var P=new Map([[`database`,`M4 6a8 3 0 1 0 16 0a8 3 0 1 0-16 0M4 6v12a8 3 0 0 0 16 0V6M4 12a8 3 0 0 0 16 0`],[`server`,`M3 4h18v7H3zM3 13h18v7H3zM7 7.5h.01M7 16.5h.01M11 7.5h6M11 16.5h6`],[`disk`,`M5 3h14v18H5zM12 6.5a4 4 0 1 0 0 8a4 4 0 1 0 0-8M12 10.5h.01M8 18h3`],[`internet`,`M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0M3 12h18M12 3a13 13 0 0 0 0 18M12 3a13 13 0 0 1 0 18`],[`cloud`,`M7 18a4 4 0 0 1-.5-7.97A6 6 0 0 1 18 9.5a4.25 4.25 0 0 1-.5 8.5z`]]);function F(e){let t=P.get(e);return t===void 0?``:`<path d="${t}" stroke="var(--_fg)" stroke-width="1.5"/>`}var I=[-1,1,0,0],L=[0,0,-1,1];function ne(e){return e===`L`?0:e===`R`?1:e===`T`?2:3}var R=64,z=2**25,B=2**26;function re(e,t,n,r){let i=e.length,a=t.length,o=a,s=new Map,c=new Map,l=new Int32Array(i+a).fill(o),u=new Int32Array(a+1),d=[];for(let e=0;e<=a;e++)d.push([]);t.forEach((e,t)=>{c.set(e.id,t);let n=e.in===void 0?void 0:c.get(e.in);n!==void 0&&n!==t?(l[i+t]=n,u[t]=u[n]+1):u[t]=1}),e.forEach((e,t)=>{s.set(e.id,t);let n=e.in===void 0?void 0:c.get(e.in);n!==void 0&&(l[t]=n),d[l[t]].push(t)});for(let e=0;e<a;e++)d[l[i+e]].push(i+e);let f=[],p=[],m=[],h=[],g=[],_=[],v=Array(i+a),y=Array(i+a),b=(e,t,n,r,a)=>{if(e===t)return;let o=e,s=t,c=l[e],d=l[t];for(;c!==d;)u[c]>=u[d]?(o=i+c,c=l[o]):(s=i+d,d=l[s]);let v=f.length;f.push(e),p.push(t),m.push(n),h.push(r),g.push(o),_.push(s),(a[o]??=[]).push(v),(a[s]??=[]).push(v)};for(let e of r){let t=e.direction===`row`;for(let n=1;n<e.members.length;n++){let r=s.get(e.members[n-1]),i=s.get(e.members[n]);r!==void 0&&i!==void 0&&b(r,i,t?1:3,t?0:2,v)}}for(let e of[!1,!0])for(let t of n){if(t.lhsDir===t.rhsDir!==e)continue;let n=s.get(t.lhsId),r=s.get(t.rhsId);n!==void 0&&r!==void 0&&b(n,r,ne(t.lhsDir),ne(t.rhsDir),y)}let x=new Int32Array(i+a),S=new Int32Array(i+a),C=new Int32Array(i+a).fill(1),w=new Int32Array(i+a).fill(1),ee=new Uint8Array(i+a),T=[],te=new Map,E=[],D=new Map,O=0,k=0,A=0,j=(e,t)=>{k=0,A=0;for(let n=e;n!==t;n=i+l[n])k+=x[n],A+=S[n]},M=(e,t,n)=>{if(x[e]=t,S[e]=n,ee[e]=1,T.push(e),C[e]*w[e]>R)E.push(e);else for(let r=n;r<n+w[e];r++)for(let n=t;n<t+C[e];n++)te.set((n+z)*B+r+z,e)},N=(e,t,n,r,i)=>x[e]<t+r&&t<x[e]+C[e]&&S[e]<n+i&&n<S[e]+w[e],P=(e,t,n,r)=>{if(n*r>R){for(let i=O;i<T.length;i++)if(N(T[i],e,t,n,r))return T[i];return-1}for(let i=t;i<t+r;i++)for(let t=e;t<e+n;t++){let e=te.get((t+z)*B+i+z);if(e!==void 0)return e}for(let i of E)if(N(i,e,t,n,r))return i;return-1},F=(e,t,n,r,i,a)=>{let o=`${e},${t},${n},${r},${i},${a}`,s=D.get(o)??0;for(;;){let o=P(e+s*i,t+s*a,n,r);if(o<0)break;s=i>0?x[o]+C[o]-e:i<0?e+n-x[o]:a>0?S[o]+w[o]-t:t+r-S[o]}return D.set(o,s),s},re=(e,t)=>{let n=g[t]===e,r=n?_[t]:g[t];if(ee[r])return;let i=n?m[t]:h[t],a=n?h[t]:m[t];j(n?f[t]:p[t],e);let o=k,s=A;j(n?p[t]:f[t],r);let c=I[i],l=L[i],u=0,d=0,v=I[i]+I[a]===0&&L[i]+L[a]===0;i===a?(c=+(I[i]===0),l=1-c):v||(u=-I[a],d=-L[a]);let b,T;if(c===0?(T=l>0?S[e]+w[e]:S[e]-w[r],b=x[e]+o+u-k):(b=c>0?x[e]+C[e]:x[e]-C[r],T=S[e]+s+d-A),v){let e=y[r];if(e!==void 0&&e.length>1){let t=[];for(let n of e){let e=_[n]===r,o=e?g[n]:_[n];if(!ee[o]||(e?m[n]:h[n])!==i||(e?h[n]:m[n])!==a)continue;j(e?f[n]:p[n],o);let s=c===0?x[o]+k:S[o]+A;j(e?p[n]:f[n],r),t.push(s-(c===0?k:A))}t.length>1&&(t.sort((e,t)=>e-t),c===0?b=t[t.length-1>>1]:T=t[t.length-1>>1])}let t=+(c===0),n=1-t,o=F(b,T,C[r],w[r],t,n),s=o===0?0:F(b,T,C[r],w[r],-t,-n),l=o<=s?o:-s;b+=t*l,T+=n*l}else{let e=F(b,T,C[r],w[r],c,l);b+=c*e,T+=l*e}M(r,b,T)},V=e=>{let t=d[e];if(t.length===0)return;T.length=0;let n=[];for(let e of t){if(ee[e])continue;O=T.length,n.push(O),te.clear(),E.length=0,D.clear(),M(e,0,0);let t=O,r=O,i=0;for(;;){if(t<T.length){let e=T[t++],n=v[e];if(n!==void 0)for(let t of n)re(e,t);continue}if(r>=T.length)break;let e=y[T[r]];e===void 0||i>=e.length?(r++,i=0):re(T[r],e[i++])}}n.push(T.length);let r=n.length-1,o=Array(r),s=Array(r),c=Array(r),l=Array(r),u=0,f=0;for(let e=0;e<r;e++){let t=1/0,r=1/0,i=-1/0,a=-1/0;for(let o=n[e];o<n[e+1];o++){let e=T[o];t=Math.min(t,x[e]),r=Math.min(r,S[e]),i=Math.max(i,x[e]+C[e]),a=Math.max(a,S[e]+w[e])}o[e]=t,s[e]=r,c[e]=i-t,l[e]=a-r,u+=c[e]*l[e],f=Math.max(f,c[e])}let p=Math.max(f,Math.ceil(Math.sqrt(u*2))),m=0,h=0,g=0,_=0;for(let e=0;e<r;e++){m>0&&m+c[e]>p&&(h+=g,m=0,g=0);for(let t=n[e];t<n[e+1];t++)x[T[t]]+=m-o[e],S[T[t]]+=h-s[e];m+=c[e],g=Math.max(g,l[e]),_=Math.max(_,m)}e<a&&(C[i+e]=_,w[i+e]=h+g)};for(let e=a-1;e>=0;e--)V(e);V(o);let H=new Int32Array(a),U=new Int32Array(a),ie=new Int32Array(a),ae=new Uint8Array(a);for(let e=0;e<a;e++){let t=l[i+e];ie[e]=t===o?-1:t,H[e]=x[i+e]+(t===o?0:H[t]),U[e]=S[i+e]+(t===o?0:U[t]),d[e].length===0&&(ae[e]=1)}let oe=new Int32Array(i),se=new Int32Array(i),ce=new Int32Array(i);for(let e=0;e<i;e++){let t=l[e];ce[e]=t===o?-1:t,oe[e]=x[e]+(t===o?0:H[t]),se[e]=S[e]+(t===o?0:U[t])}return{col:oe,row:se,groupCol:H,groupRow:U,groupCols:C.slice(i),groupRows:w.slice(i),groupParent:ie,groupEmpty:ae,nodeParent:ce}}var V=12,H=6,U=4,ie=3,ae=[-1,1,0,0],oe=[0,0,-1,1];function se(e,t,n,r,i){let a=e.architecture,o=typeof a==`object`&&a&&!Array.isArray(a)?a[t]:void 0;return typeof o==`number`&&Number.isFinite(o)?Math.min(i,Math.max(r,o)):n}function ce(e){let t=new Map;for(let n of e.sort((e,t)=>e-t))t.has(n)||t.set(n,t.size);return t}function le(e,t,n,r,i){return`<svg class="pele-icon" data-icon="${v(e)}" x="${h(t)}" y="${h(n)}" width="${h(r)}" height="${h(r)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${i?.(e)??F(e)}</svg>`}function ue(e,t,n,r){let i=e.lines.length>n;if(!i&&e.width<=t)return e;let a=r.width(`…`,e.size,0),o=[],s=[],c=0;for(let l=0;l<Math.min(n,e.lines.length);l++){let u=e.lines[l].map(e=>({...e})),d=e.widths[l];if(d>t||i&&l===n-1)for(;;){let n=u[u.length-1];if(n===void 0){u.push({text:`…`,style:0,width:a}),d=a;break}let i=d-n.width;if(n.icon===void 0&&i+a<t){let o=0,s=n.text.length;for(;o<s;){let c=o+s+1>>1;i+r.width(n.text.slice(0,c),e.size,n.style)+a<=t?o=c:s=c-1}let c=o>0?n.text.charCodeAt(o-1):0;c>=55296&&c<=56319&&o--,n.text=n.text.slice(0,o).trimEnd()+`…`,n.width=r.width(n.text,e.size,n.style),d=i+n.width;break}u.pop(),d=i}o.push(u),s.push(d),c=Math.max(c,d)}return{...e,lines:o,widths:s,width:c,height:o.length*e.lineHeight}}function de(e,t){let{x:n,y:r,dx:i,dy:a}=e,{x:o,y:s,dx:c,dy:l}=t,u=n+i*V,d=r+a*V,f=o+c*V,p=s+l*V;if(i*c+a*l===0){let e=i===0?n:o,t=i===0?s:r;return(e-n)*i+(t-r)*a>0&&(e-o)*c+(t-s)*l>0?[n,r,e,t,o,s]:i===0?[n,r,u,d,f,d,f,p,o,s]:[n,r,u,d,u,p,f,p,o,s]}let m=i!==0,h=m?s-r:o-n;if(i===-c&&a===-l){if((o-n)*i+(s-r)*a>0){if(Math.abs(h)<.5)return[n,r,o,s];if(m){let a=i>0?e.x1:t.x1,c=i>0?t.x0:e.x0,l=a<c?(a+c)/2:(n+o)/2;return[n,r,l,r,l,s,o,s]}let c=a>0?e.y1:t.y1,l=a>0?t.y0:e.y0,u=c<l?(c+l)/2:(r+s)/2;return[n,r,n,u,o,u,o,s]}}else if(Math.abs(h)>=1){if(m){let e=i>0?Math.max(n,o)+V:Math.min(n,o)-V;return[n,r,e,r,e,s,o,s]}let e=a>0?Math.max(r,s)+V:Math.min(r,s)-V;return[n,r,n,e,o,e,o,s]}if(m){let i=e.y1+V<=t.y0?(e.y1+t.y0)/2:t.y1+V<=e.y0?(t.y1+e.y0)/2:Math.max(e.y1,t.y1)+V;return[n,r,u,r,u,i,f,i,f,s,o,s]}let g=e.x1+V<=t.x0?(e.x1+t.x0)/2:t.x1+V<=e.x0?(t.x1+e.x0)/2:Math.max(e.x1,t.x1)+V;return[n,r,n,d,g,d,g,p,o,p,o,s]}function fe(e){let t=[e[0],e[1]];for(let n=2;n<e.length;n+=2){let r=e[n],i=e[n+1],a=t.length,o=Math.abs(r-t[a-2])<.01,s=Math.abs(i-t[a-1])<.01;o&&s||(a>=4&&(o&&Math.abs(t[a-4]-t[a-2])<.01||s&&Math.abs(t[a-3]-t[a-1])<.01)?(t[a-2]=r,t[a-1]=i):t.push(r,i))}return t}function pe(e,t,n){let r=e.length/2,i=Array(r),a=Array(r);for(let t=0;t<r;t++)i[t]=e[t*2],a[t]=e[t*2+1];let o=(e,t,n)=>{let r=Math.hypot(i[t]-i[e],a[t]-a[e]),o=Math.min(n,Math.max(0,r-1));r>0&&o>0&&(i[e]+=(i[t]-i[e])/r*o,a[e]+=(a[t]-a[e])/r*o)};o(0,1,t),o(r-1,r-2,n);let s=`M${h(i[0])},${h(a[0])}`;for(let e=1;e<r-1;e++){let t=Math.hypot(i[e]-i[e-1],a[e]-a[e-1]),n=Math.hypot(i[e+1]-i[e],a[e+1]-a[e]),r=Math.min(H,t/2,n/2);if(r<.5){s+=`L${h(i[e])},${h(a[e])}`;continue}let o=i[e]-(i[e]-i[e-1])/t*r,c=a[e]-(a[e]-a[e-1])/t*r,l=i[e]+(i[e+1]-i[e])/n*r,u=a[e]+(a[e+1]-a[e])/n*r;s+=`L${h(o)},${h(c)}Q${h(i[e])},${h(a[e])} ${h(l)},${h(u)}`}return s+`L${h(i[r-1])},${h(a[r-1])}`}function W(e,t,n){return w(n,r=>G(e,t,n,r))}function G(e,t,n,r){let i=se(t,`iconSize`,48,8,512),a=se(t,`fontSize`,n.fontSize??16,4,128),o=Math.min(se(t,`padding`,20,0,256),r?12:1/0),s=Math.round(a*.875),c=n.measurer??te(n.fontFamily),l=n.padding??8,u=n.icons,d=i/2,f=[...e.nodes.values()],p=[...e.groups.values()],m=f.length,w=p.length,T=re(f,p,e.edges,e.layoutHints),E=new Map;f.forEach((e,t)=>E.set(e.id,t));let D=Array(m),O=new Float64Array(m),k=new Float64Array(m),A=r?Math.max(i,64):Math.max(i*2.25,96);for(let e=0;e<m;e++){let t=f[e],n=y(t.type===`service`?t.title:void 0,!0,c,a,A);D[e]=n,O[e]=Math.max(i,2*Math.ceil(n.width/2)),k[e]=i+(n.height>0?U+n.height:0)}let j=[],M=[];for(let e=0;e<m;e++)j.push(T.col[e]),M.push(T.row[e]);for(let e=0;e<w;e++)T.groupEmpty[e]&&(j.push(T.groupCol[e]),M.push(T.groupRow[e]));let N=ce(j),P=ce(M),F=N.size,I=P.size,L=new Float64Array(F),R=new Float64Array(I),z=r?Math.max(24,2*V):Math.max(40,Math.round(i*.75)),B=new Float64Array(F).fill(z),H=new Float64Array(I).fill(z),W=new Int32Array(m),G=new Int32Array(m);for(let e=0;e<m;e++){let t=W[e]=N.get(T.col[e]),n=G[e]=P.get(T.row[e]);L[t]=Math.max(L[t],O[e]),R[n]=Math.max(R[n],k[e])}for(let e=0;e<w;e++){if(!T.groupEmpty[e])continue;let t=N.get(T.groupCol[e]),n=P.get(T.groupRow[e]);L[t]=Math.max(L[t],i),R[n]=Math.max(R[n],d)}let me=e.edges.length,he=Array(me),ge=new Int32Array(me*2);for(let t=0;t<me;t++){let n=e.edges[t],r=ge[t*2]=E.get(n.lhsId)??-1,i=ge[t*2+1]=E.get(n.rhsId)??-1,a=y(n.title,!0,c,s,160);if(he[t]=a,!(a.width===0||r<0||i<0)){if(W[r]!==W[i]){let e=Math.min(W[r],W[i]);B[e]=Math.max(B[e],Math.ceil(a.width)+28)}else if(L[W[r]]=Math.max(L[W[r]],2*Math.ceil(a.width/2)+8),G[r]!==G[i]){let e=Math.min(G[r],G[i]);H[e]=Math.max(H[e],Math.ceil(a.height)+24)}}}let _e=Array(w),K=new Int32Array(w),q=new Int32Array(w),J=new Int32Array(w),Y=new Int32Array(w),ve=new Float64Array(w),ye=new Float64Array(w),be=new Float64Array(w),xe=new Float64Array(w),X=new Float64Array(w),Se=new Float64Array(w),Ce=new Float64Array(F),we=new Float64Array(F),Te=new Float64Array(I),Ee=new Float64Array(I),De=Math.round(a*1.25);for(let e=0;e<w;e++){K[e]=N.get(T.groupCol[e]),q[e]=N.get(T.groupCol[e]+T.groupCols[e]-1),J[e]=P.get(T.groupRow[e]),Y[e]=P.get(T.groupRow[e]+T.groupRows[e]-1);let t=y(p[e].title,!0,c,a,r?Math.max(80,ee(n)/2):320);_e[e]=t;let i=p[e].icon?De:0;X[e]=t.width+i+(t.width>0&&i>0?6:0),Se[e]=Math.max(t.height,i)}for(let e=w-1;e>=0;e--){let t=o+ve[e],n=o+ye[e],r=(Se[e]>0?Math.max(o,Se[e]+12):o)+be[e],i=o+xe[e];if(X[e]>0){let r=t+n;for(let t=K[e];t<=q[e];t++)r+=L[t]+(t<q[e]?we[t]+B[t]+Ce[t+1]:0);X[e]+20>r&&(n+=Math.ceil(X[e]+20-r))}ve[e]=t,ye[e]=n,be[e]=r,xe[e]=i,Ce[K[e]]=Math.max(Ce[K[e]],t),we[q[e]]=Math.max(we[q[e]],n),Te[J[e]]=Math.max(Te[J[e]],r),Ee[Y[e]]=Math.max(Ee[Y[e]],i);let a=T.groupParent[e];a<0||(K[a]===K[e]&&(ve[a]=Math.max(ve[a],t)),q[a]===q[e]&&(ye[a]=Math.max(ye[a],n)),J[a]===J[e]&&(be[a]=Math.max(be[a],r)),Y[a]===Y[e]&&(xe[a]=Math.max(xe[a],i)))}let Oe=new Float64Array(F),Z=new Float64Array(I),ke=0;for(let e=0;e<F;e++)Oe[e]=ke+Ce[e],ke=Oe[e]+L[e]+we[e]+(e<F-1?B[e]:0);let Ae=0;for(let e=0;e<I;e++)Z[e]=Ae+Te[e],Ae=Z[e]+R[e]+Ee[e]+(e<I-1?H[e]:0);let Q=0,je=0,Me=ke,Ne=Ae,Pe=e=>Oe[K[e]]-ve[e],Fe=e=>Oe[q[e]]+L[q[e]]+ye[e],Ie=e=>Z[J[e]]-be[e],Le=e=>Z[Y[e]]+R[Y[e]]+xe[e],Re=e=>Oe[W[e]]+L[W[e]]/2,ze=(e,t,n)=>{let r=ae[t],i=oe[t],a=Re(e),o=Z[G[e]],s={x:a,y:o+d,dx:r,dy:i,x0:a-O[e]/2,y0:o,x1:a+O[e]/2,y1:o+k[e],gap:0,wire:!1};f[e].type===`junction`?(s.x0=s.x1=a,s.y0=s.y1=s.y,s.gap=ie):r===0?s.y=i<0?o:o+k[e]+(D[e].height>0?2:0):s.x=a+r*d;let c=n?T.nodeParent[e]:-1;return c>=0&&(s.x0=Pe(c),s.x1=Fe(c),s.y0=Ie(c),s.y1=Le(c),s.gap=0,s.wire=f[e].type===`junction`,r===0?s.y=i<0?s.y0:s.y1:s.x=r<0?s.x0:s.x1),s},Be=``,Ve=``,$=[],He=x(`arrow_point`);for(let t=0;t<me;t++){let n=e.edges[t],r=ge[t*2],i=ge[t*2+1];if(r<0||i<0)continue;let a=ze(r,ne(n.lhsDir),n.lhsGroup),o=ze(i,ne(n.rhsDir),n.rhsGroup);a.x===o.x&&a.y===o.y&&a.dx===o.dx&&(a.x-=8*Math.abs(a.dy),a.y-=8*Math.abs(a.dx),o.x+=8*Math.abs(a.dy),o.y+=8*Math.abs(a.dx));let s=de(a,o);a.wire&&s.unshift(Re(r),Z[G[r]]+d),o.wire&&s.push(Re(i),Z[G[i]]+d);let c=fe(s);if(c.length<4)continue;let l=v(`${n.lhsId}-${n.rhsId}`);Be+=`<g class="pele-edge" data-id="${l}"><path d="${pe(c,n.lhsInto&&!a.wire?He+a.gap:0,n.rhsInto&&!o.wire?He+o.gap:0)}"/>`+(n.lhsInto?C(`arrow_point`,a.x+a.dx*a.gap,a.y+a.dy*a.gap,-a.dx,-a.dy,`var(--_l)`):``)+(n.rhsInto?C(`arrow_point`,o.x+o.dx*o.gap,o.y+o.dy*o.gap,-o.dx,-o.dy,`var(--_l)`):``)+`</g>`;let f=-1,p=-1,m=-1,h=-1,g=he[t];for(let e=0;e<c.length;e+=2)Q=Math.min(Q,c[e]-4),Me=Math.max(Me,c[e]+4),je=Math.min(je,c[e+1]-4),Ne=Math.max(Ne,c[e+1]+4);for(let e=0;e+3<c.length;e+=2){let t=Math.abs(c[e+1]-c[e+3])<.01,n=Math.abs(c[e]-c[e+2])+Math.abs(c[e+1]-c[e+3]);t||$.push(c[e],Math.min(c[e+1],c[e+3]),Math.max(c[e+1],c[e+3])),n>p&&(f=e,p=n),t&&n>h&&(m=e,h=n)}if(g.width>0){let e=h>=g.width+8?m:f,t=(c[e]+c[e+2])/2,r=(c[e+1]+c[e+3])/2,i=g.width+8,s=Math.abs(c[e]-c[e+2])<.01;for(let e of[a,o])t+i/2<=e.x0||t-i/2>=e.x1||r+g.height/2<=e.y0||r-g.height/2>=e.y1||(s?t=t>=(e.x0+e.x1)/2?e.x1+i/2+4:e.x0-i/2-4:r=r>=(e.y0+e.y1)/2?e.y1+g.height/2+4:e.y0-g.height/2-4);Q=Math.min(Q,t-i/2),Me=Math.max(Me,t+i/2),je=Math.min(je,r-g.height/2),Ne=Math.max(Ne,r+g.height/2),Ve+=S(`${n.lhsId}-${n.rhsId}`,g,t,r,``,u)}}let Ue=``;for(let e=0;e<w;e++){let t=p[e],n=Pe(e),r=Ie(e),i=Fe(e)-n,a=_e[e],o=``;if(X[e]>0){let s=r+Se[e]+12,c=[];for(let e=0;e<$.length;e+=3)$[e+1]<s&&$[e+2]>r&&$[e]>n&&$[e]<n+i&&c.push($[e]);c.sort((e,t)=>e-t),c.push(n+i-4);let l=n+10;for(let t of c){if(t-6-l>=X[e])break;l=Math.max(l,t+6)}l+X[e]>n+i-4&&(l=n+10);let d=r+6+Se[e]/2,f=l;t.icon&&(o+=le(t.icon,l,d-De/2,De,u),f+=De+6),o+=b(a,f+a.width/2,d,` class="pele-cluster-label" fill="var(--_m)"`,u)}Ue+=`<g class="pele-cluster" data-id="${v(t.id)}"><rect x="${h(n)}" y="${h(r)}" width="${h(i)}" height="${h(Le(e)-r)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${_}/>`+o+`</g>`}let We=``,Ge=i*.5,Ke=Math.max(6,Math.round(a*.75));for(let e=0;e<m;e++){let t=f[e],n=`data-id="${v(t.id)}" transform="translate(${h(Re(e))},${h(Z[G[e]])})"`;if(t.type===`junction`){We+=`<g class="pele-node pele-junction" ${n}><circle cy="${h(d)}" r="${ie}" fill="var(--_l)"/></g>`;continue}let r=``;if(t.icon)r=le(t.icon,-Ge/2,(i-Ge)/2,Ge,u);else if(t.iconText){let e=y(t.iconText,!1,c,Ke,i-8),n=Math.max(1,Math.floor((i-4)/(e.lineHeight||1)));r=b(ue(e,i-8,n,c),0,d,` class="pele-icon-text" font-size="${Ke}"`,u)}We+=`<g class="pele-node pele-service" ${n}><rect x="${h(-d)}" width="${h(i)}" height="${h(i)}" fill="var(--_s)" stroke="var(--_b)"${_}/>`+r+b(D[e],0,i+U+D[e].height/2,` class="pele-label"`,u)+`</g>`}let qe=y(e.title,!1,c,a,r?ee(n):4e3,1),Je=qe.height>0?qe.height+12:0,Ye=Math.ceil(Math.max(Me-Q,qe.width)+2*l),Xe=Math.ceil(Ne-je+Je+2*l),Ze=Math.round((Ye-(Me-Q))/2-Q),Qe=Math.round(l+Je-je),$e=(Ue?`<g class="pele-clusters">${Ue}</g>`:``)+(Be?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round" stroke-linejoin="round">${Be}</g>`:``)+(Ve?`<g class="pele-edge-labels" font-size="${s}">${Ve}</g>`:``)+(We?`<g class="pele-nodes">${We}</g>`:``);return{svg:g(`architecture`,Ye,Xe,a,n,e,b(qe,Ye/2,l+qe.height/2,` class="pele-title" font-weight="var(--_tw)"`)+($e?`<g transform="translate(${Ze},${Qe})">${$e}</g>`:``)),width:Ye,height:Xe,links:[]}}var me={type:`architecture`,parse(e,t,n){let r=new D;return n&&(r.title=n),O(N(e),r),r},render:W};export{me as architecture};
|
|
3
|
-
//# sourceMappingURL=HSJLKHB7-
|
|
3
|
+
//# sourceMappingURL=HSJLKHB7-CHpiqxlA.js.map
|