@seanhogg/builderforce-agents 2026.10.9 → 2026.10.11
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/{acp-cli-DcKpPsJa.js → acp-cli-C23mmrQt.js} +1 -1
- package/dist/{acp-cli-BxH-eUDl.js → acp-cli-D6F-D5JB.js} +1 -1
- package/dist/{agent-cXF-aL0g.js → agent-B-2r1Lr_.js} +1 -1
- package/dist/{agent-wJmvciTM.js → agent-BI9qSnSp.js} +1 -1
- package/dist/{agentbot-cli-Cub3Abbt.js → agentbot-cli-Cyrhr5jX.js} +1 -1
- package/dist/{agentbot-cli-CTRvEfBp.js → agentbot-cli-sC55m-XS.js} +1 -1
- package/dist/{agents-Cr7WO73I.js → agents-CMThT_Bj.js} +1 -1
- package/dist/agents-Chz9nfm2.js +1 -0
- package/dist/{api-key-rotation-CHBjUwUJ.js → api-key-rotation-CyCi-UqR.js} +1 -1
- package/dist/{audio-preflight-CWFuqbao.js → audio-preflight-B411b2-y.js} +1 -1
- package/dist/{audio-preflight-F2e3Y4CW.js → audio-preflight-Cs4eUjQk.js} +1 -1
- package/dist/{audit-DGnEhZYe.js → audit-B-USV03V.js} +1 -1
- package/dist/{audit-DBjjjW93.js → audit-SKNPS-K2.js} +1 -1
- package/dist/auth-choice-CChsMy-F.js +1 -0
- package/dist/{auth-choice-9gZuOvPS.js → auth-choice-CCib_yVL.js} +1 -1
- package/dist/auth-choice-DSnpkrMc.js +1 -0
- package/dist/{auth-choice-BoZFVmEa.js → auth-choice-DzBqqq7i.js} +1 -1
- package/dist/auth-choice.apply-6f3Jb_lS.js +1 -0
- package/dist/{auth-choice.apply-CcatXiNo.js → auth-choice.apply-BgOXoS8X.js} +1 -1
- package/dist/{auth-choice.apply-BHLQeym9.js → auth-choice.apply-DBuvopiF.js} +1 -1
- package/dist/auth-choice.apply-DeXnLwVS.js +1 -0
- package/dist/auth-choice.apply.transformers-CZDuBaOr.js +1 -0
- package/dist/{auth-choice.apply.transformers-CIn3fs7K.js → auth-choice.apply.transformers-Df9l_jRz.js} +2 -2
- package/dist/{auth-choice.apply.transformers-1plI0MUg.js → auth-choice.apply.transformers-DmdxpHGz.js} +2 -2
- package/dist/{auth-choice.apply.transformers-D5OrjEHo.js → auth-choice.apply.transformers-dn7l6XyJ.js} +1 -1
- package/dist/{auth-json-D1ite-pW.js → auth-json-BB-VBn5E.js} +1 -1
- package/dist/{auth-json-CN3MWw57.js → auth-json-BVyos95N.js} +1 -1
- package/dist/{auth-json-HGu227VM.js → auth-json-CoOe4tEg.js} +1 -1
- package/dist/{auth-json-DZ7E50Y1.js → auth-json-wrKixZxh.js} +1 -1
- package/dist/{auth-profiles-C1VbcUOm.js → auth-profiles-pt7Tr4HA.js} +1 -1
- package/dist/{auth-token-CyVfNEQb.js → auth-token-BE67qxLw.js} +1 -1
- package/dist/{auth-token-CoQ5ePPl.js → auth-token-BPHeoBAW.js} +1 -1
- package/dist/{banner-DY-L7_eI.js → banner-ErBINvbk.js} +1 -1
- package/dist/{browser-cli-D2O94twn.js → browser-cli-BZc64-Xx.js} +1 -1
- package/dist/{browser-cli-CoRx_4iM.js → browser-cli-CoxVKdon.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/{builderforce-BmrsVdFw.js → builderforce-B9187Tm9.js} +4 -4
- package/dist/{builderforce-Bwyw0GJ6.js → builderforce-BLqHwgeu.js} +4 -4
- package/dist/builderforce-api-DKgXl8BH.js +1 -0
- package/dist/builderforce-api-DcPAGsla.js +1 -0
- package/dist/builderforce-onboarding-CaPJZSvw.js +24 -0
- package/dist/builderforce-onboarding-RXFb0gct.js +24 -0
- package/dist/{builderforcellm-syscheck-CprBhARf.js → builderforcellm-syscheck-9ksvqHYX.js} +1 -1
- package/dist/{builderforcellm-syscheck-DrFJ638L.js → builderforcellm-syscheck-F5JMAr3p.js} +1 -1
- package/dist/{call-DxPWzV-k.js → call-BnAs_SER.js} +1 -1
- package/dist/{call-DFjBq0H2.js → call-D1Opj5ev.js} +1 -1
- package/dist/{call-DmAU4cRX.js → call-Du2LiaX6.js} +1 -1
- package/dist/{call-BbRf8gFM.js → call-T8ciwMTA.js} +1 -1
- package/dist/{channel-options-d4EwVQD0.js → channel-options-B7sRMp2v.js} +1 -1
- package/dist/{channel-options-CDixz6dT.js → channel-options-rhDBCtlp.js} +1 -1
- package/dist/{channel-web-DJa8JC9W.js → channel-web-CcCqUQrJ.js} +1 -1
- package/dist/{channels-cli-BgKy0MbE.js → channels-cli-BjnLW14T.js} +1 -1
- package/dist/{channels-cli-nNW0ezPM.js → channels-cli-DVWUBsmc.js} +1 -1
- package/dist/{chrome-BnEbJV3D.js → chrome-CFmcixaE.js} +1 -1
- package/dist/{chrome-a3X9_-nf.js → chrome-DXt86tmV.js} +1 -1
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-DkWt7p2x.js → cli-BUqtALJK.js} +1 -1
- package/dist/{cli-C5MbcECQ.js → cli-K4reS6IS.js} +1 -1
- package/dist/{coding-tools.policy-NEPm7Mz1.js → coding-tools.policy-D9Ba8eDh.js} +1 -1
- package/dist/{coding-tools.policy-6qh9acJy.js → coding-tools.policy-ZhOdlcEI.js} +1 -1
- package/dist/{command-registry-COUcUWby.js → command-registry-B7uAoROP.js} +1 -1
- package/dist/{command-registry-4_K-lfW5.js → command-registry-CW16Mk2Y.js} +1 -1
- package/dist/{completion-cli-DlvHqL86.js → completion-cli-ZvXrCQqk.js} +1 -1
- package/dist/{completion-cli-B2qcVd6q.js → completion-cli-gyvx5ZXu.js} +1 -1
- package/dist/{completion-cli-DpFvU4Qn.js → completion-cli-n8UsdT91.js} +1 -1
- package/dist/{completion-cli-SdcQ-kQj.js → completion-cli-sKReGv3d.js} +1 -1
- package/dist/{config-_1Ca6jGb.js → config-BgV_FYSq.js} +1 -1
- package/dist/{config-toczWD3q.js → config-BpChMIJ6.js} +1 -1
- package/dist/{config-BTWlKwtB.js → config-D01EgOky.js} +1 -1
- package/dist/{config-27_FNba3.js → config-Dsnbi-a3.js} +1 -1
- package/dist/{config-cli-DeiQz5sY.js → config-cli-Bpo74mE5.js} +1 -1
- package/dist/{config-cli-CfczShaZ.js → config-cli-CF31O_5s.js} +1 -1
- package/dist/{config-guard-CD-Wq8kk.js → config-guard-BRUOk5YL.js} +1 -1
- package/dist/{config-guard-ClVl2FvD.js → config-guard-BUpQiSTW.js} +1 -1
- package/dist/{config-guard-B4in8l8I.js → config-guard-USCN-dq0.js} +1 -1
- package/dist/{config-validation-jpeXzoU3.js → config-validation-BGpSeNbh.js} +1 -1
- package/dist/{config-validation-C6u-z9bJ.js → config-validation-CdBJ-tZq.js} +1 -1
- package/dist/{configure-3W9C5LiT.js → configure-CWr61Ph2.js} +1 -1
- package/dist/configure-DhazB2qh.js +1 -0
- package/dist/{configure-BtXQW7ue.js → configure-DlcO1tWx.js} +1 -1
- package/dist/configure-MXheujvX.js +1 -0
- package/dist/{control-service-CJuuqNOE.js → control-service-2PkCt256.js} +1 -1
- package/dist/{control-service-qKfWP7VD.js → control-service-CcsbseZS.js} +1 -1
- package/dist/{control-service-izGyCWQs.js → control-service-qK1oboMo.js} +1 -1
- package/dist/{control-service-BbsswoMy.js → control-service-y3GYvIBg.js} +1 -1
- package/dist/{cron-cli-BrOM4s6N.js → cron-cli-BYu_lA8i.js} +1 -1
- package/dist/{cron-cli-CwtTX6pg.js → cron-cli-D_Og20iB.js} +1 -1
- package/dist/{daemon-cli-DyVsMf8p.js → daemon-cli-BNzthScZ.js} +1 -1
- package/dist/{daemon-cli-DlwOVDbt.js → daemon-cli-Bh3p0hui.js} +1 -1
- package/dist/{daemon-cli-Br0wu9xQ.js → daemon-cli-DxxKiKVN.js} +1 -1
- package/dist/{daemon-cli-DmicpZED.js → daemon-cli-emNxLkIw.js} +1 -1
- package/dist/{daemon-runtime-CtOr1ncS.js → daemon-runtime-9XitJmIL.js} +1 -1
- package/dist/{daemon-runtime-B4UjqdyJ.js → daemon-runtime-Dx800VUt.js} +1 -1
- package/dist/{deliver-BpLm3ktn.js → deliver--6OBF3LL.js} +1 -1
- package/dist/{deliver-9o_SE4ZK.js → deliver-ADpnRGRf.js} +1 -1
- package/dist/{deliver-D2VAVelb.js → deliver-BM6-damm.js} +1 -1
- package/dist/{deliver-BuZu68tp.js → deliver-CsG0cHbZ.js} +1 -1
- package/dist/{deps-CkJiJ6wc.js → deps-Dg_9rfXK.js} +1 -1
- package/dist/{devices-cli-BfXeDnbx.js → devices-cli-B8DXzcRP.js} +1 -1
- package/dist/{devices-cli-B9G6YOsS.js → devices-cli-BZkdWSx-.js} +1 -1
- package/dist/{directory-cli-BRCaiGOn.js → directory-cli-B78pAVI_.js} +1 -1
- package/dist/{directory-cli-D5ciZ5fY.js → directory-cli-CSaRkkL8.js} +1 -1
- package/dist/{dm-policy-shared-CRZpjRv0.js → dm-policy-shared-B9lW-AsK.js} +1 -1
- package/dist/{dm-policy-shared-Dhw9_6mi.js → dm-policy-shared-DYZ_T-az.js} +1 -1
- package/dist/{dns-cli-CgZ7oMcT.js → dns-cli-CLPGOFA1.js} +1 -1
- package/dist/{dns-cli-C4f4Tyij.js → dns-cli-dr5dHzfI.js} +1 -1
- package/dist/{doctor-completion-BSotFS6p.js → doctor-completion-94zme499.js} +1 -1
- package/dist/{doctor-completion-DVxbs-74.js → doctor-completion-CbF34DIH.js} +1 -1
- package/dist/{embedded-helpers-CEsr3aQ0.js → embedded-helpers-C9jpiwlw.js} +1 -1
- package/dist/{embedded-helpers-DK8_apW0.js → embedded-helpers-DdU30lmt.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/{exec-approvals-cli-YuOu7mVg.js → exec-approvals-cli-CS_uabo7.js} +1 -1
- package/dist/{exec-approvals-cli-BPFi82B0.js → exec-approvals-cli-ktB7M7WE.js} +1 -1
- package/dist/{gateway-cli-D2Bg1Um6.js → gateway-cli-CKcoLVMA.js} +5 -5
- package/dist/{gateway-cli-DFEo8C0z.js → gateway-cli-CuXBDBWe.js} +5 -5
- package/dist/{gateway-rpc-BXR_lVIx.js → gateway-rpc-B02y0PnE.js} +1 -1
- package/dist/{gateway-rpc-ByUcnQ7W.js → gateway-rpc-ff1RVb0_.js} +1 -1
- package/dist/{gemini-auth-CkD5jCPh.js → gemini-auth-DDR12zst.js} +1 -1
- package/dist/health-D0DZmCmh.js +1 -0
- package/dist/{health-yS3NRKvY.js → health-FO8MG5Ur.js} +1 -1
- package/dist/{health-DVo8a9yg.js → health-zrsgFZmR.js} +1 -1
- package/dist/{hooks-cli-B0lVee-j.js → hooks-cli-5Y4hnSX9.js} +1 -1
- package/dist/{hooks-cli-DsVmrQAG.js → hooks-cli-DpHZzRo2.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{ink-session-BitZ1wcY.js → ink-session-Dt9Q4iH-.js} +2 -2
- package/dist/{ink-session-CyAqXDla.js → ink-session-N8wCBzwk.js} +2 -2
- package/dist/{installs-CWd54ARy.js → installs-B_t2YXgq.js} +1 -1
- package/dist/{installs-C9A8QFiF.js → installs-DFiF4lGy.js} +1 -1
- package/dist/{io-3R_ZyUxB.js → io-BLBq4T2o.js} +1 -1
- package/dist/{io-DSIGyPrT.js → io-CXN4uLS2.js} +1 -1
- package/dist/{io-6jLoKffb.js → io-Ckd4NlvH.js} +1 -1
- package/dist/{io-CohJffHG.js → io-D9hC2aG0.js} +1 -1
- package/dist/{lifecycle-core-BpMvDXy1.js → lifecycle-core-D9Dg5Qps.js} +1 -1
- package/dist/{lifecycle-core-Dwb4gHjZ.js → lifecycle-core-uxjxTzFv.js} +1 -1
- package/dist/login-B3sDAgHb.js +1 -0
- package/dist/{login-C_ZdMOvv.js → login-CwwuaXtb.js} +1 -1
- package/dist/{login-DtDUyFO3.js → login-D1bVUPlv.js} +1 -1
- package/dist/{login-CEnjUo5c.js → login-GLDax56V.js} +1 -1
- package/dist/{login-qr-B9lyIZVD.js → login-qr-CbiUcBLy.js} +1 -1
- package/dist/{login-qr-BCBsxwhT.js → login-qr-Cp0YqK4e.js} +1 -1
- package/dist/{logs-cli-CdM5W3HE.js → logs-cli-Cy11HfSG.js} +1 -1
- package/dist/{logs-cli-jh5Xn3TD.js → logs-cli-nD36c-Y1.js} +1 -1
- package/dist/{manager-CRba8roB.js → manager-BeohB4-8.js} +1 -1
- package/dist/{manager-B3IJ_IKf.js → manager-CTTXDBt3.js} +1 -1
- package/dist/{manager-TGVy_fAb.js → manager-CoQMlcrf.js} +1 -1
- package/dist/{manager-DwywI_5-.js → manager-DSz61dXv.js} +1 -1
- package/dist/{memory-cli-BlayFTAM.js → memory-cli-BpAiRntI.js} +1 -1
- package/dist/{memory-cli-DRz4wtHk.js → memory-cli-CbkWGjRn.js} +1 -1
- package/dist/{memory-cli-PdyTQ84w.js → memory-cli-CrBMLM2P.js} +1 -1
- package/dist/{memory-cli-ivAs7q7v.js → memory-cli-CveeVOWH.js} +1 -1
- package/dist/{model-catalog-CQOdhMUY.js → model-catalog-B29yeBYS.js} +1 -1
- package/dist/{model-catalog-CiiFJX77.js → model-catalog-BeBXvbFm.js} +1 -1
- package/dist/model-catalog-CMKHKuBL.js +1 -0
- package/dist/{model-catalog-C6UrZ0uG.js → model-catalog-DjNiebr7.js} +1 -1
- package/dist/{model-discovery-C9Xm95uL.js → model-discovery-D0i1JpiL.js} +1 -1
- package/dist/{model-picker-swoSwauV.js → model-picker-CGDNPRPc.js} +1 -1
- package/dist/model-picker-CGEF8yhc.js +1 -0
- package/dist/model-picker-DeUNOC78.js +1 -0
- package/dist/{model-picker-BUePD7Zg.js → model-picker-EIhpfOZa.js} +1 -1
- package/dist/{model-selection-9bRFKBI_.js → model-selection-DG9J_VTz.js} +1 -1
- package/dist/{models-BNivsd2o.js → models-BjIzVQYX.js} +2 -2
- package/dist/{models-DQeSIY6M.js → models-JoqOgEF5.js} +1 -1
- package/dist/{models-cli-KokGgWeP.js → models-cli-B2zbchgs.js} +1 -1
- package/dist/{models-cli-BcNxU4P_.js → models-cli-CkFdc8NN.js} +2 -2
- package/dist/{node-cli-DIMh3X2F.js → node-cli-CXnuxiBq.js} +1 -1
- package/dist/{node-cli-EmTU-Gh0.js → node-cli-oVyjVnb7.js} +1 -1
- package/dist/{nodes-cli-BX8TznFK.js → nodes-cli-BBVotxNt.js} +1 -1
- package/dist/{nodes-cli-DyHovdAc.js → nodes-cli-DVMBSUhK.js} +1 -1
- package/dist/{onboard-DfMVh1bM.js → onboard-BItclJp0.js} +1 -1
- package/dist/{onboard-BVmZ4jMw.js → onboard-CqvHIvKj.js} +1 -1
- package/dist/{onboard-auth.credentials-yagR-VMG.js → onboard-auth.credentials-DneFSdYg.js} +1 -1
- package/dist/{onboard-auth.credentials-BuT-etnE.js → onboard-auth.credentials-DpitLlzw.js} +1 -1
- package/dist/onboard-channels-B91m5S3w.js +1 -0
- package/dist/onboard-channels-BOoPtYbF.js +1 -0
- package/dist/{onboard-channels-B6QDFkkK.js → onboard-channels-Dn0u5C-C.js} +1 -1
- package/dist/{onboard-channels-C8FCFn29.js → onboard-channels-vhtccaIV.js} +1 -1
- package/dist/onboard-custom-BN0uzSq_.js +1 -0
- package/dist/{onboard-custom-D1nd8Hlu.js → onboard-custom-BYIza2e7.js} +1 -1
- package/dist/onboard-custom-CCFthqto.js +1 -0
- package/dist/{onboard-custom-C_BI0ZXn.js → onboard-custom-Ckf0xKXY.js} +1 -1
- package/dist/{onboard-helpers-CGlLpagb.js → onboard-helpers-B8I5AVyb.js} +1 -1
- package/dist/{onboard-helpers-CckrS8_K.js → onboard-helpers-Ce_c4Raj.js} +1 -1
- package/dist/{onboard-helpers-Cf5dNq7-.js → onboard-helpers-CiHzTaFX.js} +1 -1
- package/dist/{onboard-helpers-BvIZ4-R5.js → onboard-helpers-DC-nMl-V.js} +1 -1
- package/dist/{onboard-interactive-DYJttZ2w.js → onboard-interactive-Cl2K3EYn.js} +1 -1
- package/dist/{onboard-interactive-zgjmwJz-.js → onboard-interactive-JNux9zfA.js} +1 -1
- package/dist/{onboard-interactive-B3-KBZbZ.js → onboard-interactive-J_ObFzeW.js} +1 -1
- package/dist/{onboard-interactive-Dc_7URYb.js → onboard-interactive-OUNsvlh0.js} +1 -1
- package/dist/{onboard-remote-D5lR2lVm.js → onboard-remote-0-q7MG9t.js} +1 -1
- package/dist/{onboard-remote-BmSyHww1.js → onboard-remote-CgAAEZpq.js} +1 -1
- package/dist/{onboard-remote-CzzQMZ3X.js → onboard-remote-DKXHDdBD.js} +1 -1
- package/dist/{onboard-remote-DcuX8b2g.js → onboard-remote-cB8j9RG-.js} +1 -1
- package/dist/{onboard-skills-ILHIeg1R.js → onboard-skills-47upVdA2.js} +1 -1
- package/dist/{onboard-skills-BPlNN_-T.js → onboard-skills-9Um4TL2x.js} +1 -1
- package/dist/{onboard-skills-DIhjDMom.js → onboard-skills-DhCmvhJY.js} +1 -1
- package/dist/{onboard-skills-CI1OtWsE.js → onboard-skills-mI2kfvdT.js} +1 -1
- package/dist/{onboarding-D4-HDbmU.js → onboarding-BSENgR9C.js} +5 -5
- package/dist/{onboarding-CP9rrz8y.js → onboarding-CIaZLNc1.js} +5 -5
- package/dist/{onboarding.finalize-C2kZi7F0.js → onboarding.finalize-BwOpvoPE.js} +1 -1
- package/dist/{onboarding.finalize-BfWXPgX7.js → onboarding.finalize-yMK-g7Uy.js} +1 -1
- package/dist/{onboarding.gateway-config-Cd7_bXVs.js → onboarding.gateway-config-Kn1O-QFl.js} +1 -1
- package/dist/{onboarding.gateway-config-Bd8HJkso.js → onboarding.gateway-config-huOjFf8D.js} +1 -1
- package/dist/{openai-model-default-Cp3nf21W.js → openai-model-default-CH2-2Hvk.js} +1 -1
- package/dist/{openai-model-default-BMRrqTmH.js → openai-model-default-pfoEzWYJ.js} +1 -1
- package/dist/{outbound-BRInCJD9.js → outbound-BdeHcMAo.js} +1 -1
- package/dist/{outbound-CAtBpFoD.js → outbound-BylJYD7n.js} +1 -1
- package/dist/{outbound-OI-t5zZ0.js → outbound-CAirtWr1.js} +1 -1
- package/dist/{outbound-CnIvOJlU.js → outbound-VNcvF2MG.js} +1 -1
- package/dist/{outbound-send-deps-m6DqOma_.js → outbound-send-deps-B3Lg-uqF.js} +1 -1
- package/dist/{pairing-cli-CEr0yEsc.js → pairing-cli-5RtPvz2i.js} +1 -1
- package/dist/{pairing-cli-Dxfoni-F.js → pairing-cli-C_Mj6Dy4.js} +1 -1
- package/dist/{pairing-labels-3j_iRYOO.js → pairing-labels-BJPrScRl.js} +1 -1
- package/dist/{pairing-labels-BW5jQZlr.js → pairing-labels-oA-nKTaW.js} +1 -1
- package/dist/{pairing-store-QDb6lhIU.js → pairing-store-YRy7EBgI.js} +1 -1
- package/dist/{pairing-store-CbvMJhD3.js → pairing-store-ti3FEkmr.js} +1 -1
- package/dist/{plugin-auto-enable-BV9K9Vhr.js → plugin-auto-enable-Cupr4wbt.js} +1 -1
- package/dist/{plugin-auto-enable-DDry2fA6.js → plugin-auto-enable-D8gKiE3F.js} +1 -1
- package/dist/plugin-registry-BEfyc2f_.js +1 -0
- package/dist/{plugin-registry-C-_GA65s.js → plugin-registry-BoPaef5I.js} +1 -1
- package/dist/{plugin-registry-SAdxNUwm.js → plugin-registry-CxnuHO_n.js} +1 -1
- package/dist/plugin-registry-D0tIqo8L.js +1 -0
- package/dist/plugin-sdk/{accounts-Cy3WCbWg.js → accounts-BwreSNAR.js} +1 -1
- package/dist/plugin-sdk/{active-listener-DVWVNlT9.js → active-listener-DpQ7aGYd.js} +1 -1
- package/dist/plugin-sdk/agent-runtime/src/infra/workflow-telemetry.d.ts +12 -1
- package/dist/plugin-sdk/{agent-scope-DgKN27hJ.js → agent-scope-BQByW0cD.js} +1 -1
- package/dist/plugin-sdk/{api-key-rotation-ftXf7mBZ.js → api-key-rotation-7YdImWrh.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-CfTmmeS-.js → audio-preflight-EbkaATDO.js} +1 -1
- package/dist/plugin-sdk/{auth-json-BrNBg87n.js → auth-json-DK6qod1_.js} +1 -1
- package/dist/plugin-sdk/{bindings-CH-YLOLC.js → bindings-CDEzl4kl.js} +1 -1
- package/dist/plugin-sdk/{channel-web-B6rg0Rbf.js → channel-web-D2KuONp0.js} +1 -1
- package/dist/plugin-sdk/{chrome-CuXP-hes.js → chrome-SOXFIkUM.js} +1 -1
- package/dist/plugin-sdk/{chunk-C94IAOuf.js → chunk-cW0POl22.js} +1 -1
- package/dist/plugin-sdk/{command-format-B3XMq_73.js → command-format-CAX9XFjI.js} +1 -1
- package/dist/plugin-sdk/{common-n0l_XN-S.js → common-BxEWhN2X.js} +1 -1
- package/dist/plugin-sdk/{config-DsXZsCkJ.js → config-v1EU9Ll8.js} +2 -2
- package/dist/plugin-sdk/{fetch-B-GxSYRO.js → fetch-DH0Y8iyO.js} +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/{login-_my8QwPP.js → login-d1zBgykF.js} +1 -1
- package/dist/plugin-sdk/{login-qr-BaePtXuG.js → login-qr-B6exvQnN.js} +1 -1
- package/dist/plugin-sdk/{manager-BsC-4ymy.js → manager-BH_bmGds.js} +1 -1
- package/dist/plugin-sdk/{markdown-tables-BUfhHgfs.js → markdown-tables-Epim9b-0.js} +1 -1
- package/dist/plugin-sdk/{message-channel-CuZ2xOAM.js → message-channel-sBPQc_-T.js} +1 -1
- package/dist/plugin-sdk/{model-catalog-yuiXVcmw.js → model-catalog-cXsza5GU.js} +1 -1
- package/dist/plugin-sdk/{model-selection-BtgvnqB5.js → model-selection-K82MAGlL.js} +1 -1
- package/dist/plugin-sdk/{outbound-D_attiyO.js → outbound-Chn_H1O7.js} +1 -1
- package/dist/plugin-sdk/{plugins-BdkC9v5E.js → plugins-CaUOZBVb.js} +1 -1
- package/dist/plugin-sdk/{pw-ai-A7Rathx6.js → pw-ai-BIiJF7ZD.js} +1 -1
- package/dist/plugin-sdk/{qmd-manager-Dxn0jCpE.js → qmd-manager-BRe5fGZw.js} +1 -1
- package/dist/plugin-sdk/{registry-CZHRcH-q.js → registry-DJq2Cvo9.js} +1 -1
- package/dist/plugin-sdk/{render-CuA_WRX5.js → render-BUCRXPIk.js} +1 -1
- package/dist/plugin-sdk/{replies-DmLfO-pg.js → replies-Cz5OD3qN.js} +1 -1
- package/dist/plugin-sdk/{reply-3-ne-N_7.js → reply-D5Uk7pUv.js} +9 -9
- package/dist/plugin-sdk/{reply-prefix-w7kAvH11.js → reply-prefix-CCymsmsP.js} +1 -1
- package/dist/plugin-sdk/{resolve-route-0sbvl4ZN.js → resolve-route-DN1J7Wyc.js} +1 -1
- package/dist/plugin-sdk/{runner-4UfrAQnx.js → runner-CYkuO7Fh.js} +4 -4
- package/dist/plugin-sdk/{session-BB-yfDWx.js → session-D5jHDo78.js} +1 -1
- package/dist/plugin-sdk/{sqlite-JjFgDV-H.js → sqlite-BlMLqMl8.js} +1 -1
- package/dist/plugin-sdk/{subsystem-D0Ril4rt.js → subsystem-COTa5Ly_.js} +1 -1
- package/dist/plugin-sdk/{tool-images-WRTP95FT.js → tool-images-DSpchb4x.js} +1 -1
- package/dist/plugin-sdk/{tool-loop-detection-sC_rhJfb.js → tool-loop-detection-BP6u-mbh.js} +1 -1
- package/dist/plugin-sdk/web-BbganhKi.js +1 -0
- package/dist/plugin-sdk/{whatsapp-actions-ThxQ5niy.js → whatsapp-actions-CZUqxmP1.js} +1 -1
- package/dist/{plugins-BIG8NDB9.js → plugins-Cx29kkDj.js} +1 -1
- package/dist/{plugins-iAq-Gr8l.js → plugins-DJqou2hi.js} +1 -1
- package/dist/{plugins-cli-CpaVUv_r.js → plugins-cli-Bu-A8aGy.js} +1 -1
- package/dist/{plugins-cli-CPkSgvdL.js → plugins-cli-CGFsQDVW.js} +1 -1
- package/dist/{program-context-BCwL3wlM.js → program-context-ClBa4lUj.js} +1 -1
- package/dist/{program-2w7Ue902.js → program-vVCzU0cH.js} +2 -2
- package/dist/{prompt-select-styled-hB_nLOn1.js → prompt-select-styled-BJPGccTJ.js} +1 -1
- package/dist/{prompt-select-styled-Dd5swW2b.js → prompt-select-styled-BK74z6FF.js} +1 -1
- package/dist/{provider-auth-helpers-BpTnp2Yr.js → provider-auth-helpers-B84m5VMc.js} +1 -1
- package/dist/{provider-auth-helpers-CJTG_tVx.js → provider-auth-helpers-hNwpK_hl.js} +1 -1
- package/dist/{provider-dispatcher-TWwBT2aH.js → provider-dispatcher-BjR5DE3O.js} +1 -1
- package/dist/provider-dispatcher-DgOeVjcL.js +1 -0
- package/dist/{provider-usage-BdrU4cIE.js → provider-usage-B-wPVN_j.js} +1 -1
- package/dist/{provider-usage-Bn4ZrnU7.js → provider-usage-B8lFHp0K.js} +1 -1
- package/dist/{push-apns-C4sJnHbO.js → push-apns-BTPPvY81.js} +1 -1
- package/dist/{push-apns-CiD3rrVv.js → push-apns-CscYUS0D.js} +1 -1
- package/dist/{pw-ai-DSEj1QrV.js → pw-ai-CLS_VZ8p.js} +1 -1
- package/dist/{pw-ai-dNZY-qBs.js → pw-ai-D5og_rIf.js} +1 -1
- package/dist/{qr-cli-qr-SFLZW.js → qr-cli-CAquM1Zk.js} +1 -1
- package/dist/{qr-cli-B45dCV0o.js → qr-cli-GsR8n1cm.js} +1 -1
- package/dist/{qr-cli-CMlAIzrD.js → qr-cli-kAKgaL-T.js} +1 -1
- package/dist/{qr-cli-CySNSEFj.js → qr-cli-uyxNf-cQ.js} +1 -1
- package/dist/{register.agent-BA6LIJSb.js → register.agent-BwTCfyeJ.js} +1 -1
- package/dist/{register.agent-D2uCH8jZ.js → register.agent-Dhdo3_7k.js} +1 -1
- package/dist/register.configure-B0m0G3ot.js +1 -0
- package/dist/register.configure-D3cbjmTz.js +1 -0
- package/dist/{register.maintenance-BELfCO_C.js → register.maintenance-C6ocMld2.js} +1 -1
- package/dist/{register.maintenance-DukWFS_D.js → register.maintenance-CbE2zSyc.js} +1 -1
- package/dist/{register.message-DiZRRAE5.js → register.message-Jn4u533_.js} +1 -1
- package/dist/{register.message-8iGDhO8h.js → register.message-Tu1hlM0m.js} +1 -1
- package/dist/{register.onboard-B9DMNfHE.js → register.onboard-B34211N6.js} +1 -1
- package/dist/{register.onboard-Dt7rzAq-.js → register.onboard-S1d2WAE4.js} +1 -1
- package/dist/{register.setup-CSF-2ImP.js → register.setup-CJPyAwCQ.js} +1 -1
- package/dist/{register.setup-BRRVPrx7.js → register.setup-Sg8f3nsH.js} +1 -1
- package/dist/{register.status-health-sessions-D6wdwPwV.js → register.status-health-sessions-BlgVxoZ4.js} +1 -1
- package/dist/{register.status-health-sessions-ZSufYw5j.js → register.status-health-sessions-DwADQJ74.js} +1 -1
- package/dist/{register.subclis-4eDV9jKH.js → register.subclis-C9V_M-Lk.js} +1 -1
- package/dist/{register.subclis-Cr9DoYcv.js → register.subclis-pWn9XObB.js} +1 -1
- package/dist/{replies-DbkT_5BV.js → replies-BOGMDhSN.js} +1 -1
- package/dist/{replies-CzV-RFUG.js → replies-BXbV02ik.js} +1 -1
- package/dist/{replies-DIBQzxGp.js → replies-CUv671JF.js} +1 -1
- package/dist/{replies-Bd2RPZwQ.js → replies-DokbEfJD.js} +1 -1
- package/dist/{reply-Cd3vVnD7.js → reply-GY1C8tcv.js} +10 -10
- package/dist/{routes-BzfLvF8W.js → routes-DZntyPY6.js} +1 -1
- package/dist/{routes-lclJHOYY.js → routes-_iZdG1Fo.js} +1 -1
- package/dist/{rpc-BLqXRn5R.js → rpc-CbUnwStf.js} +1 -1
- package/dist/{rpc-DcQNGQlj.js → rpc-Cwm4gchc.js} +1 -1
- package/dist/{run-main-DLcDEJgv.js → run-main-DQMbgbcF.js} +1 -1
- package/dist/{runner-DwWmciCt.js → runner-Cu9NJouV.js} +1 -1
- package/dist/{runner-SxCr9kXD.js → runner-eTTUbLAK.js} +1 -1
- package/dist/{sandbox-BZibn6PX.js → sandbox-C4AKi2EX.js} +1 -1
- package/dist/{sandbox-z9t_PRf9.js → sandbox-DvKMuAXL.js} +1 -1
- package/dist/{sandbox-cli-BtGs0dBR.js → sandbox-cli-C0LhzYq_.js} +1 -1
- package/dist/{sandbox-cli-B8FpLgyY.js → sandbox-cli-De0iaoHB.js} +1 -1
- package/dist/{security-cli-D8Q8I7fn.js → security-cli-BvEfiO8m.js} +1 -1
- package/dist/{security-cli-IIMR7Pb4.js → security-cli-BzsQ0XQh.js} +1 -1
- package/dist/{send-DnMzjS7L.js → send-2dRKMWtl.js} +1 -1
- package/dist/{send-DerUBvXW.js → send-Aw8wK3vK.js} +1 -1
- package/dist/{send-BvroeIQ6.js → send-B7H8Ae5j.js} +1 -1
- package/dist/{send-4d9NswaD.js → send-BP5osGBo.js} +1 -1
- package/dist/{send-BU_-BGmf.js → send-BVal50Bi.js} +1 -1
- package/dist/{send-CxG2suVM.js → send-Bbo7TXLx.js} +1 -1
- package/dist/{send-CBBziNqM.js → send-BxoVLIy1.js} +1 -1
- package/dist/{send-dDpSBSBo.js → send-COKUbcqs.js} +1 -1
- package/dist/{send--12DIueA.js → send-CTw3PqN4.js} +1 -1
- package/dist/{send-UFtylOiq.js → send-CYGOPcKq.js} +1 -1
- package/dist/{send-DyF1Xy9K.js → send-ChGpVO3O.js} +1 -1
- package/dist/{send-Q-uTkSFE.js → send-Cqea2UFo.js} +1 -1
- package/dist/{send-j15662lv.js → send-CrFWgJKx.js} +1 -1
- package/dist/{send-gDb60Hk-.js → send-CwK8QBR3.js} +1 -1
- package/dist/{send-CceNWtYE.js → send-DqR7Rxzm.js} +1 -1
- package/dist/{send-CJHXQvVl.js → send-DxwfUIN-.js} +1 -1
- package/dist/{send-ByCVQQVz.js → send-KgN1P41U.js} +1 -1
- package/dist/{send-B1rJLLpr.js → send-bNp87SIq.js} +1 -1
- package/dist/{send-B_1BtyfA.js → send-kkm_zrHQ.js} +1 -1
- package/dist/{send-BJDzwYJN.js → send-l3ge4wkC.js} +1 -1
- package/dist/{server-context-DJZT7Upf.js → server-context-CQ2v4BAx.js} +1 -1
- package/dist/{server-context-owOmmyUM.js → server-context-CttALzrW.js} +1 -1
- package/dist/{server-node-events-54d8Rmjl.js → server-node-events-CIMO6Vae.js} +1 -1
- package/dist/{server-node-events-CSFVqgxX.js → server-node-events-iCF2ngcN.js} +1 -1
- package/dist/{session-BzQdcCqN.js → session-BJHsjD3z.js} +1 -1
- package/dist/{session-4FpEJvkE.js → session-C_b1ttHJ.js} +1 -1
- package/dist/{session-dirs-OxQuIvJW.js → session-dirs-Bvbgw0GC.js} +1 -1
- package/dist/{session-dirs-D_ARkyw0.js → session-dirs-DHaoq7zc.js} +1 -1
- package/dist/{session-utils-GMvum00v.js → session-utils-Dxou8SbO.js} +1 -1
- package/dist/{sessions-Bl1wwotX.js → sessions-BA8Se_bT.js} +1 -1
- package/dist/{sessions-CdanN_ZI.js → sessions-BuZVmOWt.js} +1 -1
- package/dist/{sessions-B5dwRhUC.js → sessions-DvbW0FNJ.js} +1 -1
- package/dist/{sessions-B1t7qeEn.js → sessions-DvqsIg0M.js} +1 -1
- package/dist/{shared-xj-xaKFi.js → shared-BBOiNdjf.js} +1 -1
- package/dist/{shared-BPN3qd7G.js → shared-C2orjbTD.js} +1 -1
- package/dist/{skill-scanner-U3AJgjqc.js → skill-scanner-BEvov9QH.js} +1 -1
- package/dist/{skill-scanner-DEmbPsRh.js → skill-scanner-OTLeRZ_p.js} +1 -1
- package/dist/{skills-cli-CIdnXa3B.js → skills-cli-C1BOgB3y.js} +1 -1
- package/dist/{skills-cli-BXbGr7vl.js → skills-cli-CFT2Aq5R.js} +1 -1
- package/dist/{skills-install-Btw_GHbI.js → skills-install-LlKntDHa.js} +1 -1
- package/dist/{skills-install-DMHQRpIl.js → skills-install-tx5Mahav.js} +1 -1
- package/dist/{status-DXaDS_0w.js → status-Bh8V7kjv.js} +1 -1
- package/dist/{status-BxeKmkVr.js → status-BtBHmhQh.js} +1 -1
- package/dist/{status-BkcmeZg6.js → status-CpwD4y9B.js} +1 -1
- package/dist/status-CqaTmyih.js +1 -0
- package/dist/{status-DouJcFzf.js → status-yXz8PUbL.js} +1 -1
- package/dist/{status.update-C9iy31xr.js → status.update-CdgsLBPg.js} +1 -1
- package/dist/{status.update-KYyRSDZY.js → status.update-hzMro-BT.js} +1 -1
- package/dist/{subagent-registry-Dr20nzwk.js → subagent-registry-CaRUNwCj.js} +1 -1
- package/dist/{subagent-registry-CyGxu3kP.js → subagent-registry-DDEN4oJi.js} +10 -10
- package/dist/{subagent-registry-BiXkIDeh.js → subagent-registry-DYYfeIc3.js} +1 -1
- package/dist/{system-cli-b4YgXPHv.js → system-cli-4aii1JYf.js} +1 -1
- package/dist/{system-cli-C7YzJeP4.js → system-cli-CfkDD3FV.js} +1 -1
- package/dist/{tui-DylWbrDx.js → tui-DnVRxfI8.js} +2 -2
- package/dist/{tui-BwWMByVp.js → tui-JfWoLGIV.js} +2 -2
- package/dist/{tui-cli-C_TTgabr.js → tui-cli-CGjg2Eb5.js} +1 -1
- package/dist/{tui-cli-Bh1V8-w9.js → tui-cli-cd7Efw5u.js} +1 -1
- package/dist/{tui-setup-check-DJZCJokQ.js → tui-setup-check-BEHm9wwo.js} +1 -1
- package/dist/{tui-setup-check-BABAyl-e.js → tui-setup-check-DK8vdhLI.js} +1 -1
- package/dist/{tui-stream-assembler-ign_cPkv.js → tui-stream-assembler-8ud9oyMK.js} +1 -1
- package/dist/{tui-stream-assembler-q9GANTDr.js → tui-stream-assembler-Br15rhRH.js} +1 -1
- package/dist/{update-BUzcmoDf.js → update-B5yKFeGO.js} +1 -1
- package/dist/{update-D6U-V8Au.js → update-DodoQDCk.js} +1 -1
- package/dist/{update-cli-DUrUIrYQ.js → update-cli-CfJJcSUS.js} +1 -1
- package/dist/{update-cli-CA3LuuJ7.js → update-cli-x8Ocbf-0.js} +1 -1
- package/dist/{usage-cli-CfEg1_NZ.js → usage-cli-CN7L1YRG.js} +1 -1
- package/dist/{usage-cli-CpbYMXxS.js → usage-cli-CQmokGkG.js} +1 -1
- package/dist/{web-D-NSyF6b.js → web-BXLk9UT2.js} +1 -1
- package/dist/web-Btgs8oWv.js +1 -0
- package/dist/{webhooks-cli-B_f61rq7.js → webhooks-cli-DIo8p3lk.js} +1 -1
- package/dist/{webhooks-cli-Bi0t3w6P.js → webhooks-cli-DhxEtiFt.js} +1 -1
- package/dist/{whatsapp-actions-JbF2MrTV.js → whatsapp-actions-B7r9AyZN.js} +1 -1
- package/dist/{whatsapp-actions-BkCMhD9X.js → whatsapp-actions-DX2QU6Gs.js} +1 -1
- package/dist/{with-timeout-T07SJo4N.js → with-timeout-B_p5pWDv.js} +1 -1
- package/dist/{with-timeout-Bwq-GyUQ.js → with-timeout-GDLpcjW7.js} +1 -1
- package/dist/workflow-telemetry-BMTg5lPd.js +1 -0
- package/dist/workflow-telemetry-Bg8MVUr_.js +2 -0
- package/dist/workflow-telemetry-Do1UsYwM.js +1 -0
- package/dist/workflow-telemetry-DqBPhVL4.js +2 -0
- package/package.json +1 -1
- package/dist/agents-DsZ5vLKE.js +0 -1
- package/dist/auth-choice-Btd2Rxxd.js +0 -1
- package/dist/auth-choice-CVV9wRFN.js +0 -1
- package/dist/auth-choice.apply-BOK9XRCQ.js +0 -1
- package/dist/auth-choice.apply-Cv-BiV5Q.js +0 -1
- package/dist/auth-choice.apply.transformers-CXywS3GZ.js +0 -1
- package/dist/builderforce-onboarding-Dq6VUSKZ.js +0 -24
- package/dist/builderforce-onboarding-DuUfZ6oL.js +0 -24
- package/dist/configure-CWBBFk3F.js +0 -1
- package/dist/configure-fHVOAucW.js +0 -1
- package/dist/health-GLcAfqDz.js +0 -1
- package/dist/login-CPyEf5h6.js +0 -1
- package/dist/model-catalog-J7R-tJDu.js +0 -1
- package/dist/model-picker-D2bcWrtu.js +0 -1
- package/dist/model-picker-DO1HtEEm.js +0 -1
- package/dist/onboard-channels-CmqKsAoW.js +0 -1
- package/dist/onboard-channels-Db0P4iWl.js +0 -1
- package/dist/onboard-custom-BABqIYa4.js +0 -1
- package/dist/onboard-custom-VpW3UC8u.js +0 -1
- package/dist/plugin-registry-B-UOeWqM.js +0 -1
- package/dist/plugin-registry-BjMr3yXM.js +0 -1
- package/dist/plugin-sdk/web-CThgoHQp.js +0 -1
- package/dist/provider-dispatcher-C4nHaNqn.js +0 -1
- package/dist/register.configure-DAL38e7r.js +0 -1
- package/dist/register.configure-DZG7-WVi.js +0 -1
- package/dist/status-BTYqHVha.js +0 -1
- package/dist/web-P6QsgmSD.js +0 -1
- package/dist/workflow-telemetry-B8Im0mPk.js +0 -1
- package/dist/workflow-telemetry-DLEnm5TI.js +0 -2
- package/dist/workflow-telemetry-Dc_oseV7.js +0 -2
- package/dist/workflow-telemetry-Dkm3mofI.js +0 -1
- /package/dist/{devtools-CI7JyCXv.js → devtools-Cg4F-l9O.js} +0 -0
- /package/dist/{devtools-eMFaIsAT.js → devtools-Dl2DACSO.js} +0 -0
- /package/dist/{github-copilot-token-D3gHtNUu.js → github-copilot-token-BlyiXyTy.js} +0 -0
- /package/dist/{github-copilot-token-DHP2kAiN.js → github-copilot-token-D5sB2AUI.js} +0 -0
- /package/dist/{onboard-hooks-Cenav0eW.js → onboard-hooks-BaOSgxs9.js} +0 -0
- /package/dist/{onboard-hooks-Ce20rwpW.js → onboard-hooks-fO5eeDe_.js} +0 -0
- /package/dist/{qmd-manager-DVd_aWEV.js → qmd-manager-BgplOjHN.js} +0 -0
- /package/dist/{qmd-manager-keHvLmvP.js → qmd-manager-COUi_Fqb.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as __require,r as __toESM,t as __commonJSMin}from"./chunk-4VIosCLc.js";import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import"./utils-BP60e80M.js";import"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./auth-profiles-
|
|
1
|
+
import{n as __require,r as __toESM,t as __commonJSMin}from"./chunk-4VIosCLc.js";import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import"./utils-BP60e80M.js";import"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./auth-profiles-pt7Tr4HA.js";import"./src-DvWaTze9.js";import"./logger-wuOr7HKl.js";import"./session-key-CksCYipj.js";import"./builderforce-root-DY1qbWNX.js";import"./exec-COgsU9ql.js";import"./agent-scope-CufEmNj_.js";import"./env-file-DeS6x2OL.js";import"./src-HrLX5bhG.js";import"./io-D9hC2aG0.js";import"./manifest-registry-009gLJ4l.js";import"./config-BpChMIJ6.js";import"./frontmatter-CaY7feZm.js";import"./skills-D3MwwPOH.js";import"./plugin-skills-pSFUbhg_.js";import"./client-CGgp3zkQ.js";import"./call-Du2LiaX6.js";import"./message-channel-z5YRpR2d.js";import"./sessions-BA8Se_bT.js";import"./plugins-1Mn6RiNf.js";import"./accounts-BkTLjSrD.js";import"./bindings-CKSDlQ1i.js";import"./accounts-Cx82nj4E.js";import"./image-ops-CotJhwRR.js";import"./redact-CgO7wehS.js";import"./errors-tAt19c1E.js";import"./embedded-helpers-DdU30lmt.js";import"./sandbox-DvKMuAXL.js";import"./chrome-CFmcixaE.js";import"./tailscale-DV-yOmYe.js";import"./auth-ChecwOXS.js";import"./server-context-CttALzrW.js";import"./routes-_iZdG1Fo.js";import"./paths-BnOjueoX.js";import"./ssrf-DJXLYZ0d.js";import"./store-DHD2IEgd.js";import"./ports-DTku9NSx.js";import"./trash-C3zmJ_O7.js";import"./accounts-DcoaLXKI.js";import"./paths-ClsbsPQP.js";import"./tool-images-CCpqFtrL.js";import"./usage-format-5sp5AMSu.js";import{n as GatewayChatClient,t as TuiStreamAssembler}from"./tui-stream-assembler-Br15rhRH.js";import{execFileSync}from"node:child_process";import process$1,{cwd,env}from"node:process";import os from"node:os";import*as fs$1 from"node:fs";import fs from"node:fs";import chalk from"chalk";import{PassThrough,Stream}from"node:stream";import{EventEmitter}from"node:events";import tty from"node:tty";const RENDERER_IDS={headless:`headless`,ink:`ink`},DEFAULT_RENDERER_ID=RENDERER_IDS.ink;var RendererRegistry=class{constructor(){this.factories=new Map}register(id,factory){return this.factories.set(id,factory),this}has(id){return this.factories.has(id)}resolve(id){let factory=this.factories.get(id??``)??this.factories.get(DEFAULT_RENDERER_ID);if(!factory)throw Error(`No renderer registered for "${id??DEFAULT_RENDERER_ID}" (and no default "${DEFAULT_RENDERER_ID}"). Register one via RendererRegistry.register().`);return factory()}};const ANSI_SGR=/\[[0-9;]*m/g;var HeadlessChat=class{constructor(){this.entries=[]}append(entry){let index=this.entries.push(entry)-1;return{update:next=>{this.entries[index]=next}}}clear(){this.entries.length=0}},HeadlessInput=class{constructor(){this.history=[],this.text=``,this.enabled=!0}getText(){return this.text}setText(value){this.text=value}addToHistory(value){this.history.push(value)}onSubmit(handler){this.submitHandler=handler}setEnabled(enabled){this.enabled=enabled}isEnabled(){return this.enabled}async submit(text){await this.submitHandler?.(text)}},HeadlessStatus=class{constructor(){this.line=``}set(line){this.line=line}clear(){this.line=``}};const textMetrics$1={visibleWidth(text){return text.replace(ANSI_SGR,``).length},truncateToWidth(text,width){let bare=text.replace(ANSI_SGR,``);return bare.length<=width?text:width<=1?bare.slice(0,Math.max(0,width)):`${bare.slice(0,width-1)}…`}};function createHeadlessRenderer(script={}){let chat=new HeadlessChat,input=new HeadlessInput,status=new HeadlessStatus,selects=[...script.selectAnswers??[]],settingsAns=[...script.settingsAnswers??[]],confirms=[...script.confirmAnswers??[]];return{id:RENDERER_IDS.headless,chat,input,status,text:textMetrics$1,started:!1,renderCount:0,start(_options){this.started=!0},stop(){this.started=!1},requestRender(){this.renderCount+=1},async select(_request){return selects.shift()??void 0},async settings(_request){return settingsAns.shift()},async confirm(_message){return confirms.shift()??!1}}}
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.js
|
|
@@ -49,7 +49,7 @@ Error generating stack: `+x.message+`
|
|
|
49
49
|
No matching component was found for:
|
|
50
50
|
`)+hostRoot.join(` > `)}return null},exports$1.getPublicRootInstance=function(container){if(container=container.current,!container.child)return null;switch(container.child.tag){case 27:case 5:return getPublicInstance(container.child.stateNode);default:return container.child.stateNode}},exports$1.injectIntoDevTools=function(){var internals={bundleType:0,version:rendererVersion,rendererPackageName,currentDispatcherRef:ReactSharedInternals,reconcilerVersion:`19.2.0`};if(extraDevToolsConfig!==null&&(internals.rendererConfig=extraDevToolsConfig),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`)internals=!1;else{var hook=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(hook.isDisabled||!hook.supportsFiber)internals=!0;else{try{rendererID=hook.inject(internals),injectedHook=hook}catch{}internals=!!hook.checkDCE}}return internals},exports$1.isAlreadyRendering=function(){return(executionContext&6)!=0},exports$1.observeVisibleRects=function(hostRoot,selectors,callback,options){if(!supportsTestSelectors)throw Error(formatProdErrorMessage(363));hostRoot=findAllNodes(hostRoot,selectors);var disconnect=setupIntersectionObserver(hostRoot,callback,options).disconnect;return{disconnect:function(){disconnect()}}},exports$1.shouldError=function(){return null},exports$1.shouldSuspend=function(){return!1},exports$1.startHostTransition=function(formFiber,pendingState,action,formData){if(formFiber.tag!==5)throw Error(formatProdErrorMessage(476));var queue=ensureFormComponentIsStateful(formFiber).queue;startTransition(formFiber,queue,pendingState,NotPendingTransition,action===null?noop:function(){var stateHook=ensureFormComponentIsStateful(formFiber);return stateHook.next===null&&(stateHook=formFiber.alternate.memoizedState),dispatchSetStateInternal(formFiber,stateHook.next.queue,{},requestUpdateLane()),action(formData)})},exports$1.updateContainer=function(element,container,parentComponent,callback){var current=container.current,lane=requestUpdateLane();return updateContainerImpl(current,lane,element,container,parentComponent,callback),lane},exports$1.updateContainerSync=function(element,container,parentComponent,callback){return updateContainerImpl(container.current,2,element,container,parentComponent,callback),2},exports$1},module.exports.default=module.exports,Object.defineProperty(module.exports,`__esModule`,{value:!0})})),import_react_reconciler=__toESM(__commonJSMin(((exports,module)=>{module.exports=require_react_reconciler_production()}))(),1),import_scheduler=__toESM(require_scheduler(),1);function widestLine(string){let lineWidth=0;for(let line of string.split(`
|
|
51
51
|
`))lineWidth=Math.max(lineWidth,stringWidth(line));return lineWidth}const cache$1=new Map,measureText=text=>{if(text.length===0)return{width:0,height:0};let cachedDimensions=cache$1.get(text);if(cachedDimensions)return cachedDimensions;let dimensions={width:widestLine(text),height:text.split(`
|
|
52
|
-
`).length};return cache$1.set(text,dimensions),dimensions};function isFullwidthCodePoint(codePoint){return Number.isInteger(codePoint)?isFullWidth(codePoint)||isWide(codePoint):!1}const ESCAPES$1=new Set([27,144,152,155,156,157,158,159]),ANSI_HYPERLINK_ESC_PREFIX=`\x1B]8;`,ANSI_HYPERLINK_C1_PREFIX=`8;`,ANSI_HYPERLINK_ESC_CLOSE=`${ANSI_HYPERLINK_ESC_PREFIX};`,ANSI_HYPERLINK_C1_CLOSE=`${ANSI_HYPERLINK_C1_PREFIX};`,CODE_POINT_0=`0`.codePointAt(0),CODE_POINT_9=`9`.codePointAt(0),CODE_POINT_SEMICOLON=`;`.codePointAt(0),CODE_POINT_COLON=`:`.codePointAt(0),CODE_POINT_CSI_PARAMETER_START=`0`.codePointAt(0),CODE_POINT_CSI_PARAMETER_END=`?`.codePointAt(0),CODE_POINT_CSI_INTERMEDIATE_START=` `.codePointAt(0),CODE_POINT_CSI_INTERMEDIATE_END=`/`.codePointAt(0),CODE_POINT_CSI_FINAL_START=`@`.codePointAt(0),CODE_POINT_CSI_FINAL_END=`~`.codePointAt(0),EMOJI_PRESENTATION_GRAPHEME_REGEX=/\p{Emoji_Presentation}/v,GRAPHEME_SEGMENTER=new Intl.Segmenter(void 0,{granularity:`grapheme`}),endCodeNumbers=new Set;for(let[,end]of ansiStyles.codes)endCodeNumbers.add(end);function isSgrParameterCharacter(codePoint){return codePoint>=CODE_POINT_0&&codePoint<=CODE_POINT_9||codePoint===CODE_POINT_SEMICOLON||codePoint===CODE_POINT_COLON}function isCsiParameterCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_PARAMETER_START&&codePoint<=CODE_POINT_CSI_PARAMETER_END}function isCsiIntermediateCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_INTERMEDIATE_START&&codePoint<=CODE_POINT_CSI_INTERMEDIATE_END}function isCsiFinalCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_FINAL_START&&codePoint<=CODE_POINT_CSI_FINAL_END}function isRegionalIndicatorCodePoint(codePoint){return codePoint>=127462&&codePoint<=127487}function createControlParseResult(code,endIndex){return{token:{type:`control`,code},endIndex}}function isEmojiStyleGrapheme(grapheme){if(EMOJI_PRESENTATION_GRAPHEME_REGEX.test(grapheme))return!0;for(let character of grapheme){let codePoint=character.codePointAt(0);if(codePoint===65039||codePoint===8419)return!0}return!1}function getGraphemeWidth(grapheme){let regionalIndicatorCount=0;for(let character of grapheme){let codePoint=character.codePointAt(0);if(isFullwidthCodePoint(codePoint))return 2;isRegionalIndicatorCodePoint(codePoint)&®ionalIndicatorCount++}return regionalIndicatorCount>=1||isEmojiStyleGrapheme(grapheme)?2:1}function getSgrPrefix(code){return code.startsWith(``)?``:`\x1B[`}function createSgrCode(prefix,values){return`${prefix}${values.join(`;`)}m`}function getSgrFragments(code){let fragments=[],sgrPrefix=getSgrPrefix(code),parameterString;if(code.startsWith(`\x1B[`))parameterString=code.slice(2,-1);else if(code.startsWith(``))parameterString=code.slice(1,-1);else return fragments;let rawCodes=parameterString.length===0?[`0`]:parameterString.split(`;`),index=0;for(;index<rawCodes.length;){let codeNumber=Number.parseInt(rawCodes[index],10);if(Number.isNaN(codeNumber)){index++;continue}if(codeNumber===0){fragments.push({type:`reset`}),index++;continue}if(codeNumber===38||codeNumber===48){let colorType=Number.parseInt(rawCodes[index+1],10);if(colorType===5&&index+2<rawCodes.length){let openCode=createSgrCode(sgrPrefix,rawCodes.slice(index,index+3));fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index+=3;continue}if(colorType===2&&index+4<rawCodes.length){let openCode=createSgrCode(sgrPrefix,rawCodes.slice(index,index+5));fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index+=5;continue}let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index++;continue}if(endCodeNumbers.has(codeNumber)){fragments.push({type:`end`,endCode:ansiStyles.color.ansi(codeNumber)}),index++;continue}let mappedEndCode=ansiStyles.codes.get(codeNumber);if(mappedEndCode!==void 0){let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(mappedEndCode)}),index++;continue}let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.reset.open}),index++}return fragments.length===0&&fragments.push({type:`reset`}),fragments}function parseCsiCode(string,index){let escapeCodePoint=string.codePointAt(index),sequenceStartIndex;if(escapeCodePoint===27){if(string[index+1]!==`[`)return;sequenceStartIndex=index+2}else if(escapeCodePoint===155)sequenceStartIndex=index+1;else return;let hasCanonicalSgrParameters=!0;for(let sequenceIndex=sequenceStartIndex;sequenceIndex<string.length;sequenceIndex++){let codePoint=string.codePointAt(sequenceIndex);if(isCsiFinalCharacter$1(codePoint)){let code=string.slice(index,sequenceIndex+1);return string[sequenceIndex]!==`m`||!hasCanonicalSgrParameters?createControlParseResult(code,sequenceIndex+1):{token:{type:`sgr`,code,fragments:getSgrFragments(code)},endIndex:sequenceIndex+1}}if(isCsiParameterCharacter$1(codePoint)){isSgrParameterCharacter(codePoint)||(hasCanonicalSgrParameters=!1);continue}if(isCsiIntermediateCharacter$1(codePoint)){hasCanonicalSgrParameters=!1;continue}let endIndex=sequenceIndex;return createControlParseResult(string.slice(index,endIndex),endIndex)}return createControlParseResult(string.slice(index),string.length)}function parseHyperlinkCode(string,index){let hyperlinkPrefix,hyperlinkClose,codePoint=string.codePointAt(index);if(codePoint===27&&string.startsWith(ANSI_HYPERLINK_ESC_PREFIX,index))hyperlinkPrefix=ANSI_HYPERLINK_ESC_PREFIX,hyperlinkClose=ANSI_HYPERLINK_ESC_CLOSE;else if(codePoint===157&&string.startsWith(ANSI_HYPERLINK_C1_PREFIX,index))hyperlinkPrefix=ANSI_HYPERLINK_C1_PREFIX,hyperlinkClose=ANSI_HYPERLINK_C1_CLOSE;else return;let uriStart=string.indexOf(`;`,index+hyperlinkPrefix.length);if(uriStart===-1)return createControlParseResult(string.slice(index),string.length);for(let sequenceIndex=uriStart+1;sequenceIndex<string.length;sequenceIndex++){let character=string[sequenceIndex];if(character===`\x07`)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+1),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:`\x07`},endIndex:sequenceIndex+1};if(character===`\x1B`&&string[sequenceIndex+1]===`\\`)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+2),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:`\x1B\\`},endIndex:sequenceIndex+2};if(character===``)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+1),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:``},endIndex:sequenceIndex+1}}return createControlParseResult(string.slice(index),string.length)}function parseControlStringCode(string,index){let codePoint=string.codePointAt(index),sequenceStartIndex,supportsBellTerminator=!1;switch(codePoint){case 27:switch(string[index+1]){case`]`:sequenceStartIndex=index+2,supportsBellTerminator=!0;break;case`P`:case`X`:case`^`:case`_`:sequenceStartIndex=index+2;break;case`\\`:return createControlParseResult(`\x1B\\`,index+2);default:return}break;case 157:sequenceStartIndex=index+1,supportsBellTerminator=!0;break;case 144:case 152:case 158:case 159:sequenceStartIndex=index+1;break;case 156:return createControlParseResult(``,index+1);default:return}for(let sequenceIndex=sequenceStartIndex;sequenceIndex<string.length;sequenceIndex++){if(supportsBellTerminator&&string[sequenceIndex]===`\x07`)return createControlParseResult(string.slice(index,sequenceIndex+1),sequenceIndex+1);if(string[sequenceIndex]===`\x1B`&&string[sequenceIndex+1]===`\\`)return createControlParseResult(string.slice(index,sequenceIndex+2),sequenceIndex+2);if(string[sequenceIndex]===``)return createControlParseResult(string.slice(index,sequenceIndex+1),sequenceIndex+1)}return createControlParseResult(string.slice(index),string.length)}function parseAnsiCode(string,index){let codePoint=string.codePointAt(index);if(codePoint===27||codePoint===157){let hyperlinkCode=parseHyperlinkCode(string,index);if(hyperlinkCode)return hyperlinkCode}return parseControlStringCode(string,index)||parseCsiCode(string,index)}function appendTrailingAnsiTokens(string,index,tokens){for(;index<string.length;){let nextCodePoint=string.codePointAt(index);if(!ESCAPES$1.has(nextCodePoint))break;let escapeCode=parseAnsiCode(string,index);if(!escapeCode)break;tokens.push(escapeCode.token),index=escapeCode.endIndex}return index}function parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments){let segment=graphemeSegments.containing(index);if(!(!segment||segment.index!==index))return{token:{type:`character`,value:segment.segment,visibleWidth:getGraphemeWidth(segment.segment),isGraphemeContinuation:!1},endIndex:index+segment.segment.length}}function collectVisibleCharacters(string){let visibleCharacters=[],index=0;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){index=code.endIndex;continue}}let value=String.fromCodePoint(codePoint);visibleCharacters.push({value,visibleWidth:1,isGraphemeContinuation:!1}),index+=value.length}return visibleCharacters}function applyGraphemeMetadata(visibleCharacters){if(visibleCharacters.length===0)return;let visibleString=visibleCharacters.map(({value})=>value).join(``),scalarOffsets=[],scalarOffset=0;for(let visibleCharacter of visibleCharacters)scalarOffsets.push(scalarOffset),scalarOffset+=visibleCharacter.value.length;let scalarIndex=0;for(let segment of GRAPHEME_SEGMENTER.segment(visibleString)){for(;scalarIndex<visibleCharacters.length&&scalarOffsets[scalarIndex]<segment.index;)scalarIndex++;let graphemeIndex=scalarIndex,isFirstInGrapheme=!0;for(;graphemeIndex<visibleCharacters.length&&scalarOffsets[graphemeIndex]<segment.index+segment.segment.length;)visibleCharacters[graphemeIndex].visibleWidth=isFirstInGrapheme?getGraphemeWidth(segment.segment):0,visibleCharacters[graphemeIndex].isGraphemeContinuation=!isFirstInGrapheme,isFirstInGrapheme=!1,graphemeIndex++;scalarIndex=graphemeIndex}}function tokenizeAnsiWithVisibleSegmentation(string,{endCharacter=1/0}={}){let tokens=[],visibleCharacters=collectVisibleCharacters(string);applyGraphemeMetadata(visibleCharacters);let index=0,visibleCharacterIndex=0,visibleCount=0;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){tokens.push(code.token),index=code.endIndex;continue}}let value=String.fromCodePoint(codePoint),visibleCharacter=visibleCharacters[visibleCharacterIndex],visibleWidth=isFullwidthCodePoint(codePoint)?2:value.length;visibleCharacter&&(visibleWidth=visibleCharacter.visibleWidth);let token={type:`character`,value,visibleWidth,isGraphemeContinuation:visibleCharacter?visibleCharacter.isGraphemeContinuation:!1};if(tokens.push(token),index+=value.length,visibleCharacterIndex++,visibleCount+=token.visibleWidth,visibleCount>=endCharacter){let nextVisibleCharacter=visibleCharacters[visibleCharacterIndex];if(!nextVisibleCharacter||!nextVisibleCharacter.isGraphemeContinuation){index=appendTrailingAnsiTokens(string,index,tokens);break}}}return tokens}function areValuesInSameGrapheme(leftValue,rightValue){let pair=`${leftValue}${rightValue}`,splitIndex=leftValue.length;for(let segment of GRAPHEME_SEGMENTER.segment(pair)){if(segment.index===splitIndex)return!1;if(segment.index>splitIndex)return!0}return!0}function hasAnsiSplitContinuationAhead(string,startIndex,previousVisibleValue,graphemeSegments){if(!previousVisibleValue)return!1;let index=startIndex,hasAnsiCode=!1;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){hasAnsiCode=!0,index=code.endIndex;continue}}if(!hasAnsiCode)return!1;let characterToken=parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments);return characterToken?areValuesInSameGrapheme(previousVisibleValue,characterToken.token.value):!0}return!1}function tokenizeAnsi$1(string,{endCharacter=1/0}={}){let tokens=[],graphemeSegments=GRAPHEME_SEGMENTER.segment(string),index=0,visibleCount=0,previousVisibleValue,hasAnsiSinceLastVisible=!1;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){tokens.push(code.token),index=code.endIndex,hasAnsiSinceLastVisible=!0;continue}}let characterToken=parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments);if(!characterToken||hasAnsiSinceLastVisible&&previousVisibleValue&&areValuesInSameGrapheme(previousVisibleValue,characterToken.token.value))return tokenizeAnsiWithVisibleSegmentation(string,{endCharacter});if(tokens.push(characterToken.token),index=characterToken.endIndex,visibleCount+=characterToken.token.visibleWidth,hasAnsiSinceLastVisible=!1,previousVisibleValue=characterToken.token.value,visibleCount>=endCharacter){if(hasAnsiSplitContinuationAhead(string,index,previousVisibleValue,graphemeSegments))return tokenizeAnsiWithVisibleSegmentation(string,{endCharacter});index=appendTrailingAnsiTokens(string,index,tokens);break}}return tokens}function applySgrFragments(activeStyles,fragments){for(let fragment of fragments)switch(fragment.type){case`reset`:activeStyles.clear();break;case`end`:activeStyles.delete(fragment.endCode);break;case`start`:activeStyles.delete(fragment.endCode),activeStyles.set(fragment.endCode,fragment.code);break;default:break}return activeStyles}function undoAnsiCodes$1(activeStyles){return[...activeStyles.keys()].toReversed().join(``)}function closeHyperlink(hyperlinkToken){return`${hyperlinkToken.closePrefix}${hyperlinkToken.terminator}`}function shouldIncludeSgrAfterEnd(token,activeStyles){let hasStartFragment=!1,hasClosingEffect=!1;for(let fragment of token.fragments){if(fragment.type===`start`){hasStartFragment=!0;continue}if(fragment.type===`reset`&&activeStyles.size>0){hasClosingEffect=!0;continue}fragment.type===`end`&&activeStyles.has(fragment.endCode)&&(hasClosingEffect=!0)}return hasClosingEffect&&!hasStartFragment}function hasSgrStartFragment(token){return token.fragments.some(fragment=>fragment.type===`start`)}function discardPendingHyperlink(parameters){if(parameters.activeHyperlink&&!parameters.activeHyperlinkHasVisibleText&¶meters.activeHyperlinkOutputIndex!==void 0){let openCodeLength=parameters.activeHyperlink.code.length;parameters.returnValue=parameters.returnValue.slice(0,parameters.activeHyperlinkOutputIndex)+parameters.returnValue.slice(parameters.activeHyperlinkOutputIndex+openCodeLength),parameters.pendingSgrOutputIndex!==void 0&¶meters.pendingSgrOutputIndex>parameters.activeHyperlinkOutputIndex&&(parameters.pendingSgrOutputIndex-=openCodeLength)}parameters.activeHyperlink=void 0,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0}function applySgrToken(parameters){return parameters.isPastEnd&&!shouldIncludeSgrAfterEnd(parameters.token,parameters.activeStyles)?parameters:(parameters.include&&hasSgrStartFragment(parameters.token)&¶meters.pendingSgrOutputIndex===void 0&&(parameters.pendingSgrOutputIndex=parameters.returnValue.length,parameters.pendingSgrActiveStyles=new Map(parameters.activeStyles)),parameters.activeStyles=applySgrFragments(parameters.activeStyles,parameters.token.fragments),parameters.include&&(parameters.returnValue+=parameters.token.code),parameters)}function applyHyperlinkToken(parameters){if(parameters.isPastEnd&&(parameters.token.action!==`close`||!parameters.activeHyperlink))return parameters;if(parameters.token.action===`open`)parameters.activeHyperlink=parameters.token,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0,parameters.include&&(parameters.activeHyperlinkOutputIndex=parameters.returnValue.length);else if(parameters.token.action===`close`){if(parameters.include&¶meters.activeHyperlink&&!parameters.activeHyperlinkHasVisibleText)return discardPendingHyperlink(parameters),parameters;parameters.activeHyperlink=void 0,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0}return parameters.include&&(parameters.returnValue+=parameters.token.code),parameters}function applyControlToken(parameters){return!parameters.isPastEnd&¶meters.include&&(parameters.returnValue+=parameters.token.code),parameters}function applyCharacterToken(parameters){return!parameters.include&¶meters.position>=parameters.start&&!parameters.token.isGraphemeContinuation&&(parameters.include=!0,parameters.returnValue=[...parameters.activeStyles.values()].join(``),parameters.activeHyperlink&&(parameters.activeHyperlinkOutputIndex=parameters.returnValue.length,parameters.returnValue+=parameters.activeHyperlink.code)),parameters.include&&(parameters.returnValue+=parameters.token.value,parameters.pendingSgrOutputIndex=void 0,parameters.pendingSgrActiveStyles=void 0,parameters.activeHyperlink&&(parameters.activeHyperlinkHasVisibleText=!0)),parameters.position+=parameters.token.visibleWidth,parameters}const tokenHandlers={sgr:applySgrToken,hyperlink:applyHyperlinkToken,control:applyControlToken,character:applyCharacterToken};function applyToken(parameters){let tokenHandler=tokenHandlers[parameters.token.type];return tokenHandler?tokenHandler(parameters):parameters}function createHasContinuationAheadMap(tokens){let hasContinuationAhead=Array.from({length:tokens.length},()=>!1),nextCharacterIsContinuation=!1;for(let tokenIndex=tokens.length-1;tokenIndex>=0;tokenIndex--){let token=tokens[tokenIndex];hasContinuationAhead[tokenIndex]=nextCharacterIsContinuation,token.type===`character`&&(nextCharacterIsContinuation=!!token.isGraphemeContinuation)}return hasContinuationAhead}function isPastEndBoundary(token,position,end){return end===void 0?!1:position>=end?!0:token.type===`character`&&!token.isGraphemeContinuation&&position+token.visibleWidth>end}function sliceAnsi(string,start,end){let tokens=tokenizeAnsi$1(string,{endCharacter:end}),hasContinuationAhead=createHasContinuationAheadMap(tokens),activeStyles=new Map,activeHyperlink,activeHyperlinkHasVisibleText=!1,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position=0,returnValue=``,include=!1;for(let[tokenIndex,token]of tokens.entries()){let isPastEnd=isPastEndBoundary(token,position,end);if(isPastEnd&&token.type!==`character`&&hasContinuationAhead[tokenIndex]&&(isPastEnd=!1),isPastEnd&&token.type===`character`&&!token.isGraphemeContinuation){if(activeHyperlink&&!activeHyperlinkHasVisibleText){let hyperlinkState={activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,returnValue};discardPendingHyperlink(hyperlinkState),{activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,returnValue}=hyperlinkState}pendingSgrOutputIndex!==void 0&&(returnValue=returnValue.slice(0,pendingSgrOutputIndex),activeStyles=pendingSgrActiveStyles,pendingSgrOutputIndex=void 0,pendingSgrActiveStyles=void 0);break}({activeStyles,activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position,returnValue,include}=applyToken({token,isPastEnd,start,activeStyles,activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position,returnValue,include}))}return include?(activeHyperlink&&(returnValue+=closeHyperlink(activeHyperlink)),returnValue+=undoAnsiCodes$1(activeStyles),returnValue):``}function getIndexOfNearestSpace(string,wantedIndex,shouldSearchRight){if(string.charAt(wantedIndex)===` `)return wantedIndex;let direction=shouldSearchRight?1:-1;for(let index=0;index<=3;index++){let finalIndex=wantedIndex+index*direction;if(string.charAt(finalIndex)===` `)return finalIndex}return wantedIndex}function cliTruncate(text,columns,options={}){let{position=`end`,space=!1,preferTruncationOnSpace=!1}=options,{truncationCharacter=`…`}=options;if(typeof text!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof text}`);if(typeof columns!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);if(columns<1)return``;let length=stringWidth(text);if(length<=columns)return text;if(columns===1)return truncationCharacter;let ANSI={ESC:27,LEFT_BRACKET:91,LETTER_M:109},isSgrParameter=code=>code>=48&&code<=57||code===59;function leadingSgrSpanEndIndex(string){let index=0;for(;index+2<string.length&&string.codePointAt(index)===ANSI.ESC&&string.codePointAt(index+1)===ANSI.LEFT_BRACKET;){let j=index+2;for(;j<string.length&&isSgrParameter(string.codePointAt(j));)j++;if(j<string.length&&string.codePointAt(j)===ANSI.LETTER_M){index=j+1;continue}break}return index}function trailingSgrSpanStartIndex(string){let start=string.length;for(;start>1&&string.codePointAt(start-1)===ANSI.LETTER_M;){let j=start-2;for(;j>=0&&isSgrParameter(string.codePointAt(j));)j--;if(j>=1&&string.codePointAt(j-1)===ANSI.ESC&&string.codePointAt(j)===ANSI.LEFT_BRACKET){start=j-1;continue}break}return start}function appendWithInheritedStyleFromEnd(visible,suffix){let start=trailingSgrSpanStartIndex(visible);return start===visible.length?visible+suffix:visible.slice(0,start)+suffix+visible.slice(start)}function prependWithInheritedStyleFromStart(prefix,visible){let end=leadingSgrSpanEndIndex(visible);return end===0?prefix+visible:visible.slice(0,end)+prefix+visible.slice(end)}if(position===`start`){if(preferTruncationOnSpace){let right=sliceAnsi(text,getIndexOfNearestSpace(text,length-columns+1,!0),length).trim();return prependWithInheritedStyleFromStart(truncationCharacter,right)}space&&(truncationCharacter+=` `);let right=sliceAnsi(text,length-columns+stringWidth(truncationCharacter),length);return prependWithInheritedStyleFromStart(truncationCharacter,right)}if(position===`middle`){space&&(truncationCharacter=` ${truncationCharacter} `);let half=Math.floor(columns/2);if(preferTruncationOnSpace){let spaceNearFirstBreakPoint=getIndexOfNearestSpace(text,half),spaceNearSecondBreakPoint=getIndexOfNearestSpace(text,length-(columns-half)+1,!0);return sliceAnsi(text,0,spaceNearFirstBreakPoint)+truncationCharacter+sliceAnsi(text,spaceNearSecondBreakPoint,length).trim()}return sliceAnsi(text,0,half)+truncationCharacter+sliceAnsi(text,length-(columns-half)+stringWidth(truncationCharacter),length)}if(position===`end`)return preferTruncationOnSpace?appendWithInheritedStyleFromEnd(sliceAnsi(text,0,getIndexOfNearestSpace(text,columns-1)),truncationCharacter):(space&&(truncationCharacter=` ${truncationCharacter}`),appendWithInheritedStyleFromEnd(sliceAnsi(text,0,columns-stringWidth(truncationCharacter)),truncationCharacter));throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`)}const cache={},wrapText=(text,maxWidth,wrapType)=>{let cacheKey=text+String(maxWidth)+String(wrapType),cachedText=cache[cacheKey];if(cachedText)return cachedText;let wrappedText=text;if(wrapType===`wrap`&&(wrappedText=wrapAnsi(text,maxWidth,{trim:!1,hard:!0})),wrapType===`hard`&&(wrappedText=wrapAnsi(text,maxWidth,{trim:!1,hard:!0,wordWrap:!1})),wrapType.startsWith(`truncate`)){let position=`end`;wrapType===`truncate-middle`&&(position=`middle`),wrapType===`truncate-start`&&(position=`start`),wrappedText=cliTruncate(text,maxWidth,{position})}return cache[cacheKey]=wrappedText,wrappedText},isCsiParameterCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=48&&codePoint<=63},isCsiIntermediateCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=32&&codePoint<=47},isCsiFinalCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=64&&codePoint<=126},isEscapeIntermediateCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=32&&codePoint<=47},isEscapeFinalCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=48&&codePoint<=126},isC1ControlCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=128&&codePoint<=159},readCsiSequence=(text,fromIndex)=>{let index=fromIndex;for(;index<text.length;){let character=text[index];if(!isCsiParameterCharacter(character))break;index++}let parameterString=text.slice(fromIndex,index),intermediateStartIndex=index;for(;index<text.length;){let character=text[index];if(!isCsiIntermediateCharacter(character))break;index++}let intermediateString=text.slice(intermediateStartIndex,index),finalCharacter=text[index];if(!(finalCharacter===void 0||!isCsiFinalCharacter(finalCharacter)))return{endIndex:index+1,parameterString,intermediateString,finalCharacter}},findControlStringTerminatorIndex=(text,fromIndex,allowBellTerminator)=>{for(let index=fromIndex;index<text.length;index++){let character=text[index];if(allowBellTerminator&&character===`\x07`||character===``)return index+1;if(character===`\x1B`){let followingCharacter=text[index+1];if(followingCharacter===`\x1B`){index++;continue}if(followingCharacter===`\\`)return index+2}}},readEscapeSequence=(text,fromIndex)=>{let index=fromIndex;for(;index<text.length;){let character=text[index];if(!isEscapeIntermediateCharacter(character))break;index++}let intermediateString=text.slice(fromIndex,index),finalCharacter=text[index];if(!(finalCharacter===void 0||!isEscapeFinalCharacter(finalCharacter)))return{endIndex:index+1,intermediateString,finalCharacter}},getControlStringFromEscapeIntroducer=character=>{switch(character){case`]`:return{type:`osc`,allowBellTerminator:!0};case`P`:return{type:`dcs`,allowBellTerminator:!1};case`^`:return{type:`pm`,allowBellTerminator:!1};case`_`:return{type:`apc`,allowBellTerminator:!1};case`X`:return{type:`sos`,allowBellTerminator:!1};default:return}},getControlStringFromC1Introducer=character=>{switch(character){case``:return{type:`osc`,allowBellTerminator:!0};case``:return{type:`dcs`,allowBellTerminator:!1};case``:return{type:`pm`,allowBellTerminator:!1};case``:return{type:`apc`,allowBellTerminator:!1};case``:return{type:`sos`,allowBellTerminator:!1};default:return}},hasAnsiControlCharacters=text=>{if(text.includes(`\x1B`))return!0;for(let character of text)if(isC1ControlCharacter(character))return!0;return!1},malformedFromIndex=(tokens,text,textStartIndex,fromIndex)=>(fromIndex>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,fromIndex)}),tokens.push({type:`invalid`,value:text.slice(fromIndex)}),tokens),tokenizeAnsi=text=>{if(!hasAnsiControlCharacters(text))return[{type:`text`,value:text}];let tokens=[],textStartIndex=0;for(let index=0;index<text.length;){let character=text[index];if(character===void 0)break;if(character===`\x1B`){let followingCharacter=text[index+1];if(followingCharacter===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);if(followingCharacter===`[`){let csiSequence=readCsiSequence(text,index+2);if(csiSequence===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`csi`,value:text.slice(index,csiSequence.endIndex),parameterString:csiSequence.parameterString,intermediateString:csiSequence.intermediateString,finalCharacter:csiSequence.finalCharacter}),index=csiSequence.endIndex,textStartIndex=index;continue}let escapeControlString=getControlStringFromEscapeIntroducer(followingCharacter);if(escapeControlString!==void 0){let controlStringTerminatorIndex=findControlStringTerminatorIndex(text,index+2,escapeControlString.allowBellTerminator);if(controlStringTerminatorIndex===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:escapeControlString.type,value:text.slice(index,controlStringTerminatorIndex)}),index=controlStringTerminatorIndex,textStartIndex=index;continue}let escapeSequence=readEscapeSequence(text,index+1);if(escapeSequence===void 0){if(isEscapeIntermediateCharacter(followingCharacter))return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),index++,textStartIndex=index;continue}index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`esc`,value:text.slice(index,escapeSequence.endIndex),intermediateString:escapeSequence.intermediateString,finalCharacter:escapeSequence.finalCharacter}),index=escapeSequence.endIndex,textStartIndex=index;continue}if(character===``){let csiSequence=readCsiSequence(text,index+1);if(csiSequence===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`csi`,value:text.slice(index,csiSequence.endIndex),parameterString:csiSequence.parameterString,intermediateString:csiSequence.intermediateString,finalCharacter:csiSequence.finalCharacter}),index=csiSequence.endIndex,textStartIndex=index;continue}let c1ControlString=getControlStringFromC1Introducer(character);if(c1ControlString!==void 0){let controlStringTerminatorIndex=findControlStringTerminatorIndex(text,index+1,c1ControlString.allowBellTerminator);if(controlStringTerminatorIndex===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:c1ControlString.type,value:text.slice(index,controlStringTerminatorIndex)}),index=controlStringTerminatorIndex,textStartIndex=index;continue}if(character===``){index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`st`,value:character}),index++,textStartIndex=index;continue}if(isC1ControlCharacter(character)){index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`c1`,value:character}),index++,textStartIndex=index;continue}index++}return textStartIndex<text.length&&tokens.push({type:`text`,value:text.slice(textStartIndex)}),tokens},sgrParametersRegex=/^[\d:;]*$/,sanitizeAnsi=text=>{if(!hasAnsiControlCharacters(text))return text;let output=``;for(let token of tokenizeAnsi(text)){if(token.type===`text`||token.type===`osc`){output+=token.value;continue}token.type===`csi`&&token.finalCharacter===`m`&&token.intermediateString===``&&sgrParametersRegex.test(token.parameterString)&&(output+=token.value)}return output},squashTextNodes=node=>{let text=``;for(let index=0;index<node.childNodes.length;index++){let childNode=node.childNodes[index];if(childNode===void 0)continue;let nodeText=``;childNode.nodeName===`#text`?nodeText=childNode.nodeValue:((childNode.nodeName===`ink-text`||childNode.nodeName===`ink-virtual-text`)&&(nodeText=squashTextNodes(childNode)),nodeText.length>0&&typeof childNode.internal_transform==`function`&&(nodeText=childNode.internal_transform(nodeText,index))),text+=nodeText}return sanitizeAnsi(text)},createNode=nodeName=>{let node={nodeName,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:nodeName===`ink-virtual-text`?void 0:Yoga.Node.create(),internal_accessibility:{}};return nodeName===`ink-text`&&node.yogaNode?.setMeasureFunc(measureTextNode.bind(null,node)),node},appendChildNode=(node,childNode)=>{childNode.parentNode&&removeChildNode(childNode.parentNode,childNode),childNode.parentNode=node,node.childNodes.push(childNode),childNode.yogaNode&&node.yogaNode?.insertChild(childNode.yogaNode,node.yogaNode.getChildCount()),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},insertBeforeNode=(node,newChildNode,beforeChildNode)=>{newChildNode.parentNode&&removeChildNode(newChildNode.parentNode,newChildNode),newChildNode.parentNode=node;let index=node.childNodes.indexOf(beforeChildNode);index>=0?(node.childNodes.splice(index,0,newChildNode),newChildNode.yogaNode&&node.yogaNode?.insertChild(newChildNode.yogaNode,index)):(node.childNodes.push(newChildNode),newChildNode.yogaNode&&node.yogaNode?.insertChild(newChildNode.yogaNode,node.yogaNode.getChildCount())),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},removeChildNode=(node,removeNode)=>{removeNode.yogaNode&&removeNode.parentNode?.yogaNode?.removeChild(removeNode.yogaNode),removeNode.parentNode=void 0;let index=node.childNodes.indexOf(removeNode);index>=0&&node.childNodes.splice(index,1),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},setAttribute=(node,key,value)=>{if(key===`internal_accessibility`){node.internal_accessibility=value;return}node.attributes[key]=value},setStyle=(node,style)=>{node.style=style??{}},createTextNode=text=>{let node={nodeName:`#text`,nodeValue:text,yogaNode:void 0,parentNode:void 0,style:{}};return setTextNodeValue(node,text),node},measureTextNode=function(node,width){let text=node.nodeName===`#text`?node.nodeValue:squashTextNodes(node),dimensions=measureText(text);return dimensions.width<=width||dimensions.width>=1&&width>0&&width<1?dimensions:measureText(wrapText(text,width,node.style?.textWrap??`wrap`))},findClosestYogaNode=node=>{if(node?.parentNode)return node.yogaNode??findClosestYogaNode(node.parentNode)},markNodeAsDirty=node=>{findClosestYogaNode(node)?.markDirty()},setTextNodeValue=(node,text)=>{typeof text!=`string`&&(text=String(text)),node.nodeValue=text,markNodeAsDirty(node)},emitLayoutListeners=rootNode=>{if(!(rootNode.nodeName!==`ink-root`||!rootNode.internal_layoutListeners))for(let listener of rootNode.internal_layoutListeners)listener()},positionEdges=[[`top`,Yoga.EDGE_TOP],[`right`,Yoga.EDGE_RIGHT],[`bottom`,Yoga.EDGE_BOTTOM],[`left`,Yoga.EDGE_LEFT]],applyPositionStyles=(node,style)=>{if(`position`in style){let positionType=Yoga.POSITION_TYPE_RELATIVE;style.position===`absolute`?positionType=Yoga.POSITION_TYPE_ABSOLUTE:style.position===`static`&&(positionType=Yoga.POSITION_TYPE_STATIC),node.setPositionType(positionType)}for(let[property,edge]of positionEdges){if(!(property in style))continue;let value=style[property];if(typeof value==`string`){node.setPositionPercent(edge,Number.parseFloat(value));continue}node.setPosition(edge,value)}},applyMarginStyles=(node,style)=>{`margin`in style&&node.setMargin(Yoga.EDGE_ALL,style.margin??0),`marginX`in style&&node.setMargin(Yoga.EDGE_HORIZONTAL,style.marginX??0),`marginY`in style&&node.setMargin(Yoga.EDGE_VERTICAL,style.marginY??0),`marginLeft`in style&&node.setMargin(Yoga.EDGE_START,style.marginLeft??0),`marginRight`in style&&node.setMargin(Yoga.EDGE_END,style.marginRight??0),`marginTop`in style&&node.setMargin(Yoga.EDGE_TOP,style.marginTop??0),`marginBottom`in style&&node.setMargin(Yoga.EDGE_BOTTOM,style.marginBottom??0)},applyPaddingStyles=(node,style)=>{`padding`in style&&node.setPadding(Yoga.EDGE_ALL,style.padding??0),`paddingX`in style&&node.setPadding(Yoga.EDGE_HORIZONTAL,style.paddingX??0),`paddingY`in style&&node.setPadding(Yoga.EDGE_VERTICAL,style.paddingY??0),`paddingLeft`in style&&node.setPadding(Yoga.EDGE_LEFT,style.paddingLeft??0),`paddingRight`in style&&node.setPadding(Yoga.EDGE_RIGHT,style.paddingRight??0),`paddingTop`in style&&node.setPadding(Yoga.EDGE_TOP,style.paddingTop??0),`paddingBottom`in style&&node.setPadding(Yoga.EDGE_BOTTOM,style.paddingBottom??0)},applyFlexStyles=(node,style)=>{`flexGrow`in style&&node.setFlexGrow(style.flexGrow??0),`flexShrink`in style&&node.setFlexShrink(typeof style.flexShrink==`number`?style.flexShrink:1),`flexWrap`in style&&(style.flexWrap===`nowrap`&&node.setFlexWrap(Yoga.WRAP_NO_WRAP),style.flexWrap===`wrap`&&node.setFlexWrap(Yoga.WRAP_WRAP),style.flexWrap===`wrap-reverse`&&node.setFlexWrap(Yoga.WRAP_WRAP_REVERSE)),`flexDirection`in style&&(style.flexDirection===`row`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW),style.flexDirection===`row-reverse`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE),style.flexDirection===`column`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN),style.flexDirection===`column-reverse`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE)),`flexBasis`in style&&(typeof style.flexBasis==`number`?node.setFlexBasis(style.flexBasis):typeof style.flexBasis==`string`?node.setFlexBasisPercent(Number.parseInt(style.flexBasis,10)):node.setFlexBasisAuto()),`alignItems`in style&&((style.alignItems===`stretch`||!style.alignItems)&&node.setAlignItems(Yoga.ALIGN_STRETCH),style.alignItems===`flex-start`&&node.setAlignItems(Yoga.ALIGN_FLEX_START),style.alignItems===`center`&&node.setAlignItems(Yoga.ALIGN_CENTER),style.alignItems===`flex-end`&&node.setAlignItems(Yoga.ALIGN_FLEX_END),style.alignItems===`baseline`&&node.setAlignItems(Yoga.ALIGN_BASELINE)),`alignSelf`in style&&((style.alignSelf===`auto`||!style.alignSelf)&&node.setAlignSelf(Yoga.ALIGN_AUTO),style.alignSelf===`flex-start`&&node.setAlignSelf(Yoga.ALIGN_FLEX_START),style.alignSelf===`center`&&node.setAlignSelf(Yoga.ALIGN_CENTER),style.alignSelf===`flex-end`&&node.setAlignSelf(Yoga.ALIGN_FLEX_END),style.alignSelf===`stretch`&&node.setAlignSelf(Yoga.ALIGN_STRETCH),style.alignSelf===`baseline`&&node.setAlignSelf(Yoga.ALIGN_BASELINE)),`alignContent`in style&&((style.alignContent===`flex-start`||!style.alignContent)&&node.setAlignContent(Yoga.ALIGN_FLEX_START),style.alignContent===`center`&&node.setAlignContent(Yoga.ALIGN_CENTER),style.alignContent===`flex-end`&&node.setAlignContent(Yoga.ALIGN_FLEX_END),style.alignContent===`space-between`&&node.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN),style.alignContent===`space-around`&&node.setAlignContent(Yoga.ALIGN_SPACE_AROUND),style.alignContent===`space-evenly`&&node.setAlignContent(Yoga.ALIGN_SPACE_EVENLY),style.alignContent===`stretch`&&node.setAlignContent(Yoga.ALIGN_STRETCH)),`justifyContent`in style&&((style.justifyContent===`flex-start`||!style.justifyContent)&&node.setJustifyContent(Yoga.JUSTIFY_FLEX_START),style.justifyContent===`center`&&node.setJustifyContent(Yoga.JUSTIFY_CENTER),style.justifyContent===`flex-end`&&node.setJustifyContent(Yoga.JUSTIFY_FLEX_END),style.justifyContent===`space-between`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN),style.justifyContent===`space-around`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND),style.justifyContent===`space-evenly`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY))},applyDimensionStyles=(node,style)=>{`width`in style&&(typeof style.width==`number`?node.setWidth(style.width):typeof style.width==`string`?node.setWidthPercent(Number.parseInt(style.width,10)):node.setWidthAuto()),`height`in style&&(typeof style.height==`number`?node.setHeight(style.height):typeof style.height==`string`?node.setHeightPercent(Number.parseInt(style.height,10)):node.setHeightAuto()),`minWidth`in style&&(typeof style.minWidth==`string`?node.setMinWidthPercent(Number.parseInt(style.minWidth,10)):node.setMinWidth(style.minWidth??0)),`minHeight`in style&&(typeof style.minHeight==`string`?node.setMinHeightPercent(Number.parseInt(style.minHeight,10)):node.setMinHeight(style.minHeight??0)),`maxWidth`in style&&(typeof style.maxWidth==`string`?node.setMaxWidthPercent(Number.parseInt(style.maxWidth,10)):node.setMaxWidth(style.maxWidth)),`maxHeight`in style&&(typeof style.maxHeight==`string`?node.setMaxHeightPercent(Number.parseInt(style.maxHeight,10)):node.setMaxHeight(style.maxHeight)),`aspectRatio`in style&&node.setAspectRatio(style.aspectRatio)},applyDisplayStyles=(node,style)=>{`display`in style&&node.setDisplay(style.display===`flex`?Yoga.DISPLAY_FLEX:Yoga.DISPLAY_NONE)},applyBorderStyles=(node,style,currentStyle)=>{if(!(`borderStyle`in style||`borderTop`in style||`borderBottom`in style||`borderLeft`in style||`borderRight`in style))return;let borderWidth=currentStyle.borderStyle?1:0;node.setBorder(Yoga.EDGE_TOP,currentStyle.borderTop===!1?0:borderWidth),node.setBorder(Yoga.EDGE_BOTTOM,currentStyle.borderBottom===!1?0:borderWidth),node.setBorder(Yoga.EDGE_LEFT,currentStyle.borderLeft===!1?0:borderWidth),node.setBorder(Yoga.EDGE_RIGHT,currentStyle.borderRight===!1?0:borderWidth)},applyGapStyles=(node,style)=>{`gap`in style&&node.setGap(Yoga.GUTTER_ALL,style.gap??0),`columnGap`in style&&node.setGap(Yoga.GUTTER_COLUMN,style.columnGap??0),`rowGap`in style&&node.setGap(Yoga.GUTTER_ROW,style.rowGap??0)},styles=(node,style={},currentStyle=style)=>{applyPositionStyles(node,style),applyMarginStyles(node,style),applyPaddingStyles(node,style),applyFlexStyles(node,style),applyDimensionStyles(node,style),applyDisplayStyles(node,style),applyBorderStyles(node,style,currentStyle),applyGapStyles(node,style)};if(process$1.env.DEV===`true`){let isDevtoolsInstalled=!1;try{import.meta.resolve(`react-devtools-core`),isDevtoolsInstalled=!0}catch{}isDevtoolsInstalled&&await import(`./devtools-eMFaIsAT.js`)}const diff=(before,after)=>{if(before===after)return;if(!before)return after;let changed={},isChanged=!1;for(let key of Object.keys(before))(!after||!Object.hasOwn(after,key))&&(changed[key]=void 0,isChanged=!0);if(after)for(let key of Object.keys(after))after[key]!==before[key]&&(changed[key]=after[key],isChanged=!0);return isChanged?changed:void 0},cleanupYogaNode=node=>{node?.unsetMeasureFunc(),node?.freeRecursive()};let currentUpdatePriority=import_constants.NoEventPriority,currentRootNode;async function loadPackageJson(){let content=(await import(`node:fs`)).readFileSync(new URL(`../package.json`,import.meta.url),`utf8`),parsedContent=JSON.parse(content);return{name:parsedContent?.name,version:parsedContent?.version}}let packageInfo={name:`ink`,version:import_react.version};if(process$1.env.DEV===`true`)try{let loaded=await loadPackageJson();packageInfo={name:loaded.name||packageInfo.name,version:loaded.version||packageInfo.version}}catch(error){console.warn(`Failed to load package.json in development mode. Falling back to default renderer metadata.`,error)}var reconciler_default=(0,import_react_reconciler.default)({getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,resetAfterCommit(rootNode){if(typeof rootNode.onComputeLayout==`function`&&rootNode.onComputeLayout(),emitLayoutListeners(rootNode),rootNode.staticNode!==rootNode.previousStaticNode&&(rootNode.previousStaticNode=rootNode.staticNode,typeof rootNode.onStaticChange==`function`&&rootNode.onStaticChange()),rootNode.isStaticDirty){rootNode.isStaticDirty=!1,typeof rootNode.onImmediateRender==`function`&&rootNode.onImmediateRender();return}typeof rootNode.onRender==`function`&&rootNode.onRender()},getChildHostContext(parentHostContext,type){let previousIsInsideText=parentHostContext.isInsideText,isInsideText=type===`ink-text`||type===`ink-virtual-text`;return previousIsInsideText===isInsideText?parentHostContext:{isInsideText}},shouldSetTextContent:()=>!1,createInstance(originalType,newProps,rootNode,hostContext){if(hostContext.isInsideText&&originalType===`ink-box`)throw Error(`<Box> can’t be nested inside <Text> component`);let node=createNode(originalType===`ink-text`&&hostContext.isInsideText?`ink-virtual-text`:originalType);for(let[key,value]of Object.entries(newProps))if(key!==`children`){if(key===`style`){setStyle(node,value),node.yogaNode&&styles(node.yogaNode,value);continue}if(key===`internal_transform`){node.internal_transform=value;continue}if(key===`internal_static`){currentRootNode=rootNode,node.internal_static=!0,rootNode.isStaticDirty=!0,rootNode.staticNode=node;continue}setAttribute(node,key,value)}return node},createTextInstance(text,_root,hostContext){if(!hostContext.isInsideText)throw Error(`Text string "${text}" must be rendered inside <Text> component`);return createTextNode(text)},resetTextContent(){},hideTextInstance(node){setTextNodeValue(node,``)},unhideTextInstance(node,text){setTextNodeValue(node,text)},getPublicInstance:instance=>instance,hideInstance(node){node.yogaNode?.setDisplay(Yoga.DISPLAY_NONE)},unhideInstance(node){node.yogaNode?.setDisplay(Yoga.DISPLAY_FLEX)},appendInitialChild:appendChildNode,appendChild:appendChildNode,insertBefore:insertBeforeNode,finalizeInitialChildren(){return!1},isPrimaryRenderer:!0,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,supportsMicrotasks:!0,scheduleMicrotask:queueMicrotask,scheduleCallback:import_scheduler.unstable_scheduleCallback,cancelCallback:import_scheduler.unstable_cancelCallback,shouldYield:import_scheduler.unstable_shouldYield,now:import_scheduler.unstable_now,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},getInstanceFromNode:()=>null,prepareScopeUpdate(){},getInstanceFromScope:()=>null,appendChildToContainer:appendChildNode,insertInContainerBefore:insertBeforeNode,removeChildFromContainer(node,removeNode){removeChildNode(node,removeNode),cleanupYogaNode(removeNode.yogaNode),removeNode.internal_static&¤tRootNode?.staticNode===removeNode&&(currentRootNode.staticNode=void 0)},commitUpdate(node,_type,oldProps,newProps){currentRootNode&&node.internal_static&&(currentRootNode.isStaticDirty=!0);let props=diff(oldProps,newProps),style=diff(oldProps.style,newProps.style);if(!(!props&&!style)){if(props)for(let[key,value]of Object.entries(props)){if(key===`style`){setStyle(node,value);continue}if(key===`internal_transform`){node.internal_transform=value;continue}if(key===`internal_static`){node.internal_static=!0;continue}setAttribute(node,key,value)}style&&node.yogaNode&&styles(node.yogaNode,style,newProps.style??{})}},commitTextUpdate(node,_oldText,newText){setTextNodeValue(node,newText)},removeChild(node,removeNode){removeChildNode(node,removeNode),cleanupYogaNode(removeNode.yogaNode),removeNode.internal_static&¤tRootNode?.staticNode===removeNode&&(currentRootNode.staticNode=void 0)},setCurrentUpdatePriority(newPriority){currentUpdatePriority=newPriority},getCurrentUpdatePriority:()=>currentUpdatePriority,resolveUpdatePriority(){return currentUpdatePriority===import_constants.NoEventPriority?import_constants.DefaultEventPriority:currentUpdatePriority},maySuspendCommit(){return!0},NotPendingTransition:void 0,HostTransitionContext:(0,import_react.createContext)(null),resetFormInstance(){},requestPostPaintCallback(){},shouldAttemptEagerTransition(){return!1},trackSchedulerEvent(){},resolveEventType(){return null},resolveEventTimeStamp(){return-1.1},preloadInstance(){return!0},startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady(){return null},rendererPackageName:packageInfo.name,rendererVersion:packageInfo.version});function indentString(string,count=1,options={}){let{indent=` `,includeEmptyLines=!1}=options;if(typeof string!=`string`)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof string}\``);if(typeof count!=`number`)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``);if(count<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${count}\``);if(typeof indent!=`string`)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\``);if(count===0)return string;let regex=includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return string.replace(regex,indent.repeat(count))}const getMaxWidth=yogaNode=>yogaNode.getComputedWidth()-yogaNode.getComputedPadding(Yoga.EDGE_LEFT)-yogaNode.getComputedPadding(Yoga.EDGE_RIGHT)-yogaNode.getComputedBorder(Yoga.EDGE_LEFT)-yogaNode.getComputedBorder(Yoga.EDGE_RIGHT);var cli_boxes_default={single:{topLeft:`┌`,top:`─`,topRight:`┐`,right:`│`,bottomRight:`┘`,bottom:`─`,bottomLeft:`└`,left:`│`},double:{topLeft:`╔`,top:`═`,topRight:`╗`,right:`║`,bottomRight:`╝`,bottom:`═`,bottomLeft:`╚`,left:`║`},round:{topLeft:`╭`,top:`─`,topRight:`╮`,right:`│`,bottomRight:`╯`,bottom:`─`,bottomLeft:`╰`,left:`│`},bold:{topLeft:`┏`,top:`━`,topRight:`┓`,right:`┃`,bottomRight:`┛`,bottom:`━`,bottomLeft:`┗`,left:`┃`},singleDouble:{topLeft:`╓`,top:`─`,topRight:`╖`,right:`║`,bottomRight:`╜`,bottom:`─`,bottomLeft:`╙`,left:`║`},doubleSingle:{topLeft:`╒`,top:`═`,topRight:`╕`,right:`│`,bottomRight:`╛`,bottom:`═`,bottomLeft:`╘`,left:`│`},classic:{topLeft:`+`,top:`-`,topRight:`+`,right:`|`,bottomRight:`+`,bottom:`-`,bottomLeft:`+`,left:`|`},arrow:{topLeft:`↘`,top:`↓`,topRight:`↙`,right:`←`,bottomRight:`↖`,bottom:`↑`,bottomLeft:`↗`,left:`→`}};const rgbRegex=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,ansiRegex=/^ansi256\(\s?(\d+)\s?\)$/,isNamedColor=color=>color in chalk,colorize=(str,color,type)=>{if(!color)return str;if(isNamedColor(color))return type===`foreground`?chalk[color](str):chalk[`bg${color[0].toUpperCase()+color.slice(1)}`](str);if(color.startsWith(`#`))return type===`foreground`?chalk.hex(color)(str):chalk.bgHex(color)(str);if(color.startsWith(`ansi256`)){let matches=ansiRegex.exec(color);if(!matches)return str;let value=Number(matches[1]);return type===`foreground`?chalk.ansi256(value)(str):chalk.bgAnsi256(value)(str)}if(color.startsWith(`rgb`)){let matches=rgbRegex.exec(color);if(!matches)return str;let firstValue=Number(matches[1]),secondValue=Number(matches[2]),thirdValue=Number(matches[3]);return type===`foreground`?chalk.rgb(firstValue,secondValue,thirdValue)(str):chalk.bgRgb(firstValue,secondValue,thirdValue)(str)}return str},stylePiece=(segment,fg,bg,dim)=>{let styled=colorize(segment,fg,`foreground`);return styled=colorize(styled,bg,`background`),dim&&(styled=chalk.dim(styled)),styled},renderBorder=(x,y,node,output)=>{if(node.style.borderStyle){let width=node.yogaNode.getComputedWidth(),height=node.yogaNode.getComputedHeight(),box=typeof node.style.borderStyle==`string`?cli_boxes_default[node.style.borderStyle]:node.style.borderStyle,topBorderColor=node.style.borderTopColor??node.style.borderColor,bottomBorderColor=node.style.borderBottomColor??node.style.borderColor,leftBorderColor=node.style.borderLeftColor??node.style.borderColor,rightBorderColor=node.style.borderRightColor??node.style.borderColor,topBorderBackgroundColor=node.style.borderTopBackgroundColor??node.style.borderBackgroundColor,bottomBorderBackgroundColor=node.style.borderBottomBackgroundColor??node.style.borderBackgroundColor,leftBorderBackgroundColor=node.style.borderLeftBackgroundColor??node.style.borderBackgroundColor,rightBorderBackgroundColor=node.style.borderRightBackgroundColor??node.style.borderBackgroundColor,dimTopBorderColor=node.style.borderTopDimColor??node.style.borderDimColor,dimBottomBorderColor=node.style.borderBottomDimColor??node.style.borderDimColor,dimLeftBorderColor=node.style.borderLeftDimColor??node.style.borderDimColor,dimRightBorderColor=node.style.borderRightDimColor??node.style.borderDimColor,showTopBorder=node.style.borderTop!==!1,showBottomBorder=node.style.borderBottom!==!1,showLeftBorder=node.style.borderLeft!==!1,showRightBorder=node.style.borderRight!==!1,contentWidth=width-(showLeftBorder?1:0)-(showRightBorder?1:0),topBorder=showTopBorder?(showLeftBorder?box.topLeft:``)+box.top.repeat(contentWidth)+(showRightBorder?box.topRight:``):void 0;topBorder&&=stylePiece(topBorder,topBorderColor,topBorderBackgroundColor,dimTopBorderColor);let verticalBorderHeight=height;showTopBorder&&--verticalBorderHeight,showBottomBorder&&--verticalBorderHeight;let leftBorder=``;showLeftBorder&&(leftBorder=(stylePiece(box.left,leftBorderColor,leftBorderBackgroundColor,dimLeftBorderColor)+`
|
|
52
|
+
`).length};return cache$1.set(text,dimensions),dimensions};function isFullwidthCodePoint(codePoint){return Number.isInteger(codePoint)?isFullWidth(codePoint)||isWide(codePoint):!1}const ESCAPES$1=new Set([27,144,152,155,156,157,158,159]),ANSI_HYPERLINK_ESC_PREFIX=`\x1B]8;`,ANSI_HYPERLINK_C1_PREFIX=`8;`,ANSI_HYPERLINK_ESC_CLOSE=`${ANSI_HYPERLINK_ESC_PREFIX};`,ANSI_HYPERLINK_C1_CLOSE=`${ANSI_HYPERLINK_C1_PREFIX};`,CODE_POINT_0=`0`.codePointAt(0),CODE_POINT_9=`9`.codePointAt(0),CODE_POINT_SEMICOLON=`;`.codePointAt(0),CODE_POINT_COLON=`:`.codePointAt(0),CODE_POINT_CSI_PARAMETER_START=`0`.codePointAt(0),CODE_POINT_CSI_PARAMETER_END=`?`.codePointAt(0),CODE_POINT_CSI_INTERMEDIATE_START=` `.codePointAt(0),CODE_POINT_CSI_INTERMEDIATE_END=`/`.codePointAt(0),CODE_POINT_CSI_FINAL_START=`@`.codePointAt(0),CODE_POINT_CSI_FINAL_END=`~`.codePointAt(0),EMOJI_PRESENTATION_GRAPHEME_REGEX=/\p{Emoji_Presentation}/v,GRAPHEME_SEGMENTER=new Intl.Segmenter(void 0,{granularity:`grapheme`}),endCodeNumbers=new Set;for(let[,end]of ansiStyles.codes)endCodeNumbers.add(end);function isSgrParameterCharacter(codePoint){return codePoint>=CODE_POINT_0&&codePoint<=CODE_POINT_9||codePoint===CODE_POINT_SEMICOLON||codePoint===CODE_POINT_COLON}function isCsiParameterCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_PARAMETER_START&&codePoint<=CODE_POINT_CSI_PARAMETER_END}function isCsiIntermediateCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_INTERMEDIATE_START&&codePoint<=CODE_POINT_CSI_INTERMEDIATE_END}function isCsiFinalCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_FINAL_START&&codePoint<=CODE_POINT_CSI_FINAL_END}function isRegionalIndicatorCodePoint(codePoint){return codePoint>=127462&&codePoint<=127487}function createControlParseResult(code,endIndex){return{token:{type:`control`,code},endIndex}}function isEmojiStyleGrapheme(grapheme){if(EMOJI_PRESENTATION_GRAPHEME_REGEX.test(grapheme))return!0;for(let character of grapheme){let codePoint=character.codePointAt(0);if(codePoint===65039||codePoint===8419)return!0}return!1}function getGraphemeWidth(grapheme){let regionalIndicatorCount=0;for(let character of grapheme){let codePoint=character.codePointAt(0);if(isFullwidthCodePoint(codePoint))return 2;isRegionalIndicatorCodePoint(codePoint)&®ionalIndicatorCount++}return regionalIndicatorCount>=1||isEmojiStyleGrapheme(grapheme)?2:1}function getSgrPrefix(code){return code.startsWith(``)?``:`\x1B[`}function createSgrCode(prefix,values){return`${prefix}${values.join(`;`)}m`}function getSgrFragments(code){let fragments=[],sgrPrefix=getSgrPrefix(code),parameterString;if(code.startsWith(`\x1B[`))parameterString=code.slice(2,-1);else if(code.startsWith(``))parameterString=code.slice(1,-1);else return fragments;let rawCodes=parameterString.length===0?[`0`]:parameterString.split(`;`),index=0;for(;index<rawCodes.length;){let codeNumber=Number.parseInt(rawCodes[index],10);if(Number.isNaN(codeNumber)){index++;continue}if(codeNumber===0){fragments.push({type:`reset`}),index++;continue}if(codeNumber===38||codeNumber===48){let colorType=Number.parseInt(rawCodes[index+1],10);if(colorType===5&&index+2<rawCodes.length){let openCode=createSgrCode(sgrPrefix,rawCodes.slice(index,index+3));fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index+=3;continue}if(colorType===2&&index+4<rawCodes.length){let openCode=createSgrCode(sgrPrefix,rawCodes.slice(index,index+5));fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index+=5;continue}let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index++;continue}if(endCodeNumbers.has(codeNumber)){fragments.push({type:`end`,endCode:ansiStyles.color.ansi(codeNumber)}),index++;continue}let mappedEndCode=ansiStyles.codes.get(codeNumber);if(mappedEndCode!==void 0){let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(mappedEndCode)}),index++;continue}let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.reset.open}),index++}return fragments.length===0&&fragments.push({type:`reset`}),fragments}function parseCsiCode(string,index){let escapeCodePoint=string.codePointAt(index),sequenceStartIndex;if(escapeCodePoint===27){if(string[index+1]!==`[`)return;sequenceStartIndex=index+2}else if(escapeCodePoint===155)sequenceStartIndex=index+1;else return;let hasCanonicalSgrParameters=!0;for(let sequenceIndex=sequenceStartIndex;sequenceIndex<string.length;sequenceIndex++){let codePoint=string.codePointAt(sequenceIndex);if(isCsiFinalCharacter$1(codePoint)){let code=string.slice(index,sequenceIndex+1);return string[sequenceIndex]!==`m`||!hasCanonicalSgrParameters?createControlParseResult(code,sequenceIndex+1):{token:{type:`sgr`,code,fragments:getSgrFragments(code)},endIndex:sequenceIndex+1}}if(isCsiParameterCharacter$1(codePoint)){isSgrParameterCharacter(codePoint)||(hasCanonicalSgrParameters=!1);continue}if(isCsiIntermediateCharacter$1(codePoint)){hasCanonicalSgrParameters=!1;continue}let endIndex=sequenceIndex;return createControlParseResult(string.slice(index,endIndex),endIndex)}return createControlParseResult(string.slice(index),string.length)}function parseHyperlinkCode(string,index){let hyperlinkPrefix,hyperlinkClose,codePoint=string.codePointAt(index);if(codePoint===27&&string.startsWith(ANSI_HYPERLINK_ESC_PREFIX,index))hyperlinkPrefix=ANSI_HYPERLINK_ESC_PREFIX,hyperlinkClose=ANSI_HYPERLINK_ESC_CLOSE;else if(codePoint===157&&string.startsWith(ANSI_HYPERLINK_C1_PREFIX,index))hyperlinkPrefix=ANSI_HYPERLINK_C1_PREFIX,hyperlinkClose=ANSI_HYPERLINK_C1_CLOSE;else return;let uriStart=string.indexOf(`;`,index+hyperlinkPrefix.length);if(uriStart===-1)return createControlParseResult(string.slice(index),string.length);for(let sequenceIndex=uriStart+1;sequenceIndex<string.length;sequenceIndex++){let character=string[sequenceIndex];if(character===`\x07`)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+1),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:`\x07`},endIndex:sequenceIndex+1};if(character===`\x1B`&&string[sequenceIndex+1]===`\\`)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+2),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:`\x1B\\`},endIndex:sequenceIndex+2};if(character===``)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+1),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:``},endIndex:sequenceIndex+1}}return createControlParseResult(string.slice(index),string.length)}function parseControlStringCode(string,index){let codePoint=string.codePointAt(index),sequenceStartIndex,supportsBellTerminator=!1;switch(codePoint){case 27:switch(string[index+1]){case`]`:sequenceStartIndex=index+2,supportsBellTerminator=!0;break;case`P`:case`X`:case`^`:case`_`:sequenceStartIndex=index+2;break;case`\\`:return createControlParseResult(`\x1B\\`,index+2);default:return}break;case 157:sequenceStartIndex=index+1,supportsBellTerminator=!0;break;case 144:case 152:case 158:case 159:sequenceStartIndex=index+1;break;case 156:return createControlParseResult(``,index+1);default:return}for(let sequenceIndex=sequenceStartIndex;sequenceIndex<string.length;sequenceIndex++){if(supportsBellTerminator&&string[sequenceIndex]===`\x07`)return createControlParseResult(string.slice(index,sequenceIndex+1),sequenceIndex+1);if(string[sequenceIndex]===`\x1B`&&string[sequenceIndex+1]===`\\`)return createControlParseResult(string.slice(index,sequenceIndex+2),sequenceIndex+2);if(string[sequenceIndex]===``)return createControlParseResult(string.slice(index,sequenceIndex+1),sequenceIndex+1)}return createControlParseResult(string.slice(index),string.length)}function parseAnsiCode(string,index){let codePoint=string.codePointAt(index);if(codePoint===27||codePoint===157){let hyperlinkCode=parseHyperlinkCode(string,index);if(hyperlinkCode)return hyperlinkCode}return parseControlStringCode(string,index)||parseCsiCode(string,index)}function appendTrailingAnsiTokens(string,index,tokens){for(;index<string.length;){let nextCodePoint=string.codePointAt(index);if(!ESCAPES$1.has(nextCodePoint))break;let escapeCode=parseAnsiCode(string,index);if(!escapeCode)break;tokens.push(escapeCode.token),index=escapeCode.endIndex}return index}function parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments){let segment=graphemeSegments.containing(index);if(!(!segment||segment.index!==index))return{token:{type:`character`,value:segment.segment,visibleWidth:getGraphemeWidth(segment.segment),isGraphemeContinuation:!1},endIndex:index+segment.segment.length}}function collectVisibleCharacters(string){let visibleCharacters=[],index=0;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){index=code.endIndex;continue}}let value=String.fromCodePoint(codePoint);visibleCharacters.push({value,visibleWidth:1,isGraphemeContinuation:!1}),index+=value.length}return visibleCharacters}function applyGraphemeMetadata(visibleCharacters){if(visibleCharacters.length===0)return;let visibleString=visibleCharacters.map(({value})=>value).join(``),scalarOffsets=[],scalarOffset=0;for(let visibleCharacter of visibleCharacters)scalarOffsets.push(scalarOffset),scalarOffset+=visibleCharacter.value.length;let scalarIndex=0;for(let segment of GRAPHEME_SEGMENTER.segment(visibleString)){for(;scalarIndex<visibleCharacters.length&&scalarOffsets[scalarIndex]<segment.index;)scalarIndex++;let graphemeIndex=scalarIndex,isFirstInGrapheme=!0;for(;graphemeIndex<visibleCharacters.length&&scalarOffsets[graphemeIndex]<segment.index+segment.segment.length;)visibleCharacters[graphemeIndex].visibleWidth=isFirstInGrapheme?getGraphemeWidth(segment.segment):0,visibleCharacters[graphemeIndex].isGraphemeContinuation=!isFirstInGrapheme,isFirstInGrapheme=!1,graphemeIndex++;scalarIndex=graphemeIndex}}function tokenizeAnsiWithVisibleSegmentation(string,{endCharacter=1/0}={}){let tokens=[],visibleCharacters=collectVisibleCharacters(string);applyGraphemeMetadata(visibleCharacters);let index=0,visibleCharacterIndex=0,visibleCount=0;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){tokens.push(code.token),index=code.endIndex;continue}}let value=String.fromCodePoint(codePoint),visibleCharacter=visibleCharacters[visibleCharacterIndex],visibleWidth=isFullwidthCodePoint(codePoint)?2:value.length;visibleCharacter&&(visibleWidth=visibleCharacter.visibleWidth);let token={type:`character`,value,visibleWidth,isGraphemeContinuation:visibleCharacter?visibleCharacter.isGraphemeContinuation:!1};if(tokens.push(token),index+=value.length,visibleCharacterIndex++,visibleCount+=token.visibleWidth,visibleCount>=endCharacter){let nextVisibleCharacter=visibleCharacters[visibleCharacterIndex];if(!nextVisibleCharacter||!nextVisibleCharacter.isGraphemeContinuation){index=appendTrailingAnsiTokens(string,index,tokens);break}}}return tokens}function areValuesInSameGrapheme(leftValue,rightValue){let pair=`${leftValue}${rightValue}`,splitIndex=leftValue.length;for(let segment of GRAPHEME_SEGMENTER.segment(pair)){if(segment.index===splitIndex)return!1;if(segment.index>splitIndex)return!0}return!0}function hasAnsiSplitContinuationAhead(string,startIndex,previousVisibleValue,graphemeSegments){if(!previousVisibleValue)return!1;let index=startIndex,hasAnsiCode=!1;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){hasAnsiCode=!0,index=code.endIndex;continue}}if(!hasAnsiCode)return!1;let characterToken=parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments);return characterToken?areValuesInSameGrapheme(previousVisibleValue,characterToken.token.value):!0}return!1}function tokenizeAnsi$1(string,{endCharacter=1/0}={}){let tokens=[],graphemeSegments=GRAPHEME_SEGMENTER.segment(string),index=0,visibleCount=0,previousVisibleValue,hasAnsiSinceLastVisible=!1;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){tokens.push(code.token),index=code.endIndex,hasAnsiSinceLastVisible=!0;continue}}let characterToken=parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments);if(!characterToken||hasAnsiSinceLastVisible&&previousVisibleValue&&areValuesInSameGrapheme(previousVisibleValue,characterToken.token.value))return tokenizeAnsiWithVisibleSegmentation(string,{endCharacter});if(tokens.push(characterToken.token),index=characterToken.endIndex,visibleCount+=characterToken.token.visibleWidth,hasAnsiSinceLastVisible=!1,previousVisibleValue=characterToken.token.value,visibleCount>=endCharacter){if(hasAnsiSplitContinuationAhead(string,index,previousVisibleValue,graphemeSegments))return tokenizeAnsiWithVisibleSegmentation(string,{endCharacter});index=appendTrailingAnsiTokens(string,index,tokens);break}}return tokens}function applySgrFragments(activeStyles,fragments){for(let fragment of fragments)switch(fragment.type){case`reset`:activeStyles.clear();break;case`end`:activeStyles.delete(fragment.endCode);break;case`start`:activeStyles.delete(fragment.endCode),activeStyles.set(fragment.endCode,fragment.code);break;default:break}return activeStyles}function undoAnsiCodes$1(activeStyles){return[...activeStyles.keys()].toReversed().join(``)}function closeHyperlink(hyperlinkToken){return`${hyperlinkToken.closePrefix}${hyperlinkToken.terminator}`}function shouldIncludeSgrAfterEnd(token,activeStyles){let hasStartFragment=!1,hasClosingEffect=!1;for(let fragment of token.fragments){if(fragment.type===`start`){hasStartFragment=!0;continue}if(fragment.type===`reset`&&activeStyles.size>0){hasClosingEffect=!0;continue}fragment.type===`end`&&activeStyles.has(fragment.endCode)&&(hasClosingEffect=!0)}return hasClosingEffect&&!hasStartFragment}function hasSgrStartFragment(token){return token.fragments.some(fragment=>fragment.type===`start`)}function discardPendingHyperlink(parameters){if(parameters.activeHyperlink&&!parameters.activeHyperlinkHasVisibleText&¶meters.activeHyperlinkOutputIndex!==void 0){let openCodeLength=parameters.activeHyperlink.code.length;parameters.returnValue=parameters.returnValue.slice(0,parameters.activeHyperlinkOutputIndex)+parameters.returnValue.slice(parameters.activeHyperlinkOutputIndex+openCodeLength),parameters.pendingSgrOutputIndex!==void 0&¶meters.pendingSgrOutputIndex>parameters.activeHyperlinkOutputIndex&&(parameters.pendingSgrOutputIndex-=openCodeLength)}parameters.activeHyperlink=void 0,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0}function applySgrToken(parameters){return parameters.isPastEnd&&!shouldIncludeSgrAfterEnd(parameters.token,parameters.activeStyles)?parameters:(parameters.include&&hasSgrStartFragment(parameters.token)&¶meters.pendingSgrOutputIndex===void 0&&(parameters.pendingSgrOutputIndex=parameters.returnValue.length,parameters.pendingSgrActiveStyles=new Map(parameters.activeStyles)),parameters.activeStyles=applySgrFragments(parameters.activeStyles,parameters.token.fragments),parameters.include&&(parameters.returnValue+=parameters.token.code),parameters)}function applyHyperlinkToken(parameters){if(parameters.isPastEnd&&(parameters.token.action!==`close`||!parameters.activeHyperlink))return parameters;if(parameters.token.action===`open`)parameters.activeHyperlink=parameters.token,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0,parameters.include&&(parameters.activeHyperlinkOutputIndex=parameters.returnValue.length);else if(parameters.token.action===`close`){if(parameters.include&¶meters.activeHyperlink&&!parameters.activeHyperlinkHasVisibleText)return discardPendingHyperlink(parameters),parameters;parameters.activeHyperlink=void 0,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0}return parameters.include&&(parameters.returnValue+=parameters.token.code),parameters}function applyControlToken(parameters){return!parameters.isPastEnd&¶meters.include&&(parameters.returnValue+=parameters.token.code),parameters}function applyCharacterToken(parameters){return!parameters.include&¶meters.position>=parameters.start&&!parameters.token.isGraphemeContinuation&&(parameters.include=!0,parameters.returnValue=[...parameters.activeStyles.values()].join(``),parameters.activeHyperlink&&(parameters.activeHyperlinkOutputIndex=parameters.returnValue.length,parameters.returnValue+=parameters.activeHyperlink.code)),parameters.include&&(parameters.returnValue+=parameters.token.value,parameters.pendingSgrOutputIndex=void 0,parameters.pendingSgrActiveStyles=void 0,parameters.activeHyperlink&&(parameters.activeHyperlinkHasVisibleText=!0)),parameters.position+=parameters.token.visibleWidth,parameters}const tokenHandlers={sgr:applySgrToken,hyperlink:applyHyperlinkToken,control:applyControlToken,character:applyCharacterToken};function applyToken(parameters){let tokenHandler=tokenHandlers[parameters.token.type];return tokenHandler?tokenHandler(parameters):parameters}function createHasContinuationAheadMap(tokens){let hasContinuationAhead=Array.from({length:tokens.length},()=>!1),nextCharacterIsContinuation=!1;for(let tokenIndex=tokens.length-1;tokenIndex>=0;tokenIndex--){let token=tokens[tokenIndex];hasContinuationAhead[tokenIndex]=nextCharacterIsContinuation,token.type===`character`&&(nextCharacterIsContinuation=!!token.isGraphemeContinuation)}return hasContinuationAhead}function isPastEndBoundary(token,position,end){return end===void 0?!1:position>=end?!0:token.type===`character`&&!token.isGraphemeContinuation&&position+token.visibleWidth>end}function sliceAnsi(string,start,end){let tokens=tokenizeAnsi$1(string,{endCharacter:end}),hasContinuationAhead=createHasContinuationAheadMap(tokens),activeStyles=new Map,activeHyperlink,activeHyperlinkHasVisibleText=!1,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position=0,returnValue=``,include=!1;for(let[tokenIndex,token]of tokens.entries()){let isPastEnd=isPastEndBoundary(token,position,end);if(isPastEnd&&token.type!==`character`&&hasContinuationAhead[tokenIndex]&&(isPastEnd=!1),isPastEnd&&token.type===`character`&&!token.isGraphemeContinuation){if(activeHyperlink&&!activeHyperlinkHasVisibleText){let hyperlinkState={activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,returnValue};discardPendingHyperlink(hyperlinkState),{activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,returnValue}=hyperlinkState}pendingSgrOutputIndex!==void 0&&(returnValue=returnValue.slice(0,pendingSgrOutputIndex),activeStyles=pendingSgrActiveStyles,pendingSgrOutputIndex=void 0,pendingSgrActiveStyles=void 0);break}({activeStyles,activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position,returnValue,include}=applyToken({token,isPastEnd,start,activeStyles,activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position,returnValue,include}))}return include?(activeHyperlink&&(returnValue+=closeHyperlink(activeHyperlink)),returnValue+=undoAnsiCodes$1(activeStyles),returnValue):``}function getIndexOfNearestSpace(string,wantedIndex,shouldSearchRight){if(string.charAt(wantedIndex)===` `)return wantedIndex;let direction=shouldSearchRight?1:-1;for(let index=0;index<=3;index++){let finalIndex=wantedIndex+index*direction;if(string.charAt(finalIndex)===` `)return finalIndex}return wantedIndex}function cliTruncate(text,columns,options={}){let{position=`end`,space=!1,preferTruncationOnSpace=!1}=options,{truncationCharacter=`…`}=options;if(typeof text!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof text}`);if(typeof columns!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);if(columns<1)return``;let length=stringWidth(text);if(length<=columns)return text;if(columns===1)return truncationCharacter;let ANSI={ESC:27,LEFT_BRACKET:91,LETTER_M:109},isSgrParameter=code=>code>=48&&code<=57||code===59;function leadingSgrSpanEndIndex(string){let index=0;for(;index+2<string.length&&string.codePointAt(index)===ANSI.ESC&&string.codePointAt(index+1)===ANSI.LEFT_BRACKET;){let j=index+2;for(;j<string.length&&isSgrParameter(string.codePointAt(j));)j++;if(j<string.length&&string.codePointAt(j)===ANSI.LETTER_M){index=j+1;continue}break}return index}function trailingSgrSpanStartIndex(string){let start=string.length;for(;start>1&&string.codePointAt(start-1)===ANSI.LETTER_M;){let j=start-2;for(;j>=0&&isSgrParameter(string.codePointAt(j));)j--;if(j>=1&&string.codePointAt(j-1)===ANSI.ESC&&string.codePointAt(j)===ANSI.LEFT_BRACKET){start=j-1;continue}break}return start}function appendWithInheritedStyleFromEnd(visible,suffix){let start=trailingSgrSpanStartIndex(visible);return start===visible.length?visible+suffix:visible.slice(0,start)+suffix+visible.slice(start)}function prependWithInheritedStyleFromStart(prefix,visible){let end=leadingSgrSpanEndIndex(visible);return end===0?prefix+visible:visible.slice(0,end)+prefix+visible.slice(end)}if(position===`start`){if(preferTruncationOnSpace){let right=sliceAnsi(text,getIndexOfNearestSpace(text,length-columns+1,!0),length).trim();return prependWithInheritedStyleFromStart(truncationCharacter,right)}space&&(truncationCharacter+=` `);let right=sliceAnsi(text,length-columns+stringWidth(truncationCharacter),length);return prependWithInheritedStyleFromStart(truncationCharacter,right)}if(position===`middle`){space&&(truncationCharacter=` ${truncationCharacter} `);let half=Math.floor(columns/2);if(preferTruncationOnSpace){let spaceNearFirstBreakPoint=getIndexOfNearestSpace(text,half),spaceNearSecondBreakPoint=getIndexOfNearestSpace(text,length-(columns-half)+1,!0);return sliceAnsi(text,0,spaceNearFirstBreakPoint)+truncationCharacter+sliceAnsi(text,spaceNearSecondBreakPoint,length).trim()}return sliceAnsi(text,0,half)+truncationCharacter+sliceAnsi(text,length-(columns-half)+stringWidth(truncationCharacter),length)}if(position===`end`)return preferTruncationOnSpace?appendWithInheritedStyleFromEnd(sliceAnsi(text,0,getIndexOfNearestSpace(text,columns-1)),truncationCharacter):(space&&(truncationCharacter=` ${truncationCharacter}`),appendWithInheritedStyleFromEnd(sliceAnsi(text,0,columns-stringWidth(truncationCharacter)),truncationCharacter));throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`)}const cache={},wrapText=(text,maxWidth,wrapType)=>{let cacheKey=text+String(maxWidth)+String(wrapType),cachedText=cache[cacheKey];if(cachedText)return cachedText;let wrappedText=text;if(wrapType===`wrap`&&(wrappedText=wrapAnsi(text,maxWidth,{trim:!1,hard:!0})),wrapType===`hard`&&(wrappedText=wrapAnsi(text,maxWidth,{trim:!1,hard:!0,wordWrap:!1})),wrapType.startsWith(`truncate`)){let position=`end`;wrapType===`truncate-middle`&&(position=`middle`),wrapType===`truncate-start`&&(position=`start`),wrappedText=cliTruncate(text,maxWidth,{position})}return cache[cacheKey]=wrappedText,wrappedText},isCsiParameterCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=48&&codePoint<=63},isCsiIntermediateCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=32&&codePoint<=47},isCsiFinalCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=64&&codePoint<=126},isEscapeIntermediateCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=32&&codePoint<=47},isEscapeFinalCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=48&&codePoint<=126},isC1ControlCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=128&&codePoint<=159},readCsiSequence=(text,fromIndex)=>{let index=fromIndex;for(;index<text.length;){let character=text[index];if(!isCsiParameterCharacter(character))break;index++}let parameterString=text.slice(fromIndex,index),intermediateStartIndex=index;for(;index<text.length;){let character=text[index];if(!isCsiIntermediateCharacter(character))break;index++}let intermediateString=text.slice(intermediateStartIndex,index),finalCharacter=text[index];if(!(finalCharacter===void 0||!isCsiFinalCharacter(finalCharacter)))return{endIndex:index+1,parameterString,intermediateString,finalCharacter}},findControlStringTerminatorIndex=(text,fromIndex,allowBellTerminator)=>{for(let index=fromIndex;index<text.length;index++){let character=text[index];if(allowBellTerminator&&character===`\x07`||character===``)return index+1;if(character===`\x1B`){let followingCharacter=text[index+1];if(followingCharacter===`\x1B`){index++;continue}if(followingCharacter===`\\`)return index+2}}},readEscapeSequence=(text,fromIndex)=>{let index=fromIndex;for(;index<text.length;){let character=text[index];if(!isEscapeIntermediateCharacter(character))break;index++}let intermediateString=text.slice(fromIndex,index),finalCharacter=text[index];if(!(finalCharacter===void 0||!isEscapeFinalCharacter(finalCharacter)))return{endIndex:index+1,intermediateString,finalCharacter}},getControlStringFromEscapeIntroducer=character=>{switch(character){case`]`:return{type:`osc`,allowBellTerminator:!0};case`P`:return{type:`dcs`,allowBellTerminator:!1};case`^`:return{type:`pm`,allowBellTerminator:!1};case`_`:return{type:`apc`,allowBellTerminator:!1};case`X`:return{type:`sos`,allowBellTerminator:!1};default:return}},getControlStringFromC1Introducer=character=>{switch(character){case``:return{type:`osc`,allowBellTerminator:!0};case``:return{type:`dcs`,allowBellTerminator:!1};case``:return{type:`pm`,allowBellTerminator:!1};case``:return{type:`apc`,allowBellTerminator:!1};case``:return{type:`sos`,allowBellTerminator:!1};default:return}},hasAnsiControlCharacters=text=>{if(text.includes(`\x1B`))return!0;for(let character of text)if(isC1ControlCharacter(character))return!0;return!1},malformedFromIndex=(tokens,text,textStartIndex,fromIndex)=>(fromIndex>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,fromIndex)}),tokens.push({type:`invalid`,value:text.slice(fromIndex)}),tokens),tokenizeAnsi=text=>{if(!hasAnsiControlCharacters(text))return[{type:`text`,value:text}];let tokens=[],textStartIndex=0;for(let index=0;index<text.length;){let character=text[index];if(character===void 0)break;if(character===`\x1B`){let followingCharacter=text[index+1];if(followingCharacter===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);if(followingCharacter===`[`){let csiSequence=readCsiSequence(text,index+2);if(csiSequence===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`csi`,value:text.slice(index,csiSequence.endIndex),parameterString:csiSequence.parameterString,intermediateString:csiSequence.intermediateString,finalCharacter:csiSequence.finalCharacter}),index=csiSequence.endIndex,textStartIndex=index;continue}let escapeControlString=getControlStringFromEscapeIntroducer(followingCharacter);if(escapeControlString!==void 0){let controlStringTerminatorIndex=findControlStringTerminatorIndex(text,index+2,escapeControlString.allowBellTerminator);if(controlStringTerminatorIndex===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:escapeControlString.type,value:text.slice(index,controlStringTerminatorIndex)}),index=controlStringTerminatorIndex,textStartIndex=index;continue}let escapeSequence=readEscapeSequence(text,index+1);if(escapeSequence===void 0){if(isEscapeIntermediateCharacter(followingCharacter))return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),index++,textStartIndex=index;continue}index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`esc`,value:text.slice(index,escapeSequence.endIndex),intermediateString:escapeSequence.intermediateString,finalCharacter:escapeSequence.finalCharacter}),index=escapeSequence.endIndex,textStartIndex=index;continue}if(character===``){let csiSequence=readCsiSequence(text,index+1);if(csiSequence===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`csi`,value:text.slice(index,csiSequence.endIndex),parameterString:csiSequence.parameterString,intermediateString:csiSequence.intermediateString,finalCharacter:csiSequence.finalCharacter}),index=csiSequence.endIndex,textStartIndex=index;continue}let c1ControlString=getControlStringFromC1Introducer(character);if(c1ControlString!==void 0){let controlStringTerminatorIndex=findControlStringTerminatorIndex(text,index+1,c1ControlString.allowBellTerminator);if(controlStringTerminatorIndex===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:c1ControlString.type,value:text.slice(index,controlStringTerminatorIndex)}),index=controlStringTerminatorIndex,textStartIndex=index;continue}if(character===``){index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`st`,value:character}),index++,textStartIndex=index;continue}if(isC1ControlCharacter(character)){index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`c1`,value:character}),index++,textStartIndex=index;continue}index++}return textStartIndex<text.length&&tokens.push({type:`text`,value:text.slice(textStartIndex)}),tokens},sgrParametersRegex=/^[\d:;]*$/,sanitizeAnsi=text=>{if(!hasAnsiControlCharacters(text))return text;let output=``;for(let token of tokenizeAnsi(text)){if(token.type===`text`||token.type===`osc`){output+=token.value;continue}token.type===`csi`&&token.finalCharacter===`m`&&token.intermediateString===``&&sgrParametersRegex.test(token.parameterString)&&(output+=token.value)}return output},squashTextNodes=node=>{let text=``;for(let index=0;index<node.childNodes.length;index++){let childNode=node.childNodes[index];if(childNode===void 0)continue;let nodeText=``;childNode.nodeName===`#text`?nodeText=childNode.nodeValue:((childNode.nodeName===`ink-text`||childNode.nodeName===`ink-virtual-text`)&&(nodeText=squashTextNodes(childNode)),nodeText.length>0&&typeof childNode.internal_transform==`function`&&(nodeText=childNode.internal_transform(nodeText,index))),text+=nodeText}return sanitizeAnsi(text)},createNode=nodeName=>{let node={nodeName,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:nodeName===`ink-virtual-text`?void 0:Yoga.Node.create(),internal_accessibility:{}};return nodeName===`ink-text`&&node.yogaNode?.setMeasureFunc(measureTextNode.bind(null,node)),node},appendChildNode=(node,childNode)=>{childNode.parentNode&&removeChildNode(childNode.parentNode,childNode),childNode.parentNode=node,node.childNodes.push(childNode),childNode.yogaNode&&node.yogaNode?.insertChild(childNode.yogaNode,node.yogaNode.getChildCount()),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},insertBeforeNode=(node,newChildNode,beforeChildNode)=>{newChildNode.parentNode&&removeChildNode(newChildNode.parentNode,newChildNode),newChildNode.parentNode=node;let index=node.childNodes.indexOf(beforeChildNode);index>=0?(node.childNodes.splice(index,0,newChildNode),newChildNode.yogaNode&&node.yogaNode?.insertChild(newChildNode.yogaNode,index)):(node.childNodes.push(newChildNode),newChildNode.yogaNode&&node.yogaNode?.insertChild(newChildNode.yogaNode,node.yogaNode.getChildCount())),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},removeChildNode=(node,removeNode)=>{removeNode.yogaNode&&removeNode.parentNode?.yogaNode?.removeChild(removeNode.yogaNode),removeNode.parentNode=void 0;let index=node.childNodes.indexOf(removeNode);index>=0&&node.childNodes.splice(index,1),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},setAttribute=(node,key,value)=>{if(key===`internal_accessibility`){node.internal_accessibility=value;return}node.attributes[key]=value},setStyle=(node,style)=>{node.style=style??{}},createTextNode=text=>{let node={nodeName:`#text`,nodeValue:text,yogaNode:void 0,parentNode:void 0,style:{}};return setTextNodeValue(node,text),node},measureTextNode=function(node,width){let text=node.nodeName===`#text`?node.nodeValue:squashTextNodes(node),dimensions=measureText(text);return dimensions.width<=width||dimensions.width>=1&&width>0&&width<1?dimensions:measureText(wrapText(text,width,node.style?.textWrap??`wrap`))},findClosestYogaNode=node=>{if(node?.parentNode)return node.yogaNode??findClosestYogaNode(node.parentNode)},markNodeAsDirty=node=>{findClosestYogaNode(node)?.markDirty()},setTextNodeValue=(node,text)=>{typeof text!=`string`&&(text=String(text)),node.nodeValue=text,markNodeAsDirty(node)},emitLayoutListeners=rootNode=>{if(!(rootNode.nodeName!==`ink-root`||!rootNode.internal_layoutListeners))for(let listener of rootNode.internal_layoutListeners)listener()},positionEdges=[[`top`,Yoga.EDGE_TOP],[`right`,Yoga.EDGE_RIGHT],[`bottom`,Yoga.EDGE_BOTTOM],[`left`,Yoga.EDGE_LEFT]],applyPositionStyles=(node,style)=>{if(`position`in style){let positionType=Yoga.POSITION_TYPE_RELATIVE;style.position===`absolute`?positionType=Yoga.POSITION_TYPE_ABSOLUTE:style.position===`static`&&(positionType=Yoga.POSITION_TYPE_STATIC),node.setPositionType(positionType)}for(let[property,edge]of positionEdges){if(!(property in style))continue;let value=style[property];if(typeof value==`string`){node.setPositionPercent(edge,Number.parseFloat(value));continue}node.setPosition(edge,value)}},applyMarginStyles=(node,style)=>{`margin`in style&&node.setMargin(Yoga.EDGE_ALL,style.margin??0),`marginX`in style&&node.setMargin(Yoga.EDGE_HORIZONTAL,style.marginX??0),`marginY`in style&&node.setMargin(Yoga.EDGE_VERTICAL,style.marginY??0),`marginLeft`in style&&node.setMargin(Yoga.EDGE_START,style.marginLeft??0),`marginRight`in style&&node.setMargin(Yoga.EDGE_END,style.marginRight??0),`marginTop`in style&&node.setMargin(Yoga.EDGE_TOP,style.marginTop??0),`marginBottom`in style&&node.setMargin(Yoga.EDGE_BOTTOM,style.marginBottom??0)},applyPaddingStyles=(node,style)=>{`padding`in style&&node.setPadding(Yoga.EDGE_ALL,style.padding??0),`paddingX`in style&&node.setPadding(Yoga.EDGE_HORIZONTAL,style.paddingX??0),`paddingY`in style&&node.setPadding(Yoga.EDGE_VERTICAL,style.paddingY??0),`paddingLeft`in style&&node.setPadding(Yoga.EDGE_LEFT,style.paddingLeft??0),`paddingRight`in style&&node.setPadding(Yoga.EDGE_RIGHT,style.paddingRight??0),`paddingTop`in style&&node.setPadding(Yoga.EDGE_TOP,style.paddingTop??0),`paddingBottom`in style&&node.setPadding(Yoga.EDGE_BOTTOM,style.paddingBottom??0)},applyFlexStyles=(node,style)=>{`flexGrow`in style&&node.setFlexGrow(style.flexGrow??0),`flexShrink`in style&&node.setFlexShrink(typeof style.flexShrink==`number`?style.flexShrink:1),`flexWrap`in style&&(style.flexWrap===`nowrap`&&node.setFlexWrap(Yoga.WRAP_NO_WRAP),style.flexWrap===`wrap`&&node.setFlexWrap(Yoga.WRAP_WRAP),style.flexWrap===`wrap-reverse`&&node.setFlexWrap(Yoga.WRAP_WRAP_REVERSE)),`flexDirection`in style&&(style.flexDirection===`row`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW),style.flexDirection===`row-reverse`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE),style.flexDirection===`column`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN),style.flexDirection===`column-reverse`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE)),`flexBasis`in style&&(typeof style.flexBasis==`number`?node.setFlexBasis(style.flexBasis):typeof style.flexBasis==`string`?node.setFlexBasisPercent(Number.parseInt(style.flexBasis,10)):node.setFlexBasisAuto()),`alignItems`in style&&((style.alignItems===`stretch`||!style.alignItems)&&node.setAlignItems(Yoga.ALIGN_STRETCH),style.alignItems===`flex-start`&&node.setAlignItems(Yoga.ALIGN_FLEX_START),style.alignItems===`center`&&node.setAlignItems(Yoga.ALIGN_CENTER),style.alignItems===`flex-end`&&node.setAlignItems(Yoga.ALIGN_FLEX_END),style.alignItems===`baseline`&&node.setAlignItems(Yoga.ALIGN_BASELINE)),`alignSelf`in style&&((style.alignSelf===`auto`||!style.alignSelf)&&node.setAlignSelf(Yoga.ALIGN_AUTO),style.alignSelf===`flex-start`&&node.setAlignSelf(Yoga.ALIGN_FLEX_START),style.alignSelf===`center`&&node.setAlignSelf(Yoga.ALIGN_CENTER),style.alignSelf===`flex-end`&&node.setAlignSelf(Yoga.ALIGN_FLEX_END),style.alignSelf===`stretch`&&node.setAlignSelf(Yoga.ALIGN_STRETCH),style.alignSelf===`baseline`&&node.setAlignSelf(Yoga.ALIGN_BASELINE)),`alignContent`in style&&((style.alignContent===`flex-start`||!style.alignContent)&&node.setAlignContent(Yoga.ALIGN_FLEX_START),style.alignContent===`center`&&node.setAlignContent(Yoga.ALIGN_CENTER),style.alignContent===`flex-end`&&node.setAlignContent(Yoga.ALIGN_FLEX_END),style.alignContent===`space-between`&&node.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN),style.alignContent===`space-around`&&node.setAlignContent(Yoga.ALIGN_SPACE_AROUND),style.alignContent===`space-evenly`&&node.setAlignContent(Yoga.ALIGN_SPACE_EVENLY),style.alignContent===`stretch`&&node.setAlignContent(Yoga.ALIGN_STRETCH)),`justifyContent`in style&&((style.justifyContent===`flex-start`||!style.justifyContent)&&node.setJustifyContent(Yoga.JUSTIFY_FLEX_START),style.justifyContent===`center`&&node.setJustifyContent(Yoga.JUSTIFY_CENTER),style.justifyContent===`flex-end`&&node.setJustifyContent(Yoga.JUSTIFY_FLEX_END),style.justifyContent===`space-between`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN),style.justifyContent===`space-around`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND),style.justifyContent===`space-evenly`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY))},applyDimensionStyles=(node,style)=>{`width`in style&&(typeof style.width==`number`?node.setWidth(style.width):typeof style.width==`string`?node.setWidthPercent(Number.parseInt(style.width,10)):node.setWidthAuto()),`height`in style&&(typeof style.height==`number`?node.setHeight(style.height):typeof style.height==`string`?node.setHeightPercent(Number.parseInt(style.height,10)):node.setHeightAuto()),`minWidth`in style&&(typeof style.minWidth==`string`?node.setMinWidthPercent(Number.parseInt(style.minWidth,10)):node.setMinWidth(style.minWidth??0)),`minHeight`in style&&(typeof style.minHeight==`string`?node.setMinHeightPercent(Number.parseInt(style.minHeight,10)):node.setMinHeight(style.minHeight??0)),`maxWidth`in style&&(typeof style.maxWidth==`string`?node.setMaxWidthPercent(Number.parseInt(style.maxWidth,10)):node.setMaxWidth(style.maxWidth)),`maxHeight`in style&&(typeof style.maxHeight==`string`?node.setMaxHeightPercent(Number.parseInt(style.maxHeight,10)):node.setMaxHeight(style.maxHeight)),`aspectRatio`in style&&node.setAspectRatio(style.aspectRatio)},applyDisplayStyles=(node,style)=>{`display`in style&&node.setDisplay(style.display===`flex`?Yoga.DISPLAY_FLEX:Yoga.DISPLAY_NONE)},applyBorderStyles=(node,style,currentStyle)=>{if(!(`borderStyle`in style||`borderTop`in style||`borderBottom`in style||`borderLeft`in style||`borderRight`in style))return;let borderWidth=currentStyle.borderStyle?1:0;node.setBorder(Yoga.EDGE_TOP,currentStyle.borderTop===!1?0:borderWidth),node.setBorder(Yoga.EDGE_BOTTOM,currentStyle.borderBottom===!1?0:borderWidth),node.setBorder(Yoga.EDGE_LEFT,currentStyle.borderLeft===!1?0:borderWidth),node.setBorder(Yoga.EDGE_RIGHT,currentStyle.borderRight===!1?0:borderWidth)},applyGapStyles=(node,style)=>{`gap`in style&&node.setGap(Yoga.GUTTER_ALL,style.gap??0),`columnGap`in style&&node.setGap(Yoga.GUTTER_COLUMN,style.columnGap??0),`rowGap`in style&&node.setGap(Yoga.GUTTER_ROW,style.rowGap??0)},styles=(node,style={},currentStyle=style)=>{applyPositionStyles(node,style),applyMarginStyles(node,style),applyPaddingStyles(node,style),applyFlexStyles(node,style),applyDimensionStyles(node,style),applyDisplayStyles(node,style),applyBorderStyles(node,style,currentStyle),applyGapStyles(node,style)};if(process$1.env.DEV===`true`){let isDevtoolsInstalled=!1;try{import.meta.resolve(`react-devtools-core`),isDevtoolsInstalled=!0}catch{}isDevtoolsInstalled&&await import(`./devtools-Dl2DACSO.js`)}const diff=(before,after)=>{if(before===after)return;if(!before)return after;let changed={},isChanged=!1;for(let key of Object.keys(before))(!after||!Object.hasOwn(after,key))&&(changed[key]=void 0,isChanged=!0);if(after)for(let key of Object.keys(after))after[key]!==before[key]&&(changed[key]=after[key],isChanged=!0);return isChanged?changed:void 0},cleanupYogaNode=node=>{node?.unsetMeasureFunc(),node?.freeRecursive()};let currentUpdatePriority=import_constants.NoEventPriority,currentRootNode;async function loadPackageJson(){let content=(await import(`node:fs`)).readFileSync(new URL(`../package.json`,import.meta.url),`utf8`),parsedContent=JSON.parse(content);return{name:parsedContent?.name,version:parsedContent?.version}}let packageInfo={name:`ink`,version:import_react.version};if(process$1.env.DEV===`true`)try{let loaded=await loadPackageJson();packageInfo={name:loaded.name||packageInfo.name,version:loaded.version||packageInfo.version}}catch(error){console.warn(`Failed to load package.json in development mode. Falling back to default renderer metadata.`,error)}var reconciler_default=(0,import_react_reconciler.default)({getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,resetAfterCommit(rootNode){if(typeof rootNode.onComputeLayout==`function`&&rootNode.onComputeLayout(),emitLayoutListeners(rootNode),rootNode.staticNode!==rootNode.previousStaticNode&&(rootNode.previousStaticNode=rootNode.staticNode,typeof rootNode.onStaticChange==`function`&&rootNode.onStaticChange()),rootNode.isStaticDirty){rootNode.isStaticDirty=!1,typeof rootNode.onImmediateRender==`function`&&rootNode.onImmediateRender();return}typeof rootNode.onRender==`function`&&rootNode.onRender()},getChildHostContext(parentHostContext,type){let previousIsInsideText=parentHostContext.isInsideText,isInsideText=type===`ink-text`||type===`ink-virtual-text`;return previousIsInsideText===isInsideText?parentHostContext:{isInsideText}},shouldSetTextContent:()=>!1,createInstance(originalType,newProps,rootNode,hostContext){if(hostContext.isInsideText&&originalType===`ink-box`)throw Error(`<Box> can’t be nested inside <Text> component`);let node=createNode(originalType===`ink-text`&&hostContext.isInsideText?`ink-virtual-text`:originalType);for(let[key,value]of Object.entries(newProps))if(key!==`children`){if(key===`style`){setStyle(node,value),node.yogaNode&&styles(node.yogaNode,value);continue}if(key===`internal_transform`){node.internal_transform=value;continue}if(key===`internal_static`){currentRootNode=rootNode,node.internal_static=!0,rootNode.isStaticDirty=!0,rootNode.staticNode=node;continue}setAttribute(node,key,value)}return node},createTextInstance(text,_root,hostContext){if(!hostContext.isInsideText)throw Error(`Text string "${text}" must be rendered inside <Text> component`);return createTextNode(text)},resetTextContent(){},hideTextInstance(node){setTextNodeValue(node,``)},unhideTextInstance(node,text){setTextNodeValue(node,text)},getPublicInstance:instance=>instance,hideInstance(node){node.yogaNode?.setDisplay(Yoga.DISPLAY_NONE)},unhideInstance(node){node.yogaNode?.setDisplay(Yoga.DISPLAY_FLEX)},appendInitialChild:appendChildNode,appendChild:appendChildNode,insertBefore:insertBeforeNode,finalizeInitialChildren(){return!1},isPrimaryRenderer:!0,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,supportsMicrotasks:!0,scheduleMicrotask:queueMicrotask,scheduleCallback:import_scheduler.unstable_scheduleCallback,cancelCallback:import_scheduler.unstable_cancelCallback,shouldYield:import_scheduler.unstable_shouldYield,now:import_scheduler.unstable_now,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},getInstanceFromNode:()=>null,prepareScopeUpdate(){},getInstanceFromScope:()=>null,appendChildToContainer:appendChildNode,insertInContainerBefore:insertBeforeNode,removeChildFromContainer(node,removeNode){removeChildNode(node,removeNode),cleanupYogaNode(removeNode.yogaNode),removeNode.internal_static&¤tRootNode?.staticNode===removeNode&&(currentRootNode.staticNode=void 0)},commitUpdate(node,_type,oldProps,newProps){currentRootNode&&node.internal_static&&(currentRootNode.isStaticDirty=!0);let props=diff(oldProps,newProps),style=diff(oldProps.style,newProps.style);if(!(!props&&!style)){if(props)for(let[key,value]of Object.entries(props)){if(key===`style`){setStyle(node,value);continue}if(key===`internal_transform`){node.internal_transform=value;continue}if(key===`internal_static`){node.internal_static=!0;continue}setAttribute(node,key,value)}style&&node.yogaNode&&styles(node.yogaNode,style,newProps.style??{})}},commitTextUpdate(node,_oldText,newText){setTextNodeValue(node,newText)},removeChild(node,removeNode){removeChildNode(node,removeNode),cleanupYogaNode(removeNode.yogaNode),removeNode.internal_static&¤tRootNode?.staticNode===removeNode&&(currentRootNode.staticNode=void 0)},setCurrentUpdatePriority(newPriority){currentUpdatePriority=newPriority},getCurrentUpdatePriority:()=>currentUpdatePriority,resolveUpdatePriority(){return currentUpdatePriority===import_constants.NoEventPriority?import_constants.DefaultEventPriority:currentUpdatePriority},maySuspendCommit(){return!0},NotPendingTransition:void 0,HostTransitionContext:(0,import_react.createContext)(null),resetFormInstance(){},requestPostPaintCallback(){},shouldAttemptEagerTransition(){return!1},trackSchedulerEvent(){},resolveEventType(){return null},resolveEventTimeStamp(){return-1.1},preloadInstance(){return!0},startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady(){return null},rendererPackageName:packageInfo.name,rendererVersion:packageInfo.version});function indentString(string,count=1,options={}){let{indent=` `,includeEmptyLines=!1}=options;if(typeof string!=`string`)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof string}\``);if(typeof count!=`number`)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``);if(count<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${count}\``);if(typeof indent!=`string`)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\``);if(count===0)return string;let regex=includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return string.replace(regex,indent.repeat(count))}const getMaxWidth=yogaNode=>yogaNode.getComputedWidth()-yogaNode.getComputedPadding(Yoga.EDGE_LEFT)-yogaNode.getComputedPadding(Yoga.EDGE_RIGHT)-yogaNode.getComputedBorder(Yoga.EDGE_LEFT)-yogaNode.getComputedBorder(Yoga.EDGE_RIGHT);var cli_boxes_default={single:{topLeft:`┌`,top:`─`,topRight:`┐`,right:`│`,bottomRight:`┘`,bottom:`─`,bottomLeft:`└`,left:`│`},double:{topLeft:`╔`,top:`═`,topRight:`╗`,right:`║`,bottomRight:`╝`,bottom:`═`,bottomLeft:`╚`,left:`║`},round:{topLeft:`╭`,top:`─`,topRight:`╮`,right:`│`,bottomRight:`╯`,bottom:`─`,bottomLeft:`╰`,left:`│`},bold:{topLeft:`┏`,top:`━`,topRight:`┓`,right:`┃`,bottomRight:`┛`,bottom:`━`,bottomLeft:`┗`,left:`┃`},singleDouble:{topLeft:`╓`,top:`─`,topRight:`╖`,right:`║`,bottomRight:`╜`,bottom:`─`,bottomLeft:`╙`,left:`║`},doubleSingle:{topLeft:`╒`,top:`═`,topRight:`╕`,right:`│`,bottomRight:`╛`,bottom:`═`,bottomLeft:`╘`,left:`│`},classic:{topLeft:`+`,top:`-`,topRight:`+`,right:`|`,bottomRight:`+`,bottom:`-`,bottomLeft:`+`,left:`|`},arrow:{topLeft:`↘`,top:`↓`,topRight:`↙`,right:`←`,bottomRight:`↖`,bottom:`↑`,bottomLeft:`↗`,left:`→`}};const rgbRegex=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,ansiRegex=/^ansi256\(\s?(\d+)\s?\)$/,isNamedColor=color=>color in chalk,colorize=(str,color,type)=>{if(!color)return str;if(isNamedColor(color))return type===`foreground`?chalk[color](str):chalk[`bg${color[0].toUpperCase()+color.slice(1)}`](str);if(color.startsWith(`#`))return type===`foreground`?chalk.hex(color)(str):chalk.bgHex(color)(str);if(color.startsWith(`ansi256`)){let matches=ansiRegex.exec(color);if(!matches)return str;let value=Number(matches[1]);return type===`foreground`?chalk.ansi256(value)(str):chalk.bgAnsi256(value)(str)}if(color.startsWith(`rgb`)){let matches=rgbRegex.exec(color);if(!matches)return str;let firstValue=Number(matches[1]),secondValue=Number(matches[2]),thirdValue=Number(matches[3]);return type===`foreground`?chalk.rgb(firstValue,secondValue,thirdValue)(str):chalk.bgRgb(firstValue,secondValue,thirdValue)(str)}return str},stylePiece=(segment,fg,bg,dim)=>{let styled=colorize(segment,fg,`foreground`);return styled=colorize(styled,bg,`background`),dim&&(styled=chalk.dim(styled)),styled},renderBorder=(x,y,node,output)=>{if(node.style.borderStyle){let width=node.yogaNode.getComputedWidth(),height=node.yogaNode.getComputedHeight(),box=typeof node.style.borderStyle==`string`?cli_boxes_default[node.style.borderStyle]:node.style.borderStyle,topBorderColor=node.style.borderTopColor??node.style.borderColor,bottomBorderColor=node.style.borderBottomColor??node.style.borderColor,leftBorderColor=node.style.borderLeftColor??node.style.borderColor,rightBorderColor=node.style.borderRightColor??node.style.borderColor,topBorderBackgroundColor=node.style.borderTopBackgroundColor??node.style.borderBackgroundColor,bottomBorderBackgroundColor=node.style.borderBottomBackgroundColor??node.style.borderBackgroundColor,leftBorderBackgroundColor=node.style.borderLeftBackgroundColor??node.style.borderBackgroundColor,rightBorderBackgroundColor=node.style.borderRightBackgroundColor??node.style.borderBackgroundColor,dimTopBorderColor=node.style.borderTopDimColor??node.style.borderDimColor,dimBottomBorderColor=node.style.borderBottomDimColor??node.style.borderDimColor,dimLeftBorderColor=node.style.borderLeftDimColor??node.style.borderDimColor,dimRightBorderColor=node.style.borderRightDimColor??node.style.borderDimColor,showTopBorder=node.style.borderTop!==!1,showBottomBorder=node.style.borderBottom!==!1,showLeftBorder=node.style.borderLeft!==!1,showRightBorder=node.style.borderRight!==!1,contentWidth=width-(showLeftBorder?1:0)-(showRightBorder?1:0),topBorder=showTopBorder?(showLeftBorder?box.topLeft:``)+box.top.repeat(contentWidth)+(showRightBorder?box.topRight:``):void 0;topBorder&&=stylePiece(topBorder,topBorderColor,topBorderBackgroundColor,dimTopBorderColor);let verticalBorderHeight=height;showTopBorder&&--verticalBorderHeight,showBottomBorder&&--verticalBorderHeight;let leftBorder=``;showLeftBorder&&(leftBorder=(stylePiece(box.left,leftBorderColor,leftBorderBackgroundColor,dimLeftBorderColor)+`
|
|
53
53
|
`).repeat(verticalBorderHeight));let rightBorder=``;showRightBorder&&(rightBorder=(stylePiece(box.right,rightBorderColor,rightBorderBackgroundColor,dimRightBorderColor)+`
|
|
54
54
|
`).repeat(verticalBorderHeight));let bottomBorder=showBottomBorder?(showLeftBorder?box.bottomLeft:``)+box.bottom.repeat(contentWidth)+(showRightBorder?box.bottomRight:``):void 0;bottomBorder&&=stylePiece(bottomBorder,bottomBorderColor,bottomBorderBackgroundColor,dimBottomBorderColor);let offsetY=showTopBorder?1:0;topBorder&&output.write(x,y,topBorder,{transformers:[]}),leftBorder&&output.write(x,y+offsetY,leftBorder,{transformers:[]}),rightBorder&&output.write(x+width-1,y+offsetY,rightBorder,{transformers:[]}),bottomBorder&&output.write(x,y+height-1,bottomBorder,{transformers:[]})}},renderBackground=(x,y,node,output)=>{if(!node.style.backgroundColor)return;let width=node.yogaNode.getComputedWidth(),height=node.yogaNode.getComputedHeight(),leftBorderWidth=node.style.borderStyle&&node.style.borderLeft!==!1?1:0,rightBorderWidth=node.style.borderStyle&&node.style.borderRight!==!1?1:0,topBorderHeight=node.style.borderStyle&&node.style.borderTop!==!1?1:0,bottomBorderHeight=node.style.borderStyle&&node.style.borderBottom!==!1?1:0,contentWidth=width-leftBorderWidth-rightBorderWidth,contentHeight=height-topBorderHeight-bottomBorderHeight;if(!(contentWidth>0&&contentHeight>0))return;let backgroundLine=colorize(` `.repeat(contentWidth),node.style.backgroundColor,`background`);for(let row=0;row<contentHeight;row++)output.write(x+leftBorderWidth,y+topBorderHeight+row,backgroundLine,{transformers:[]})},applyPaddingToText=(node,text)=>{let yogaNode=node.childNodes[0]?.yogaNode;if(yogaNode){let offsetX=yogaNode.getComputedLeft(),offsetY=yogaNode.getComputedTop();text=`
|
|
55
55
|
`.repeat(offsetY)+indentString(text,offsetX)}return text},renderNodeToScreenReaderOutput=(node,options={})=>{if(options.skipStaticElements&&node.internal_static||node.yogaNode?.getDisplay()===Yoga.DISPLAY_NONE)return``;let output=``;if(node.nodeName===`ink-text`)output=squashTextNodes(node);else if(node.nodeName===`ink-box`||node.nodeName===`ink-root`){let separator=node.style.flexDirection===`row`||node.style.flexDirection===`row-reverse`?` `:`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as __require,r as __toESM,t as __commonJSMin}from"./chunk-4VIosCLc.js";import"./paths-5FcIFMsj.js";import"./utils-DbaBVFaK.js";import"./embedded-helpers-
|
|
1
|
+
import{n as __require,r as __toESM,t as __commonJSMin}from"./chunk-4VIosCLc.js";import"./paths-5FcIFMsj.js";import"./utils-DbaBVFaK.js";import"./embedded-helpers-C9jpiwlw.js";import"./session-key-EoB0qaG9.js";import"./builderforce-root-D64_sXEi.js";import"./subsystem-B3TqcCrZ.js";import"./registry-TdK-aV05.js";import"./logger-Bch0bx9c.js";import"./exec-DdcIjeyn.js";import"./agent-scope-DPtjOxzp.js";import"./src-CA0fU67C.js";import"./model-selection-DG9J_VTz.js";import"./env-file-D1MDi-AM.js";import"./boolean-Cnh1KNl1.js";import"./env-BIdU5BAp.js";import"./src-DTFqOIQD.js";import"./io-BLBq4T2o.js";import"./manifest-registry-BJCfNV1a.js";import"./config-BgV_FYSq.js";import"./sandbox-C4AKi2EX.js";import"./chrome-DXt86tmV.js";import"./tailscale-DLkpGquM.js";import"./auth-lebUHrkd.js";import"./server-context-CQ2v4BAx.js";import"./frontmatter-3D1EdC1L.js";import"./skills-Ba4ftrB-.js";import"./plugin-skills-B11rggZh.js";import"./routes-DZntyPY6.js";import"./redact-BHdfp2MZ.js";import"./errors-B1MIg3g-.js";import"./paths-cR8ct-Y3.js";import"./ssrf-p9k-iapc.js";import"./image-ops-C8IUQKjn.js";import"./store-CmHBQ-yX.js";import"./ports-DgmEDNOm.js";import"./trash-DD2Hc5oq.js";import"./sessions-BuZVmOWt.js";import"./message-channel-D_jXxXQj.js";import"./plugins-D5zP6ENo.js";import"./accounts-o35LU_iy.js";import"./accounts-rmXEiebi.js";import"./accounts-BLueHgKj.js";import"./bindings-DR59065T.js";import"./paths-DJ6rztqJ.js";import"./tool-images-B7b_OiMz.js";import"./client-xfoidwPI.js";import"./call-T8ciwMTA.js";import"./usage-format-DGf8ZWPH.js";import{n as GatewayChatClient,t as TuiStreamAssembler}from"./tui-stream-assembler-8ud9oyMK.js";import process$1,{cwd,env}from"node:process";import*as fs$1 from"node:fs";import fs from"node:fs";import os from"node:os";import chalk from"chalk";import{execFileSync}from"node:child_process";import{PassThrough,Stream}from"node:stream";import{EventEmitter}from"node:events";import tty from"node:tty";const RENDERER_IDS={headless:`headless`,ink:`ink`},DEFAULT_RENDERER_ID=RENDERER_IDS.ink;var RendererRegistry=class{constructor(){this.factories=new Map}register(id,factory){return this.factories.set(id,factory),this}has(id){return this.factories.has(id)}resolve(id){let factory=this.factories.get(id??``)??this.factories.get(DEFAULT_RENDERER_ID);if(!factory)throw Error(`No renderer registered for "${id??DEFAULT_RENDERER_ID}" (and no default "${DEFAULT_RENDERER_ID}"). Register one via RendererRegistry.register().`);return factory()}};const ANSI_SGR=/\[[0-9;]*m/g;var HeadlessChat=class{constructor(){this.entries=[]}append(entry){let index=this.entries.push(entry)-1;return{update:next=>{this.entries[index]=next}}}clear(){this.entries.length=0}},HeadlessInput=class{constructor(){this.history=[],this.text=``,this.enabled=!0}getText(){return this.text}setText(value){this.text=value}addToHistory(value){this.history.push(value)}onSubmit(handler){this.submitHandler=handler}setEnabled(enabled){this.enabled=enabled}isEnabled(){return this.enabled}async submit(text){await this.submitHandler?.(text)}},HeadlessStatus=class{constructor(){this.line=``}set(line){this.line=line}clear(){this.line=``}};const textMetrics$1={visibleWidth(text){return text.replace(ANSI_SGR,``).length},truncateToWidth(text,width){let bare=text.replace(ANSI_SGR,``);return bare.length<=width?text:width<=1?bare.slice(0,Math.max(0,width)):`${bare.slice(0,width-1)}…`}};function createHeadlessRenderer(script={}){let chat=new HeadlessChat,input=new HeadlessInput,status=new HeadlessStatus,selects=[...script.selectAnswers??[]],settingsAns=[...script.settingsAnswers??[]],confirms=[...script.confirmAnswers??[]];return{id:RENDERER_IDS.headless,chat,input,status,text:textMetrics$1,started:!1,renderCount:0,start(_options){this.started=!0},stop(){this.started=!1},requestRender(){this.renderCount+=1},async select(_request){return selects.shift()??void 0},async settings(_request){return settingsAns.shift()},async confirm(_message){return confirms.shift()??!1}}}
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.js
|
|
@@ -49,7 +49,7 @@ Error generating stack: `+x.message+`
|
|
|
49
49
|
No matching component was found for:
|
|
50
50
|
`)+hostRoot.join(` > `)}return null},exports$1.getPublicRootInstance=function(container){if(container=container.current,!container.child)return null;switch(container.child.tag){case 27:case 5:return getPublicInstance(container.child.stateNode);default:return container.child.stateNode}},exports$1.injectIntoDevTools=function(){var internals={bundleType:0,version:rendererVersion,rendererPackageName,currentDispatcherRef:ReactSharedInternals,reconcilerVersion:`19.2.0`};if(extraDevToolsConfig!==null&&(internals.rendererConfig=extraDevToolsConfig),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`)internals=!1;else{var hook=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(hook.isDisabled||!hook.supportsFiber)internals=!0;else{try{rendererID=hook.inject(internals),injectedHook=hook}catch{}internals=!!hook.checkDCE}}return internals},exports$1.isAlreadyRendering=function(){return(executionContext&6)!=0},exports$1.observeVisibleRects=function(hostRoot,selectors,callback,options){if(!supportsTestSelectors)throw Error(formatProdErrorMessage(363));hostRoot=findAllNodes(hostRoot,selectors);var disconnect=setupIntersectionObserver(hostRoot,callback,options).disconnect;return{disconnect:function(){disconnect()}}},exports$1.shouldError=function(){return null},exports$1.shouldSuspend=function(){return!1},exports$1.startHostTransition=function(formFiber,pendingState,action,formData){if(formFiber.tag!==5)throw Error(formatProdErrorMessage(476));var queue=ensureFormComponentIsStateful(formFiber).queue;startTransition(formFiber,queue,pendingState,NotPendingTransition,action===null?noop:function(){var stateHook=ensureFormComponentIsStateful(formFiber);return stateHook.next===null&&(stateHook=formFiber.alternate.memoizedState),dispatchSetStateInternal(formFiber,stateHook.next.queue,{},requestUpdateLane()),action(formData)})},exports$1.updateContainer=function(element,container,parentComponent,callback){var current=container.current,lane=requestUpdateLane();return updateContainerImpl(current,lane,element,container,parentComponent,callback),lane},exports$1.updateContainerSync=function(element,container,parentComponent,callback){return updateContainerImpl(container.current,2,element,container,parentComponent,callback),2},exports$1},module.exports.default=module.exports,Object.defineProperty(module.exports,`__esModule`,{value:!0})})),import_react_reconciler=__toESM(__commonJSMin(((exports,module)=>{module.exports=require_react_reconciler_production()}))(),1),import_scheduler=__toESM(require_scheduler(),1);function widestLine(string){let lineWidth=0;for(let line of string.split(`
|
|
51
51
|
`))lineWidth=Math.max(lineWidth,stringWidth(line));return lineWidth}const cache$1=new Map,measureText=text=>{if(text.length===0)return{width:0,height:0};let cachedDimensions=cache$1.get(text);if(cachedDimensions)return cachedDimensions;let dimensions={width:widestLine(text),height:text.split(`
|
|
52
|
-
`).length};return cache$1.set(text,dimensions),dimensions};function isFullwidthCodePoint(codePoint){return Number.isInteger(codePoint)?isFullWidth(codePoint)||isWide(codePoint):!1}const ESCAPES$1=new Set([27,144,152,155,156,157,158,159]),ANSI_HYPERLINK_ESC_PREFIX=`\x1B]8;`,ANSI_HYPERLINK_C1_PREFIX=`8;`,ANSI_HYPERLINK_ESC_CLOSE=`${ANSI_HYPERLINK_ESC_PREFIX};`,ANSI_HYPERLINK_C1_CLOSE=`${ANSI_HYPERLINK_C1_PREFIX};`,CODE_POINT_0=`0`.codePointAt(0),CODE_POINT_9=`9`.codePointAt(0),CODE_POINT_SEMICOLON=`;`.codePointAt(0),CODE_POINT_COLON=`:`.codePointAt(0),CODE_POINT_CSI_PARAMETER_START=`0`.codePointAt(0),CODE_POINT_CSI_PARAMETER_END=`?`.codePointAt(0),CODE_POINT_CSI_INTERMEDIATE_START=` `.codePointAt(0),CODE_POINT_CSI_INTERMEDIATE_END=`/`.codePointAt(0),CODE_POINT_CSI_FINAL_START=`@`.codePointAt(0),CODE_POINT_CSI_FINAL_END=`~`.codePointAt(0),EMOJI_PRESENTATION_GRAPHEME_REGEX=/\p{Emoji_Presentation}/v,GRAPHEME_SEGMENTER=new Intl.Segmenter(void 0,{granularity:`grapheme`}),endCodeNumbers=new Set;for(let[,end]of ansiStyles.codes)endCodeNumbers.add(end);function isSgrParameterCharacter(codePoint){return codePoint>=CODE_POINT_0&&codePoint<=CODE_POINT_9||codePoint===CODE_POINT_SEMICOLON||codePoint===CODE_POINT_COLON}function isCsiParameterCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_PARAMETER_START&&codePoint<=CODE_POINT_CSI_PARAMETER_END}function isCsiIntermediateCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_INTERMEDIATE_START&&codePoint<=CODE_POINT_CSI_INTERMEDIATE_END}function isCsiFinalCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_FINAL_START&&codePoint<=CODE_POINT_CSI_FINAL_END}function isRegionalIndicatorCodePoint(codePoint){return codePoint>=127462&&codePoint<=127487}function createControlParseResult(code,endIndex){return{token:{type:`control`,code},endIndex}}function isEmojiStyleGrapheme(grapheme){if(EMOJI_PRESENTATION_GRAPHEME_REGEX.test(grapheme))return!0;for(let character of grapheme){let codePoint=character.codePointAt(0);if(codePoint===65039||codePoint===8419)return!0}return!1}function getGraphemeWidth(grapheme){let regionalIndicatorCount=0;for(let character of grapheme){let codePoint=character.codePointAt(0);if(isFullwidthCodePoint(codePoint))return 2;isRegionalIndicatorCodePoint(codePoint)&®ionalIndicatorCount++}return regionalIndicatorCount>=1||isEmojiStyleGrapheme(grapheme)?2:1}function getSgrPrefix(code){return code.startsWith(``)?``:`\x1B[`}function createSgrCode(prefix,values){return`${prefix}${values.join(`;`)}m`}function getSgrFragments(code){let fragments=[],sgrPrefix=getSgrPrefix(code),parameterString;if(code.startsWith(`\x1B[`))parameterString=code.slice(2,-1);else if(code.startsWith(``))parameterString=code.slice(1,-1);else return fragments;let rawCodes=parameterString.length===0?[`0`]:parameterString.split(`;`),index=0;for(;index<rawCodes.length;){let codeNumber=Number.parseInt(rawCodes[index],10);if(Number.isNaN(codeNumber)){index++;continue}if(codeNumber===0){fragments.push({type:`reset`}),index++;continue}if(codeNumber===38||codeNumber===48){let colorType=Number.parseInt(rawCodes[index+1],10);if(colorType===5&&index+2<rawCodes.length){let openCode=createSgrCode(sgrPrefix,rawCodes.slice(index,index+3));fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index+=3;continue}if(colorType===2&&index+4<rawCodes.length){let openCode=createSgrCode(sgrPrefix,rawCodes.slice(index,index+5));fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index+=5;continue}let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index++;continue}if(endCodeNumbers.has(codeNumber)){fragments.push({type:`end`,endCode:ansiStyles.color.ansi(codeNumber)}),index++;continue}let mappedEndCode=ansiStyles.codes.get(codeNumber);if(mappedEndCode!==void 0){let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(mappedEndCode)}),index++;continue}let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.reset.open}),index++}return fragments.length===0&&fragments.push({type:`reset`}),fragments}function parseCsiCode(string,index){let escapeCodePoint=string.codePointAt(index),sequenceStartIndex;if(escapeCodePoint===27){if(string[index+1]!==`[`)return;sequenceStartIndex=index+2}else if(escapeCodePoint===155)sequenceStartIndex=index+1;else return;let hasCanonicalSgrParameters=!0;for(let sequenceIndex=sequenceStartIndex;sequenceIndex<string.length;sequenceIndex++){let codePoint=string.codePointAt(sequenceIndex);if(isCsiFinalCharacter$1(codePoint)){let code=string.slice(index,sequenceIndex+1);return string[sequenceIndex]!==`m`||!hasCanonicalSgrParameters?createControlParseResult(code,sequenceIndex+1):{token:{type:`sgr`,code,fragments:getSgrFragments(code)},endIndex:sequenceIndex+1}}if(isCsiParameterCharacter$1(codePoint)){isSgrParameterCharacter(codePoint)||(hasCanonicalSgrParameters=!1);continue}if(isCsiIntermediateCharacter$1(codePoint)){hasCanonicalSgrParameters=!1;continue}let endIndex=sequenceIndex;return createControlParseResult(string.slice(index,endIndex),endIndex)}return createControlParseResult(string.slice(index),string.length)}function parseHyperlinkCode(string,index){let hyperlinkPrefix,hyperlinkClose,codePoint=string.codePointAt(index);if(codePoint===27&&string.startsWith(ANSI_HYPERLINK_ESC_PREFIX,index))hyperlinkPrefix=ANSI_HYPERLINK_ESC_PREFIX,hyperlinkClose=ANSI_HYPERLINK_ESC_CLOSE;else if(codePoint===157&&string.startsWith(ANSI_HYPERLINK_C1_PREFIX,index))hyperlinkPrefix=ANSI_HYPERLINK_C1_PREFIX,hyperlinkClose=ANSI_HYPERLINK_C1_CLOSE;else return;let uriStart=string.indexOf(`;`,index+hyperlinkPrefix.length);if(uriStart===-1)return createControlParseResult(string.slice(index),string.length);for(let sequenceIndex=uriStart+1;sequenceIndex<string.length;sequenceIndex++){let character=string[sequenceIndex];if(character===`\x07`)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+1),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:`\x07`},endIndex:sequenceIndex+1};if(character===`\x1B`&&string[sequenceIndex+1]===`\\`)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+2),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:`\x1B\\`},endIndex:sequenceIndex+2};if(character===``)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+1),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:``},endIndex:sequenceIndex+1}}return createControlParseResult(string.slice(index),string.length)}function parseControlStringCode(string,index){let codePoint=string.codePointAt(index),sequenceStartIndex,supportsBellTerminator=!1;switch(codePoint){case 27:switch(string[index+1]){case`]`:sequenceStartIndex=index+2,supportsBellTerminator=!0;break;case`P`:case`X`:case`^`:case`_`:sequenceStartIndex=index+2;break;case`\\`:return createControlParseResult(`\x1B\\`,index+2);default:return}break;case 157:sequenceStartIndex=index+1,supportsBellTerminator=!0;break;case 144:case 152:case 158:case 159:sequenceStartIndex=index+1;break;case 156:return createControlParseResult(``,index+1);default:return}for(let sequenceIndex=sequenceStartIndex;sequenceIndex<string.length;sequenceIndex++){if(supportsBellTerminator&&string[sequenceIndex]===`\x07`)return createControlParseResult(string.slice(index,sequenceIndex+1),sequenceIndex+1);if(string[sequenceIndex]===`\x1B`&&string[sequenceIndex+1]===`\\`)return createControlParseResult(string.slice(index,sequenceIndex+2),sequenceIndex+2);if(string[sequenceIndex]===``)return createControlParseResult(string.slice(index,sequenceIndex+1),sequenceIndex+1)}return createControlParseResult(string.slice(index),string.length)}function parseAnsiCode(string,index){let codePoint=string.codePointAt(index);if(codePoint===27||codePoint===157){let hyperlinkCode=parseHyperlinkCode(string,index);if(hyperlinkCode)return hyperlinkCode}return parseControlStringCode(string,index)||parseCsiCode(string,index)}function appendTrailingAnsiTokens(string,index,tokens){for(;index<string.length;){let nextCodePoint=string.codePointAt(index);if(!ESCAPES$1.has(nextCodePoint))break;let escapeCode=parseAnsiCode(string,index);if(!escapeCode)break;tokens.push(escapeCode.token),index=escapeCode.endIndex}return index}function parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments){let segment=graphemeSegments.containing(index);if(!(!segment||segment.index!==index))return{token:{type:`character`,value:segment.segment,visibleWidth:getGraphemeWidth(segment.segment),isGraphemeContinuation:!1},endIndex:index+segment.segment.length}}function collectVisibleCharacters(string){let visibleCharacters=[],index=0;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){index=code.endIndex;continue}}let value=String.fromCodePoint(codePoint);visibleCharacters.push({value,visibleWidth:1,isGraphemeContinuation:!1}),index+=value.length}return visibleCharacters}function applyGraphemeMetadata(visibleCharacters){if(visibleCharacters.length===0)return;let visibleString=visibleCharacters.map(({value})=>value).join(``),scalarOffsets=[],scalarOffset=0;for(let visibleCharacter of visibleCharacters)scalarOffsets.push(scalarOffset),scalarOffset+=visibleCharacter.value.length;let scalarIndex=0;for(let segment of GRAPHEME_SEGMENTER.segment(visibleString)){for(;scalarIndex<visibleCharacters.length&&scalarOffsets[scalarIndex]<segment.index;)scalarIndex++;let graphemeIndex=scalarIndex,isFirstInGrapheme=!0;for(;graphemeIndex<visibleCharacters.length&&scalarOffsets[graphemeIndex]<segment.index+segment.segment.length;)visibleCharacters[graphemeIndex].visibleWidth=isFirstInGrapheme?getGraphemeWidth(segment.segment):0,visibleCharacters[graphemeIndex].isGraphemeContinuation=!isFirstInGrapheme,isFirstInGrapheme=!1,graphemeIndex++;scalarIndex=graphemeIndex}}function tokenizeAnsiWithVisibleSegmentation(string,{endCharacter=1/0}={}){let tokens=[],visibleCharacters=collectVisibleCharacters(string);applyGraphemeMetadata(visibleCharacters);let index=0,visibleCharacterIndex=0,visibleCount=0;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){tokens.push(code.token),index=code.endIndex;continue}}let value=String.fromCodePoint(codePoint),visibleCharacter=visibleCharacters[visibleCharacterIndex],visibleWidth=isFullwidthCodePoint(codePoint)?2:value.length;visibleCharacter&&(visibleWidth=visibleCharacter.visibleWidth);let token={type:`character`,value,visibleWidth,isGraphemeContinuation:visibleCharacter?visibleCharacter.isGraphemeContinuation:!1};if(tokens.push(token),index+=value.length,visibleCharacterIndex++,visibleCount+=token.visibleWidth,visibleCount>=endCharacter){let nextVisibleCharacter=visibleCharacters[visibleCharacterIndex];if(!nextVisibleCharacter||!nextVisibleCharacter.isGraphemeContinuation){index=appendTrailingAnsiTokens(string,index,tokens);break}}}return tokens}function areValuesInSameGrapheme(leftValue,rightValue){let pair=`${leftValue}${rightValue}`,splitIndex=leftValue.length;for(let segment of GRAPHEME_SEGMENTER.segment(pair)){if(segment.index===splitIndex)return!1;if(segment.index>splitIndex)return!0}return!0}function hasAnsiSplitContinuationAhead(string,startIndex,previousVisibleValue,graphemeSegments){if(!previousVisibleValue)return!1;let index=startIndex,hasAnsiCode=!1;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){hasAnsiCode=!0,index=code.endIndex;continue}}if(!hasAnsiCode)return!1;let characterToken=parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments);return characterToken?areValuesInSameGrapheme(previousVisibleValue,characterToken.token.value):!0}return!1}function tokenizeAnsi$1(string,{endCharacter=1/0}={}){let tokens=[],graphemeSegments=GRAPHEME_SEGMENTER.segment(string),index=0,visibleCount=0,previousVisibleValue,hasAnsiSinceLastVisible=!1;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){tokens.push(code.token),index=code.endIndex,hasAnsiSinceLastVisible=!0;continue}}let characterToken=parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments);if(!characterToken||hasAnsiSinceLastVisible&&previousVisibleValue&&areValuesInSameGrapheme(previousVisibleValue,characterToken.token.value))return tokenizeAnsiWithVisibleSegmentation(string,{endCharacter});if(tokens.push(characterToken.token),index=characterToken.endIndex,visibleCount+=characterToken.token.visibleWidth,hasAnsiSinceLastVisible=!1,previousVisibleValue=characterToken.token.value,visibleCount>=endCharacter){if(hasAnsiSplitContinuationAhead(string,index,previousVisibleValue,graphemeSegments))return tokenizeAnsiWithVisibleSegmentation(string,{endCharacter});index=appendTrailingAnsiTokens(string,index,tokens);break}}return tokens}function applySgrFragments(activeStyles,fragments){for(let fragment of fragments)switch(fragment.type){case`reset`:activeStyles.clear();break;case`end`:activeStyles.delete(fragment.endCode);break;case`start`:activeStyles.delete(fragment.endCode),activeStyles.set(fragment.endCode,fragment.code);break;default:break}return activeStyles}function undoAnsiCodes$1(activeStyles){return[...activeStyles.keys()].toReversed().join(``)}function closeHyperlink(hyperlinkToken){return`${hyperlinkToken.closePrefix}${hyperlinkToken.terminator}`}function shouldIncludeSgrAfterEnd(token,activeStyles){let hasStartFragment=!1,hasClosingEffect=!1;for(let fragment of token.fragments){if(fragment.type===`start`){hasStartFragment=!0;continue}if(fragment.type===`reset`&&activeStyles.size>0){hasClosingEffect=!0;continue}fragment.type===`end`&&activeStyles.has(fragment.endCode)&&(hasClosingEffect=!0)}return hasClosingEffect&&!hasStartFragment}function hasSgrStartFragment(token){return token.fragments.some(fragment=>fragment.type===`start`)}function discardPendingHyperlink(parameters){if(parameters.activeHyperlink&&!parameters.activeHyperlinkHasVisibleText&¶meters.activeHyperlinkOutputIndex!==void 0){let openCodeLength=parameters.activeHyperlink.code.length;parameters.returnValue=parameters.returnValue.slice(0,parameters.activeHyperlinkOutputIndex)+parameters.returnValue.slice(parameters.activeHyperlinkOutputIndex+openCodeLength),parameters.pendingSgrOutputIndex!==void 0&¶meters.pendingSgrOutputIndex>parameters.activeHyperlinkOutputIndex&&(parameters.pendingSgrOutputIndex-=openCodeLength)}parameters.activeHyperlink=void 0,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0}function applySgrToken(parameters){return parameters.isPastEnd&&!shouldIncludeSgrAfterEnd(parameters.token,parameters.activeStyles)?parameters:(parameters.include&&hasSgrStartFragment(parameters.token)&¶meters.pendingSgrOutputIndex===void 0&&(parameters.pendingSgrOutputIndex=parameters.returnValue.length,parameters.pendingSgrActiveStyles=new Map(parameters.activeStyles)),parameters.activeStyles=applySgrFragments(parameters.activeStyles,parameters.token.fragments),parameters.include&&(parameters.returnValue+=parameters.token.code),parameters)}function applyHyperlinkToken(parameters){if(parameters.isPastEnd&&(parameters.token.action!==`close`||!parameters.activeHyperlink))return parameters;if(parameters.token.action===`open`)parameters.activeHyperlink=parameters.token,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0,parameters.include&&(parameters.activeHyperlinkOutputIndex=parameters.returnValue.length);else if(parameters.token.action===`close`){if(parameters.include&¶meters.activeHyperlink&&!parameters.activeHyperlinkHasVisibleText)return discardPendingHyperlink(parameters),parameters;parameters.activeHyperlink=void 0,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0}return parameters.include&&(parameters.returnValue+=parameters.token.code),parameters}function applyControlToken(parameters){return!parameters.isPastEnd&¶meters.include&&(parameters.returnValue+=parameters.token.code),parameters}function applyCharacterToken(parameters){return!parameters.include&¶meters.position>=parameters.start&&!parameters.token.isGraphemeContinuation&&(parameters.include=!0,parameters.returnValue=[...parameters.activeStyles.values()].join(``),parameters.activeHyperlink&&(parameters.activeHyperlinkOutputIndex=parameters.returnValue.length,parameters.returnValue+=parameters.activeHyperlink.code)),parameters.include&&(parameters.returnValue+=parameters.token.value,parameters.pendingSgrOutputIndex=void 0,parameters.pendingSgrActiveStyles=void 0,parameters.activeHyperlink&&(parameters.activeHyperlinkHasVisibleText=!0)),parameters.position+=parameters.token.visibleWidth,parameters}const tokenHandlers={sgr:applySgrToken,hyperlink:applyHyperlinkToken,control:applyControlToken,character:applyCharacterToken};function applyToken(parameters){let tokenHandler=tokenHandlers[parameters.token.type];return tokenHandler?tokenHandler(parameters):parameters}function createHasContinuationAheadMap(tokens){let hasContinuationAhead=Array.from({length:tokens.length},()=>!1),nextCharacterIsContinuation=!1;for(let tokenIndex=tokens.length-1;tokenIndex>=0;tokenIndex--){let token=tokens[tokenIndex];hasContinuationAhead[tokenIndex]=nextCharacterIsContinuation,token.type===`character`&&(nextCharacterIsContinuation=!!token.isGraphemeContinuation)}return hasContinuationAhead}function isPastEndBoundary(token,position,end){return end===void 0?!1:position>=end?!0:token.type===`character`&&!token.isGraphemeContinuation&&position+token.visibleWidth>end}function sliceAnsi(string,start,end){let tokens=tokenizeAnsi$1(string,{endCharacter:end}),hasContinuationAhead=createHasContinuationAheadMap(tokens),activeStyles=new Map,activeHyperlink,activeHyperlinkHasVisibleText=!1,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position=0,returnValue=``,include=!1;for(let[tokenIndex,token]of tokens.entries()){let isPastEnd=isPastEndBoundary(token,position,end);if(isPastEnd&&token.type!==`character`&&hasContinuationAhead[tokenIndex]&&(isPastEnd=!1),isPastEnd&&token.type===`character`&&!token.isGraphemeContinuation){if(activeHyperlink&&!activeHyperlinkHasVisibleText){let hyperlinkState={activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,returnValue};discardPendingHyperlink(hyperlinkState),{activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,returnValue}=hyperlinkState}pendingSgrOutputIndex!==void 0&&(returnValue=returnValue.slice(0,pendingSgrOutputIndex),activeStyles=pendingSgrActiveStyles,pendingSgrOutputIndex=void 0,pendingSgrActiveStyles=void 0);break}({activeStyles,activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position,returnValue,include}=applyToken({token,isPastEnd,start,activeStyles,activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position,returnValue,include}))}return include?(activeHyperlink&&(returnValue+=closeHyperlink(activeHyperlink)),returnValue+=undoAnsiCodes$1(activeStyles),returnValue):``}function getIndexOfNearestSpace(string,wantedIndex,shouldSearchRight){if(string.charAt(wantedIndex)===` `)return wantedIndex;let direction=shouldSearchRight?1:-1;for(let index=0;index<=3;index++){let finalIndex=wantedIndex+index*direction;if(string.charAt(finalIndex)===` `)return finalIndex}return wantedIndex}function cliTruncate(text,columns,options={}){let{position=`end`,space=!1,preferTruncationOnSpace=!1}=options,{truncationCharacter=`…`}=options;if(typeof text!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof text}`);if(typeof columns!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);if(columns<1)return``;let length=stringWidth(text);if(length<=columns)return text;if(columns===1)return truncationCharacter;let ANSI={ESC:27,LEFT_BRACKET:91,LETTER_M:109},isSgrParameter=code=>code>=48&&code<=57||code===59;function leadingSgrSpanEndIndex(string){let index=0;for(;index+2<string.length&&string.codePointAt(index)===ANSI.ESC&&string.codePointAt(index+1)===ANSI.LEFT_BRACKET;){let j=index+2;for(;j<string.length&&isSgrParameter(string.codePointAt(j));)j++;if(j<string.length&&string.codePointAt(j)===ANSI.LETTER_M){index=j+1;continue}break}return index}function trailingSgrSpanStartIndex(string){let start=string.length;for(;start>1&&string.codePointAt(start-1)===ANSI.LETTER_M;){let j=start-2;for(;j>=0&&isSgrParameter(string.codePointAt(j));)j--;if(j>=1&&string.codePointAt(j-1)===ANSI.ESC&&string.codePointAt(j)===ANSI.LEFT_BRACKET){start=j-1;continue}break}return start}function appendWithInheritedStyleFromEnd(visible,suffix){let start=trailingSgrSpanStartIndex(visible);return start===visible.length?visible+suffix:visible.slice(0,start)+suffix+visible.slice(start)}function prependWithInheritedStyleFromStart(prefix,visible){let end=leadingSgrSpanEndIndex(visible);return end===0?prefix+visible:visible.slice(0,end)+prefix+visible.slice(end)}if(position===`start`){if(preferTruncationOnSpace){let right=sliceAnsi(text,getIndexOfNearestSpace(text,length-columns+1,!0),length).trim();return prependWithInheritedStyleFromStart(truncationCharacter,right)}space&&(truncationCharacter+=` `);let right=sliceAnsi(text,length-columns+stringWidth(truncationCharacter),length);return prependWithInheritedStyleFromStart(truncationCharacter,right)}if(position===`middle`){space&&(truncationCharacter=` ${truncationCharacter} `);let half=Math.floor(columns/2);if(preferTruncationOnSpace){let spaceNearFirstBreakPoint=getIndexOfNearestSpace(text,half),spaceNearSecondBreakPoint=getIndexOfNearestSpace(text,length-(columns-half)+1,!0);return sliceAnsi(text,0,spaceNearFirstBreakPoint)+truncationCharacter+sliceAnsi(text,spaceNearSecondBreakPoint,length).trim()}return sliceAnsi(text,0,half)+truncationCharacter+sliceAnsi(text,length-(columns-half)+stringWidth(truncationCharacter),length)}if(position===`end`)return preferTruncationOnSpace?appendWithInheritedStyleFromEnd(sliceAnsi(text,0,getIndexOfNearestSpace(text,columns-1)),truncationCharacter):(space&&(truncationCharacter=` ${truncationCharacter}`),appendWithInheritedStyleFromEnd(sliceAnsi(text,0,columns-stringWidth(truncationCharacter)),truncationCharacter));throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`)}const cache={},wrapText=(text,maxWidth,wrapType)=>{let cacheKey=text+String(maxWidth)+String(wrapType),cachedText=cache[cacheKey];if(cachedText)return cachedText;let wrappedText=text;if(wrapType===`wrap`&&(wrappedText=wrapAnsi(text,maxWidth,{trim:!1,hard:!0})),wrapType===`hard`&&(wrappedText=wrapAnsi(text,maxWidth,{trim:!1,hard:!0,wordWrap:!1})),wrapType.startsWith(`truncate`)){let position=`end`;wrapType===`truncate-middle`&&(position=`middle`),wrapType===`truncate-start`&&(position=`start`),wrappedText=cliTruncate(text,maxWidth,{position})}return cache[cacheKey]=wrappedText,wrappedText},isCsiParameterCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=48&&codePoint<=63},isCsiIntermediateCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=32&&codePoint<=47},isCsiFinalCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=64&&codePoint<=126},isEscapeIntermediateCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=32&&codePoint<=47},isEscapeFinalCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=48&&codePoint<=126},isC1ControlCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=128&&codePoint<=159},readCsiSequence=(text,fromIndex)=>{let index=fromIndex;for(;index<text.length;){let character=text[index];if(!isCsiParameterCharacter(character))break;index++}let parameterString=text.slice(fromIndex,index),intermediateStartIndex=index;for(;index<text.length;){let character=text[index];if(!isCsiIntermediateCharacter(character))break;index++}let intermediateString=text.slice(intermediateStartIndex,index),finalCharacter=text[index];if(!(finalCharacter===void 0||!isCsiFinalCharacter(finalCharacter)))return{endIndex:index+1,parameterString,intermediateString,finalCharacter}},findControlStringTerminatorIndex=(text,fromIndex,allowBellTerminator)=>{for(let index=fromIndex;index<text.length;index++){let character=text[index];if(allowBellTerminator&&character===`\x07`||character===``)return index+1;if(character===`\x1B`){let followingCharacter=text[index+1];if(followingCharacter===`\x1B`){index++;continue}if(followingCharacter===`\\`)return index+2}}},readEscapeSequence=(text,fromIndex)=>{let index=fromIndex;for(;index<text.length;){let character=text[index];if(!isEscapeIntermediateCharacter(character))break;index++}let intermediateString=text.slice(fromIndex,index),finalCharacter=text[index];if(!(finalCharacter===void 0||!isEscapeFinalCharacter(finalCharacter)))return{endIndex:index+1,intermediateString,finalCharacter}},getControlStringFromEscapeIntroducer=character=>{switch(character){case`]`:return{type:`osc`,allowBellTerminator:!0};case`P`:return{type:`dcs`,allowBellTerminator:!1};case`^`:return{type:`pm`,allowBellTerminator:!1};case`_`:return{type:`apc`,allowBellTerminator:!1};case`X`:return{type:`sos`,allowBellTerminator:!1};default:return}},getControlStringFromC1Introducer=character=>{switch(character){case``:return{type:`osc`,allowBellTerminator:!0};case``:return{type:`dcs`,allowBellTerminator:!1};case``:return{type:`pm`,allowBellTerminator:!1};case``:return{type:`apc`,allowBellTerminator:!1};case``:return{type:`sos`,allowBellTerminator:!1};default:return}},hasAnsiControlCharacters=text=>{if(text.includes(`\x1B`))return!0;for(let character of text)if(isC1ControlCharacter(character))return!0;return!1},malformedFromIndex=(tokens,text,textStartIndex,fromIndex)=>(fromIndex>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,fromIndex)}),tokens.push({type:`invalid`,value:text.slice(fromIndex)}),tokens),tokenizeAnsi=text=>{if(!hasAnsiControlCharacters(text))return[{type:`text`,value:text}];let tokens=[],textStartIndex=0;for(let index=0;index<text.length;){let character=text[index];if(character===void 0)break;if(character===`\x1B`){let followingCharacter=text[index+1];if(followingCharacter===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);if(followingCharacter===`[`){let csiSequence=readCsiSequence(text,index+2);if(csiSequence===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`csi`,value:text.slice(index,csiSequence.endIndex),parameterString:csiSequence.parameterString,intermediateString:csiSequence.intermediateString,finalCharacter:csiSequence.finalCharacter}),index=csiSequence.endIndex,textStartIndex=index;continue}let escapeControlString=getControlStringFromEscapeIntroducer(followingCharacter);if(escapeControlString!==void 0){let controlStringTerminatorIndex=findControlStringTerminatorIndex(text,index+2,escapeControlString.allowBellTerminator);if(controlStringTerminatorIndex===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:escapeControlString.type,value:text.slice(index,controlStringTerminatorIndex)}),index=controlStringTerminatorIndex,textStartIndex=index;continue}let escapeSequence=readEscapeSequence(text,index+1);if(escapeSequence===void 0){if(isEscapeIntermediateCharacter(followingCharacter))return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),index++,textStartIndex=index;continue}index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`esc`,value:text.slice(index,escapeSequence.endIndex),intermediateString:escapeSequence.intermediateString,finalCharacter:escapeSequence.finalCharacter}),index=escapeSequence.endIndex,textStartIndex=index;continue}if(character===``){let csiSequence=readCsiSequence(text,index+1);if(csiSequence===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`csi`,value:text.slice(index,csiSequence.endIndex),parameterString:csiSequence.parameterString,intermediateString:csiSequence.intermediateString,finalCharacter:csiSequence.finalCharacter}),index=csiSequence.endIndex,textStartIndex=index;continue}let c1ControlString=getControlStringFromC1Introducer(character);if(c1ControlString!==void 0){let controlStringTerminatorIndex=findControlStringTerminatorIndex(text,index+1,c1ControlString.allowBellTerminator);if(controlStringTerminatorIndex===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:c1ControlString.type,value:text.slice(index,controlStringTerminatorIndex)}),index=controlStringTerminatorIndex,textStartIndex=index;continue}if(character===``){index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`st`,value:character}),index++,textStartIndex=index;continue}if(isC1ControlCharacter(character)){index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`c1`,value:character}),index++,textStartIndex=index;continue}index++}return textStartIndex<text.length&&tokens.push({type:`text`,value:text.slice(textStartIndex)}),tokens},sgrParametersRegex=/^[\d:;]*$/,sanitizeAnsi=text=>{if(!hasAnsiControlCharacters(text))return text;let output=``;for(let token of tokenizeAnsi(text)){if(token.type===`text`||token.type===`osc`){output+=token.value;continue}token.type===`csi`&&token.finalCharacter===`m`&&token.intermediateString===``&&sgrParametersRegex.test(token.parameterString)&&(output+=token.value)}return output},squashTextNodes=node=>{let text=``;for(let index=0;index<node.childNodes.length;index++){let childNode=node.childNodes[index];if(childNode===void 0)continue;let nodeText=``;childNode.nodeName===`#text`?nodeText=childNode.nodeValue:((childNode.nodeName===`ink-text`||childNode.nodeName===`ink-virtual-text`)&&(nodeText=squashTextNodes(childNode)),nodeText.length>0&&typeof childNode.internal_transform==`function`&&(nodeText=childNode.internal_transform(nodeText,index))),text+=nodeText}return sanitizeAnsi(text)},createNode=nodeName=>{let node={nodeName,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:nodeName===`ink-virtual-text`?void 0:Yoga.Node.create(),internal_accessibility:{}};return nodeName===`ink-text`&&node.yogaNode?.setMeasureFunc(measureTextNode.bind(null,node)),node},appendChildNode=(node,childNode)=>{childNode.parentNode&&removeChildNode(childNode.parentNode,childNode),childNode.parentNode=node,node.childNodes.push(childNode),childNode.yogaNode&&node.yogaNode?.insertChild(childNode.yogaNode,node.yogaNode.getChildCount()),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},insertBeforeNode=(node,newChildNode,beforeChildNode)=>{newChildNode.parentNode&&removeChildNode(newChildNode.parentNode,newChildNode),newChildNode.parentNode=node;let index=node.childNodes.indexOf(beforeChildNode);index>=0?(node.childNodes.splice(index,0,newChildNode),newChildNode.yogaNode&&node.yogaNode?.insertChild(newChildNode.yogaNode,index)):(node.childNodes.push(newChildNode),newChildNode.yogaNode&&node.yogaNode?.insertChild(newChildNode.yogaNode,node.yogaNode.getChildCount())),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},removeChildNode=(node,removeNode)=>{removeNode.yogaNode&&removeNode.parentNode?.yogaNode?.removeChild(removeNode.yogaNode),removeNode.parentNode=void 0;let index=node.childNodes.indexOf(removeNode);index>=0&&node.childNodes.splice(index,1),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},setAttribute=(node,key,value)=>{if(key===`internal_accessibility`){node.internal_accessibility=value;return}node.attributes[key]=value},setStyle=(node,style)=>{node.style=style??{}},createTextNode=text=>{let node={nodeName:`#text`,nodeValue:text,yogaNode:void 0,parentNode:void 0,style:{}};return setTextNodeValue(node,text),node},measureTextNode=function(node,width){let text=node.nodeName===`#text`?node.nodeValue:squashTextNodes(node),dimensions=measureText(text);return dimensions.width<=width||dimensions.width>=1&&width>0&&width<1?dimensions:measureText(wrapText(text,width,node.style?.textWrap??`wrap`))},findClosestYogaNode=node=>{if(node?.parentNode)return node.yogaNode??findClosestYogaNode(node.parentNode)},markNodeAsDirty=node=>{findClosestYogaNode(node)?.markDirty()},setTextNodeValue=(node,text)=>{typeof text!=`string`&&(text=String(text)),node.nodeValue=text,markNodeAsDirty(node)},emitLayoutListeners=rootNode=>{if(!(rootNode.nodeName!==`ink-root`||!rootNode.internal_layoutListeners))for(let listener of rootNode.internal_layoutListeners)listener()},positionEdges=[[`top`,Yoga.EDGE_TOP],[`right`,Yoga.EDGE_RIGHT],[`bottom`,Yoga.EDGE_BOTTOM],[`left`,Yoga.EDGE_LEFT]],applyPositionStyles=(node,style)=>{if(`position`in style){let positionType=Yoga.POSITION_TYPE_RELATIVE;style.position===`absolute`?positionType=Yoga.POSITION_TYPE_ABSOLUTE:style.position===`static`&&(positionType=Yoga.POSITION_TYPE_STATIC),node.setPositionType(positionType)}for(let[property,edge]of positionEdges){if(!(property in style))continue;let value=style[property];if(typeof value==`string`){node.setPositionPercent(edge,Number.parseFloat(value));continue}node.setPosition(edge,value)}},applyMarginStyles=(node,style)=>{`margin`in style&&node.setMargin(Yoga.EDGE_ALL,style.margin??0),`marginX`in style&&node.setMargin(Yoga.EDGE_HORIZONTAL,style.marginX??0),`marginY`in style&&node.setMargin(Yoga.EDGE_VERTICAL,style.marginY??0),`marginLeft`in style&&node.setMargin(Yoga.EDGE_START,style.marginLeft??0),`marginRight`in style&&node.setMargin(Yoga.EDGE_END,style.marginRight??0),`marginTop`in style&&node.setMargin(Yoga.EDGE_TOP,style.marginTop??0),`marginBottom`in style&&node.setMargin(Yoga.EDGE_BOTTOM,style.marginBottom??0)},applyPaddingStyles=(node,style)=>{`padding`in style&&node.setPadding(Yoga.EDGE_ALL,style.padding??0),`paddingX`in style&&node.setPadding(Yoga.EDGE_HORIZONTAL,style.paddingX??0),`paddingY`in style&&node.setPadding(Yoga.EDGE_VERTICAL,style.paddingY??0),`paddingLeft`in style&&node.setPadding(Yoga.EDGE_LEFT,style.paddingLeft??0),`paddingRight`in style&&node.setPadding(Yoga.EDGE_RIGHT,style.paddingRight??0),`paddingTop`in style&&node.setPadding(Yoga.EDGE_TOP,style.paddingTop??0),`paddingBottom`in style&&node.setPadding(Yoga.EDGE_BOTTOM,style.paddingBottom??0)},applyFlexStyles=(node,style)=>{`flexGrow`in style&&node.setFlexGrow(style.flexGrow??0),`flexShrink`in style&&node.setFlexShrink(typeof style.flexShrink==`number`?style.flexShrink:1),`flexWrap`in style&&(style.flexWrap===`nowrap`&&node.setFlexWrap(Yoga.WRAP_NO_WRAP),style.flexWrap===`wrap`&&node.setFlexWrap(Yoga.WRAP_WRAP),style.flexWrap===`wrap-reverse`&&node.setFlexWrap(Yoga.WRAP_WRAP_REVERSE)),`flexDirection`in style&&(style.flexDirection===`row`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW),style.flexDirection===`row-reverse`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE),style.flexDirection===`column`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN),style.flexDirection===`column-reverse`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE)),`flexBasis`in style&&(typeof style.flexBasis==`number`?node.setFlexBasis(style.flexBasis):typeof style.flexBasis==`string`?node.setFlexBasisPercent(Number.parseInt(style.flexBasis,10)):node.setFlexBasisAuto()),`alignItems`in style&&((style.alignItems===`stretch`||!style.alignItems)&&node.setAlignItems(Yoga.ALIGN_STRETCH),style.alignItems===`flex-start`&&node.setAlignItems(Yoga.ALIGN_FLEX_START),style.alignItems===`center`&&node.setAlignItems(Yoga.ALIGN_CENTER),style.alignItems===`flex-end`&&node.setAlignItems(Yoga.ALIGN_FLEX_END),style.alignItems===`baseline`&&node.setAlignItems(Yoga.ALIGN_BASELINE)),`alignSelf`in style&&((style.alignSelf===`auto`||!style.alignSelf)&&node.setAlignSelf(Yoga.ALIGN_AUTO),style.alignSelf===`flex-start`&&node.setAlignSelf(Yoga.ALIGN_FLEX_START),style.alignSelf===`center`&&node.setAlignSelf(Yoga.ALIGN_CENTER),style.alignSelf===`flex-end`&&node.setAlignSelf(Yoga.ALIGN_FLEX_END),style.alignSelf===`stretch`&&node.setAlignSelf(Yoga.ALIGN_STRETCH),style.alignSelf===`baseline`&&node.setAlignSelf(Yoga.ALIGN_BASELINE)),`alignContent`in style&&((style.alignContent===`flex-start`||!style.alignContent)&&node.setAlignContent(Yoga.ALIGN_FLEX_START),style.alignContent===`center`&&node.setAlignContent(Yoga.ALIGN_CENTER),style.alignContent===`flex-end`&&node.setAlignContent(Yoga.ALIGN_FLEX_END),style.alignContent===`space-between`&&node.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN),style.alignContent===`space-around`&&node.setAlignContent(Yoga.ALIGN_SPACE_AROUND),style.alignContent===`space-evenly`&&node.setAlignContent(Yoga.ALIGN_SPACE_EVENLY),style.alignContent===`stretch`&&node.setAlignContent(Yoga.ALIGN_STRETCH)),`justifyContent`in style&&((style.justifyContent===`flex-start`||!style.justifyContent)&&node.setJustifyContent(Yoga.JUSTIFY_FLEX_START),style.justifyContent===`center`&&node.setJustifyContent(Yoga.JUSTIFY_CENTER),style.justifyContent===`flex-end`&&node.setJustifyContent(Yoga.JUSTIFY_FLEX_END),style.justifyContent===`space-between`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN),style.justifyContent===`space-around`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND),style.justifyContent===`space-evenly`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY))},applyDimensionStyles=(node,style)=>{`width`in style&&(typeof style.width==`number`?node.setWidth(style.width):typeof style.width==`string`?node.setWidthPercent(Number.parseInt(style.width,10)):node.setWidthAuto()),`height`in style&&(typeof style.height==`number`?node.setHeight(style.height):typeof style.height==`string`?node.setHeightPercent(Number.parseInt(style.height,10)):node.setHeightAuto()),`minWidth`in style&&(typeof style.minWidth==`string`?node.setMinWidthPercent(Number.parseInt(style.minWidth,10)):node.setMinWidth(style.minWidth??0)),`minHeight`in style&&(typeof style.minHeight==`string`?node.setMinHeightPercent(Number.parseInt(style.minHeight,10)):node.setMinHeight(style.minHeight??0)),`maxWidth`in style&&(typeof style.maxWidth==`string`?node.setMaxWidthPercent(Number.parseInt(style.maxWidth,10)):node.setMaxWidth(style.maxWidth)),`maxHeight`in style&&(typeof style.maxHeight==`string`?node.setMaxHeightPercent(Number.parseInt(style.maxHeight,10)):node.setMaxHeight(style.maxHeight)),`aspectRatio`in style&&node.setAspectRatio(style.aspectRatio)},applyDisplayStyles=(node,style)=>{`display`in style&&node.setDisplay(style.display===`flex`?Yoga.DISPLAY_FLEX:Yoga.DISPLAY_NONE)},applyBorderStyles=(node,style,currentStyle)=>{if(!(`borderStyle`in style||`borderTop`in style||`borderBottom`in style||`borderLeft`in style||`borderRight`in style))return;let borderWidth=currentStyle.borderStyle?1:0;node.setBorder(Yoga.EDGE_TOP,currentStyle.borderTop===!1?0:borderWidth),node.setBorder(Yoga.EDGE_BOTTOM,currentStyle.borderBottom===!1?0:borderWidth),node.setBorder(Yoga.EDGE_LEFT,currentStyle.borderLeft===!1?0:borderWidth),node.setBorder(Yoga.EDGE_RIGHT,currentStyle.borderRight===!1?0:borderWidth)},applyGapStyles=(node,style)=>{`gap`in style&&node.setGap(Yoga.GUTTER_ALL,style.gap??0),`columnGap`in style&&node.setGap(Yoga.GUTTER_COLUMN,style.columnGap??0),`rowGap`in style&&node.setGap(Yoga.GUTTER_ROW,style.rowGap??0)},styles=(node,style={},currentStyle=style)=>{applyPositionStyles(node,style),applyMarginStyles(node,style),applyPaddingStyles(node,style),applyFlexStyles(node,style),applyDimensionStyles(node,style),applyDisplayStyles(node,style),applyBorderStyles(node,style,currentStyle),applyGapStyles(node,style)};if(process$1.env.DEV===`true`){let isDevtoolsInstalled=!1;try{import.meta.resolve(`react-devtools-core`),isDevtoolsInstalled=!0}catch{}isDevtoolsInstalled&&await import(`./devtools-CI7JyCXv.js`)}const diff=(before,after)=>{if(before===after)return;if(!before)return after;let changed={},isChanged=!1;for(let key of Object.keys(before))(!after||!Object.hasOwn(after,key))&&(changed[key]=void 0,isChanged=!0);if(after)for(let key of Object.keys(after))after[key]!==before[key]&&(changed[key]=after[key],isChanged=!0);return isChanged?changed:void 0},cleanupYogaNode=node=>{node?.unsetMeasureFunc(),node?.freeRecursive()};let currentUpdatePriority=import_constants.NoEventPriority,currentRootNode;async function loadPackageJson(){let content=(await import(`node:fs`)).readFileSync(new URL(`../package.json`,import.meta.url),`utf8`),parsedContent=JSON.parse(content);return{name:parsedContent?.name,version:parsedContent?.version}}let packageInfo={name:`ink`,version:import_react.version};if(process$1.env.DEV===`true`)try{let loaded=await loadPackageJson();packageInfo={name:loaded.name||packageInfo.name,version:loaded.version||packageInfo.version}}catch(error){console.warn(`Failed to load package.json in development mode. Falling back to default renderer metadata.`,error)}var reconciler_default=(0,import_react_reconciler.default)({getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,resetAfterCommit(rootNode){if(typeof rootNode.onComputeLayout==`function`&&rootNode.onComputeLayout(),emitLayoutListeners(rootNode),rootNode.staticNode!==rootNode.previousStaticNode&&(rootNode.previousStaticNode=rootNode.staticNode,typeof rootNode.onStaticChange==`function`&&rootNode.onStaticChange()),rootNode.isStaticDirty){rootNode.isStaticDirty=!1,typeof rootNode.onImmediateRender==`function`&&rootNode.onImmediateRender();return}typeof rootNode.onRender==`function`&&rootNode.onRender()},getChildHostContext(parentHostContext,type){let previousIsInsideText=parentHostContext.isInsideText,isInsideText=type===`ink-text`||type===`ink-virtual-text`;return previousIsInsideText===isInsideText?parentHostContext:{isInsideText}},shouldSetTextContent:()=>!1,createInstance(originalType,newProps,rootNode,hostContext){if(hostContext.isInsideText&&originalType===`ink-box`)throw Error(`<Box> can’t be nested inside <Text> component`);let node=createNode(originalType===`ink-text`&&hostContext.isInsideText?`ink-virtual-text`:originalType);for(let[key,value]of Object.entries(newProps))if(key!==`children`){if(key===`style`){setStyle(node,value),node.yogaNode&&styles(node.yogaNode,value);continue}if(key===`internal_transform`){node.internal_transform=value;continue}if(key===`internal_static`){currentRootNode=rootNode,node.internal_static=!0,rootNode.isStaticDirty=!0,rootNode.staticNode=node;continue}setAttribute(node,key,value)}return node},createTextInstance(text,_root,hostContext){if(!hostContext.isInsideText)throw Error(`Text string "${text}" must be rendered inside <Text> component`);return createTextNode(text)},resetTextContent(){},hideTextInstance(node){setTextNodeValue(node,``)},unhideTextInstance(node,text){setTextNodeValue(node,text)},getPublicInstance:instance=>instance,hideInstance(node){node.yogaNode?.setDisplay(Yoga.DISPLAY_NONE)},unhideInstance(node){node.yogaNode?.setDisplay(Yoga.DISPLAY_FLEX)},appendInitialChild:appendChildNode,appendChild:appendChildNode,insertBefore:insertBeforeNode,finalizeInitialChildren(){return!1},isPrimaryRenderer:!0,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,supportsMicrotasks:!0,scheduleMicrotask:queueMicrotask,scheduleCallback:import_scheduler.unstable_scheduleCallback,cancelCallback:import_scheduler.unstable_cancelCallback,shouldYield:import_scheduler.unstable_shouldYield,now:import_scheduler.unstable_now,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},getInstanceFromNode:()=>null,prepareScopeUpdate(){},getInstanceFromScope:()=>null,appendChildToContainer:appendChildNode,insertInContainerBefore:insertBeforeNode,removeChildFromContainer(node,removeNode){removeChildNode(node,removeNode),cleanupYogaNode(removeNode.yogaNode),removeNode.internal_static&¤tRootNode?.staticNode===removeNode&&(currentRootNode.staticNode=void 0)},commitUpdate(node,_type,oldProps,newProps){currentRootNode&&node.internal_static&&(currentRootNode.isStaticDirty=!0);let props=diff(oldProps,newProps),style=diff(oldProps.style,newProps.style);if(!(!props&&!style)){if(props)for(let[key,value]of Object.entries(props)){if(key===`style`){setStyle(node,value);continue}if(key===`internal_transform`){node.internal_transform=value;continue}if(key===`internal_static`){node.internal_static=!0;continue}setAttribute(node,key,value)}style&&node.yogaNode&&styles(node.yogaNode,style,newProps.style??{})}},commitTextUpdate(node,_oldText,newText){setTextNodeValue(node,newText)},removeChild(node,removeNode){removeChildNode(node,removeNode),cleanupYogaNode(removeNode.yogaNode),removeNode.internal_static&¤tRootNode?.staticNode===removeNode&&(currentRootNode.staticNode=void 0)},setCurrentUpdatePriority(newPriority){currentUpdatePriority=newPriority},getCurrentUpdatePriority:()=>currentUpdatePriority,resolveUpdatePriority(){return currentUpdatePriority===import_constants.NoEventPriority?import_constants.DefaultEventPriority:currentUpdatePriority},maySuspendCommit(){return!0},NotPendingTransition:void 0,HostTransitionContext:(0,import_react.createContext)(null),resetFormInstance(){},requestPostPaintCallback(){},shouldAttemptEagerTransition(){return!1},trackSchedulerEvent(){},resolveEventType(){return null},resolveEventTimeStamp(){return-1.1},preloadInstance(){return!0},startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady(){return null},rendererPackageName:packageInfo.name,rendererVersion:packageInfo.version});function indentString(string,count=1,options={}){let{indent=` `,includeEmptyLines=!1}=options;if(typeof string!=`string`)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof string}\``);if(typeof count!=`number`)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``);if(count<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${count}\``);if(typeof indent!=`string`)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\``);if(count===0)return string;let regex=includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return string.replace(regex,indent.repeat(count))}const getMaxWidth=yogaNode=>yogaNode.getComputedWidth()-yogaNode.getComputedPadding(Yoga.EDGE_LEFT)-yogaNode.getComputedPadding(Yoga.EDGE_RIGHT)-yogaNode.getComputedBorder(Yoga.EDGE_LEFT)-yogaNode.getComputedBorder(Yoga.EDGE_RIGHT);var cli_boxes_default={single:{topLeft:`┌`,top:`─`,topRight:`┐`,right:`│`,bottomRight:`┘`,bottom:`─`,bottomLeft:`└`,left:`│`},double:{topLeft:`╔`,top:`═`,topRight:`╗`,right:`║`,bottomRight:`╝`,bottom:`═`,bottomLeft:`╚`,left:`║`},round:{topLeft:`╭`,top:`─`,topRight:`╮`,right:`│`,bottomRight:`╯`,bottom:`─`,bottomLeft:`╰`,left:`│`},bold:{topLeft:`┏`,top:`━`,topRight:`┓`,right:`┃`,bottomRight:`┛`,bottom:`━`,bottomLeft:`┗`,left:`┃`},singleDouble:{topLeft:`╓`,top:`─`,topRight:`╖`,right:`║`,bottomRight:`╜`,bottom:`─`,bottomLeft:`╙`,left:`║`},doubleSingle:{topLeft:`╒`,top:`═`,topRight:`╕`,right:`│`,bottomRight:`╛`,bottom:`═`,bottomLeft:`╘`,left:`│`},classic:{topLeft:`+`,top:`-`,topRight:`+`,right:`|`,bottomRight:`+`,bottom:`-`,bottomLeft:`+`,left:`|`},arrow:{topLeft:`↘`,top:`↓`,topRight:`↙`,right:`←`,bottomRight:`↖`,bottom:`↑`,bottomLeft:`↗`,left:`→`}};const rgbRegex=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,ansiRegex=/^ansi256\(\s?(\d+)\s?\)$/,isNamedColor=color=>color in chalk,colorize=(str,color,type)=>{if(!color)return str;if(isNamedColor(color))return type===`foreground`?chalk[color](str):chalk[`bg${color[0].toUpperCase()+color.slice(1)}`](str);if(color.startsWith(`#`))return type===`foreground`?chalk.hex(color)(str):chalk.bgHex(color)(str);if(color.startsWith(`ansi256`)){let matches=ansiRegex.exec(color);if(!matches)return str;let value=Number(matches[1]);return type===`foreground`?chalk.ansi256(value)(str):chalk.bgAnsi256(value)(str)}if(color.startsWith(`rgb`)){let matches=rgbRegex.exec(color);if(!matches)return str;let firstValue=Number(matches[1]),secondValue=Number(matches[2]),thirdValue=Number(matches[3]);return type===`foreground`?chalk.rgb(firstValue,secondValue,thirdValue)(str):chalk.bgRgb(firstValue,secondValue,thirdValue)(str)}return str},stylePiece=(segment,fg,bg,dim)=>{let styled=colorize(segment,fg,`foreground`);return styled=colorize(styled,bg,`background`),dim&&(styled=chalk.dim(styled)),styled},renderBorder=(x,y,node,output)=>{if(node.style.borderStyle){let width=node.yogaNode.getComputedWidth(),height=node.yogaNode.getComputedHeight(),box=typeof node.style.borderStyle==`string`?cli_boxes_default[node.style.borderStyle]:node.style.borderStyle,topBorderColor=node.style.borderTopColor??node.style.borderColor,bottomBorderColor=node.style.borderBottomColor??node.style.borderColor,leftBorderColor=node.style.borderLeftColor??node.style.borderColor,rightBorderColor=node.style.borderRightColor??node.style.borderColor,topBorderBackgroundColor=node.style.borderTopBackgroundColor??node.style.borderBackgroundColor,bottomBorderBackgroundColor=node.style.borderBottomBackgroundColor??node.style.borderBackgroundColor,leftBorderBackgroundColor=node.style.borderLeftBackgroundColor??node.style.borderBackgroundColor,rightBorderBackgroundColor=node.style.borderRightBackgroundColor??node.style.borderBackgroundColor,dimTopBorderColor=node.style.borderTopDimColor??node.style.borderDimColor,dimBottomBorderColor=node.style.borderBottomDimColor??node.style.borderDimColor,dimLeftBorderColor=node.style.borderLeftDimColor??node.style.borderDimColor,dimRightBorderColor=node.style.borderRightDimColor??node.style.borderDimColor,showTopBorder=node.style.borderTop!==!1,showBottomBorder=node.style.borderBottom!==!1,showLeftBorder=node.style.borderLeft!==!1,showRightBorder=node.style.borderRight!==!1,contentWidth=width-(showLeftBorder?1:0)-(showRightBorder?1:0),topBorder=showTopBorder?(showLeftBorder?box.topLeft:``)+box.top.repeat(contentWidth)+(showRightBorder?box.topRight:``):void 0;topBorder&&=stylePiece(topBorder,topBorderColor,topBorderBackgroundColor,dimTopBorderColor);let verticalBorderHeight=height;showTopBorder&&--verticalBorderHeight,showBottomBorder&&--verticalBorderHeight;let leftBorder=``;showLeftBorder&&(leftBorder=(stylePiece(box.left,leftBorderColor,leftBorderBackgroundColor,dimLeftBorderColor)+`
|
|
52
|
+
`).length};return cache$1.set(text,dimensions),dimensions};function isFullwidthCodePoint(codePoint){return Number.isInteger(codePoint)?isFullWidth(codePoint)||isWide(codePoint):!1}const ESCAPES$1=new Set([27,144,152,155,156,157,158,159]),ANSI_HYPERLINK_ESC_PREFIX=`\x1B]8;`,ANSI_HYPERLINK_C1_PREFIX=`8;`,ANSI_HYPERLINK_ESC_CLOSE=`${ANSI_HYPERLINK_ESC_PREFIX};`,ANSI_HYPERLINK_C1_CLOSE=`${ANSI_HYPERLINK_C1_PREFIX};`,CODE_POINT_0=`0`.codePointAt(0),CODE_POINT_9=`9`.codePointAt(0),CODE_POINT_SEMICOLON=`;`.codePointAt(0),CODE_POINT_COLON=`:`.codePointAt(0),CODE_POINT_CSI_PARAMETER_START=`0`.codePointAt(0),CODE_POINT_CSI_PARAMETER_END=`?`.codePointAt(0),CODE_POINT_CSI_INTERMEDIATE_START=` `.codePointAt(0),CODE_POINT_CSI_INTERMEDIATE_END=`/`.codePointAt(0),CODE_POINT_CSI_FINAL_START=`@`.codePointAt(0),CODE_POINT_CSI_FINAL_END=`~`.codePointAt(0),EMOJI_PRESENTATION_GRAPHEME_REGEX=/\p{Emoji_Presentation}/v,GRAPHEME_SEGMENTER=new Intl.Segmenter(void 0,{granularity:`grapheme`}),endCodeNumbers=new Set;for(let[,end]of ansiStyles.codes)endCodeNumbers.add(end);function isSgrParameterCharacter(codePoint){return codePoint>=CODE_POINT_0&&codePoint<=CODE_POINT_9||codePoint===CODE_POINT_SEMICOLON||codePoint===CODE_POINT_COLON}function isCsiParameterCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_PARAMETER_START&&codePoint<=CODE_POINT_CSI_PARAMETER_END}function isCsiIntermediateCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_INTERMEDIATE_START&&codePoint<=CODE_POINT_CSI_INTERMEDIATE_END}function isCsiFinalCharacter$1(codePoint){return codePoint>=CODE_POINT_CSI_FINAL_START&&codePoint<=CODE_POINT_CSI_FINAL_END}function isRegionalIndicatorCodePoint(codePoint){return codePoint>=127462&&codePoint<=127487}function createControlParseResult(code,endIndex){return{token:{type:`control`,code},endIndex}}function isEmojiStyleGrapheme(grapheme){if(EMOJI_PRESENTATION_GRAPHEME_REGEX.test(grapheme))return!0;for(let character of grapheme){let codePoint=character.codePointAt(0);if(codePoint===65039||codePoint===8419)return!0}return!1}function getGraphemeWidth(grapheme){let regionalIndicatorCount=0;for(let character of grapheme){let codePoint=character.codePointAt(0);if(isFullwidthCodePoint(codePoint))return 2;isRegionalIndicatorCodePoint(codePoint)&®ionalIndicatorCount++}return regionalIndicatorCount>=1||isEmojiStyleGrapheme(grapheme)?2:1}function getSgrPrefix(code){return code.startsWith(``)?``:`\x1B[`}function createSgrCode(prefix,values){return`${prefix}${values.join(`;`)}m`}function getSgrFragments(code){let fragments=[],sgrPrefix=getSgrPrefix(code),parameterString;if(code.startsWith(`\x1B[`))parameterString=code.slice(2,-1);else if(code.startsWith(``))parameterString=code.slice(1,-1);else return fragments;let rawCodes=parameterString.length===0?[`0`]:parameterString.split(`;`),index=0;for(;index<rawCodes.length;){let codeNumber=Number.parseInt(rawCodes[index],10);if(Number.isNaN(codeNumber)){index++;continue}if(codeNumber===0){fragments.push({type:`reset`}),index++;continue}if(codeNumber===38||codeNumber===48){let colorType=Number.parseInt(rawCodes[index+1],10);if(colorType===5&&index+2<rawCodes.length){let openCode=createSgrCode(sgrPrefix,rawCodes.slice(index,index+3));fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index+=3;continue}if(colorType===2&&index+4<rawCodes.length){let openCode=createSgrCode(sgrPrefix,rawCodes.slice(index,index+5));fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index+=5;continue}let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(codeNumber===38?39:49)}),index++;continue}if(endCodeNumbers.has(codeNumber)){fragments.push({type:`end`,endCode:ansiStyles.color.ansi(codeNumber)}),index++;continue}let mappedEndCode=ansiStyles.codes.get(codeNumber);if(mappedEndCode!==void 0){let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.color.ansi(mappedEndCode)}),index++;continue}let openCode=createSgrCode(sgrPrefix,[rawCodes[index]]);fragments.push({type:`start`,code:openCode,endCode:ansiStyles.reset.open}),index++}return fragments.length===0&&fragments.push({type:`reset`}),fragments}function parseCsiCode(string,index){let escapeCodePoint=string.codePointAt(index),sequenceStartIndex;if(escapeCodePoint===27){if(string[index+1]!==`[`)return;sequenceStartIndex=index+2}else if(escapeCodePoint===155)sequenceStartIndex=index+1;else return;let hasCanonicalSgrParameters=!0;for(let sequenceIndex=sequenceStartIndex;sequenceIndex<string.length;sequenceIndex++){let codePoint=string.codePointAt(sequenceIndex);if(isCsiFinalCharacter$1(codePoint)){let code=string.slice(index,sequenceIndex+1);return string[sequenceIndex]!==`m`||!hasCanonicalSgrParameters?createControlParseResult(code,sequenceIndex+1):{token:{type:`sgr`,code,fragments:getSgrFragments(code)},endIndex:sequenceIndex+1}}if(isCsiParameterCharacter$1(codePoint)){isSgrParameterCharacter(codePoint)||(hasCanonicalSgrParameters=!1);continue}if(isCsiIntermediateCharacter$1(codePoint)){hasCanonicalSgrParameters=!1;continue}let endIndex=sequenceIndex;return createControlParseResult(string.slice(index,endIndex),endIndex)}return createControlParseResult(string.slice(index),string.length)}function parseHyperlinkCode(string,index){let hyperlinkPrefix,hyperlinkClose,codePoint=string.codePointAt(index);if(codePoint===27&&string.startsWith(ANSI_HYPERLINK_ESC_PREFIX,index))hyperlinkPrefix=ANSI_HYPERLINK_ESC_PREFIX,hyperlinkClose=ANSI_HYPERLINK_ESC_CLOSE;else if(codePoint===157&&string.startsWith(ANSI_HYPERLINK_C1_PREFIX,index))hyperlinkPrefix=ANSI_HYPERLINK_C1_PREFIX,hyperlinkClose=ANSI_HYPERLINK_C1_CLOSE;else return;let uriStart=string.indexOf(`;`,index+hyperlinkPrefix.length);if(uriStart===-1)return createControlParseResult(string.slice(index),string.length);for(let sequenceIndex=uriStart+1;sequenceIndex<string.length;sequenceIndex++){let character=string[sequenceIndex];if(character===`\x07`)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+1),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:`\x07`},endIndex:sequenceIndex+1};if(character===`\x1B`&&string[sequenceIndex+1]===`\\`)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+2),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:`\x1B\\`},endIndex:sequenceIndex+2};if(character===``)return{token:{type:`hyperlink`,code:string.slice(index,sequenceIndex+1),action:sequenceIndex===uriStart+1?`close`:`open`,closePrefix:hyperlinkClose,terminator:``},endIndex:sequenceIndex+1}}return createControlParseResult(string.slice(index),string.length)}function parseControlStringCode(string,index){let codePoint=string.codePointAt(index),sequenceStartIndex,supportsBellTerminator=!1;switch(codePoint){case 27:switch(string[index+1]){case`]`:sequenceStartIndex=index+2,supportsBellTerminator=!0;break;case`P`:case`X`:case`^`:case`_`:sequenceStartIndex=index+2;break;case`\\`:return createControlParseResult(`\x1B\\`,index+2);default:return}break;case 157:sequenceStartIndex=index+1,supportsBellTerminator=!0;break;case 144:case 152:case 158:case 159:sequenceStartIndex=index+1;break;case 156:return createControlParseResult(``,index+1);default:return}for(let sequenceIndex=sequenceStartIndex;sequenceIndex<string.length;sequenceIndex++){if(supportsBellTerminator&&string[sequenceIndex]===`\x07`)return createControlParseResult(string.slice(index,sequenceIndex+1),sequenceIndex+1);if(string[sequenceIndex]===`\x1B`&&string[sequenceIndex+1]===`\\`)return createControlParseResult(string.slice(index,sequenceIndex+2),sequenceIndex+2);if(string[sequenceIndex]===``)return createControlParseResult(string.slice(index,sequenceIndex+1),sequenceIndex+1)}return createControlParseResult(string.slice(index),string.length)}function parseAnsiCode(string,index){let codePoint=string.codePointAt(index);if(codePoint===27||codePoint===157){let hyperlinkCode=parseHyperlinkCode(string,index);if(hyperlinkCode)return hyperlinkCode}return parseControlStringCode(string,index)||parseCsiCode(string,index)}function appendTrailingAnsiTokens(string,index,tokens){for(;index<string.length;){let nextCodePoint=string.codePointAt(index);if(!ESCAPES$1.has(nextCodePoint))break;let escapeCode=parseAnsiCode(string,index);if(!escapeCode)break;tokens.push(escapeCode.token),index=escapeCode.endIndex}return index}function parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments){let segment=graphemeSegments.containing(index);if(!(!segment||segment.index!==index))return{token:{type:`character`,value:segment.segment,visibleWidth:getGraphemeWidth(segment.segment),isGraphemeContinuation:!1},endIndex:index+segment.segment.length}}function collectVisibleCharacters(string){let visibleCharacters=[],index=0;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){index=code.endIndex;continue}}let value=String.fromCodePoint(codePoint);visibleCharacters.push({value,visibleWidth:1,isGraphemeContinuation:!1}),index+=value.length}return visibleCharacters}function applyGraphemeMetadata(visibleCharacters){if(visibleCharacters.length===0)return;let visibleString=visibleCharacters.map(({value})=>value).join(``),scalarOffsets=[],scalarOffset=0;for(let visibleCharacter of visibleCharacters)scalarOffsets.push(scalarOffset),scalarOffset+=visibleCharacter.value.length;let scalarIndex=0;for(let segment of GRAPHEME_SEGMENTER.segment(visibleString)){for(;scalarIndex<visibleCharacters.length&&scalarOffsets[scalarIndex]<segment.index;)scalarIndex++;let graphemeIndex=scalarIndex,isFirstInGrapheme=!0;for(;graphemeIndex<visibleCharacters.length&&scalarOffsets[graphemeIndex]<segment.index+segment.segment.length;)visibleCharacters[graphemeIndex].visibleWidth=isFirstInGrapheme?getGraphemeWidth(segment.segment):0,visibleCharacters[graphemeIndex].isGraphemeContinuation=!isFirstInGrapheme,isFirstInGrapheme=!1,graphemeIndex++;scalarIndex=graphemeIndex}}function tokenizeAnsiWithVisibleSegmentation(string,{endCharacter=1/0}={}){let tokens=[],visibleCharacters=collectVisibleCharacters(string);applyGraphemeMetadata(visibleCharacters);let index=0,visibleCharacterIndex=0,visibleCount=0;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){tokens.push(code.token),index=code.endIndex;continue}}let value=String.fromCodePoint(codePoint),visibleCharacter=visibleCharacters[visibleCharacterIndex],visibleWidth=isFullwidthCodePoint(codePoint)?2:value.length;visibleCharacter&&(visibleWidth=visibleCharacter.visibleWidth);let token={type:`character`,value,visibleWidth,isGraphemeContinuation:visibleCharacter?visibleCharacter.isGraphemeContinuation:!1};if(tokens.push(token),index+=value.length,visibleCharacterIndex++,visibleCount+=token.visibleWidth,visibleCount>=endCharacter){let nextVisibleCharacter=visibleCharacters[visibleCharacterIndex];if(!nextVisibleCharacter||!nextVisibleCharacter.isGraphemeContinuation){index=appendTrailingAnsiTokens(string,index,tokens);break}}}return tokens}function areValuesInSameGrapheme(leftValue,rightValue){let pair=`${leftValue}${rightValue}`,splitIndex=leftValue.length;for(let segment of GRAPHEME_SEGMENTER.segment(pair)){if(segment.index===splitIndex)return!1;if(segment.index>splitIndex)return!0}return!0}function hasAnsiSplitContinuationAhead(string,startIndex,previousVisibleValue,graphemeSegments){if(!previousVisibleValue)return!1;let index=startIndex,hasAnsiCode=!1;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){hasAnsiCode=!0,index=code.endIndex;continue}}if(!hasAnsiCode)return!1;let characterToken=parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments);return characterToken?areValuesInSameGrapheme(previousVisibleValue,characterToken.token.value):!0}return!1}function tokenizeAnsi$1(string,{endCharacter=1/0}={}){let tokens=[],graphemeSegments=GRAPHEME_SEGMENTER.segment(string),index=0,visibleCount=0,previousVisibleValue,hasAnsiSinceLastVisible=!1;for(;index<string.length;){let codePoint=string.codePointAt(index);if(ESCAPES$1.has(codePoint)){let code=parseAnsiCode(string,index);if(code){tokens.push(code.token),index=code.endIndex,hasAnsiSinceLastVisible=!0;continue}}let characterToken=parseCharacterTokenWithRawSegmentation(string,index,graphemeSegments);if(!characterToken||hasAnsiSinceLastVisible&&previousVisibleValue&&areValuesInSameGrapheme(previousVisibleValue,characterToken.token.value))return tokenizeAnsiWithVisibleSegmentation(string,{endCharacter});if(tokens.push(characterToken.token),index=characterToken.endIndex,visibleCount+=characterToken.token.visibleWidth,hasAnsiSinceLastVisible=!1,previousVisibleValue=characterToken.token.value,visibleCount>=endCharacter){if(hasAnsiSplitContinuationAhead(string,index,previousVisibleValue,graphemeSegments))return tokenizeAnsiWithVisibleSegmentation(string,{endCharacter});index=appendTrailingAnsiTokens(string,index,tokens);break}}return tokens}function applySgrFragments(activeStyles,fragments){for(let fragment of fragments)switch(fragment.type){case`reset`:activeStyles.clear();break;case`end`:activeStyles.delete(fragment.endCode);break;case`start`:activeStyles.delete(fragment.endCode),activeStyles.set(fragment.endCode,fragment.code);break;default:break}return activeStyles}function undoAnsiCodes$1(activeStyles){return[...activeStyles.keys()].toReversed().join(``)}function closeHyperlink(hyperlinkToken){return`${hyperlinkToken.closePrefix}${hyperlinkToken.terminator}`}function shouldIncludeSgrAfterEnd(token,activeStyles){let hasStartFragment=!1,hasClosingEffect=!1;for(let fragment of token.fragments){if(fragment.type===`start`){hasStartFragment=!0;continue}if(fragment.type===`reset`&&activeStyles.size>0){hasClosingEffect=!0;continue}fragment.type===`end`&&activeStyles.has(fragment.endCode)&&(hasClosingEffect=!0)}return hasClosingEffect&&!hasStartFragment}function hasSgrStartFragment(token){return token.fragments.some(fragment=>fragment.type===`start`)}function discardPendingHyperlink(parameters){if(parameters.activeHyperlink&&!parameters.activeHyperlinkHasVisibleText&¶meters.activeHyperlinkOutputIndex!==void 0){let openCodeLength=parameters.activeHyperlink.code.length;parameters.returnValue=parameters.returnValue.slice(0,parameters.activeHyperlinkOutputIndex)+parameters.returnValue.slice(parameters.activeHyperlinkOutputIndex+openCodeLength),parameters.pendingSgrOutputIndex!==void 0&¶meters.pendingSgrOutputIndex>parameters.activeHyperlinkOutputIndex&&(parameters.pendingSgrOutputIndex-=openCodeLength)}parameters.activeHyperlink=void 0,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0}function applySgrToken(parameters){return parameters.isPastEnd&&!shouldIncludeSgrAfterEnd(parameters.token,parameters.activeStyles)?parameters:(parameters.include&&hasSgrStartFragment(parameters.token)&¶meters.pendingSgrOutputIndex===void 0&&(parameters.pendingSgrOutputIndex=parameters.returnValue.length,parameters.pendingSgrActiveStyles=new Map(parameters.activeStyles)),parameters.activeStyles=applySgrFragments(parameters.activeStyles,parameters.token.fragments),parameters.include&&(parameters.returnValue+=parameters.token.code),parameters)}function applyHyperlinkToken(parameters){if(parameters.isPastEnd&&(parameters.token.action!==`close`||!parameters.activeHyperlink))return parameters;if(parameters.token.action===`open`)parameters.activeHyperlink=parameters.token,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0,parameters.include&&(parameters.activeHyperlinkOutputIndex=parameters.returnValue.length);else if(parameters.token.action===`close`){if(parameters.include&¶meters.activeHyperlink&&!parameters.activeHyperlinkHasVisibleText)return discardPendingHyperlink(parameters),parameters;parameters.activeHyperlink=void 0,parameters.activeHyperlinkHasVisibleText=!1,parameters.activeHyperlinkOutputIndex=void 0}return parameters.include&&(parameters.returnValue+=parameters.token.code),parameters}function applyControlToken(parameters){return!parameters.isPastEnd&¶meters.include&&(parameters.returnValue+=parameters.token.code),parameters}function applyCharacterToken(parameters){return!parameters.include&¶meters.position>=parameters.start&&!parameters.token.isGraphemeContinuation&&(parameters.include=!0,parameters.returnValue=[...parameters.activeStyles.values()].join(``),parameters.activeHyperlink&&(parameters.activeHyperlinkOutputIndex=parameters.returnValue.length,parameters.returnValue+=parameters.activeHyperlink.code)),parameters.include&&(parameters.returnValue+=parameters.token.value,parameters.pendingSgrOutputIndex=void 0,parameters.pendingSgrActiveStyles=void 0,parameters.activeHyperlink&&(parameters.activeHyperlinkHasVisibleText=!0)),parameters.position+=parameters.token.visibleWidth,parameters}const tokenHandlers={sgr:applySgrToken,hyperlink:applyHyperlinkToken,control:applyControlToken,character:applyCharacterToken};function applyToken(parameters){let tokenHandler=tokenHandlers[parameters.token.type];return tokenHandler?tokenHandler(parameters):parameters}function createHasContinuationAheadMap(tokens){let hasContinuationAhead=Array.from({length:tokens.length},()=>!1),nextCharacterIsContinuation=!1;for(let tokenIndex=tokens.length-1;tokenIndex>=0;tokenIndex--){let token=tokens[tokenIndex];hasContinuationAhead[tokenIndex]=nextCharacterIsContinuation,token.type===`character`&&(nextCharacterIsContinuation=!!token.isGraphemeContinuation)}return hasContinuationAhead}function isPastEndBoundary(token,position,end){return end===void 0?!1:position>=end?!0:token.type===`character`&&!token.isGraphemeContinuation&&position+token.visibleWidth>end}function sliceAnsi(string,start,end){let tokens=tokenizeAnsi$1(string,{endCharacter:end}),hasContinuationAhead=createHasContinuationAheadMap(tokens),activeStyles=new Map,activeHyperlink,activeHyperlinkHasVisibleText=!1,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position=0,returnValue=``,include=!1;for(let[tokenIndex,token]of tokens.entries()){let isPastEnd=isPastEndBoundary(token,position,end);if(isPastEnd&&token.type!==`character`&&hasContinuationAhead[tokenIndex]&&(isPastEnd=!1),isPastEnd&&token.type===`character`&&!token.isGraphemeContinuation){if(activeHyperlink&&!activeHyperlinkHasVisibleText){let hyperlinkState={activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,returnValue};discardPendingHyperlink(hyperlinkState),{activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,returnValue}=hyperlinkState}pendingSgrOutputIndex!==void 0&&(returnValue=returnValue.slice(0,pendingSgrOutputIndex),activeStyles=pendingSgrActiveStyles,pendingSgrOutputIndex=void 0,pendingSgrActiveStyles=void 0);break}({activeStyles,activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position,returnValue,include}=applyToken({token,isPastEnd,start,activeStyles,activeHyperlink,activeHyperlinkHasVisibleText,activeHyperlinkOutputIndex,pendingSgrOutputIndex,pendingSgrActiveStyles,position,returnValue,include}))}return include?(activeHyperlink&&(returnValue+=closeHyperlink(activeHyperlink)),returnValue+=undoAnsiCodes$1(activeStyles),returnValue):``}function getIndexOfNearestSpace(string,wantedIndex,shouldSearchRight){if(string.charAt(wantedIndex)===` `)return wantedIndex;let direction=shouldSearchRight?1:-1;for(let index=0;index<=3;index++){let finalIndex=wantedIndex+index*direction;if(string.charAt(finalIndex)===` `)return finalIndex}return wantedIndex}function cliTruncate(text,columns,options={}){let{position=`end`,space=!1,preferTruncationOnSpace=!1}=options,{truncationCharacter=`…`}=options;if(typeof text!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof text}`);if(typeof columns!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);if(columns<1)return``;let length=stringWidth(text);if(length<=columns)return text;if(columns===1)return truncationCharacter;let ANSI={ESC:27,LEFT_BRACKET:91,LETTER_M:109},isSgrParameter=code=>code>=48&&code<=57||code===59;function leadingSgrSpanEndIndex(string){let index=0;for(;index+2<string.length&&string.codePointAt(index)===ANSI.ESC&&string.codePointAt(index+1)===ANSI.LEFT_BRACKET;){let j=index+2;for(;j<string.length&&isSgrParameter(string.codePointAt(j));)j++;if(j<string.length&&string.codePointAt(j)===ANSI.LETTER_M){index=j+1;continue}break}return index}function trailingSgrSpanStartIndex(string){let start=string.length;for(;start>1&&string.codePointAt(start-1)===ANSI.LETTER_M;){let j=start-2;for(;j>=0&&isSgrParameter(string.codePointAt(j));)j--;if(j>=1&&string.codePointAt(j-1)===ANSI.ESC&&string.codePointAt(j)===ANSI.LEFT_BRACKET){start=j-1;continue}break}return start}function appendWithInheritedStyleFromEnd(visible,suffix){let start=trailingSgrSpanStartIndex(visible);return start===visible.length?visible+suffix:visible.slice(0,start)+suffix+visible.slice(start)}function prependWithInheritedStyleFromStart(prefix,visible){let end=leadingSgrSpanEndIndex(visible);return end===0?prefix+visible:visible.slice(0,end)+prefix+visible.slice(end)}if(position===`start`){if(preferTruncationOnSpace){let right=sliceAnsi(text,getIndexOfNearestSpace(text,length-columns+1,!0),length).trim();return prependWithInheritedStyleFromStart(truncationCharacter,right)}space&&(truncationCharacter+=` `);let right=sliceAnsi(text,length-columns+stringWidth(truncationCharacter),length);return prependWithInheritedStyleFromStart(truncationCharacter,right)}if(position===`middle`){space&&(truncationCharacter=` ${truncationCharacter} `);let half=Math.floor(columns/2);if(preferTruncationOnSpace){let spaceNearFirstBreakPoint=getIndexOfNearestSpace(text,half),spaceNearSecondBreakPoint=getIndexOfNearestSpace(text,length-(columns-half)+1,!0);return sliceAnsi(text,0,spaceNearFirstBreakPoint)+truncationCharacter+sliceAnsi(text,spaceNearSecondBreakPoint,length).trim()}return sliceAnsi(text,0,half)+truncationCharacter+sliceAnsi(text,length-(columns-half)+stringWidth(truncationCharacter),length)}if(position===`end`)return preferTruncationOnSpace?appendWithInheritedStyleFromEnd(sliceAnsi(text,0,getIndexOfNearestSpace(text,columns-1)),truncationCharacter):(space&&(truncationCharacter=` ${truncationCharacter}`),appendWithInheritedStyleFromEnd(sliceAnsi(text,0,columns-stringWidth(truncationCharacter)),truncationCharacter));throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`)}const cache={},wrapText=(text,maxWidth,wrapType)=>{let cacheKey=text+String(maxWidth)+String(wrapType),cachedText=cache[cacheKey];if(cachedText)return cachedText;let wrappedText=text;if(wrapType===`wrap`&&(wrappedText=wrapAnsi(text,maxWidth,{trim:!1,hard:!0})),wrapType===`hard`&&(wrappedText=wrapAnsi(text,maxWidth,{trim:!1,hard:!0,wordWrap:!1})),wrapType.startsWith(`truncate`)){let position=`end`;wrapType===`truncate-middle`&&(position=`middle`),wrapType===`truncate-start`&&(position=`start`),wrappedText=cliTruncate(text,maxWidth,{position})}return cache[cacheKey]=wrappedText,wrappedText},isCsiParameterCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=48&&codePoint<=63},isCsiIntermediateCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=32&&codePoint<=47},isCsiFinalCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=64&&codePoint<=126},isEscapeIntermediateCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=32&&codePoint<=47},isEscapeFinalCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=48&&codePoint<=126},isC1ControlCharacter=character=>{let codePoint=character.codePointAt(0);return codePoint!==void 0&&codePoint>=128&&codePoint<=159},readCsiSequence=(text,fromIndex)=>{let index=fromIndex;for(;index<text.length;){let character=text[index];if(!isCsiParameterCharacter(character))break;index++}let parameterString=text.slice(fromIndex,index),intermediateStartIndex=index;for(;index<text.length;){let character=text[index];if(!isCsiIntermediateCharacter(character))break;index++}let intermediateString=text.slice(intermediateStartIndex,index),finalCharacter=text[index];if(!(finalCharacter===void 0||!isCsiFinalCharacter(finalCharacter)))return{endIndex:index+1,parameterString,intermediateString,finalCharacter}},findControlStringTerminatorIndex=(text,fromIndex,allowBellTerminator)=>{for(let index=fromIndex;index<text.length;index++){let character=text[index];if(allowBellTerminator&&character===`\x07`||character===``)return index+1;if(character===`\x1B`){let followingCharacter=text[index+1];if(followingCharacter===`\x1B`){index++;continue}if(followingCharacter===`\\`)return index+2}}},readEscapeSequence=(text,fromIndex)=>{let index=fromIndex;for(;index<text.length;){let character=text[index];if(!isEscapeIntermediateCharacter(character))break;index++}let intermediateString=text.slice(fromIndex,index),finalCharacter=text[index];if(!(finalCharacter===void 0||!isEscapeFinalCharacter(finalCharacter)))return{endIndex:index+1,intermediateString,finalCharacter}},getControlStringFromEscapeIntroducer=character=>{switch(character){case`]`:return{type:`osc`,allowBellTerminator:!0};case`P`:return{type:`dcs`,allowBellTerminator:!1};case`^`:return{type:`pm`,allowBellTerminator:!1};case`_`:return{type:`apc`,allowBellTerminator:!1};case`X`:return{type:`sos`,allowBellTerminator:!1};default:return}},getControlStringFromC1Introducer=character=>{switch(character){case``:return{type:`osc`,allowBellTerminator:!0};case``:return{type:`dcs`,allowBellTerminator:!1};case``:return{type:`pm`,allowBellTerminator:!1};case``:return{type:`apc`,allowBellTerminator:!1};case``:return{type:`sos`,allowBellTerminator:!1};default:return}},hasAnsiControlCharacters=text=>{if(text.includes(`\x1B`))return!0;for(let character of text)if(isC1ControlCharacter(character))return!0;return!1},malformedFromIndex=(tokens,text,textStartIndex,fromIndex)=>(fromIndex>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,fromIndex)}),tokens.push({type:`invalid`,value:text.slice(fromIndex)}),tokens),tokenizeAnsi=text=>{if(!hasAnsiControlCharacters(text))return[{type:`text`,value:text}];let tokens=[],textStartIndex=0;for(let index=0;index<text.length;){let character=text[index];if(character===void 0)break;if(character===`\x1B`){let followingCharacter=text[index+1];if(followingCharacter===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);if(followingCharacter===`[`){let csiSequence=readCsiSequence(text,index+2);if(csiSequence===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`csi`,value:text.slice(index,csiSequence.endIndex),parameterString:csiSequence.parameterString,intermediateString:csiSequence.intermediateString,finalCharacter:csiSequence.finalCharacter}),index=csiSequence.endIndex,textStartIndex=index;continue}let escapeControlString=getControlStringFromEscapeIntroducer(followingCharacter);if(escapeControlString!==void 0){let controlStringTerminatorIndex=findControlStringTerminatorIndex(text,index+2,escapeControlString.allowBellTerminator);if(controlStringTerminatorIndex===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:escapeControlString.type,value:text.slice(index,controlStringTerminatorIndex)}),index=controlStringTerminatorIndex,textStartIndex=index;continue}let escapeSequence=readEscapeSequence(text,index+1);if(escapeSequence===void 0){if(isEscapeIntermediateCharacter(followingCharacter))return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),index++,textStartIndex=index;continue}index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`esc`,value:text.slice(index,escapeSequence.endIndex),intermediateString:escapeSequence.intermediateString,finalCharacter:escapeSequence.finalCharacter}),index=escapeSequence.endIndex,textStartIndex=index;continue}if(character===``){let csiSequence=readCsiSequence(text,index+1);if(csiSequence===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`csi`,value:text.slice(index,csiSequence.endIndex),parameterString:csiSequence.parameterString,intermediateString:csiSequence.intermediateString,finalCharacter:csiSequence.finalCharacter}),index=csiSequence.endIndex,textStartIndex=index;continue}let c1ControlString=getControlStringFromC1Introducer(character);if(c1ControlString!==void 0){let controlStringTerminatorIndex=findControlStringTerminatorIndex(text,index+1,c1ControlString.allowBellTerminator);if(controlStringTerminatorIndex===void 0)return malformedFromIndex(tokens,text,textStartIndex,index);index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:c1ControlString.type,value:text.slice(index,controlStringTerminatorIndex)}),index=controlStringTerminatorIndex,textStartIndex=index;continue}if(character===``){index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`st`,value:character}),index++,textStartIndex=index;continue}if(isC1ControlCharacter(character)){index>textStartIndex&&tokens.push({type:`text`,value:text.slice(textStartIndex,index)}),tokens.push({type:`c1`,value:character}),index++,textStartIndex=index;continue}index++}return textStartIndex<text.length&&tokens.push({type:`text`,value:text.slice(textStartIndex)}),tokens},sgrParametersRegex=/^[\d:;]*$/,sanitizeAnsi=text=>{if(!hasAnsiControlCharacters(text))return text;let output=``;for(let token of tokenizeAnsi(text)){if(token.type===`text`||token.type===`osc`){output+=token.value;continue}token.type===`csi`&&token.finalCharacter===`m`&&token.intermediateString===``&&sgrParametersRegex.test(token.parameterString)&&(output+=token.value)}return output},squashTextNodes=node=>{let text=``;for(let index=0;index<node.childNodes.length;index++){let childNode=node.childNodes[index];if(childNode===void 0)continue;let nodeText=``;childNode.nodeName===`#text`?nodeText=childNode.nodeValue:((childNode.nodeName===`ink-text`||childNode.nodeName===`ink-virtual-text`)&&(nodeText=squashTextNodes(childNode)),nodeText.length>0&&typeof childNode.internal_transform==`function`&&(nodeText=childNode.internal_transform(nodeText,index))),text+=nodeText}return sanitizeAnsi(text)},createNode=nodeName=>{let node={nodeName,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:nodeName===`ink-virtual-text`?void 0:Yoga.Node.create(),internal_accessibility:{}};return nodeName===`ink-text`&&node.yogaNode?.setMeasureFunc(measureTextNode.bind(null,node)),node},appendChildNode=(node,childNode)=>{childNode.parentNode&&removeChildNode(childNode.parentNode,childNode),childNode.parentNode=node,node.childNodes.push(childNode),childNode.yogaNode&&node.yogaNode?.insertChild(childNode.yogaNode,node.yogaNode.getChildCount()),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},insertBeforeNode=(node,newChildNode,beforeChildNode)=>{newChildNode.parentNode&&removeChildNode(newChildNode.parentNode,newChildNode),newChildNode.parentNode=node;let index=node.childNodes.indexOf(beforeChildNode);index>=0?(node.childNodes.splice(index,0,newChildNode),newChildNode.yogaNode&&node.yogaNode?.insertChild(newChildNode.yogaNode,index)):(node.childNodes.push(newChildNode),newChildNode.yogaNode&&node.yogaNode?.insertChild(newChildNode.yogaNode,node.yogaNode.getChildCount())),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},removeChildNode=(node,removeNode)=>{removeNode.yogaNode&&removeNode.parentNode?.yogaNode?.removeChild(removeNode.yogaNode),removeNode.parentNode=void 0;let index=node.childNodes.indexOf(removeNode);index>=0&&node.childNodes.splice(index,1),(node.nodeName===`ink-text`||node.nodeName===`ink-virtual-text`)&&markNodeAsDirty(node)},setAttribute=(node,key,value)=>{if(key===`internal_accessibility`){node.internal_accessibility=value;return}node.attributes[key]=value},setStyle=(node,style)=>{node.style=style??{}},createTextNode=text=>{let node={nodeName:`#text`,nodeValue:text,yogaNode:void 0,parentNode:void 0,style:{}};return setTextNodeValue(node,text),node},measureTextNode=function(node,width){let text=node.nodeName===`#text`?node.nodeValue:squashTextNodes(node),dimensions=measureText(text);return dimensions.width<=width||dimensions.width>=1&&width>0&&width<1?dimensions:measureText(wrapText(text,width,node.style?.textWrap??`wrap`))},findClosestYogaNode=node=>{if(node?.parentNode)return node.yogaNode??findClosestYogaNode(node.parentNode)},markNodeAsDirty=node=>{findClosestYogaNode(node)?.markDirty()},setTextNodeValue=(node,text)=>{typeof text!=`string`&&(text=String(text)),node.nodeValue=text,markNodeAsDirty(node)},emitLayoutListeners=rootNode=>{if(!(rootNode.nodeName!==`ink-root`||!rootNode.internal_layoutListeners))for(let listener of rootNode.internal_layoutListeners)listener()},positionEdges=[[`top`,Yoga.EDGE_TOP],[`right`,Yoga.EDGE_RIGHT],[`bottom`,Yoga.EDGE_BOTTOM],[`left`,Yoga.EDGE_LEFT]],applyPositionStyles=(node,style)=>{if(`position`in style){let positionType=Yoga.POSITION_TYPE_RELATIVE;style.position===`absolute`?positionType=Yoga.POSITION_TYPE_ABSOLUTE:style.position===`static`&&(positionType=Yoga.POSITION_TYPE_STATIC),node.setPositionType(positionType)}for(let[property,edge]of positionEdges){if(!(property in style))continue;let value=style[property];if(typeof value==`string`){node.setPositionPercent(edge,Number.parseFloat(value));continue}node.setPosition(edge,value)}},applyMarginStyles=(node,style)=>{`margin`in style&&node.setMargin(Yoga.EDGE_ALL,style.margin??0),`marginX`in style&&node.setMargin(Yoga.EDGE_HORIZONTAL,style.marginX??0),`marginY`in style&&node.setMargin(Yoga.EDGE_VERTICAL,style.marginY??0),`marginLeft`in style&&node.setMargin(Yoga.EDGE_START,style.marginLeft??0),`marginRight`in style&&node.setMargin(Yoga.EDGE_END,style.marginRight??0),`marginTop`in style&&node.setMargin(Yoga.EDGE_TOP,style.marginTop??0),`marginBottom`in style&&node.setMargin(Yoga.EDGE_BOTTOM,style.marginBottom??0)},applyPaddingStyles=(node,style)=>{`padding`in style&&node.setPadding(Yoga.EDGE_ALL,style.padding??0),`paddingX`in style&&node.setPadding(Yoga.EDGE_HORIZONTAL,style.paddingX??0),`paddingY`in style&&node.setPadding(Yoga.EDGE_VERTICAL,style.paddingY??0),`paddingLeft`in style&&node.setPadding(Yoga.EDGE_LEFT,style.paddingLeft??0),`paddingRight`in style&&node.setPadding(Yoga.EDGE_RIGHT,style.paddingRight??0),`paddingTop`in style&&node.setPadding(Yoga.EDGE_TOP,style.paddingTop??0),`paddingBottom`in style&&node.setPadding(Yoga.EDGE_BOTTOM,style.paddingBottom??0)},applyFlexStyles=(node,style)=>{`flexGrow`in style&&node.setFlexGrow(style.flexGrow??0),`flexShrink`in style&&node.setFlexShrink(typeof style.flexShrink==`number`?style.flexShrink:1),`flexWrap`in style&&(style.flexWrap===`nowrap`&&node.setFlexWrap(Yoga.WRAP_NO_WRAP),style.flexWrap===`wrap`&&node.setFlexWrap(Yoga.WRAP_WRAP),style.flexWrap===`wrap-reverse`&&node.setFlexWrap(Yoga.WRAP_WRAP_REVERSE)),`flexDirection`in style&&(style.flexDirection===`row`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW),style.flexDirection===`row-reverse`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE),style.flexDirection===`column`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN),style.flexDirection===`column-reverse`&&node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE)),`flexBasis`in style&&(typeof style.flexBasis==`number`?node.setFlexBasis(style.flexBasis):typeof style.flexBasis==`string`?node.setFlexBasisPercent(Number.parseInt(style.flexBasis,10)):node.setFlexBasisAuto()),`alignItems`in style&&((style.alignItems===`stretch`||!style.alignItems)&&node.setAlignItems(Yoga.ALIGN_STRETCH),style.alignItems===`flex-start`&&node.setAlignItems(Yoga.ALIGN_FLEX_START),style.alignItems===`center`&&node.setAlignItems(Yoga.ALIGN_CENTER),style.alignItems===`flex-end`&&node.setAlignItems(Yoga.ALIGN_FLEX_END),style.alignItems===`baseline`&&node.setAlignItems(Yoga.ALIGN_BASELINE)),`alignSelf`in style&&((style.alignSelf===`auto`||!style.alignSelf)&&node.setAlignSelf(Yoga.ALIGN_AUTO),style.alignSelf===`flex-start`&&node.setAlignSelf(Yoga.ALIGN_FLEX_START),style.alignSelf===`center`&&node.setAlignSelf(Yoga.ALIGN_CENTER),style.alignSelf===`flex-end`&&node.setAlignSelf(Yoga.ALIGN_FLEX_END),style.alignSelf===`stretch`&&node.setAlignSelf(Yoga.ALIGN_STRETCH),style.alignSelf===`baseline`&&node.setAlignSelf(Yoga.ALIGN_BASELINE)),`alignContent`in style&&((style.alignContent===`flex-start`||!style.alignContent)&&node.setAlignContent(Yoga.ALIGN_FLEX_START),style.alignContent===`center`&&node.setAlignContent(Yoga.ALIGN_CENTER),style.alignContent===`flex-end`&&node.setAlignContent(Yoga.ALIGN_FLEX_END),style.alignContent===`space-between`&&node.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN),style.alignContent===`space-around`&&node.setAlignContent(Yoga.ALIGN_SPACE_AROUND),style.alignContent===`space-evenly`&&node.setAlignContent(Yoga.ALIGN_SPACE_EVENLY),style.alignContent===`stretch`&&node.setAlignContent(Yoga.ALIGN_STRETCH)),`justifyContent`in style&&((style.justifyContent===`flex-start`||!style.justifyContent)&&node.setJustifyContent(Yoga.JUSTIFY_FLEX_START),style.justifyContent===`center`&&node.setJustifyContent(Yoga.JUSTIFY_CENTER),style.justifyContent===`flex-end`&&node.setJustifyContent(Yoga.JUSTIFY_FLEX_END),style.justifyContent===`space-between`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN),style.justifyContent===`space-around`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND),style.justifyContent===`space-evenly`&&node.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY))},applyDimensionStyles=(node,style)=>{`width`in style&&(typeof style.width==`number`?node.setWidth(style.width):typeof style.width==`string`?node.setWidthPercent(Number.parseInt(style.width,10)):node.setWidthAuto()),`height`in style&&(typeof style.height==`number`?node.setHeight(style.height):typeof style.height==`string`?node.setHeightPercent(Number.parseInt(style.height,10)):node.setHeightAuto()),`minWidth`in style&&(typeof style.minWidth==`string`?node.setMinWidthPercent(Number.parseInt(style.minWidth,10)):node.setMinWidth(style.minWidth??0)),`minHeight`in style&&(typeof style.minHeight==`string`?node.setMinHeightPercent(Number.parseInt(style.minHeight,10)):node.setMinHeight(style.minHeight??0)),`maxWidth`in style&&(typeof style.maxWidth==`string`?node.setMaxWidthPercent(Number.parseInt(style.maxWidth,10)):node.setMaxWidth(style.maxWidth)),`maxHeight`in style&&(typeof style.maxHeight==`string`?node.setMaxHeightPercent(Number.parseInt(style.maxHeight,10)):node.setMaxHeight(style.maxHeight)),`aspectRatio`in style&&node.setAspectRatio(style.aspectRatio)},applyDisplayStyles=(node,style)=>{`display`in style&&node.setDisplay(style.display===`flex`?Yoga.DISPLAY_FLEX:Yoga.DISPLAY_NONE)},applyBorderStyles=(node,style,currentStyle)=>{if(!(`borderStyle`in style||`borderTop`in style||`borderBottom`in style||`borderLeft`in style||`borderRight`in style))return;let borderWidth=currentStyle.borderStyle?1:0;node.setBorder(Yoga.EDGE_TOP,currentStyle.borderTop===!1?0:borderWidth),node.setBorder(Yoga.EDGE_BOTTOM,currentStyle.borderBottom===!1?0:borderWidth),node.setBorder(Yoga.EDGE_LEFT,currentStyle.borderLeft===!1?0:borderWidth),node.setBorder(Yoga.EDGE_RIGHT,currentStyle.borderRight===!1?0:borderWidth)},applyGapStyles=(node,style)=>{`gap`in style&&node.setGap(Yoga.GUTTER_ALL,style.gap??0),`columnGap`in style&&node.setGap(Yoga.GUTTER_COLUMN,style.columnGap??0),`rowGap`in style&&node.setGap(Yoga.GUTTER_ROW,style.rowGap??0)},styles=(node,style={},currentStyle=style)=>{applyPositionStyles(node,style),applyMarginStyles(node,style),applyPaddingStyles(node,style),applyFlexStyles(node,style),applyDimensionStyles(node,style),applyDisplayStyles(node,style),applyBorderStyles(node,style,currentStyle),applyGapStyles(node,style)};if(process$1.env.DEV===`true`){let isDevtoolsInstalled=!1;try{import.meta.resolve(`react-devtools-core`),isDevtoolsInstalled=!0}catch{}isDevtoolsInstalled&&await import(`./devtools-Cg4F-l9O.js`)}const diff=(before,after)=>{if(before===after)return;if(!before)return after;let changed={},isChanged=!1;for(let key of Object.keys(before))(!after||!Object.hasOwn(after,key))&&(changed[key]=void 0,isChanged=!0);if(after)for(let key of Object.keys(after))after[key]!==before[key]&&(changed[key]=after[key],isChanged=!0);return isChanged?changed:void 0},cleanupYogaNode=node=>{node?.unsetMeasureFunc(),node?.freeRecursive()};let currentUpdatePriority=import_constants.NoEventPriority,currentRootNode;async function loadPackageJson(){let content=(await import(`node:fs`)).readFileSync(new URL(`../package.json`,import.meta.url),`utf8`),parsedContent=JSON.parse(content);return{name:parsedContent?.name,version:parsedContent?.version}}let packageInfo={name:`ink`,version:import_react.version};if(process$1.env.DEV===`true`)try{let loaded=await loadPackageJson();packageInfo={name:loaded.name||packageInfo.name,version:loaded.version||packageInfo.version}}catch(error){console.warn(`Failed to load package.json in development mode. Falling back to default renderer metadata.`,error)}var reconciler_default=(0,import_react_reconciler.default)({getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,resetAfterCommit(rootNode){if(typeof rootNode.onComputeLayout==`function`&&rootNode.onComputeLayout(),emitLayoutListeners(rootNode),rootNode.staticNode!==rootNode.previousStaticNode&&(rootNode.previousStaticNode=rootNode.staticNode,typeof rootNode.onStaticChange==`function`&&rootNode.onStaticChange()),rootNode.isStaticDirty){rootNode.isStaticDirty=!1,typeof rootNode.onImmediateRender==`function`&&rootNode.onImmediateRender();return}typeof rootNode.onRender==`function`&&rootNode.onRender()},getChildHostContext(parentHostContext,type){let previousIsInsideText=parentHostContext.isInsideText,isInsideText=type===`ink-text`||type===`ink-virtual-text`;return previousIsInsideText===isInsideText?parentHostContext:{isInsideText}},shouldSetTextContent:()=>!1,createInstance(originalType,newProps,rootNode,hostContext){if(hostContext.isInsideText&&originalType===`ink-box`)throw Error(`<Box> can’t be nested inside <Text> component`);let node=createNode(originalType===`ink-text`&&hostContext.isInsideText?`ink-virtual-text`:originalType);for(let[key,value]of Object.entries(newProps))if(key!==`children`){if(key===`style`){setStyle(node,value),node.yogaNode&&styles(node.yogaNode,value);continue}if(key===`internal_transform`){node.internal_transform=value;continue}if(key===`internal_static`){currentRootNode=rootNode,node.internal_static=!0,rootNode.isStaticDirty=!0,rootNode.staticNode=node;continue}setAttribute(node,key,value)}return node},createTextInstance(text,_root,hostContext){if(!hostContext.isInsideText)throw Error(`Text string "${text}" must be rendered inside <Text> component`);return createTextNode(text)},resetTextContent(){},hideTextInstance(node){setTextNodeValue(node,``)},unhideTextInstance(node,text){setTextNodeValue(node,text)},getPublicInstance:instance=>instance,hideInstance(node){node.yogaNode?.setDisplay(Yoga.DISPLAY_NONE)},unhideInstance(node){node.yogaNode?.setDisplay(Yoga.DISPLAY_FLEX)},appendInitialChild:appendChildNode,appendChild:appendChildNode,insertBefore:insertBeforeNode,finalizeInitialChildren(){return!1},isPrimaryRenderer:!0,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,supportsMicrotasks:!0,scheduleMicrotask:queueMicrotask,scheduleCallback:import_scheduler.unstable_scheduleCallback,cancelCallback:import_scheduler.unstable_cancelCallback,shouldYield:import_scheduler.unstable_shouldYield,now:import_scheduler.unstable_now,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},getInstanceFromNode:()=>null,prepareScopeUpdate(){},getInstanceFromScope:()=>null,appendChildToContainer:appendChildNode,insertInContainerBefore:insertBeforeNode,removeChildFromContainer(node,removeNode){removeChildNode(node,removeNode),cleanupYogaNode(removeNode.yogaNode),removeNode.internal_static&¤tRootNode?.staticNode===removeNode&&(currentRootNode.staticNode=void 0)},commitUpdate(node,_type,oldProps,newProps){currentRootNode&&node.internal_static&&(currentRootNode.isStaticDirty=!0);let props=diff(oldProps,newProps),style=diff(oldProps.style,newProps.style);if(!(!props&&!style)){if(props)for(let[key,value]of Object.entries(props)){if(key===`style`){setStyle(node,value);continue}if(key===`internal_transform`){node.internal_transform=value;continue}if(key===`internal_static`){node.internal_static=!0;continue}setAttribute(node,key,value)}style&&node.yogaNode&&styles(node.yogaNode,style,newProps.style??{})}},commitTextUpdate(node,_oldText,newText){setTextNodeValue(node,newText)},removeChild(node,removeNode){removeChildNode(node,removeNode),cleanupYogaNode(removeNode.yogaNode),removeNode.internal_static&¤tRootNode?.staticNode===removeNode&&(currentRootNode.staticNode=void 0)},setCurrentUpdatePriority(newPriority){currentUpdatePriority=newPriority},getCurrentUpdatePriority:()=>currentUpdatePriority,resolveUpdatePriority(){return currentUpdatePriority===import_constants.NoEventPriority?import_constants.DefaultEventPriority:currentUpdatePriority},maySuspendCommit(){return!0},NotPendingTransition:void 0,HostTransitionContext:(0,import_react.createContext)(null),resetFormInstance(){},requestPostPaintCallback(){},shouldAttemptEagerTransition(){return!1},trackSchedulerEvent(){},resolveEventType(){return null},resolveEventTimeStamp(){return-1.1},preloadInstance(){return!0},startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady(){return null},rendererPackageName:packageInfo.name,rendererVersion:packageInfo.version});function indentString(string,count=1,options={}){let{indent=` `,includeEmptyLines=!1}=options;if(typeof string!=`string`)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof string}\``);if(typeof count!=`number`)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``);if(count<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${count}\``);if(typeof indent!=`string`)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\``);if(count===0)return string;let regex=includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return string.replace(regex,indent.repeat(count))}const getMaxWidth=yogaNode=>yogaNode.getComputedWidth()-yogaNode.getComputedPadding(Yoga.EDGE_LEFT)-yogaNode.getComputedPadding(Yoga.EDGE_RIGHT)-yogaNode.getComputedBorder(Yoga.EDGE_LEFT)-yogaNode.getComputedBorder(Yoga.EDGE_RIGHT);var cli_boxes_default={single:{topLeft:`┌`,top:`─`,topRight:`┐`,right:`│`,bottomRight:`┘`,bottom:`─`,bottomLeft:`└`,left:`│`},double:{topLeft:`╔`,top:`═`,topRight:`╗`,right:`║`,bottomRight:`╝`,bottom:`═`,bottomLeft:`╚`,left:`║`},round:{topLeft:`╭`,top:`─`,topRight:`╮`,right:`│`,bottomRight:`╯`,bottom:`─`,bottomLeft:`╰`,left:`│`},bold:{topLeft:`┏`,top:`━`,topRight:`┓`,right:`┃`,bottomRight:`┛`,bottom:`━`,bottomLeft:`┗`,left:`┃`},singleDouble:{topLeft:`╓`,top:`─`,topRight:`╖`,right:`║`,bottomRight:`╜`,bottom:`─`,bottomLeft:`╙`,left:`║`},doubleSingle:{topLeft:`╒`,top:`═`,topRight:`╕`,right:`│`,bottomRight:`╛`,bottom:`═`,bottomLeft:`╘`,left:`│`},classic:{topLeft:`+`,top:`-`,topRight:`+`,right:`|`,bottomRight:`+`,bottom:`-`,bottomLeft:`+`,left:`|`},arrow:{topLeft:`↘`,top:`↓`,topRight:`↙`,right:`←`,bottomRight:`↖`,bottom:`↑`,bottomLeft:`↗`,left:`→`}};const rgbRegex=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,ansiRegex=/^ansi256\(\s?(\d+)\s?\)$/,isNamedColor=color=>color in chalk,colorize=(str,color,type)=>{if(!color)return str;if(isNamedColor(color))return type===`foreground`?chalk[color](str):chalk[`bg${color[0].toUpperCase()+color.slice(1)}`](str);if(color.startsWith(`#`))return type===`foreground`?chalk.hex(color)(str):chalk.bgHex(color)(str);if(color.startsWith(`ansi256`)){let matches=ansiRegex.exec(color);if(!matches)return str;let value=Number(matches[1]);return type===`foreground`?chalk.ansi256(value)(str):chalk.bgAnsi256(value)(str)}if(color.startsWith(`rgb`)){let matches=rgbRegex.exec(color);if(!matches)return str;let firstValue=Number(matches[1]),secondValue=Number(matches[2]),thirdValue=Number(matches[3]);return type===`foreground`?chalk.rgb(firstValue,secondValue,thirdValue)(str):chalk.bgRgb(firstValue,secondValue,thirdValue)(str)}return str},stylePiece=(segment,fg,bg,dim)=>{let styled=colorize(segment,fg,`foreground`);return styled=colorize(styled,bg,`background`),dim&&(styled=chalk.dim(styled)),styled},renderBorder=(x,y,node,output)=>{if(node.style.borderStyle){let width=node.yogaNode.getComputedWidth(),height=node.yogaNode.getComputedHeight(),box=typeof node.style.borderStyle==`string`?cli_boxes_default[node.style.borderStyle]:node.style.borderStyle,topBorderColor=node.style.borderTopColor??node.style.borderColor,bottomBorderColor=node.style.borderBottomColor??node.style.borderColor,leftBorderColor=node.style.borderLeftColor??node.style.borderColor,rightBorderColor=node.style.borderRightColor??node.style.borderColor,topBorderBackgroundColor=node.style.borderTopBackgroundColor??node.style.borderBackgroundColor,bottomBorderBackgroundColor=node.style.borderBottomBackgroundColor??node.style.borderBackgroundColor,leftBorderBackgroundColor=node.style.borderLeftBackgroundColor??node.style.borderBackgroundColor,rightBorderBackgroundColor=node.style.borderRightBackgroundColor??node.style.borderBackgroundColor,dimTopBorderColor=node.style.borderTopDimColor??node.style.borderDimColor,dimBottomBorderColor=node.style.borderBottomDimColor??node.style.borderDimColor,dimLeftBorderColor=node.style.borderLeftDimColor??node.style.borderDimColor,dimRightBorderColor=node.style.borderRightDimColor??node.style.borderDimColor,showTopBorder=node.style.borderTop!==!1,showBottomBorder=node.style.borderBottom!==!1,showLeftBorder=node.style.borderLeft!==!1,showRightBorder=node.style.borderRight!==!1,contentWidth=width-(showLeftBorder?1:0)-(showRightBorder?1:0),topBorder=showTopBorder?(showLeftBorder?box.topLeft:``)+box.top.repeat(contentWidth)+(showRightBorder?box.topRight:``):void 0;topBorder&&=stylePiece(topBorder,topBorderColor,topBorderBackgroundColor,dimTopBorderColor);let verticalBorderHeight=height;showTopBorder&&--verticalBorderHeight,showBottomBorder&&--verticalBorderHeight;let leftBorder=``;showLeftBorder&&(leftBorder=(stylePiece(box.left,leftBorderColor,leftBorderBackgroundColor,dimLeftBorderColor)+`
|
|
53
53
|
`).repeat(verticalBorderHeight));let rightBorder=``;showRightBorder&&(rightBorder=(stylePiece(box.right,rightBorderColor,rightBorderBackgroundColor,dimRightBorderColor)+`
|
|
54
54
|
`).repeat(verticalBorderHeight));let bottomBorder=showBottomBorder?(showLeftBorder?box.bottomLeft:``)+box.bottom.repeat(contentWidth)+(showRightBorder?box.bottomRight:``):void 0;bottomBorder&&=stylePiece(bottomBorder,bottomBorderColor,bottomBorderBackgroundColor,dimBottomBorderColor);let offsetY=showTopBorder?1:0;topBorder&&output.write(x,y,topBorder,{transformers:[]}),leftBorder&&output.write(x,y+offsetY,leftBorder,{transformers:[]}),rightBorder&&output.write(x+width-1,y+offsetY,rightBorder,{transformers:[]}),bottomBorder&&output.write(x,y+height-1,bottomBorder,{transformers:[]})}},renderBackground=(x,y,node,output)=>{if(!node.style.backgroundColor)return;let width=node.yogaNode.getComputedWidth(),height=node.yogaNode.getComputedHeight(),leftBorderWidth=node.style.borderStyle&&node.style.borderLeft!==!1?1:0,rightBorderWidth=node.style.borderStyle&&node.style.borderRight!==!1?1:0,topBorderHeight=node.style.borderStyle&&node.style.borderTop!==!1?1:0,bottomBorderHeight=node.style.borderStyle&&node.style.borderBottom!==!1?1:0,contentWidth=width-leftBorderWidth-rightBorderWidth,contentHeight=height-topBorderHeight-bottomBorderHeight;if(!(contentWidth>0&&contentHeight>0))return;let backgroundLine=colorize(` `.repeat(contentWidth),node.style.backgroundColor,`background`);for(let row=0;row<contentHeight;row++)output.write(x+leftBorderWidth,y+topBorderHeight+row,backgroundLine,{transformers:[]})},applyPaddingToText=(node,text)=>{let yogaNode=node.childNodes[0]?.yogaNode;if(yogaNode){let offsetX=yogaNode.getComputedLeft(),offsetY=yogaNode.getComputedTop();text=`
|
|
55
55
|
`.repeat(offsetY)+indentString(text,offsetX)}return text},renderNodeToScreenReaderOutput=(node,options={})=>{if(options.skipStaticElements&&node.internal_static||node.yogaNode?.getDisplay()===Yoga.DISPLAY_NONE)return``;let output=``;if(node.nodeName===`ink-text`)output=squashTextNodes(node);else if(node.nodeName===`ink-box`||node.nodeName===`ink-root`){let separator=node.style.flexDirection===`row`||node.style.flexDirection===`row-reverse`?` `:`
|