@inkeep/open-knowledge 0.4.0 → 0.4.1
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/THIRD_PARTY_NOTICES.md +10 -5
- package/dist/alias-JE7RI5QX-BCGl9_yw.mjs +1 -0
- package/dist/assets/skills/open-knowledge/SKILL.md +3 -3
- package/dist/awk2-POPGKRAI-CGGIG9fD.mjs +1 -0
- package/dist/{banner-DdbR6AZr.mjs → banner-8cQrR88n.mjs} +2 -2
- package/dist/base64-4YMZCVJ5-DQZX3-n8.mjs +1 -0
- package/dist/basename-AA2KJYZQ-BxQSdX4k.mjs +1 -0
- package/dist/bash-IJWYRKFO-BitzNsGT.mjs +1 -0
- package/dist/build-GAD37AZK.mjs +1 -0
- package/dist/build-fAc55Z_L.mjs +2 -0
- package/dist/cat-RDUMLXKC-DT-A9snL.mjs +1 -0
- package/dist/chmod-SYMGL4JA-DjEw7qQb.mjs +1 -0
- package/dist/{chokidar-CxU7f6JW.mjs → chokidar-DnkSPA-1.mjs} +1 -1
- package/dist/{chunk-24IMIIXA-B6yIPkk2.mjs → chunk-24IMIIXA-_PX4ITYZ.mjs} +2 -2
- package/dist/{chunk-3THT3N7L-DztAF386.mjs → chunk-3THT3N7L-DrzOuTpA.mjs} +1 -1
- package/dist/{chunk-3ZUFRYJ4-qsYuZX7b.mjs → chunk-3ZUFRYJ4-BUqSdAvt.mjs} +1 -1
- package/dist/{chunk-44UOCSGV-CaFxJDHm.mjs → chunk-44UOCSGV-BbZqjKvt.mjs} +1 -1
- package/dist/{chunk-4GTNDTRF-PuLVuVJW.mjs → chunk-4GTNDTRF-C7Bk89yc.mjs} +2 -2
- package/dist/{chunk-4HHKTUW3-CQ53AiA_.mjs → chunk-4HHKTUW3-DaxBqSRO.mjs} +1 -1
- package/dist/{chunk-4Q4SM6WR-BlQvqCag.mjs → chunk-4Q4SM6WR-CQ3yG3KJ.mjs} +2 -2
- package/dist/{chunk-55VFSPNA-DLwfww5b.mjs → chunk-55VFSPNA-o6aQtPTI.mjs} +2 -2
- package/dist/{chunk-5QMZ5MUS-CAp625aG.mjs → chunk-5QMZ5MUS-SLhNX8t9.mjs} +2 -2
- package/dist/{chunk-5QVNJEHU-dbrKfPGl.mjs → chunk-5QVNJEHU-Besgjasu.mjs} +2 -2
- package/dist/{chunk-5V6VZH6T-DMPvCPbn.mjs → chunk-5V6VZH6T-1WdUUj8r.mjs} +2 -2
- package/dist/{chunk-62RKD26F-B9la0pfD.mjs → chunk-62RKD26F-BbNaH0fp.mjs} +2 -2
- package/dist/{chunk-64BAICW3-D92CLSK-.mjs → chunk-64BAICW3-CQTRuYnm.mjs} +2 -2
- package/dist/{chunk-74CEPOFO-BcZUJMO1.mjs → chunk-74CEPOFO-CLQh_oXv.mjs} +1 -1
- package/dist/{chunk-7L36YK2X-D7Z_Qw_C.mjs → chunk-7L36YK2X-VJvKq7OX.mjs} +1 -1
- package/dist/{chunk-7TSDKFEO-DUQhJkDy.mjs → chunk-7TSDKFEO-D7K8a1nI.mjs} +1 -1
- package/dist/{chunk-A4HU7SVR-DKLaJeys.mjs → chunk-A4HU7SVR-SqitiwTc.mjs} +1 -1
- package/dist/{chunk-A4JSPFCI-CEm2r8SB.mjs → chunk-A4JSPFCI-BzZWBgeR.mjs} +2 -2
- package/dist/{chunk-A5O5YHGN-DvJz5Cpw.mjs → chunk-A5O5YHGN-DQP-O5US.mjs} +2 -2
- package/dist/{chunk-A65PWWJC-DV6RO_es.mjs → chunk-A65PWWJC-C9G7KuCV.mjs} +2 -2
- package/dist/{chunk-A7A2DBEE-dTNL-45u.mjs → chunk-A7A2DBEE-CWXz1JTo.mjs} +1 -1
- package/dist/{chunk-A7ICOL4V-BvXPAaHu.mjs → chunk-A7ICOL4V-k5RTBWOL.mjs} +2 -2
- package/dist/{chunk-ALLTKNUZ-Cu6JFoC4.mjs → chunk-ALLTKNUZ-SyOkRvXW.mjs} +2 -2
- package/dist/{chunk-APT7OOP2-DmUrFuRy.mjs → chunk-APT7OOP2-CriAmyUL.mjs} +2 -2
- package/dist/{chunk-BBXLRYSX-K758HlCs.mjs → chunk-BBXLRYSX-dCISWeRn.mjs} +2 -2
- package/dist/{chunk-BRGMQKJV-BXc-9Cgj.mjs → chunk-BRGMQKJV-Dnv0H02a.mjs} +3 -3
- package/dist/{chunk-CR5AFCPT-DxNsgM0M.mjs → chunk-CR5AFCPT-BS9vrR_k.mjs} +2 -2
- package/dist/{chunk-CWQS3NFK-Co4ALolT.mjs → chunk-CWQS3NFK-BQ5SUtd7.mjs} +1 -1
- package/dist/{chunk-D4J545R4-DkHLjHX6.mjs → chunk-D4J545R4-T2J_By_d.mjs} +2 -2
- package/dist/{chunk-D6CWQ5DW-7lvT8dGP.mjs → chunk-D6CWQ5DW-0uvJGnRG.mjs} +2 -2
- package/dist/{chunk-D7MEQ3VN-D8jJZr4A.mjs → chunk-D7MEQ3VN-CSN8BGNX.mjs} +2 -2
- package/dist/{chunk-DCAAORBQ-C3s1D8OY.mjs → chunk-DCAAORBQ-BgX2K5fq.mjs} +2 -2
- package/dist/{chunk-DXB73IDG-DIKSLkPq.mjs → chunk-DXB73IDG-DfmyzFzL.mjs} +1 -1
- package/dist/{chunk-EEXR5ZDP-CETL3_Uw.mjs → chunk-EEXR5ZDP-DUXT2_T-.mjs} +1 -1
- package/dist/{chunk-EIZGF4BS-DOoQW9jQ.mjs → chunk-EIZGF4BS-BMblx_pb.mjs} +2 -2
- package/dist/{chunk-F23WWYKW-BK2tpXPf.mjs → chunk-F23WWYKW-B0xoXfw7.mjs} +2 -2
- package/dist/{chunk-F55TLFGB-Vy5RU2P3.mjs → chunk-F55TLFGB-CekdCv-K.mjs} +2 -2
- package/dist/{chunk-FEIOJCZD-C25Und0M.mjs → chunk-FEIOJCZD-Vm1q1kLH.mjs} +2 -2
- package/dist/{chunk-GCTKCWKD-Di-RB9Qt.mjs → chunk-GCTKCWKD-ByezaQ15.mjs} +1 -1
- package/dist/{chunk-GFQRA5P5-DnjwTqP3.mjs → chunk-GFQRA5P5-CkMj9l7f.mjs} +1 -1
- package/dist/{chunk-GOV5EKKI-CKV9jOGv.mjs → chunk-GOV5EKKI-B4qGAgcI.mjs} +2 -2
- package/dist/{chunk-GXVXFKBA-CUKDClxt.mjs → chunk-GXVXFKBA-CQs4HBko.mjs} +2 -2
- package/dist/{chunk-HDQ56CKY-MTQ75a8z.mjs → chunk-HDQ56CKY-DnAJDKCm.mjs} +2 -2
- package/dist/{chunk-HJQJAYMS-D-8Vc6Zb.mjs → chunk-HJQJAYMS-lEGf1x1q.mjs} +1 -1
- package/dist/{chunk-HJWBQKYG-XrOcsn2f.mjs → chunk-HJWBQKYG-lmVh-ZXn.mjs} +2 -2
- package/dist/{chunk-HWBSOZZR-BZF8XsyZ.mjs → chunk-HWBSOZZR-CdcHflPt.mjs} +2 -2
- package/dist/{chunk-HWKDQ44K-wgmyck2O.mjs → chunk-HWKDQ44K-cV6V5ZgY.mjs} +2 -2
- package/dist/{chunk-I57KEIP3-DipCOPKf.mjs → chunk-I57KEIP3-Cr5Okw7t.mjs} +2 -2
- package/dist/{chunk-IPJHKYVM-C3IodQq7.mjs → chunk-IPJHKYVM-orb6vjJ1.mjs} +1 -1
- package/dist/{chunk-J642UCRS-YiNealfn.mjs → chunk-J642UCRS-DfKEFKiV.mjs} +2 -2
- package/dist/{chunk-JVPRLUMK-VMFWXimu.mjs → chunk-JVPRLUMK-Bf9V_Gv7.mjs} +2 -2
- package/dist/{chunk-KMEYNNUA-pRogdye4.mjs → chunk-KMEYNNUA-Caoc9sHa.mjs} +2 -2
- package/dist/{chunk-LL3S3NLB-ByBS5IDP.mjs → chunk-LL3S3NLB-GadY6GUd.mjs} +2 -2
- package/dist/{chunk-LPQPILI2-FRQB9gt5.mjs → chunk-LPQPILI2-DDrAB1na.mjs} +2 -2
- package/dist/{chunk-LTZRCH7N-46S7WKw8.mjs → chunk-LTZRCH7N-DsWqztAp.mjs} +2 -2
- package/dist/{chunk-LWEGUNWT-DdGmM3wr.mjs → chunk-LWEGUNWT-DQ_TsrhS.mjs} +2 -2
- package/dist/{chunk-MDDMCKUK-CuRdI1Uv.mjs → chunk-MDDMCKUK-Cnfznbkf.mjs} +2 -2
- package/dist/{chunk-MDLLFABN-Wd1iVjXi.mjs → chunk-MDLLFABN-C_2lIHFT.mjs} +2 -2
- package/dist/{chunk-MHTUABJP-BWrqic3t.mjs → chunk-MHTUABJP-7AQ2Pv6q.mjs} +1 -1
- package/dist/{chunk-MIZPJHVH-DWdPvcYR.mjs → chunk-MIZPJHVH-BB7Is338.mjs} +2 -2
- package/dist/{chunk-MLXIYONF-CiCzoeGt.mjs → chunk-MLXIYONF-BI0CC1Dm.mjs} +2 -2
- package/dist/{chunk-MYE6AGBJ-DJo74dVC.mjs → chunk-MYE6AGBJ-DWNp4Fd-.mjs} +2 -2
- package/dist/{chunk-NAERJDUW-CIHrNgJB.mjs → chunk-NAERJDUW-D3VeMMYB.mjs} +2 -2
- package/dist/{chunk-NCNPKYJZ-BVljycUZ.mjs → chunk-NCNPKYJZ-BBZ5fJNa.mjs} +2 -2
- package/dist/{chunk-NUYSJFDK-BTseBdxv.mjs → chunk-NUYSJFDK-5tRwRhY2.mjs} +2 -2
- package/dist/{chunk-NYQYO467-BgXuDHUQ.mjs → chunk-NYQYO467-Blr3IMkQ.mjs} +2 -2
- package/dist/{chunk-OARHFVLG-Cr0x3Si_.mjs → chunk-OARHFVLG-Irp_vfLa.mjs} +2 -2
- package/dist/{chunk-OCLXQMOG-BW6rwyzS.mjs → chunk-OCLXQMOG-DKBkjIbk.mjs} +2 -2
- package/dist/{chunk-OCS6LSEM-D7VAOziZ.mjs → chunk-OCS6LSEM-C2EAQI0w.mjs} +2 -2
- package/dist/{chunk-OJDRYQWQ-ikvLWpfV.mjs → chunk-OJDRYQWQ-D4lSWh0K.mjs} +1 -1
- package/dist/{chunk-OL3S66CO-CQnF8cPH.mjs → chunk-OL3S66CO-BSC-nhbc.mjs} +2 -2
- package/dist/{chunk-PBXLG62G-CgbPJTiw.mjs → chunk-PBXLG62G-9wkRpzkO.mjs} +2 -2
- package/dist/{chunk-PP6PSHAB-CO4MYU__.mjs → chunk-PP6PSHAB-BkN6oaqq.mjs} +1 -1
- package/dist/{chunk-PYSFUGCK-DsRn64Ef.mjs → chunk-PYSFUGCK-C-zBGrN0.mjs} +2 -2
- package/dist/{chunk-QCDB2VPH-BUMOhlW7.mjs → chunk-QCDB2VPH-BUg_3i-W.mjs} +2 -2
- package/dist/{chunk-QJ7O6ZN3-F0_rcDPM.mjs → chunk-QJ7O6ZN3-h8P6Rj5g.mjs} +2 -2
- package/dist/{chunk-R6QSAL5T-CeW6f7-x.mjs → chunk-R6QSAL5T-CBXSpChE.mjs} +1 -1
- package/dist/{chunk-R6VWJ2ZL-FwG_Za20.mjs → chunk-R6VWJ2ZL-DSqbA7Rj.mjs} +1 -1
- package/dist/{chunk-RPNGRAAP-BmkapBPD.mjs → chunk-RPNGRAAP-BVzuWIcl.mjs} +2 -2
- package/dist/{chunk-SDNKECQQ-DkebEzkd.mjs → chunk-SDNKECQQ-CQaGD8tt.mjs} +2 -2
- package/dist/{chunk-SYMJJMQ4-DOZMaECk.mjs → chunk-SYMJJMQ4-C3GxJv_z.mjs} +2 -2
- package/dist/{chunk-T56QNPHK-DPXaSSfC.mjs → chunk-T56QNPHK-DLf9xkTG.mjs} +2 -2
- package/dist/{chunk-TLSUDHID-BovZg0r1.mjs → chunk-TLSUDHID-BHtR3boD.mjs} +2 -2
- package/dist/{chunk-TOMNU26N-AAglMy4J.mjs → chunk-TOMNU26N-DerX6zSM.mjs} +2 -2
- package/dist/{chunk-TXBZCHCQ-WeVWfqYv.mjs → chunk-TXBZCHCQ-CAbfX7on.mjs} +2 -2
- package/dist/{chunk-UNYNJIFU-CqGlXAg7.mjs → chunk-UNYNJIFU-Bd2svF5l.mjs} +3 -3
- package/dist/{chunk-V7TAPXDL-DQgGPvBY.mjs → chunk-V7TAPXDL-BUbPC-Wn.mjs} +2 -2
- package/dist/{chunk-VJFXDYWH-DIo0Ia0_.mjs → chunk-VJFXDYWH-B5EkAwKK.mjs} +2 -2
- package/dist/{chunk-VLGZJRPG-DymOu90-.mjs → chunk-VLGZJRPG-C9UlHcZa.mjs} +2 -2
- package/dist/{chunk-VOBGTVA6-Bfa1NTzt.mjs → chunk-VOBGTVA6-BbJdoZlr.mjs} +2 -2
- package/dist/{chunk-VYOJP4TV-PBsHe2md.mjs → chunk-VYOJP4TV-B4Ua-c0F.mjs} +2 -2
- package/dist/{chunk-WKFATFPP-KO2zkfs2.mjs → chunk-WKFATFPP-DWw-N9hi.mjs} +2 -2
- package/dist/{chunk-X2AJGDEF-D5w6wtaX.mjs → chunk-X2AJGDEF-BosVr67X.mjs} +1 -1
- package/dist/{chunk-XHM67O4N-akBjDPaR.mjs → chunk-XHM67O4N-Cd7Fiqsb.mjs} +1 -1
- package/dist/{chunk-XKQRETAK-RHzVmuiF.mjs → chunk-XKQRETAK-ud_FNcYV.mjs} +2 -2
- package/dist/{chunk-XORM457F-wr_DBBnV.mjs → chunk-XORM457F-B_0Xbzib.mjs} +2 -2
- package/dist/{chunk-XVDPCNWR-DxaG1FfA.mjs → chunk-XVDPCNWR-DNk_0jVb.mjs} +2 -2
- package/dist/{chunk-YCFVLTST-Dzwevuc3.mjs → chunk-YCFVLTST-0XsXjpJU.mjs} +2 -2
- package/dist/{chunk-YFG2CMIF-BoZQym0L.mjs → chunk-YFG2CMIF-BwW9XX2A.mjs} +2 -2
- package/dist/{chunk-YNYSPYQ5-DesxOVHh.mjs → chunk-YNYSPYQ5-Dq-BWW-f.mjs} +1 -1
- package/dist/{chunk-YS3AZT3J-CBc9LHIy.mjs → chunk-YS3AZT3J-CLwj1P0Z.mjs} +2 -2
- package/dist/{chunk-YTNYSM6T-WMIf3AF8.mjs → chunk-YTNYSM6T-TIb8x1lA.mjs} +2 -2
- package/dist/{chunk-Z6LRHWXI-DGTVoTuf.mjs → chunk-Z6LRHWXI-VE8VWpH9.mjs} +2 -2
- package/dist/{chunk-Z7JVV2SM-Cb4YKOCM.mjs → chunk-Z7JVV2SM-BAsPuUWb.mjs} +2 -2
- package/dist/clear-5CZ5X4YR-ph4db-bT.mjs +1 -0
- package/dist/cli.mjs +42 -38
- package/dist/colors-BCE2jNgl.mjs +1 -0
- package/dist/{colors-BNufdynn.mjs → colors-BtKMHmBX.mjs} +1 -1
- package/dist/column-WLPMMSTS-BCX6Q17n.mjs +1 -0
- package/dist/comm-5SLSESQG-C7AhH0K0.mjs +1 -0
- package/dist/config-schema.json +0 -23
- package/dist/config.project.schema.json +0 -13
- package/dist/config.user.schema.json +0 -10
- package/dist/constants-D6K9fctf.mjs +2 -0
- package/dist/cp-XOYR4ABJ-CQdiaiBl.mjs +1 -0
- package/dist/{curl-47BFPSFW-C2kRcGkX.mjs → curl-47BFPSFW-BzVtpc-O.mjs} +2 -2
- package/dist/cut-OPC3VAGB-oTKBumd9.mjs +1 -0
- package/dist/date-DD7FVA2V-BrmKZaC_.mjs +1 -0
- package/dist/diff-HJF2MPDN-BNIGqrz6.mjs +1 -0
- package/dist/dirname-LEMTZZFS-BwH_Sy4c.mjs +1 -0
- package/dist/{dist-DfIz2LcA.mjs → dist-CGdW0JZ5.mjs} +69 -68
- package/dist/{dist-D4M20vXU.mjs → dist-CM-e7rrB.mjs} +1065 -91
- package/dist/dist-iEhrVwoD.mjs +1 -0
- package/dist/du-WO2ENHXQ-CaFJHtt9.mjs +1 -0
- package/dist/echo-O45JWWI2-BVUJjhWK.mjs +1 -0
- package/dist/env-5EPCWSXR-DH5CCl6V.mjs +1 -0
- package/dist/{execAsync-CulVJBMN.mjs → execAsync-Bpfn4nfY.mjs} +1 -1
- package/dist/{execAsync-CzW9fUYQ.mjs → execAsync-D93HRpVy.mjs} +1 -1
- package/dist/{execAsync-DuQoqWaW.mjs → execAsync-DMx5TUjh.mjs} +1 -1
- package/dist/expand-DTNXU4LQ-eK5V8PVi.mjs +1 -0
- package/dist/expansion-ENLSRCXJ-DJReNXZq.mjs +1 -0
- package/dist/expr-5T3UU5KE-DTdq14FE.mjs +1 -0
- package/dist/file-ZIGAJ4YS-WHJtEeVR.mjs +1 -0
- package/dist/find-TPUOAIUQ-Dk362bwv.mjs +1 -0
- package/dist/flag-coverage-QT4N2Z44-C5s46vwi.mjs +2 -0
- package/dist/fold-LDSORVYE-CkRa6rpW.mjs +1 -0
- package/dist/{getMachineId-bsd-DAmB-Ym0.mjs → getMachineId-bsd-B3nMvpKd.mjs} +2 -2
- package/dist/{getMachineId-bsd-FYDP9w5Q.mjs → getMachineId-bsd-CbGsKq4x.mjs} +2 -2
- package/dist/{getMachineId-bsd-mPrX3ckm.mjs → getMachineId-bsd-Cbosky3N.mjs} +2 -2
- package/dist/{getMachineId-darwin-B0Qw-MTj.mjs → getMachineId-darwin-BNex6tJ8.mjs} +2 -2
- package/dist/{getMachineId-darwin-C79HtyON.mjs → getMachineId-darwin-BnJVzhVS.mjs} +2 -2
- package/dist/{getMachineId-darwin-Co8Jnu5v.mjs → getMachineId-darwin-UUooObuL.mjs} +2 -2
- package/dist/{getMachineId-linux-BizmCjYq.mjs → getMachineId-linux-BCV7VFT0.mjs} +1 -1
- package/dist/{getMachineId-linux-BvLCCmKQ.mjs → getMachineId-linux-Bo4OhbSY.mjs} +1 -1
- package/dist/{getMachineId-linux-BBORs2cS.mjs → getMachineId-linux-D4ybKI-D.mjs} +1 -1
- package/dist/{getMachineId-unsupported-CbR45h2D.mjs → getMachineId-unsupported-4i2apDO3.mjs} +1 -1
- package/dist/{getMachineId-unsupported-DbGFOAw1.mjs → getMachineId-unsupported-DKWpTC9E.mjs} +1 -1
- package/dist/{getMachineId-unsupported-Bgp-Es9j.mjs → getMachineId-unsupported-DYYMUAWj.mjs} +1 -1
- package/dist/{getMachineId-win-Cy0XHq4X.mjs → getMachineId-win-CHxnm_JZ.mjs} +2 -2
- package/dist/{getMachineId-win-D5gDnBHa.mjs → getMachineId-win-E9RqBHbs.mjs} +2 -2
- package/dist/{getMachineId-win-CT_Y5i_4.mjs → getMachineId-win-W9lSyLKl.mjs} +2 -2
- package/dist/grep-3AIAIJVR-9FFpNxXg.mjs +1 -0
- package/dist/gzip-AQXSGOVS-B69jDA3r.mjs +1 -0
- package/dist/head-HT2B6D2J-LVz3MZgn.mjs +1 -0
- package/dist/help-VVWX7SA5-NiesqNE9.mjs +1 -0
- package/dist/history-J4QRNGRO-CJ6sdqLF.mjs +1 -0
- package/dist/hostname-BK6HG2DE-BTiQGLXj.mjs +1 -0
- package/dist/html-to-markdown-TFCECAGV-gA9lIhli.mjs +1 -0
- package/dist/index.d.mts +75 -4
- package/dist/index.mjs +1 -1
- package/dist/init-3AFVYf9q.mjs +1 -0
- package/dist/init-CdsG66O_.mjs +408 -0
- package/dist/{is-object-DF0ZeuvD.mjs → is-object-C-4FJ0rP.mjs} +1 -1
- package/dist/join-GG2LDHE5-DP2t9Lzd.mjs +1 -0
- package/dist/jq-ODXZBPLY-DIh5TTSi.mjs +1 -0
- package/dist/{js-exec-M6UR76J5-IyD-lpzv.mjs → js-exec-M6UR76J5-2jDKLOtz.mjs} +2 -2
- package/dist/{lib-BOCdCkg7.mjs → lib-CxZz7HCo.mjs} +1 -1
- package/dist/ln-4TRFBYAT-CcfWdebC.mjs +1 -0
- package/dist/loader-Bncr5BJi.mjs +4 -0
- package/dist/loader-DTI1TGWC.mjs +1 -0
- package/dist/ls-KSXFZCWH-Ck3u5K5M.mjs +1 -0
- package/dist/{lzma-vr8hBkhz.mjs → lzma-noRZ7I73.mjs} +1 -1
- package/dist/md5sum-INMIK4DX-B5BLDgGd.mjs +1 -0
- package/dist/mkdir-TDEMSB6C-BHFCS7vA.mjs +1 -0
- package/dist/mv-Z6MORUFL-CmLWSH1J.mjs +1 -0
- package/dist/nl-U5YJDM32-Cn7q_PFe.mjs +1 -0
- package/dist/od-VJEF2UR5-BMxC8c-2.mjs +1 -0
- package/dist/paste-7N6AFSDS-C9XyEur2.mjs +1 -0
- package/dist/preview-BvnHrXsi.mjs +1 -0
- package/dist/{preview-FAMk9J0z.mjs → preview-CpFNaoeP.mjs} +2 -2
- package/dist/printf-CX64KX2P-Hzp-xme8.mjs +1 -0
- package/dist/public/assets/ActivityModeContent-B9qJjoag.js +2 -0
- package/dist/public/assets/ConsentDialogBody-Nm0bF6eX.js +2 -0
- package/dist/public/assets/DocumentContext-DXmaxXXr.js +37 -0
- package/dist/public/assets/GraphPanel-lypmG_hQ.js +46 -0
- package/dist/public/assets/McpConsentDialogBody-0w9-K4mU.js +1 -0
- package/dist/public/assets/SettingsDialog-B0r_NhKC.js +11 -0
- package/dist/public/assets/SourceEditor-CzC_EQwX.js +2 -0
- package/dist/public/assets/{_baseFor-DTImdh6y.js → _baseFor-CVV1DSgL.js} +1 -1
- package/dist/public/assets/{agent-presence-CaGG2gp7.js → agent-presence-BrTlNKmt.js} +1 -1
- package/dist/public/assets/{arc-VNWsD8TF.js → arc-DoxD41WW.js} +1 -1
- package/dist/public/assets/architecture-YZFGNWBL-C7rs88Cj.js +1 -0
- package/dist/public/assets/{architectureDiagram-Q4EWVU46-C7EDVIb_.js → architectureDiagram-Q4EWVU46-Du5oNRD5.js} +1 -1
- package/dist/public/assets/{blockDiagram-DXYQGD6D-RDoQRmSR.js → blockDiagram-DXYQGD6D-CuxUJ8VP.js} +1 -1
- package/dist/public/assets/button-C1nwPVFQ.js +1 -0
- package/dist/public/assets/{c4Diagram-AHTNJAMY-DWq5v6f-.js → c4Diagram-AHTNJAMY-D58kKzW4.js} +1 -1
- package/dist/public/assets/channel-kvPH_LHg.js +1 -0
- package/dist/public/assets/{chunk-2KRD3SAO-BTibUhx6.js → chunk-2KRD3SAO-uai9wz3V.js} +1 -1
- package/dist/public/assets/{chunk-336JU56O-Bm6IwRki.js → chunk-336JU56O-CtkQ28bg.js} +2 -2
- package/dist/public/assets/chunk-426QAEUC-jRhC4EYv.js +1 -0
- package/dist/public/assets/{chunk-4BX2VUAB-Dzrv7xRQ.js → chunk-4BX2VUAB-BTctgoF3.js} +1 -1
- package/dist/public/assets/{chunk-4TB4RGXK-n_VCZ-Dw.js → chunk-4TB4RGXK-Cnl-K_AI.js} +1 -1
- package/dist/public/assets/chunk-55IACEB6-dtXOOCuI.js +1 -0
- package/dist/public/assets/{chunk-5FUZZQ4R-CwFS-NM9.js → chunk-5FUZZQ4R-DF0EG1O8.js} +1 -1
- package/dist/public/assets/{chunk-5PVQY5BW-Cf3pEIAB.js → chunk-5PVQY5BW-BpceE2BZ.js} +1 -1
- package/dist/public/assets/{chunk-67CJDMHE-B1qjR6o5.js → chunk-67CJDMHE-DiSIolj4.js} +1 -1
- package/dist/public/assets/{chunk-7N4EOEYR-9LthribN.js → chunk-7N4EOEYR-Yp7Nf16N.js} +1 -1
- package/dist/public/assets/{chunk-AA7GKIK3-DFgv_Jxv.js → chunk-AA7GKIK3--s2NNuet.js} +1 -1
- package/dist/public/assets/{chunk-BSJP7CBP-BMfaq0VP.js → chunk-BSJP7CBP-BrRqu__W.js} +1 -1
- package/dist/public/assets/{chunk-CIAEETIT-DUfZ-zCl.js → chunk-CIAEETIT-BUzaopy6.js} +1 -1
- package/dist/public/assets/{chunk-EDXVE4YY-BKbUy63F.js → chunk-EDXVE4YY-Bo83e0iq.js} +1 -1
- package/dist/public/assets/{chunk-ENJZ2VHE-DIZOQmDi.js → chunk-ENJZ2VHE-CY9yto8o.js} +1 -1
- package/dist/public/assets/{chunk-FMBD7UC4-DA5iFIgZ.js → chunk-FMBD7UC4-DEzvlUl3.js} +1 -1
- package/dist/public/assets/{chunk-FOC6F5B3-DlEcGgqD.js → chunk-FOC6F5B3-BtjWNx10.js} +1 -1
- package/dist/public/assets/{chunk-ICPOFSXX-BDU_0nPa.js → chunk-ICPOFSXX-BC5Xd13f.js} +2 -2
- package/dist/public/assets/{chunk-K5T4RW27-CZi_8YH2.js → chunk-K5T4RW27-CfU2wPmV.js} +1 -1
- package/dist/public/assets/{chunk-KGLVRYIC-q8yxX2UV.js → chunk-KGLVRYIC-BV1pDifD.js} +1 -1
- package/dist/public/assets/{chunk-LIHQZDEY-BqlaDvTQ.js → chunk-LIHQZDEY-C40dIbib.js} +1 -1
- package/dist/public/assets/{chunk-ORNJ4GCN-B6A2jdfA.js → chunk-ORNJ4GCN-8cFqvOFf.js} +1 -1
- package/dist/public/assets/{chunk-OYMX7WX6-BtgGgZZ0.js → chunk-OYMX7WX6-D0C6jdl8.js} +1 -1
- package/dist/public/assets/chunk-QZHKN3VN-Bz4XrtbS.js +1 -0
- package/dist/public/assets/{chunk-U2HBQHQK-LrOM0aht.js → chunk-U2HBQHQK-DenE4TdD.js} +1 -1
- package/dist/public/assets/{chunk-X2U36JSP-CsEhwsxu.js → chunk-X2U36JSP-DSyuGkzP.js} +1 -1
- package/dist/public/assets/{chunk-XPW4576I-D3W7wPR1.js → chunk-XPW4576I-CLO5Bb_q.js} +1 -1
- package/dist/public/assets/{chunk-YZCP3GAM-C2TR8l-U.js → chunk-YZCP3GAM-D8kUvWu6.js} +1 -1
- package/dist/public/assets/{chunk-ZZ45TVLE-DGa_Hgat.js → chunk-ZZ45TVLE-DHB0SHUz.js} +1 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-MrFnlVPS.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-DFkKo4Ct.js +1 -0
- package/dist/public/assets/clone-jj9sSaF-.js +1 -0
- package/dist/public/assets/config-validation-events-CajjS6y9.js +10 -0
- package/dist/public/assets/consent-store-lB0p7dI5.js +1 -0
- package/dist/public/assets/{cose-bilkent-S5V4N54A-cxoevGhk.js → cose-bilkent-S5V4N54A-6FB6GAoi.js} +1 -1
- package/dist/public/assets/{dagre-DoC3Vx7E.js → dagre-D2_448Gx.js} +1 -1
- package/dist/public/assets/{dagre-KV5264BT-CjRUxU3J.js → dagre-KV5264BT-Bn9RtFC-.js} +1 -1
- package/dist/public/assets/{diagram-5BDNPKRD-DlgILr6_.js → diagram-5BDNPKRD-XCR9sVhK.js} +1 -1
- package/dist/public/assets/{diagram-G4DWMVQ6-CA3PL8En.js → diagram-G4DWMVQ6-Bz0ngc_7.js} +1 -1
- package/dist/public/assets/{diagram-MMDJMWI5-DVx-bZhM.js → diagram-MMDJMWI5-o_IQFxK_.js} +1 -1
- package/dist/public/assets/{diagram-TYMM5635-DCl_Xx4h.js → diagram-TYMM5635-D2QJXyfV.js} +1 -1
- package/dist/public/assets/dialog-BFN-ujuF.js +1 -0
- package/dist/public/assets/{dist-ByDNshqn.js → dist-BYGzJeLM.js} +1 -1
- package/dist/public/assets/dist-Bej94Urx.js +1 -0
- package/dist/public/assets/dist-BrsSsfiw.js +1 -0
- package/dist/public/assets/dist-CXGJFbY5.js +9 -0
- package/dist/public/assets/dist-Cg-Qaqw_.js +1 -0
- package/dist/public/assets/dist-Cq1LYbUj.js +1 -0
- package/dist/public/assets/{dist-BJPjDIRr.js → dist-CyaBbyDQ.js} +1 -1
- package/dist/public/assets/dist-DsbVHLNy.js +1 -0
- package/dist/public/assets/{dist-BEF_m-Pp.js → dist-Du-s1q8P.js} +1 -1
- package/dist/public/assets/dist-OTL8-1C2.js +45 -0
- package/dist/public/assets/doc-hash-Cp6jbuyP.js +422 -0
- package/dist/public/assets/{erDiagram-SMLLAGMA-ChTvmoDx.js → erDiagram-SMLLAGMA-C1Mr5jbs.js} +1 -1
- package/dist/public/assets/{flatten-DXpXo4tl.js → flatten-DFiFicpD.js} +1 -1
- package/dist/public/assets/{flowDiagram-DWJPFMVM-8ceKQudh.js → flowDiagram-DWJPFMVM--ukgnTYS.js} +1 -1
- package/dist/public/assets/{ganttDiagram-T4ZO3ILL-uadeK_KN.js → ganttDiagram-T4ZO3ILL-CVeIdgCM.js} +1 -1
- package/dist/public/assets/gitGraph-7Q5UKJZL-Bmgp5n-M.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-BcANz6_Q.js → gitGraphDiagram-UUTBAWPF-BSivDyLh.js} +1 -1
- package/dist/public/assets/{graphlib-D3l3HBM4.js → graphlib-DvRtwu4N.js} +1 -1
- package/dist/public/assets/index-Cuiz8Dsb.js +1853 -0
- package/dist/public/assets/index-zh5eSlzN.css +1 -0
- package/dist/public/assets/info-OMHHGYJF-DCMX4pS_.js +1 -0
- package/dist/public/assets/{infoDiagram-42DDH7IO-qKcHjiUa.js → infoDiagram-42DDH7IO-DtO1Tc8U.js} +1 -1
- package/dist/public/assets/input-BOmkuBId.js +1 -0
- package/dist/public/assets/{isEmpty-D9j5AQZB.js → isEmpty-gGVpRSDa.js} +1 -1
- package/dist/public/assets/isSymbol-D0ur5y-p.js +1 -0
- package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-DyndBZjz.js → ishikawaDiagram-UXIWVN3A-BY3noyNF.js} +1 -1
- package/dist/public/assets/{journeyDiagram-VCZTEJTY-CTiuXUzg.js → journeyDiagram-VCZTEJTY-DdFdkR8_.js} +1 -1
- package/dist/public/assets/{kanban-definition-6JOO6SKY-D03tqXqX.js → kanban-definition-6JOO6SKY-WoLnXp48.js} +1 -1
- package/dist/public/assets/{label-BOVWulDu.js → label-Dv_9VZWz.js} +1 -1
- package/dist/public/assets/{line-CZuyNGqX.js → line-C59Ezo8Z.js} +1 -1
- package/dist/public/assets/{linear-CoY1VP-w.js → linear-faBQNtcz.js} +1 -1
- package/dist/public/assets/mcp-consent-store-DZ1pCmhN.js +1 -0
- package/dist/public/assets/{mermaid-parser.core-D4O7MeLl.js → mermaid-parser.core-CFsvu03i.js} +2 -2
- package/dist/public/assets/{mermaid.core-4xgx5kDJ.js → mermaid.core-CWYso-V4.js} +3 -3
- package/dist/public/assets/{mindmap-definition-QFDTVHPH-BaMNW13B.js → mindmap-definition-QFDTVHPH-BG3Kwhhs.js} +1 -1
- package/dist/public/assets/{now-CJgVN_7h.js → now-D_m-3Vjm.js} +1 -1
- package/dist/public/assets/{ordinal-BZbu6HlW.js → ordinal-BLFwWMHf.js} +1 -1
- package/dist/public/assets/packet-4T2RLAQJ-DveBhlQF.js +1 -0
- package/dist/public/assets/{panel-BaN47PCr.js → panel-8fydlQgn.js} +1 -1
- package/dist/public/assets/pie-ZZUOXDRM-yiLyabeZ.js +1 -0
- package/dist/public/assets/{pieDiagram-DEJITSTG-_dBzvPAb.js → pieDiagram-DEJITSTG-B1wtn7py.js} +1 -1
- package/dist/public/assets/{propagation-api-CuTE-jIt.js → propagation-api-3kmMXRwS.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-34T5L4WZ-jnOwhGSn.js → quadrantDiagram-34T5L4WZ-yboV7Kxh.js} +1 -1
- package/dist/public/assets/radar-PYXPWWZC-D8GV_2fZ.js +1 -0
- package/dist/public/assets/{reduce-Cn1fAmcq.js → reduce-DmI60TfL.js} +1 -1
- package/dist/public/assets/{requirementDiagram-MS252O5E-DpZY5MOe.js → requirementDiagram-MS252O5E-BpVLqxNT.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-XADWPNL6-CNLrFRka.js → sankeyDiagram-XADWPNL6-CH1ZYL1H.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-FGHM5R23-Cqjio9cN.js → sequenceDiagram-FGHM5R23-CwQvwa3m.js} +1 -1
- package/dist/public/assets/{src-CVigMQ0t.js → src-DOAilbaA.js} +1 -1
- package/dist/public/assets/{stateDiagram-FHFEXIEX-rE9sZdwc.js → stateDiagram-FHFEXIEX-DL3pXt3n.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-6f8E13YF.js +1 -0
- package/dist/public/assets/stex-CzCFWeB9.js +1 -0
- package/dist/public/assets/{target-navigation-intent-CNDuSbLi.js → target-navigation-intent-D0C4LZky.js} +1 -1
- package/dist/public/assets/{telemetry-impl-iq6UBtaA.js → telemetry-impl-H--5W_Jc.js} +2 -2
- package/dist/public/assets/textarea-CaFqgjns.js +1 -0
- package/dist/public/assets/{timeline-definition-GMOUNBTQ-B_X3o8J_.js → timeline-definition-GMOUNBTQ-CDbb3c--.js} +1 -1
- package/dist/public/assets/toggle-group-Dq1Ta0Sb.js +1 -0
- package/dist/public/assets/tooltip-BVo05ikW.js +1 -0
- package/dist/public/assets/treeView-SZITEDCU-A2Cj-I1J.js +1 -0
- package/dist/public/assets/treemap-W4RFUUIX-uOn6xcZK.js +1 -0
- package/dist/public/assets/typing-burst-detector-Bj_bIEkO.js +2 -0
- package/dist/public/assets/{vennDiagram-DHZGUBPP-Cs25K1vw.js → vennDiagram-DHZGUBPP-BaHOUqGA.js} +1 -1
- package/dist/public/assets/wardley-RL74JXVD-DrTPuxUO.js +1 -0
- package/dist/public/assets/{wardleyDiagram-NUSXRM2D-RgfpVD8G.js → wardleyDiagram-NUSXRM2D-5ysokC2z.js} +1 -1
- package/dist/public/assets/{xychartDiagram-5P7HB3ND-BrRrEDJB.js → xychartDiagram-5P7HB3ND-CFQqcNjf.js} +1 -1
- package/dist/public/index.html +43 -26
- package/dist/pwd-D4OZ7N27-CxX1ETVW.mjs +1 -0
- package/dist/{python3-AUFTPCU6-BaJugIdp.mjs → python3-AUFTPCU6-C74hXpFG.mjs} +2 -2
- package/dist/readlink-MI4GCHJF-DeD4E7nz.mjs +1 -0
- package/dist/rev-XOSYPP45-BnymxcnA.mjs +1 -0
- package/dist/rg-FOQSCCX3-BiJSKli9.mjs +1 -0
- package/dist/rm-RTZG23RL-Djvo3nEY.mjs +1 -0
- package/dist/rmdir-XTQXT7RK-OI_3n90A.mjs +1 -0
- package/dist/schemas/v0/config.project.schema.json +0 -13
- package/dist/schemas/v0/config.user.schema.json +0 -10
- package/dist/sed-VFTTATXJ-Tyu5G4I6.mjs +1 -0
- package/dist/seq-RN5ZUASB-CG-hfPIu.mjs +1 -0
- package/dist/sha1sum-VJPNLNU6-CEXqRxvP.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-Bxzw_ykX.mjs +1 -0
- package/dist/sleep-VZFPZFWA-WRTGZhTn.mjs +1 -0
- package/dist/sort-DCNRDA7U-CuSJrCSQ.mjs +1 -0
- package/dist/split-SITCSYCZ-DqKN3r-A.mjs +1 -0
- package/dist/sqlite3-56UMWEY3-C6G8A9IC.mjs +1 -0
- package/dist/src-DMe_jLWZ.mjs +2 -0
- package/dist/start-BTbMaVtC.mjs +1 -0
- package/dist/start-BtHrrb3o.mjs +3 -0
- package/dist/stat-BT5A227F-D3-4IZjb.mjs +1 -0
- package/dist/strings-7PLOGTPD-DoJhZcXP.mjs +1 -0
- package/dist/tac-SJGXQ4T2-CGNEtOiG.mjs +1 -0
- package/dist/tail-S5ULNTJU-17nfIM0G.mjs +1 -0
- package/dist/tar-ANUBEFJY-C-eZUMPO.mjs +1 -0
- package/dist/tee-O7VXZDCO-D4C0E2s8.mjs +1 -0
- package/dist/time-DEUO3QV2-Wc9ZVUVu.mjs +1 -0
- package/dist/timeout-VRKMCG72-2MptSPRD.mjs +1 -0
- package/dist/touch-DX2IJOQ4-DOTz2-NU.mjs +1 -0
- package/dist/tr-2HXZRDSW-5aOBfN_I.mjs +1 -0
- package/dist/tree-LYXBS7DC-BVyeg_3R.mjs +1 -0
- package/dist/true-WHJNXCHG-QiTH9f1Z.mjs +1 -0
- package/dist/unexpand-RGTMIGZM-m3YwxdOg.mjs +1 -0
- package/dist/uniq-SUNANL47-CuhWyTTO.mjs +1 -0
- package/dist/wc-TQB3VNOX-CaEqXvYd.mjs +1 -0
- package/dist/which-XZHEH76L-DA_Bm_KM.mjs +1 -0
- package/dist/whoami-DGKU3D2X-Bdt58SNY.mjs +1 -0
- package/dist/xan-BXDXYEIB-CWBZ1rgf.mjs +1 -0
- package/dist/xan-view-ECQUO7AJ-eo_owVyX.mjs +1 -0
- package/dist/xargs-I6EZUCYF-VBH5v0oN.mjs +1 -0
- package/dist/yq-MJMAR36V-eZBfA9vJ.mjs +1 -0
- package/package.json +1 -1
- package/dist/alias-JE7RI5QX-Bia4gLMF.mjs +0 -1
- package/dist/awk2-POPGKRAI-DDrFV-7v.mjs +0 -1
- package/dist/base64-4YMZCVJ5-DDKKOjMm.mjs +0 -1
- package/dist/basename-AA2KJYZQ-BK5zVs3W.mjs +0 -1
- package/dist/bash-IJWYRKFO-B9r1a0X9.mjs +0 -1
- package/dist/build-B6buVrsB.mjs +0 -2
- package/dist/cat-RDUMLXKC-CeNrSElK.mjs +0 -1
- package/dist/chmod-SYMGL4JA-DFJ4ylQU.mjs +0 -1
- package/dist/clear-5CZ5X4YR-CadVxKrq.mjs +0 -1
- package/dist/colors-T3xmlXQT.mjs +0 -1
- package/dist/column-WLPMMSTS-6o4DDsDk.mjs +0 -1
- package/dist/comm-5SLSESQG-C2GatHU6.mjs +0 -1
- package/dist/constants-BWv15Llm.mjs +0 -2
- package/dist/cp-XOYR4ABJ-DmS6dER-.mjs +0 -1
- package/dist/cut-OPC3VAGB-s4tQWhL5.mjs +0 -1
- package/dist/date-DD7FVA2V-Dubgjr6a.mjs +0 -1
- package/dist/diff-HJF2MPDN-DjGBLQph.mjs +0 -1
- package/dist/dirname-LEMTZZFS-B477CImE.mjs +0 -1
- package/dist/dist-Bu-MwAbD.mjs +0 -1
- package/dist/du-WO2ENHXQ-C4c5wweW.mjs +0 -1
- package/dist/echo-O45JWWI2-TudodhHR.mjs +0 -1
- package/dist/env-5EPCWSXR-CTcNEMpy.mjs +0 -1
- package/dist/expand-DTNXU4LQ-BT6M2Tdc.mjs +0 -1
- package/dist/expansion-ENLSRCXJ-Cy7j--Iy.mjs +0 -1
- package/dist/expr-5T3UU5KE-D2Kr5nuJ.mjs +0 -1
- package/dist/file-ZIGAJ4YS-BH3jYcuM.mjs +0 -1
- package/dist/find-TPUOAIUQ-RFxkUcGN.mjs +0 -1
- package/dist/flag-coverage-QT4N2Z44--nNG-HLV.mjs +0 -2
- package/dist/fold-LDSORVYE-CfKQmrJ1.mjs +0 -1
- package/dist/grep-3AIAIJVR-DgQJLmW0.mjs +0 -1
- package/dist/gzip-AQXSGOVS-yXjpnIVd.mjs +0 -1
- package/dist/head-HT2B6D2J-BR4RHRTk.mjs +0 -1
- package/dist/help-VVWX7SA5-M6C6klSC.mjs +0 -1
- package/dist/history-J4QRNGRO-C1r7-kvT.mjs +0 -1
- package/dist/hostname-BK6HG2DE-BBBcRrtV.mjs +0 -1
- package/dist/html-to-markdown-TFCECAGV-B9oYuMVf.mjs +0 -1
- package/dist/init-B1cOyI0L.mjs +0 -397
- package/dist/init-DssmNpgE.mjs +0 -1
- package/dist/join-GG2LDHE5-xeTE0Mi4.mjs +0 -1
- package/dist/jq-ODXZBPLY-C5v6qNu_.mjs +0 -1
- package/dist/ln-4TRFBYAT-4XMTO1OQ.mjs +0 -1
- package/dist/loader-CHkc9V89.mjs +0 -1
- package/dist/loader-CWaAs1JL.mjs +0 -4
- package/dist/ls-KSXFZCWH-Bw_Cf-VY.mjs +0 -1
- package/dist/md5sum-INMIK4DX-CAIH4ZVI.mjs +0 -1
- package/dist/mkdir-TDEMSB6C-D1oUG8Jf.mjs +0 -1
- package/dist/mrmime-C2W7cgq2.mjs +0 -2
- package/dist/mv-Z6MORUFL-CN471qcL.mjs +0 -1
- package/dist/nl-U5YJDM32-CFzXKze3.mjs +0 -1
- package/dist/od-VJEF2UR5-C2R4Accu.mjs +0 -1
- package/dist/paste-7N6AFSDS-bUl2Dwz3.mjs +0 -1
- package/dist/preview-BjoTulUl.mjs +0 -1
- package/dist/printf-CX64KX2P-Ce--gWAq.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-BS-F_q5b.js +0 -2
- package/dist/public/assets/DocumentContext-CKgn09Wu.js +0 -37
- package/dist/public/assets/GraphPanel-BYxZ6mOr.js +0 -46
- package/dist/public/assets/McpConsentDialogBody-C-eBNOSk.js +0 -1
- package/dist/public/assets/OutlinePanel-B1VwD6nb.js +0 -2
- package/dist/public/assets/SettingsPane-Byz_-VcF.js +0 -11
- package/dist/public/assets/SourceEditor-CF1C1jlS.js +0 -2
- package/dist/public/assets/architecture-YZFGNWBL-BiRl99NU.js +0 -1
- package/dist/public/assets/button-qDXa0MxS.js +0 -1
- package/dist/public/assets/channel-C0UNiHDS.js +0 -1
- package/dist/public/assets/checkbox-kWXLLH40.js +0 -1
- package/dist/public/assets/chunk-426QAEUC-BexV_O4G.js +0 -1
- package/dist/public/assets/chunk-55IACEB6-yo8vOoww.js +0 -1
- package/dist/public/assets/chunk-QZHKN3VN-Dm2czGiD.js +0 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-DqMO_sxB.js +0 -1
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-BbC-74zc.js +0 -1
- package/dist/public/assets/clone-DpRB82L-.js +0 -1
- package/dist/public/assets/config-validation-events-BX5T6Pv4.js +0 -7
- package/dist/public/assets/dialog-CV9Q4JrD.js +0 -45
- package/dist/public/assets/dist-Bf3rdSRu.js +0 -1
- package/dist/public/assets/dist-CSfB7p8y.js +0 -9
- package/dist/public/assets/dist-DVWct0HX.js +0 -1
- package/dist/public/assets/dist-Gvva1zQ6.js +0 -1
- package/dist/public/assets/doc-hash-CfmBVnag.js +0 -421
- package/dist/public/assets/gitGraph-7Q5UKJZL-CN7yaTu1.js +0 -1
- package/dist/public/assets/index-B4T9ZPge.js +0 -1854
- package/dist/public/assets/index-DFiz58v4.css +0 -1
- package/dist/public/assets/info-OMHHGYJF-oSrA8B1G.js +0 -1
- package/dist/public/assets/isSymbol-C4J31wCa.js +0 -1
- package/dist/public/assets/packet-4T2RLAQJ-N-KqWOhj.js +0 -1
- package/dist/public/assets/pie-ZZUOXDRM-BcRf7Q2g.js +0 -1
- package/dist/public/assets/radar-PYXPWWZC-CqcGRFrW.js +0 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-CrJSNsUc.js +0 -1
- package/dist/public/assets/stex-DQW679lh.js +0 -1
- package/dist/public/assets/tooltip-csUfbEtd.js +0 -1
- package/dist/public/assets/treeView-SZITEDCU-B1rO_oUt.js +0 -1
- package/dist/public/assets/treemap-W4RFUUIX-DXE3h2Bn.js +0 -1
- package/dist/public/assets/wardley-RL74JXVD-ChWi2iyS.js +0 -1
- package/dist/pwd-D4OZ7N27-C18XewhV.mjs +0 -1
- package/dist/readlink-MI4GCHJF-CHvs7DDT.mjs +0 -1
- package/dist/rev-XOSYPP45-2mnFFZWW.mjs +0 -1
- package/dist/rg-FOQSCCX3-BJahNfSe.mjs +0 -1
- package/dist/rm-RTZG23RL-D9-0WGRY.mjs +0 -1
- package/dist/rmdir-XTQXT7RK-Br7eH9kL.mjs +0 -1
- package/dist/sed-VFTTATXJ-mYhAmixc.mjs +0 -1
- package/dist/seq-RN5ZUASB-CKf5MNNO.mjs +0 -1
- package/dist/sha1sum-VJPNLNU6-DuOHap1X.mjs +0 -1
- package/dist/sha256sum-PI32XWXY-D9fEipQ7.mjs +0 -1
- package/dist/sleep-VZFPZFWA-B1fSoYuO.mjs +0 -1
- package/dist/sort-DCNRDA7U-DDCY4JZu.mjs +0 -1
- package/dist/split-SITCSYCZ-b9hfEJw7.mjs +0 -1
- package/dist/sqlite3-56UMWEY3-BQEx5i3P.mjs +0 -1
- package/dist/src-B_Vh13Py.mjs +0 -1
- package/dist/start-CSRc43Yr.mjs +0 -3
- package/dist/start-DVUu2YvT.mjs +0 -1
- package/dist/stat-BT5A227F-Dzp4sgau.mjs +0 -1
- package/dist/strings-7PLOGTPD-DT41jX9d.mjs +0 -1
- package/dist/tac-SJGXQ4T2-BpdVoP8b.mjs +0 -1
- package/dist/tail-S5ULNTJU-0-sYrYik.mjs +0 -1
- package/dist/tar-ANUBEFJY-Wh3na_NU.mjs +0 -1
- package/dist/tee-O7VXZDCO-CwnGG0go.mjs +0 -1
- package/dist/time-DEUO3QV2-DzkqaQ1k.mjs +0 -1
- package/dist/timeout-VRKMCG72-BtPBpIRq.mjs +0 -1
- package/dist/touch-DX2IJOQ4-KW0Ui-lB.mjs +0 -1
- package/dist/tr-2HXZRDSW-C6Kf0M8T.mjs +0 -1
- package/dist/tree-LYXBS7DC-BN1FBqvM.mjs +0 -1
- package/dist/true-WHJNXCHG-DxCMVdqj.mjs +0 -1
- package/dist/unexpand-RGTMIGZM-DZ4Kf6Xq.mjs +0 -1
- package/dist/uniq-SUNANL47-Ceg51JdA.mjs +0 -1
- package/dist/wc-TQB3VNOX-BzWNq0MY.mjs +0 -1
- package/dist/which-XZHEH76L-DH_U2-Cj.mjs +0 -1
- package/dist/whoami-DGKU3D2X-BholYNPM.mjs +0 -1
- package/dist/xan-BXDXYEIB-b1eAtgch.mjs +0 -1
- package/dist/xan-view-ECQUO7AJ-DWDC57b_.mjs +0 -1
- package/dist/xargs-I6EZUCYF-Cov-i7kW.mjs +0 -1
- package/dist/yq-MJMAR36V-1r29nH4p.mjs +0 -1
- /package/dist/public/assets/{ActivityPanelDiffView-B_49ivYc.js → ActivityPanelDiffView-DeDaG2lq.js} +0 -0
- /package/dist/public/assets/{__vite-browser-external-6Gb3h3lj.js → __vite-browser-external-sCjVW6Bj.js} +0 -0
- /package/dist/public/assets/{array-DO1uCttT.js → array-COEOjKUv.js} +0 -0
- /package/dist/public/assets/{colors-BjbB2MOj.js → colors-D6LRuSY-.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-AyAnQ5hQ.js → cytoscape.esm-4jw_vW_Q.js} +0 -0
- /package/dist/public/assets/{defaultLocale-B6RGN4id.js → defaultLocale-CoF2cqkH.js} +0 -0
- /package/dist/public/assets/{dist-0bM9CqzR.js → dist-Bog19bCH.js} +0 -0
- /package/dist/public/assets/{go-BRhAdNMM.js → go-wMvjCq97.js} +0 -0
- /package/dist/public/assets/{init-BmUWJJHz.js → init-8GNx5phc.js} +0 -0
- /package/dist/public/assets/{isObjectLike-CjYO71dq.js → isObjectLike-DFnkciUU.js} +0 -0
- /package/dist/public/assets/{katex-DBuiuHex.js → katex-DX-tM4Fr.js} +0 -0
- /package/dist/public/assets/{min-CwjSmrJ6.js → min-BiwsSkbB.js} +0 -0
- /package/dist/public/assets/{path-CoPyR7c2.js → path-C-grg3CZ.js} +0 -0
- /package/dist/public/assets/{pdf-DaFpV-4n.js → pdf-CtJiipL_.js} +0 -0
- /package/dist/public/assets/{pdf.worker-Cq62cyp3.js → pdf.worker-BZq-wJdz.js} +0 -0
- /package/dist/public/assets/{rough.esm-ec8xsRC7.js → rough.esm-DDK-gphn.js} +0 -0
- /package/dist/public/assets/{shell-DT_H80Gx.js → shell-DdhS5_h8.js} +0 -0
- /package/dist/public/assets/{src-CWigLjcs.js → src-L3wpjxBL.js} +0 -0
- /package/dist/public/assets/{trace-api-CbLDdnQA.js → trace-api-CiCjX4Sz.js} +0 -0
|
@@ -0,0 +1,1853 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-H--5W_Jc.js","./chunk-CFjPhJqf.js","./preload-helper-2ej06EnG.js","./trace-api-CiCjX4Sz.js","./propagation-api-3kmMXRwS.js","./ConsentDialogBody-Nm0bF6eX.js","./button-C1nwPVFQ.js","./compiler-runtime-CVnuRdak.js","./dist-OTL8-1C2.js","./dialog-BFN-ujuF.js","./input-BOmkuBId.js","./textarea-CaFqgjns.js","./consent-store-lB0p7dI5.js","./McpConsentDialogBody-0w9-K4mU.js","./mcp-consent-store-DZ1pCmhN.js","./dist-Bej94Urx.js","./dist-Cg-Qaqw_.js","./label-Dv_9VZWz.js","./ActivityPanelDiffView-DeDaG2lq.js","./ActivityPanelDiffView-legcy4jI.css","./GraphPanel-lypmG_hQ.js","./doc-hash-Cp6jbuyP.js","./w3c-keyname-B5t0fahT.js","./toggle-group-Dq1Ta0Sb.js","./tooltip-BVo05ikW.js","./panel-8fydlQgn.js","./min-BiwsSkbB.js","./src-L3wpjxBL.js","./colors-D6LRuSY-.js","./ordinal-BLFwWMHf.js","./init-8GNx5phc.js","./isObjectLike-DFnkciUU.js","./now-D_m-3Vjm.js","./isSymbol-D0ur5y-p.js","./target-navigation-intent-D0C4LZky.js","./ActivityModeContent-B9qJjoag.js","./DocumentContext-DXmaxXXr.js","./dist-BrsSsfiw.js","./dist-Du-s1q8P.js","./dist-DsbVHLNy.js","./dist-BYGzJeLM.js","./dist-Cq1LYbUj.js","./stex-CzCFWeB9.js","./agent-presence-BrTlNKmt.js","./SourceEditor-CzC_EQwX.js","./typing-burst-detector-Bj_bIEkO.js","./SettingsDialog-B0r_NhKC.js","./config-validation-events-CajjS6y9.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e,r as t,t as n}from"./chunk-CFjPhJqf.js";import{t as r}from"./preload-helper-2ej06EnG.js";import{n as i,r as a,t as o}from"./compiler-runtime-CVnuRdak.js";import{$ as s,$t as c,At as l,B as u,C as d,Cn as f,Ct as p,Dt as m,E as h,Et as g,F as _,G as v,Gt as y,H as b,I as x,J as S,Jt as C,Kt as w,L as T,M as E,N as D,Nt as O,Ot as k,P as A,Q as j,Qt as M,R as N,S as P,Sn as F,St as I,T as L,Tn as R,Tt as z,U as B,V,W as H,X as U,Xt as W,Y as G,Yt as K,Z as q,Zt as ee,_ as te,_n as ne,_t as re,a as ie,an as ae,at as oe,bt as se,c as ce,cn as le,ct as ue,d as de,dn as fe,en as pe,et as J,f as me,fn as he,ft as ge,g as _e,gn as ve,gt as ye,h as be,hn as xe,ht as Se,i as Ce,in as we,it as Te,j as Y,jt as Ee,kt as De,l as Oe,ln as ke,lt as Ae,m as je,mn as Me,mt as Ne,n as Pe,nn as Fe,nt as Ie,o as Le,on as Re,ot as ze,p as Be,pn as Ve,pt as He,q as Ue,qt as We,r as Ge,rn as Ke,rt as qe,s as Je,sn as Ye,st as Xe,t as Ze,tn as Qe,tt as $e,u as et,un as tt,vn as nt,vt as rt,w as it,wn as at,wt as ot,x as st,xn as ct,xt as lt,yn as ut,yt as dt,z as ft}from"./DocumentContext-DXmaxXXr.js";import{A as pt,C as mt,D as ht,E as gt,O as _t,S as vt,T as yt,_ as bt,a as xt,b as St,c as Ct,d as wt,f as Tt,g as Et,h as Dt,i as Ot,k as kt,l as At,m as jt,n as Mt,p as Nt,r as Pt,s as Ft,t as It,u as Lt,v as Rt,w as zt,x as Bt,y as Vt}from"./panel-8fydlQgn.js";import{$n as Ht,A as Ut,At as Wt,B as Gt,Br as Kt,Cn as qt,Cr as Jt,Ct as Yt,D as Xt,E as Zt,F as Qt,Ft as $t,Gt as en,H as tn,Hr as nn,I as rn,In as an,Jn as on,K as sn,Kn as cn,M as ln,Mt as un,N as dn,O as fn,P as pn,Qt as mn,Sn as hn,Sr as gn,Un as _n,Ut as vn,V as yn,Vr as bn,Wn as xn,Xt as Sn,Yn as Cn,Yt as wn,Zt as Tn,_ as En,a as Dn,an as On,at as kn,b as An,bn as jn,br as Mn,c as Nn,cn as Pn,dn as Fn,dr as In,dt as Ln,er as Rn,f as zn,g as Bn,gn as Vn,gr as Hn,gt as Un,ht as Wn,i as Gn,in as Kn,j as qn,jn as Jn,k as Yn,l as Xn,ln as Zn,lr as Qn,lt as $n,mn as er,mr as tr,mt as nr,n as rr,nr as ir,o as ar,ot as or,p as sr,pt as cr,qn as lr,qt as ur,r as dr,rn as fr,rr as pr,rt as mr,s as hr,t as gr,tr as _r,un as vr,ur as yr,ut as br,v as xr,vn as Sr,wr as Cr,y as wr,zn as Tr,zr as Er}from"./doc-hash-Cp6jbuyP.js";import{C as Dr,S as Or,_ as kr,b as Ar,c as jr,f as Mr,h as Nr,i as Pr,l as Fr,m as Ir,n as Lr,r as X,s as Rr,t as zr,u as Br,w as Vr,x as Hr}from"./button-C1nwPVFQ.js";import{a as Ur,c as Wr,d as Gr,f as Kr,i as qr,l as Jr,m as Yr,n as Xr,o as Zr,p as Qr,r as $r,s as ei,t as ti,u as ni}from"./agent-presence-BrTlNKmt.js";import{$ as ri,A as ii,B as ai,C as oi,Ct as si,D as ci,Dt as li,E as ui,Et as di,F as fi,G as pi,H as mi,I as hi,J as gi,K as _i,L as vi,M as yi,N as bi,O as xi,Ot as Si,P as Ci,Q as wi,R as Ti,S as Ei,St as Di,T as Oi,Tt as ki,U as Ai,V as ji,W as Mi,X as Ni,Y as Pi,Z as Fi,_ as Ii,_t as Li,a as Ri,at as zi,b as Bi,bt as Vi,c as Hi,ct as Ui,d as Wi,dt as Gi,et as Ki,f as qi,ft as Ji,g as Yi,gt as Xi,h as Zi,ht as Qi,it as $i,j as ea,k as ta,lt as na,m as ra,mt as ia,nt as aa,ot as oa,p as sa,pt as ca,q as la,r as ua,rt as da,st as fa,t as pa,tt as ma,ut as ha,v as ga,vt as _a,w as va,wt as ya,x as ba,xt as xa,y as Sa,yt as Ca,z as wa}from"./config-validation-events-CajjS6y9.js";import{n as Ta,r as Ea,t as Da}from"./target-navigation-intent-D0C4LZky.js";import{t as Oa}from"./dist-Bej94Urx.js";import{a as ka,f as Aa,i as ja,m as Ma,n as Na,o as Pa,p as Fa,s as Ia,t as La}from"./dist-OTL8-1C2.js";import{t as Ra}from"./dist-Cg-Qaqw_.js";import{n as za,r as Ba,t as Va}from"./mcp-consent-store-DZ1pCmhN.js";import{a as Ha,i as Ua,n as Wa,r as Ga,t as Ka}from"./toggle-group-Dq1Ta0Sb.js";import{t as qa}from"./label-Dv_9VZWz.js";import{i as Ja,n as Ya,r as Xa,t as Za}from"./tooltip-BVo05ikW.js";import{a as Qa,c as $a,i as eo,n as to,o as no,s as ro,t as io}from"./dialog-BFN-ujuF.js";import{t as ao}from"./input-BOmkuBId.js";import{n as oo,t as so}from"./consent-store-lB0p7dI5.js";import{$ as co,At as lo,Ct as uo,Dt as fo,Ft as po,I as mo,It as ho,J as go,Mt as _o,Ot as vo,Pt as yo,Q as bo,Tt as xo,X as So,Z as Co,at as wo,bt as To,jt as Eo,k as Do,w as Oo}from"./dist-Du-s1q8P.js";import{n as ko,o as Ao,r as jo,t as Mo}from"./typing-burst-detector-Bj_bIEkO.js";import"./textarea-CaFqgjns.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function No(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1})?.VITE_OTEL_ENABLED===`true`&&r(()=>import(`./telemetry-impl-H--5W_Jc.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}function Po(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Et(e,()=>t.signal,()=>n=!0)},u=Vt(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Rt:bt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Io:Fo,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Fo(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Fo(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Io(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Lo=class extends Tt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ro(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Nt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),Dt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ro(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var zo=class extends pt{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Lo({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Bo(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Bo(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Bo(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Bo(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Dt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>mt(t,e))}findAll(e={}){return this.getAll().filter(t=>mt(e,t))}notify(e){Dt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Dt.batch(()=>Promise.all(e.map(e=>e.continue().catch(yt))))}};function Bo(e){return e.options.scope?.id}var Vo=class extends pt{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??vt(r,t),a=this.get(i);return a||(a=new wt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Dt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>zt(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>zt(e,t)):t}notify(e){Dt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ho=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Vo,this.#t=e.mutationCache||new zo,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=kt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=jt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ht(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=St(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Dt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Dt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Dt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Dt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(yt).catch(yt)}invalidateQueries(e,t={}){return Dt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Dt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(yt)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(yt)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ht(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yt).catch(yt)}fetchInfiniteQuery(e){return e.behavior=Po(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yt).catch(yt)}ensureInfiniteQueryData(e){return e.behavior=Po(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return jt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Bt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{gt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Bt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{gt(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=vt(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===_t&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Uo=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Wo=n(((e,t)=>{t.exports=Uo()})),Go=n((e=>{var t=Wo(),n=i(),r=Vr();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},L=[],R=-1;function z(e){return{current:e}}function B(e){0>R||(e.current=L[R],L[R]=null,R--)}function V(e,t){R++,L[R]=e.current,e.current=t}var H=z(null),U=z(null),W=z(null),G=z(null);function K(e,t){switch(V(W,t),V(U,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function q(){B(H),B(U),B(W)}function ee(e){e.memoizedState!==null&&V(G,e);var t=H.current,n=Hd(t,e.type);t!==n&&(V(U,e),V(H,n))}function te(e){U.current===e&&(B(H),B(U)),G.current===e&&(B(G),Qf._currentValue=I)}var ne,re;function ie(e){if(ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ne=t&&t[1]||``,re=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+ne+e+re}var ae=!1;function oe(e,t){if(!e||ae)return``;ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ae=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ie(n):``}function se(e,t){switch(e.tag){case 26:case 27:case 5:return ie(e.type);case 16:return ie(`Lazy`);case 13:return e.child!==t&&t!==null?ie(`Suspense Fallback`):ie(`Suspense`);case 19:return ie(`SuspenseList`);case 0:case 15:return oe(e.type,!1);case 11:return oe(e.type.render,!1);case 1:return oe(e.type,!0);case 31:return ie(`Activity`);default:return``}}function ce(e){try{var t=``,n=null;do t+=se(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var le=Object.prototype.hasOwnProperty,ue=t.unstable_scheduleCallback,de=t.unstable_cancelCallback,fe=t.unstable_shouldYield,pe=t.unstable_requestPaint,J=t.unstable_now,me=t.unstable_getCurrentPriorityLevel,he=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,_e=t.unstable_NormalPriority,ve=t.unstable_LowPriority,ye=t.unstable_IdlePriority,be=t.log,xe=t.unstable_setDisableYieldValue,Se=null,Ce=null;function we(e){if(typeof be==`function`&&xe(e),Ce&&typeof Ce.setStrictMode==`function`)try{Ce.setStrictMode(Se,e)}catch{}}var Te=Math.clz32?Math.clz32:De,Y=Math.log,Ee=Math.LN2;function De(e){return e>>>=0,e===0?32:31-(Y(e)/Ee|0)|0}var Oe=256,ke=262144,Ae=4194304;function je(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Me(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=je(n))):i=je(o):i=je(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=je(n))):i=je(o)):i=je(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ne(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Pe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fe(){var e=Ae;return Ae<<=1,!(Ae&62914560)&&(Ae=4194304),e}function Ie(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Le(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Re(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Te(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Te(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Be(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Te(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ve(e,t){var n=t&-t;return n=n&42?1:He(n),(n&(e.suspendedLanes|t))===0?n:0}function He(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ue(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function We(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function Ge(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var Ke=Math.random().toString(36).slice(2),qe=`__reactFiber$`+Ke,Je=`__reactProps$`+Ke,Ye=`__reactContainer$`+Ke,Xe=`__reactEvents$`+Ke,Ze=`__reactListeners$`+Ke,Qe=`__reactHandles$`+Ke,$e=`__reactResources$`+Ke,et=`__reactMarker$`+Ke;function tt(e){delete e[qe],delete e[Je],delete e[Xe],delete e[Ze],delete e[Qe]}function nt(e){var t=e[qe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ye]||n[qe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[qe])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function rt(e){if(e=e[qe]||e[Ye]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function it(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function at(e){var t=e[$e];return t||=e[$e]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ot(e){e[et]=!0}var st=new Set,ct={};function lt(e,t){ut(e,t),ut(e+`Capture`,t)}function ut(e,t){for(ct[e]=t,e=0;e<t.length;e++)st.add(t[e])}var dt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),ft={},pt={};function mt(e){return le.call(pt,e)?!0:le.call(ft,e)?!1:dt.test(e)?pt[e]=!0:(ft[e]=!0,!1)}function ht(e,t,n){if(mt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function _t(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function vt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function yt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function bt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xt(e){if(!e._valueTracker){var t=yt(e)?`checked`:`value`;e._valueTracker=bt(e,t,``+e[t])}}function St(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=yt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ct(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var wt=/[\n"\\]/g;function Tt(e){return e.replace(wt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Et(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+vt(t)):e.value!==``+vt(t)&&(e.value=``+vt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ot(e,o,vt(n)):Ot(e,o,vt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+vt(s):e.removeAttribute(`name`)}function Dt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){xt(e);return}n=n==null?``:``+vt(n),t=t==null?n:``+vt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),xt(e)}function Ot(e,t,n){t===`number`&&Ct(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function kt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+vt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function At(e,t,n){if(t!=null&&(t=``+vt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+vt(n)}function jt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(N(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=vt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),xt(e)}function Mt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Pt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Nt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ft(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Pt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Pt(e,o,t[o])}function It(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Lt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Rt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function zt(e){return Rt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Bt(){}var Vt=null;function Ht(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ut=null,Wt=null;function Gt(e){var t=rt(e);if(t&&(e=t.stateNode)){var n=e[Je]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Et(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Tt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Je]||null;if(!i)throw Error(a(90));Et(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&St(r)}break a;case`textarea`:At(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&kt(e,!!n.multiple,t,!1)}}}var Kt=!1;function qt(e,t,n){if(Kt)return e(t,n);Kt=!0;try{return e(t)}finally{if(Kt=!1,(Ut!==null||Wt!==null)&&(_u(),Ut&&(t=Ut,e=Wt,Wt=Ut=null,Gt(t),e)))for(t=0;t<e.length;t++)Gt(e[t])}}function Jt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Je]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var Yt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Xt=!1;if(Yt)try{var Zt={};Object.defineProperty(Zt,`passive`,{get:function(){Xt=!0}}),window.addEventListener(`test`,Zt,Zt),window.removeEventListener(`test`,Zt,Zt)}catch{Xt=!1}var Qt=null,$t=null,en=null;function tn(){if(en)return en;var e,t=$t,n=t.length,r,i=`value`in Qt?Qt.value:Qt.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return en=i.slice(e,1<r?1-r:void 0)}function nn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function rn(){return!0}function an(){return!1}function on(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?rn:an,this.isPropagationStopped=an,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=on(sn),ln=p({},sn,{view:0,detail:0}),un=on(ln),dn,fn,pn,mn=p({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==pn&&(pn&&e.type===`mousemove`?(dn=e.screenX-pn.screenX,fn=e.screenY-pn.screenY):fn=dn=0,pn=e),dn)},movementY:function(e){return`movementY`in e?e.movementY:fn}}),hn=on(mn),gn=on(p({},mn,{dataTransfer:0})),_n=on(p({},ln,{relatedTarget:0})),vn=on(p({},sn,{animationName:0,elapsedTime:0,pseudoElement:0})),yn=on(p({},sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),bn=on(p({},sn,{data:0})),xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Sn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Cn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Cn[e])?!!t[e]:!1}function Tn(){return wn}var En=on(p({},ln,{key:function(e){if(e.key){var t=xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=nn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Sn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tn,charCode:function(e){return e.type===`keypress`?nn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?nn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Dn=on(p({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),On=on(p({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tn})),kn=on(p({},sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),An=on(p({},mn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),jn=on(p({},sn,{newState:0,oldState:0})),Mn=[9,13,27,32],Nn=Yt&&`CompositionEvent`in window,Pn=null;Yt&&`documentMode`in document&&(Pn=document.documentMode);var Fn=Yt&&`TextEvent`in window&&!Pn,In=Yt&&(!Nn||Pn&&8<Pn&&11>=Pn),Ln=` `,Rn=!1;function zn(e,t){switch(e){case`keyup`:return Mn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Bn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Vn=!1;function Hn(e,t){switch(e){case`compositionend`:return Bn(t);case`keypress`:return t.which===32?(Rn=!0,Ln):null;case`textInput`:return e=t.data,e===Ln&&Rn?null:e;default:return null}}function Un(e,t){if(Vn)return e===`compositionend`||!Nn&&zn(e,t)?(e=tn(),en=$t=Qt=null,Vn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return In&&t.locale!==`ko`?null:t.data;default:return null}}var Wn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Wn[e.type]:t===`textarea`}function Kn(e,t,n,r){Ut?Wt?Wt.push(r):Wt=[r]:Ut=r,t=Td(t,`onChange`),0<t.length&&(n=new cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var qn=null,Jn=null;function Yn(e){_d(e,0)}function Xn(e){if(St(it(e)))return e}function Zn(e,t){if(e===`change`)return t}var Qn=!1;if(Yt){var $n;if(Yt){var er=`oninput`in document;if(!er){var tr=document.createElement(`div`);tr.setAttribute(`oninput`,`return;`),er=typeof tr.oninput==`function`}$n=er}else $n=!1;Qn=$n&&(!document.documentMode||9<document.documentMode)}function nr(){qn&&(qn.detachEvent(`onpropertychange`,rr),Jn=qn=null)}function rr(e){if(e.propertyName===`value`&&Xn(Jn)){var t=[];Kn(t,Jn,e,Ht(e)),qt(Yn,t)}}function ir(e,t,n){e===`focusin`?(nr(),qn=t,Jn=n,qn.attachEvent(`onpropertychange`,rr)):e===`focusout`&&nr()}function ar(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Xn(Jn)}function or(e,t){if(e===`click`)return Xn(t)}function sr(e,t){if(e===`input`||e===`change`)return Xn(t)}function cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var lr=typeof Object.is==`function`?Object.is:cr;function ur(e,t){if(lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!le.call(t,i)||!lr(e[i],t[i]))return!1}return!0}function dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fr(e,t){var n=dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=dr(n)}}function pr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ct(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ct(e.document)}return t}function hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var gr=Yt&&`documentMode`in document&&11>=document.documentMode,_r=null,vr=null,yr=null,br=!1;function xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;br||_r==null||_r!==Ct(r)||(r=_r,`selectionStart`in r&&hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),yr&&ur(yr,r)||(yr=r,r=Td(vr,`onSelect`),0<r.length&&(t=new cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=_r)))}function Sr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Cr={animationend:Sr(`Animation`,`AnimationEnd`),animationiteration:Sr(`Animation`,`AnimationIteration`),animationstart:Sr(`Animation`,`AnimationStart`),transitionrun:Sr(`Transition`,`TransitionRun`),transitionstart:Sr(`Transition`,`TransitionStart`),transitioncancel:Sr(`Transition`,`TransitionCancel`),transitionend:Sr(`Transition`,`TransitionEnd`)},wr={},Tr={};Yt&&(Tr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),`TransitionEvent`in window||delete Cr.transitionend.transition);function Er(e){if(wr[e])return wr[e];if(!Cr[e])return e;var t=Cr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Tr)return wr[e]=t[n];return e}var Dr=Er(`animationend`),Or=Er(`animationiteration`),kr=Er(`animationstart`),Ar=Er(`transitionrun`),jr=Er(`transitionstart`),Mr=Er(`transitioncancel`),Nr=Er(`transitionend`),Pr=new Map,Fr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Fr.push(`scrollEnd`);function Ir(e,t){Pr.set(e,t),lt(t,[e])}var Lr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},X=[],Rr=0,zr=0;function Br(){for(var e=Rr,t=zr=Rr=0;t<e;){var n=X[t];X[t++]=null;var r=X[t];X[t++]=null;var i=X[t];X[t++]=null;var a=X[t];if(X[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Gr(n,i,a)}}function Hr(e,t,n,r){X[Rr++]=e,X[Rr++]=t,X[Rr++]=n,X[Rr++]=r,zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ur(e,t,n,r){return Hr(e,t,n,r),Kr(e)}function Wr(e,t){return Hr(e,null,null,t),Kr(e)}function Gr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Te(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Kr(e){if(50<cu)throw cu=0,lu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var qr={};function Jr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(e,t,n,r){return new Jr(e,t,n,r)}function Xr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zr(e,t){var n=e.alternate;return n===null?(n=Yr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Qr(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function $r(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)Xr(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,H.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=Yr(31,n,t,i),e.elementType=D,e.lanes=o,e;case _:return ei(n.children,i,o,t);case v:s=8,i|=24;break;case y:return e=Yr(12,n,t,i|2),e.elementType=y,e.lanes=o,e;case C:return e=Yr(13,n,t,i),e.elementType=C,e.lanes=o,e;case w:return e=Yr(19,n,t,i),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Yr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ei(e,t,n,r){return e=Yr(7,e,r,t),e.lanes=n,e}function ti(e,t,n){return e=Yr(6,e,null,t),e.lanes=n,e}function ni(e){var t=Yr(18,null,null,0);return t.stateNode=e,t}function ri(e,t,n){return t=Yr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ii=new WeakMap;function ai(e,t){if(typeof e==`object`&&e){var n=ii.get(e);return n===void 0?(t={value:e,source:t,stack:ce(t)},ii.set(e,t),t):n}return{value:e,source:t,stack:ce(t)}}var oi=[],si=0,ci=null,li=0,ui=[],di=0,fi=null,pi=1,mi=``;function hi(e,t){oi[si++]=li,oi[si++]=ci,ci=e,li=t}function gi(e,t,n){ui[di++]=pi,ui[di++]=mi,ui[di++]=fi,fi=e;var r=pi;e=mi;var i=32-Te(r)-1;r&=~(1<<i),n+=1;var a=32-Te(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,pi=1<<32-Te(t)+i|n<<i|r,mi=a+e}else pi=1<<a|n<<i|r,mi=e}function _i(e){e.return!==null&&(hi(e,1),gi(e,1,0))}function vi(e){for(;e===ci;)ci=oi[--si],oi[si]=null,li=oi[--si],oi[si]=null;for(;e===fi;)fi=ui[--di],ui[di]=null,mi=ui[--di],ui[di]=null,pi=ui[--di],ui[di]=null}function yi(e,t){ui[di++]=pi,ui[di++]=mi,ui[di++]=fi,pi=t.id,mi=t.overflow,fi=e}var bi=null,xi=null,Si=!1,Ci=null,wi=!1,Ti=Error(a(519));function Ei(e){throw Mi(ai(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ti}function Di(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[qe]=e,t[Je]=r,n){case`dialog`:vd(`cancel`,t),vd(`close`,t);break;case`iframe`:case`object`:case`embed`:vd(`load`,t);break;case`video`:case`audio`:for(n=0;n<hd.length;n++)vd(hd[n],t);break;case`source`:vd(`error`,t);break;case`img`:case`image`:case`link`:vd(`error`,t),vd(`load`,t);break;case`details`:vd(`toggle`,t);break;case`input`:vd(`invalid`,t),Dt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:vd(`invalid`,t);break;case`textarea`:vd(`invalid`,t),jt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&(vd(`beforetoggle`,t),vd(`toggle`,t)),r.onScroll!=null&&vd(`scroll`,t),r.onScrollEnd!=null&&vd(`scrollend`,t),r.onClick!=null&&(t.onclick=Bt),t=!0):t=!1,t||Ei(e,!0)}function Oi(e){for(bi=e.return;bi;)switch(bi.tag){case 5:case 31:case 13:wi=!1;return;case 27:case 3:wi=!0;return;default:bi=bi.return}}function ki(e){if(e!==bi)return!1;if(!Si)return Oi(e),Si=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&xi&&Ei(e),Oi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));xi=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));xi=uf(e)}else t===27?(t=xi,Zd(e.type)?(e=lf,lf=null,xi=e):xi=t):xi=bi?cf(e.stateNode.nextSibling):null;return!0}function Ai(){xi=bi=null,Si=!1}function ji(){var e=Ci;return e!==null&&(Jl===null?Jl=e:Jl.push.apply(Jl,e),Ci=null),e}function Mi(e){Ci===null?Ci=[e]:Ci.push(e)}var Ni=z(null),Pi=null,Fi=null;function Ii(e,t,n){V(Ni,t._currentValue),t._currentValue=n}function Li(e){e._currentValue=Ni.current,B(Ni)}function Ri(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function zi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ri(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ri(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Bi(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;lr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===G.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&zi(t,e,n,r),t.flags|=262144}function Vi(e){for(e=e.firstContext;e!==null;){if(!lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Hi(e){Pi=e,Fi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ui(e){return Gi(Pi,e)}function Wi(e,t){return Pi===null&&Hi(e),Gi(e,t)}function Gi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Fi===null){if(e===null)throw Error(a(308));Fi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fi=Fi.next=t;return n}var Ki=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},qi=t.unstable_scheduleCallback,Ji=t.unstable_NormalPriority,Yi={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xi(){return{controller:new Ki,data:new Map,refCount:0}}function Zi(e){e.refCount--,e.refCount===0&&qi(Ji,function(){e.controller.abort()})}var Qi=null,$i=0,ea=0,ta=null;function na(e,t){if(Qi===null){var n=Qi=[];$i=0,ea=ld(),ta={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return $i++,t.then(ra,ra),t}function ra(){if(--$i===0&&Qi!==null){ta!==null&&(ta.status=`fulfilled`);var e=Qi;Qi=null,ea=0,ta=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ia(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var aa=P.S;P.S=function(e,t){Zl=J(),typeof t==`object`&&t&&typeof t.then==`function`&&na(e,t),aa!==null&&aa(e,t)};var oa=z(null);function sa(){var e=oa.current;return e===null?Ml.pooledCache:e}function ca(e,t){t===null?V(oa,oa.current):V(oa,t.pool)}function la(){var e=sa();return e===null?null:{parent:Yi._currentValue,pool:e}}var ua=Error(a(460)),da=Error(a(474)),fa=Error(a(542)),pa={then:function(){}};function ma(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ha(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Bt,Bt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ya(e),e;default:if(typeof t.status==`string`)t.then(Bt,Bt);else{if(e=Ml,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ya(e),e}throw _a=t,ua}}function ga(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(_a=e,ua):e}}var _a=null;function va(){if(_a===null)throw Error(a(459));var e=_a;return _a=null,e}function ya(e){if(e===ua||e===fa)throw Error(a(483))}var ba=null,xa=0;function Sa(e){var t=xa;return xa+=1,ba===null&&(ba=[]),ha(ba,e,t)}function Ca(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function wa(e,t){throw t.$$typeof===m?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ta(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Zr(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ti(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===E&&ga(a)===t.type)?(t=i(t,n.props),Ca(t,n),t.return=e,t):(t=$r(n.type,n.key,n.props,null,e.mode,r),Ca(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ri(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=ei(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ti(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=$r(t.type,t.key,t.props,null,e.mode,n),Ca(n,t),n.return=e,n;case g:return t=ri(t,e.mode,n),t.return=e,t;case E:return t=ga(t),f(e,t,n)}if(N(t)||A(t))return t=ei(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Sa(t),n);if(t.$$typeof===x)return f(e,Wi(e,t),n);wa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case E:return n=ga(n),p(e,t,n,r)}if(N(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Sa(n),r);if(n.$$typeof===x)return p(e,t,Wi(e,n),r);wa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=ga(r),m(e,t,n,r,i)}if(N(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Sa(r),i);if(r.$$typeof===x)return m(e,t,n,Wi(t,r),i);wa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Si&&hi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Si&&hi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Si&&hi(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Si&&hi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Si&&hi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Si&&hi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&ga(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ca(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=ei(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=$r(o.type,o.key,o.props,null,e.mode,c),Ca(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ri(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=ga(o),b(e,r,o,c)}if(N(o))return v(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Sa(o),c);if(o.$$typeof===x)return b(e,r,Wi(e,o),c);wa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=ti(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{xa=0;var i=b(e,t,n,r);return ba=null,i}catch(t){if(t===ua||t===fa)throw t;var a=Yr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ea=Ta(!0),Da=Ta(!1),Oa=!1;function ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Aa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ma(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,jl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Kr(e),Gr(e,null,n),t}return Hr(e,r,t,n),Kr(e)}function Na(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Be(e,n)}}function Pa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Fa=!1;function Ia(){if(Fa){var e=ta;if(e!==null)throw e}}function La(e,t,n,r){Fa=!1;var i=e.updateQueue;Oa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(Pl&f)===f:(r&f)===f){f!==0&&f===ea&&(Fa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Oa=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Hl|=o,e.lanes=o,e.memoizedState=d}}function Ra(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ra(n[e],t)}var Ba=z(null),Va=z(0);function Ha(e,t){e=Bl,V(Va,e),V(Ba,t),Bl=e|t.baseLanes}function Ua(){V(Va,Bl),V(Ba,Ba.current)}function Wa(){Bl=Va.current,B(Ba),B(Va)}var Ga=z(null),Ka=null;function qa(e){var t=e.alternate;V(Qa,Qa.current&1),V(Ga,e),Ka===null&&(t===null||Ba.current!==null||t.memoizedState!==null)&&(Ka=e)}function Ja(e){V(Qa,Qa.current),V(Ga,e),Ka===null&&(Ka=e)}function Ya(e){e.tag===22?(V(Qa,Qa.current),V(Ga,e),Ka===null&&(Ka=e)):Xa(e)}function Xa(){V(Qa,Qa.current),V(Ga,Ga.current)}function Za(e){B(Ga),Ka===e&&(Ka=null),B(Qa)}var Qa=z(0);function $a(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var eo=0,to=null,no=null,ro=null,io=!1,ao=!1,oo=!1,so=0,co=0,lo=null,uo=0;function fo(){throw Error(a(321))}function po(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lr(e[n],t[n]))return!1;return!0}function mo(e,t,n,r,i,a){return eo=a,to=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?ks:As,oo=!1,a=n(r,i),oo=!1,ao&&(a=go(t,n,r,i)),ho(e),a}function ho(e){P.H=Os;var t=no!==null&&no.next!==null;if(eo=0,ro=no=to=null,io=!1,co=0,lo=null,t)throw Error(a(300));e===null||qs||(e=e.dependencies,e!==null&&Vi(e)&&(qs=!0))}function go(e,t,n,r){to=e;var i=0;do{if(ao&&(lo=null),co=0,ao=!1,25<=i)throw Error(a(301));if(i+=1,ro=no=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=js,o=t(n,r)}while(ao);return o}function _o(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?wo(t):t,e=e.useState()[0],(no===null?null:no.memoizedState)!==e&&(to.flags|=1024),t}function vo(){var e=so!==0;return so=0,e}function yo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function bo(e){if(io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}io=!1}eo=0,ro=no=to=null,ao=!1,co=so=0,lo=null}function xo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ro===null?to.memoizedState=ro=e:ro=ro.next=e,ro}function So(){if(no===null){var e=to.alternate;e=e===null?null:e.memoizedState}else e=no.next;var t=ro===null?to.memoizedState:ro.next;if(t!==null)ro=t,no=e;else{if(e===null)throw to.alternate===null?Error(a(467)):Error(a(310));no=e,e={memoizedState:no.memoizedState,baseState:no.baseState,baseQueue:no.baseQueue,queue:no.queue,next:null},ro===null?to.memoizedState=ro=e:ro=ro.next=e}return ro}function Co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wo(e){var t=co;return co+=1,lo===null&&(lo=[]),e=ha(lo,e,t),t=to,(ro===null?t.memoizedState:ro.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?ks:As),e}function To(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return wo(e);if(e.$$typeof===x)return Ui(e)}throw Error(a(438,String(e)))}function Eo(e){var t=null,n=to.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=to.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Co(),to.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function Do(e,t){return typeof t==`function`?t(e):t}function Oo(e){return ko(So(),no,e)}function ko(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(eo&f)===f:(Pl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ea&&(d=!0);else if((eo&p)===p){u=u.next,p===ea&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,to.lanes|=p,Hl|=p;f=u.action,oo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,to.lanes|=f,Hl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!lr(o,e.memoizedState)&&(qs=!0,d&&(n=ta,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ao(e){var t=So(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);lr(o,t.memoizedState)||(qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function jo(e,t,n){var r=to,i=So(),o=Si;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!lr((no||i).memoizedState,n);if(s&&(i.memoizedState=n,qs=!0),i=i.queue,es(Po.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||ro!==null&&ro.memoizedState.tag&1){if(r.flags|=2048,Q(9,{destroy:void 0},No.bind(null,r,i,n,t),null),Ml===null)throw Error(a(349));o||eo&127||Mo(r,t,n)}return n}function Mo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=to.updateQueue,t===null?(t=Co(),to.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function No(e,t,n,r){t.value=n,t.getSnapshot=r,Fo(t)&&Io(e)}function Po(e,t,n){return n(function(){Fo(t)&&Io(e)})}function Fo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lr(e,n)}catch{return!0}}function Io(e){var t=Wr(e,2);t!==null&&fu(t,e,2)}function Lo(e){var t=xo();if(typeof e==`function`){var n=e;if(e=n(),oo){we(!0);try{n()}finally{we(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:e},t}function Ro(e,t,n,r){return e.baseState=n,ko(e,no,typeof r==`function`?r:Do)}function zo(e,t,n,r,i){if(Ts(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Bo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Bo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Vo(e,t,s)}catch(n){Uo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Vo(e,t,a)}catch(n){Uo(e,t,n)}}function Vo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ho(e,t,n)},function(n){return Uo(e,t,n)}):Ho(e,t,n)}function Ho(e,t,n){t.status=`fulfilled`,t.value=n,Go(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Bo(e,n)))}function Uo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Go(t),t=t.next;while(t!==r)}e.action=null}function Go(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ko(e,t){return t}function qo(e,t){if(Si){var n=Ml.formState;if(n!==null){a:{var r=to;if(Si){if(xi){b:{for(var i=xi,a=wi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){xi=cf(i.nextSibling),r=i.data===`F!`;break a}}Ei(r)}r=!1}r&&(t=n[0])}}return n=xo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:t},n.queue=r,n=Ss.bind(null,to,r),r.dispatch=n,r=Lo(!1),a=ws.bind(null,to,!1,r.queue),r=xo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=zo.bind(null,to,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Jo(e){return Yo(So(),no,e)}function Yo(e,t,n){if(t=ko(e,t,Ko)[0],e=Oo(Do)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=wo(t)}catch(e){throw e===ua?fa:e}else r=t;t=So();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(to.flags|=2048,Q(9,{destroy:void 0},Xo.bind(null,i,n),null)),[r,a,e]}function Xo(e,t){e.action=t}function Z(e){var t=So(),n=no;if(n!==null)return Yo(t,n,e);So(),t=t.memoizedState,n=So();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Q(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=to.updateQueue,t===null&&(t=Co(),to.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Zo(){return So().memoizedState}function Qo(e,t,n,r){var i=xo();to.flags|=e,i.memoizedState=Q(1|t,{destroy:void 0},n,r===void 0?null:r)}function $(e,t,n,r){var i=So();r=r===void 0?null:r;var a=i.memoizedState.inst;no!==null&&r!==null&&po(r,no.memoizedState.deps)?i.memoizedState=Q(t,a,n,r):(to.flags|=e,i.memoizedState=Q(1|t,a,n,r))}function $o(e,t){Qo(8390656,8,e,t)}function es(e,t){$(2048,8,e,t)}function ts(e){to.flags|=4;var t=to.updateQueue;if(t===null)t=Co(),to.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ns(e){var t=So().memoizedState;return ts({ref:t,nextImpl:e}),function(){if(jl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function rs(e,t){return $(4,2,e,t)}function is(e,t){return $(4,4,e,t)}function as(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function os(e,t,n){n=n==null?null:n.concat([e]),$(4,4,as.bind(null,t,e),n)}function ss(){}function cs(e,t){var n=So();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&po(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ls(e,t){var n=So();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&po(t,r[1]))return r[0];if(r=e(),oo){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[r,t],r}function us(e,t,n){return n===void 0||eo&1073741824&&!(Pl&261930)?e.memoizedState=t:(e.memoizedState=n,e=du(),to.lanes|=e,Hl|=e,n)}function ds(e,t,n,r){return lr(n,t)?n:Ba.current===null?!(eo&42)||eo&1073741824&&!(Pl&261930)?(qs=!0,e.memoizedState=n):(e=du(),to.lanes|=e,Hl|=e,t):(e=us(e,n,r),lr(e,t)||(qs=!0),e)}function fs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,ws(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Cs(e,t,ia(c,r),uu(e)):Cs(e,t,r,uu(e))}catch(n){Cs(e,t,{then:function(){},status:`rejected`,reason:n},uu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ps(){}function ms(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=hs(e).queue;fs(e,i,t,I,n===null?ps:function(){return gs(e),n(r)})}function hs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gs(e){var t=hs(e);t.next===null&&(t=e.alternate.memoizedState),Cs(e,t.next.queue,{},uu())}function _s(){return Ui(Qf)}function vs(){return So().memoizedState}function ys(){return So().memoizedState}function bs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=uu();e=ja(n);var r=Ma(t,e,n);r!==null&&(fu(r,t,n),Na(r,t,n)),t={cache:Xi()},e.payload=t;return}t=t.return}}function xs(e,t,n){var r=uu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ts(e)?Es(t,n):(n=Ur(e,t,n,r),n!==null&&(fu(n,e,r),Ds(n,t,r)))}function Ss(e,t,n){Cs(e,t,n,uu())}function Cs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ts(e))Es(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,lr(s,o))return Hr(e,t,i,0),Ml===null&&Br(),!1}catch{}if(n=Ur(e,t,i,r),n!==null)return fu(n,e,r),Ds(n,t,r),!0}return!1}function ws(e,t,n,r){if(r={lane:2,revertLane:ld(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ts(e)){if(t)throw Error(a(479))}else t=Ur(e,n,r,2),t!==null&&fu(t,e,2)}function Ts(e){var t=e.alternate;return e===to||t!==null&&t===to}function Es(e,t){ao=io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ds(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Be(e,n)}}var Os={readContext:Ui,use:To,useCallback:fo,useContext:fo,useEffect:fo,useImperativeHandle:fo,useLayoutEffect:fo,useInsertionEffect:fo,useMemo:fo,useReducer:fo,useRef:fo,useState:fo,useDebugValue:fo,useDeferredValue:fo,useTransition:fo,useSyncExternalStore:fo,useId:fo,useHostTransitionStatus:fo,useFormState:fo,useActionState:fo,useOptimistic:fo,useMemoCache:fo,useCacheRefresh:fo};Os.useEffectEvent=fo;var ks={readContext:Ui,use:To,useCallback:function(e,t){return xo().memoizedState=[e,t===void 0?null:t],e},useContext:Ui,useEffect:$o,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Qo(4194308,4,as.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qo(4194308,4,e,t)},useInsertionEffect:function(e,t){Qo(4,2,e,t)},useMemo:function(e,t){var n=xo();t=t===void 0?null:t;var r=e();if(oo){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=xo();if(n!==void 0){var i=n(t);if(oo){we(!0);try{n(t)}finally{we(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=xs.bind(null,to,e),[r.memoizedState,e]},useRef:function(e){var t=xo();return e={current:e},t.memoizedState=e},useState:function(e){e=Lo(e);var t=e.queue,n=Ss.bind(null,to,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ss,useDeferredValue:function(e,t){return us(xo(),e,t)},useTransition:function(){var e=Lo(!1);return e=fs.bind(null,to,e.queue,!0,!1),xo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=to,i=xo();if(Si){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Ml===null)throw Error(a(349));Pl&127||Mo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,$o(Po.bind(null,r,o,e),[e]),r.flags|=2048,Q(9,{destroy:void 0},No.bind(null,r,o,n,t),null),n},useId:function(){var e=xo(),t=Ml.identifierPrefix;if(Si){var n=mi,r=pi;n=(r&~(1<<32-Te(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=so++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:_s,useFormState:qo,useActionState:qo,useOptimistic:function(e){var t=xo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ws.bind(null,to,!0,n),n.dispatch=t,[e,t]},useMemoCache:Eo,useCacheRefresh:function(){return xo().memoizedState=bs.bind(null,to)},useEffectEvent:function(e){var t=xo(),n={impl:e};return t.memoizedState=n,function(){if(jl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},As={readContext:Ui,use:To,useCallback:cs,useContext:Ui,useEffect:es,useImperativeHandle:os,useInsertionEffect:rs,useLayoutEffect:is,useMemo:ls,useReducer:Oo,useRef:Zo,useState:function(){return Oo(Do)},useDebugValue:ss,useDeferredValue:function(e,t){return ds(So(),no.memoizedState,e,t)},useTransition:function(){var e=Oo(Do)[0],t=So().memoizedState;return[typeof e==`boolean`?e:wo(e),t]},useSyncExternalStore:jo,useId:vs,useHostTransitionStatus:_s,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){return Ro(So(),no,e,t)},useMemoCache:Eo,useCacheRefresh:ys};As.useEffectEvent=ns;var js={readContext:Ui,use:To,useCallback:cs,useContext:Ui,useEffect:es,useImperativeHandle:os,useInsertionEffect:rs,useLayoutEffect:is,useMemo:ls,useReducer:Ao,useRef:Zo,useState:function(){return Ao(Do)},useDebugValue:ss,useDeferredValue:function(e,t){var n=So();return no===null?us(n,e,t):ds(n,no.memoizedState,e,t)},useTransition:function(){var e=Ao(Do)[0],t=So().memoizedState;return[typeof e==`boolean`?e:wo(e),t]},useSyncExternalStore:jo,useId:vs,useHostTransitionStatus:_s,useFormState:Z,useActionState:Z,useOptimistic:function(e,t){var n=So();return no===null?(n.baseState=e,[e,n.queue.dispatch]):Ro(n,no,e,t)},useMemoCache:Eo,useCacheRefresh:ys};js.useEffectEvent=ns;function Ms(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ns={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=uu(),i=ja(r);i.payload=t,n!=null&&(i.callback=n),t=Ma(e,i,r),t!==null&&(fu(t,e,r),Na(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=uu(),i=ja(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ma(e,i,r),t!==null&&(fu(t,e,r),Na(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=uu(),r=ja(n);r.tag=2,t!=null&&(r.callback=t),t=Ma(e,r,n),t!==null&&(fu(t,e,n),Na(t,e,n))}};function Ps(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!ur(n,r)||!ur(i,a):!0}function Fs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ns.enqueueReplaceState(t,t.state,null)}function Is(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ls(e){Lr(e)}function Rs(e){console.error(e)}function zs(e){Lr(e)}function Bs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Vs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Hs(e,t,n){return n=ja(n),n.tag=3,n.payload={element:null},n.callback=function(){Bs(e,t)},n}function Us(e){return e=ja(e),e.tag=3,e}function Ws(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Vs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Vs(t,n,r),typeof i!=`function`&&(eu===null?eu=new Set([this]):eu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Gs(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Bi(t,n,i,!0),n=Ga.current,n!==null){switch(n.tag){case 31:case 13:return Ka===null?wu():n.alternate===null&&Vl===0&&(Vl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===pa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Uu(e,r,i)),!1;case 22:return n.flags|=65536,r===pa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Uu(e,r,i)),!1}throw Error(a(435,n.tag))}return Uu(e,r,i),wu(),!1}if(Si)return t=Ga.current,t===null?(r!==Ti&&(t=Error(a(423),{cause:r}),Mi(ai(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ai(r,n),i=Hs(e.stateNode,r,i),Pa(e,i),Vl!==4&&(Vl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ti&&(e=Error(a(422),{cause:r}),Mi(ai(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=ai(o,n),ql===null?ql=[o]:ql.push(o),Vl!==4&&(Vl=2),t===null)return!0;r=ai(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Hs(n.stateNode,r,e),Pa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(eu===null||!eu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Us(i),Ws(i,e,n,r),Pa(n,i),!1}n=n.return}while(n!==null);return!1}var Ks=Error(a(461)),qs=!1;function Js(e,t,n,r){t.child=e===null?Da(t,null,n,r):Ea(t,e.child,n,r)}function Ys(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Hi(t),r=mo(e,t,n,o,a,i),s=vo(),e!==null&&!qs?(yo(e,t,i),yc(e,t,i)):(Si&&s&&_i(t),t.flags|=1,Js(e,t,r,i),t.child)}function Xs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Xr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Zs(e,t,a,r,i)):(e=$r(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!bc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?ur:n,n(o,r)&&e.ref===t.ref)return yc(e,t,i)}return t.flags|=1,e=Zr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Zs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(ur(a,r)&&e.ref===t.ref)if(qs=!1,t.pendingProps=r=a,bc(e,i))e.flags&131072&&(qs=!0);else return t.lanes=e.lanes,yc(e,t,i)}return ac(e,t,n,r,i)}function Qs(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ec(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ca(t,a===null?null:a.cachePool),a===null?Ua():Ha(t,a),Ya(t);else return r=t.lanes=536870912,ec(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ca(t,null),Ua(),Xa(t)):(ca(t,a.cachePool),Ha(t,a),Xa(t),t.memoizedState=null);return Js(e,t,i,n),t.child}function $s(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ec(e,t,n,r,i){var a=sa();return a=a===null?null:{parent:Yi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ca(t,null),Ua(),Ya(t),e!==null&&Bi(e,t,r,!0),t.childLanes=i,null}function tc(e,t){return t=mc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function nc(e,t,n){return Ea(t,e.child,null,n),e=tc(t,t.pendingProps),e.flags|=2,Za(t),t.memoizedState=null,e}function rc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Si){if(r.mode===`hidden`)return e=tc(t,r),t.lanes=536870912,$s(null,e);if(Ja(t),(e=xi)?(e=rf(e,wi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fi===null?null:{id:pi,overflow:mi},retryLane:536870912,hydrationErrors:null},n=ni(e),n.return=t,t.child=n,bi=t,xi=null)):e=null,e===null)throw Ei(t);return t.lanes=536870912,null}return tc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ja(t),i)if(t.flags&256)t.flags&=-257,t=nc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(qs||Bi(e,t,n,!1),i=(n&e.childLanes)!==0,qs||i){if(r=Ml,r!==null&&(s=Ve(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Wr(e,s),fu(r,e,s),Ks;wu(),t=nc(e,t,n)}else e=o.treeContext,xi=cf(s.nextSibling),bi=t,Si=!0,Ci=null,wi=!1,e!==null&&yi(t,e),t=tc(t,r),t.flags|=4096;return t}return e=Zr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ic(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ac(e,t,n,r,i){return Hi(t),n=mo(e,t,n,r,void 0,i),r=vo(),e!==null&&!qs?(yo(e,t,i),yc(e,t,i)):(Si&&r&&_i(t),t.flags|=1,Js(e,t,n,i),t.child)}function oc(e,t,n,r,i,a){return Hi(t),t.updateQueue=null,n=go(t,r,n,i),ho(e),r=vo(),e!==null&&!qs?(yo(e,t,a),yc(e,t,a)):(Si&&r&&_i(t),t.flags|=1,Js(e,t,n,a),t.child)}function sc(e,t,n,r,i){if(Hi(t),t.stateNode===null){var a=qr,o=n.contextType;typeof o==`object`&&o&&(a=Ui(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ns,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ka(t),o=n.contextType,a.context=typeof o==`object`&&o?Ui(o):qr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ms(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ns.enqueueReplaceState(a,a.state,null),La(t,r,a,i),Ia(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Is(n,s);a.props=c;var l=a.context,u=n.contextType;o=qr,typeof u==`object`&&u&&(o=Ui(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Fs(t,a,r,o),Oa=!1;var f=t.memoizedState;a.state=f,La(t,r,a,i),Ia(),l=t.memoizedState,s||f!==l||Oa?(typeof d==`function`&&(Ms(t,n,d,r),l=t.memoizedState),(c=Oa||Ps(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Aa(e,t),o=t.memoizedProps,u=Is(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=qr,typeof l==`object`&&l&&(c=Ui(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Fs(t,a,r,c),Oa=!1,f=t.memoizedState,a.state=f,La(t,r,a,i),Ia();var p=t.memoizedState;o!==d||f!==p||Oa||e!==null&&e.dependencies!==null&&Vi(e.dependencies)?(typeof s==`function`&&(Ms(t,n,s,r),p=t.memoizedState),(u=Oa||Ps(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Vi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,ic(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ea(t,e.child,null,i),t.child=Ea(t,null,n,i)):Js(e,t,n,i),t.memoizedState=a.state,e=t.child):e=yc(e,t,i),e}function cc(e,t,n,r){return Ai(),t.flags|=256,Js(e,t,n,r),t.child}var lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function uc(e){return{baseLanes:e,cachePool:la()}}function dc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Gl),e}function fc(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(Qa.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Si){if(i?qa(t):Xa(t),(e=xi)?(e=rf(e,wi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fi===null?null:{id:pi,overflow:mi},retryLane:536870912,hydrationErrors:null},n=ni(e),n.return=t,t.child=n,bi=t,xi=null)):e=null,e===null)throw Ei(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(Xa(t),i=t.mode,c=mc({mode:`hidden`,children:c},i),r=ei(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=uc(n),r.childLanes=dc(e,s,n),t.memoizedState=lc,$s(null,r)):(qa(t),pc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(qa(t),t.flags&=-257,t=hc(e,t,n)):t.memoizedState===null?(Xa(t),c=r.fallback,i=t.mode,r=mc({mode:`visible`,children:r.children},i),c=ei(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ea(t,e.child,null,n),r=t.child,r.memoizedState=uc(n),r.childLanes=dc(e,s,n),t.memoizedState=lc,t=$s(null,r)):(Xa(t),t.child=e.child,t.flags|=128,t=null);else if(qa(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Mi({value:r,source:null,stack:null}),t=hc(e,t,n)}else if(qs||Bi(e,t,n,!1),s=(n&e.childLanes)!==0,qs||s){if(s=Ml,s!==null&&(r=Ve(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Wr(e,r),fu(s,e,r),Ks;af(c)||wu(),t=hc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,xi=cf(c.nextSibling),bi=t,Si=!0,Ci=null,wi=!1,e!==null&&yi(t,e),t=pc(t,r.children),t.flags|=4096);return t}return i?(Xa(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=Zr(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ei(c,i,n,null),c.flags|=2):c=Zr(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,$s(null,r),r=t.child,c=e.child.memoizedState,c===null?c=uc(n):(i=c.cachePool,i===null?i=la():(l=Yi._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=dc(e,s,n),t.memoizedState=lc,$s(e.child,r)):(qa(t),n=e.child,e=n.sibling,n=Zr(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function pc(e,t){return t=mc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function mc(e,t){return e=Yr(22,e,null,t),e.lanes=0,e}function hc(e,t,n){return Ea(t,e.child,null,n),e=pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ri(e.return,t,n)}function _c(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function vc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Qa.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,V(Qa,o),Js(e,t,r,n),r=Si?li:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gc(e,n,t);else if(e.tag===19)gc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&$a(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),_c(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&$a(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}_c(t,!0,n,null,a,r);break;case`together`:_c(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function yc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Bi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Zr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Zr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function bc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Vi(e))):!0}function xc(e,t,n){switch(t.tag){case 3:K(t,t.stateNode.containerInfo),Ii(t,Yi,e.memoizedState.cache),Ai();break;case 27:case 5:ee(t);break;case 4:K(t,t.stateNode.containerInfo);break;case 10:Ii(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ja(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(qa(t),e=yc(e,t,n),e===null?null:e.sibling):fc(e,t,n):(qa(t),t.flags|=128,null);qa(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Bi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return vc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),V(Qa,Qa.current),r)break;return null;case 22:return t.lanes=0,Qs(e,t,n,t.pendingProps);case 24:Ii(t,Yi,e.memoizedState.cache)}return yc(e,t,n)}function Sc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)qs=!0;else{if(!bc(e,n)&&!(t.flags&128))return qs=!1,xc(e,t,n);qs=!!(e.flags&131072)}else qs=!1,Si&&t.flags&1048576&&gi(t,li,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ga(t.elementType),t.type=e,typeof e==`function`)Xr(e)?(r=Is(e,r),t.tag=1,t=sc(null,t,e,r,n)):(t.tag=0,t=ac(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===S){t.tag=11,t=Ys(null,t,e,r,n);break a}else if(i===T){t.tag=14,t=Xs(null,t,e,r,n);break a}}throw t=M(e)||e,Error(a(306,t,``))}}return t;case 0:return ac(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Is(r,t.pendingProps),sc(e,t,r,i,n);case 3:a:{if(K(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Aa(e,t),La(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ii(t,Yi,r),r!==o.cache&&zi(t,[Yi],n,!0),Ia(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=cc(e,t,r,n);break a}else if(r!==i){i=ai(Error(a(424)),t),Mi(i),t=cc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(xi=cf(e.firstChild),bi=t,Si=!0,Ci=null,wi=!0,n=Da(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ai(),r===i){t=yc(e,t,n);break a}Js(e,t,r,n)}t=t.child}return t;case 26:return ic(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Si||(n=t.type,e=t.pendingProps,r=Bd(W.current).createElement(n),r[qe]=t,r[Je]=e,Pd(r,n,e),ot(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ee(t),e===null&&Si&&(r=t.stateNode=ff(t.type,t.pendingProps,W.current),bi=t,wi=!0,i=xi,Zd(t.type)?(lf=i,xi=cf(r.firstChild)):xi=i),Js(e,t,t.pendingProps.children,n),ic(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Si&&((i=r=xi)&&(r=tf(r,t.type,t.pendingProps,wi),r===null?i=!1:(t.stateNode=r,bi=t,xi=cf(r.firstChild),wi=!1,i=!0)),i||Ei(t)),ee(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=mo(e,t,_o,null,null,n),Qf._currentValue=i),ic(e,t),Js(e,t,r,n),t.child;case 6:return e===null&&Si&&((e=n=xi)&&(n=nf(n,t.pendingProps,wi),n===null?e=!1:(t.stateNode=n,bi=t,xi=null,e=!0)),e||Ei(t)),null;case 13:return fc(e,t,n);case 4:return K(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ea(t,null,r,n):Js(e,t,r,n),t.child;case 11:return Ys(e,t,t.type,t.pendingProps,n);case 7:return Js(e,t,t.pendingProps,n),t.child;case 8:return Js(e,t,t.pendingProps.children,n),t.child;case 12:return Js(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ii(t,t.type,r.value),Js(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Hi(t),i=Ui(i),r=r(i),t.flags|=1,Js(e,t,r,n),t.child;case 14:return Xs(e,t,t.type,t.pendingProps,n);case 15:return Zs(e,t,t.type,t.pendingProps,n);case 19:return vc(e,t,n);case 31:return rc(e,t,n);case 22:return Qs(e,t,n,t.pendingProps);case 24:return Hi(t),r=Ui(Yi),e===null?(i=sa(),i===null&&(i=Ml,o=Xi(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},ka(t),Ii(t,Yi,i)):((e.lanes&n)!==0&&(Aa(e,t),La(t,null,null,n),Ia()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Ii(t,Yi,r),r!==i.cache&&zi(t,[Yi],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ii(t,Yi,r))),Js(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Cc(e){e.flags|=4}function wc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(xu())e.flags|=8192;else throw _a=pa,da}else e.flags&=-16777217}function Tc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(xu())e.flags|=8192;else throw _a=pa,da}function Ec(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Fe(),e.lanes|=t,Kl|=t)}function Dc(e,t){if(!Si)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Oc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kc(e,t,n){var r=t.pendingProps;switch(vi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oc(t),null;case 1:return Oc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Li(Yi),q(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ki(t)?Cc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ji())),Oc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Cc(t),o===null?(Oc(t),wc(t,i,null,r,n)):(Oc(t),Tc(t,o))):o?o===e.memoizedState?(Oc(t),t.flags&=-16777217):(Cc(t),Oc(t),Tc(t,o)):(e=e.memoizedProps,e!==r&&Cc(t),Oc(t),wc(t,i,e,r,n)),null;case 27:if(te(t),n=W.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Oc(t),null}e=H.current,ki(t)?Di(t,e):(e=ff(i,r,n),t.stateNode=e,Cc(t))}return Oc(t),null;case 5:if(te(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Oc(t),null}if(o=H.current,ki(t))Di(t,o);else{var s=Bd(W.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[qe]=t,o[Je]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Cc(t)}}return Oc(t),wc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=W.current,ki(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=bi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[qe]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ei(t,!0)}else e=Bd(e).createTextNode(r),e[qe]=t,t.stateNode=e}return Oc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ki(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[qe]=t}else Ai(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oc(t),e=!1}else n=ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Za(t),t):(Za(t),null);if(t.flags&128)throw Error(a(558))}return Oc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ki(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[qe]=t}else Ai(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oc(t),i=!1}else i=ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Za(t),t):(Za(t),null)}return Za(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ec(t,t.updateQueue),Oc(t),null);case 4:return q(),e===null&&xd(t.stateNode.containerInfo),Oc(t),null;case 10:return Li(t.type),Oc(t),null;case 19:if(B(Qa),r=t.memoizedState,r===null)return Oc(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Dc(r,!1);else{if(Vl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=$a(e),o!==null){for(t.flags|=128,Dc(r,!1),e=o.updateQueue,t.updateQueue=e,Ec(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Qr(n,e),n=n.sibling;return V(Qa,Qa.current&1|2),Si&&hi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&J()>Ql&&(t.flags|=128,i=!0,Dc(r,!1),t.lanes=4194304)}else{if(!i)if(e=$a(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ec(t,e),Dc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Si)return Oc(t),null}else 2*J()-r.renderingStartTime>Ql&&n!==536870912&&(t.flags|=128,i=!0,Dc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Oc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=J(),e.sibling=null,n=Qa.current,V(Qa,i?n&1|2:n&1),Si&&hi(t,r.treeForkCount),e);case 22:case 23:return Za(t),Wa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Oc(t),t.subtreeFlags&6&&(t.flags|=8192)):Oc(t),n=t.updateQueue,n!==null&&Ec(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&B(oa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Li(Yi),Oc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Ac(e,t){switch(vi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Li(Yi),q(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return te(t),null;case 31:if(t.memoizedState!==null){if(Za(t),t.alternate===null)throw Error(a(340));Ai()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Za(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ai()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(Qa),null;case 4:return q(),null;case 10:return Li(t.type),null;case 22:case 23:return Za(t),Wa(),e!==null&&B(oa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Li(Yi),null;case 25:return null;default:return null}}function jc(e,t){switch(vi(t),t.tag){case 3:Li(Yi),q();break;case 26:case 27:case 5:te(t);break;case 4:q();break;case 31:t.memoizedState!==null&&Za(t);break;case 13:Za(t);break;case 19:B(Qa);break;case 10:Li(t.type);break;case 22:case 23:Za(t),Wa(),e!==null&&B(oa);break;case 24:Li(Yi)}}function Mc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Hu(t,t.return,e)}}function Nc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Hu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Hu(t,t.return,e)}}function Pc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{za(t,n)}catch(t){Hu(e,e.return,t)}}}function Fc(e,t,n){n.props=Is(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Hu(e,t,n)}}function Ic(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Hu(e,t,n)}}function Lc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Hu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Hu(e,t,n)}else n.current=null}function Rc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Hu(e,e.return,t)}}function zc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[Je]=t}catch(t){Hu(e,e.return,t)}}function Bc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Vc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Bt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Hc(e,t,n),e=e.sibling;e!==null;)Hc(e,t,n),e=e.sibling}function Uc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Uc(e,t,n),e=e.sibling;e!==null;)Uc(e,t,n),e=e.sibling}function Wc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[qe]=e,t[Je]=n}catch(t){Hu(e,e.return,t)}}var Gc=!1,Kc=!1,qc=!1,Jc=typeof WeakSet==`function`?WeakSet:Set,Yc=null;function Xc(e,t){if(e=e.containerInfo,Rd=sp,e=mr(e),hr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,Yc=t;Yc!==null;)if(t=Yc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Yc=e;else for(;Yc!==null;){switch(t=Yc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Is(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Hu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,Yc=e;break}Yc=t.return}}function Zc(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:fl(e,n),r&4&&Mc(5,n);break;case 1:if(fl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Hu(n,n.return,e)}else{var i=Is(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Hu(n,n.return,e)}}r&64&&Pc(n),r&512&&Ic(n,n.return);break;case 3:if(fl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{za(e,t)}catch(e){Hu(n,n.return,e)}}break;case 27:t===null&&r&4&&Wc(n);case 26:case 5:fl(e,n),t===null&&r&4&&Rc(n),r&512&&Ic(n,n.return);break;case 12:fl(e,n);break;case 31:fl(e,n),r&4&&rl(e,n);break;case 13:fl(e,n),r&4&&il(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ku.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Gc,!r){t=t!==null&&t.memoizedState!==null||Kc,i=Gc;var a=Kc;Gc=r,(Kc=t)&&!a?ml(e,n,(n.subtreeFlags&8772)!=0):fl(e,n),Gc=i,Kc=a}break;case 30:break;default:fl(e,n)}}function Qc(e){var t=e.alternate;t!==null&&(e.alternate=null,Qc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var $c=null,el=!1;function tl(e,t,n){for(n=n.child;n!==null;)nl(e,t,n),n=n.sibling}function nl(e,t,n){if(Ce&&typeof Ce.onCommitFiberUnmount==`function`)try{Ce.onCommitFiberUnmount(Se,n)}catch{}switch(n.tag){case 26:Kc||Lc(n,t),tl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Kc||Lc(n,t);var r=$c,i=el;Zd(n.type)&&($c=n.stateNode,el=!1),tl(e,t,n),pf(n.stateNode),$c=r,el=i;break;case 5:Kc||Lc(n,t);case 6:if(r=$c,i=el,$c=null,tl(e,t,n),$c=r,el=i,$c!==null)if(el)try{($c.nodeType===9?$c.body:$c.nodeName===`HTML`?$c.ownerDocument.body:$c).removeChild(n.stateNode)}catch(e){Hu(n,t,e)}else try{$c.removeChild(n.stateNode)}catch(e){Hu(n,t,e)}break;case 18:$c!==null&&(el?(e=$c,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd($c,n.stateNode));break;case 4:r=$c,i=el,$c=n.stateNode.containerInfo,el=!0,tl(e,t,n),$c=r,el=i;break;case 0:case 11:case 14:case 15:Nc(2,n,t),Kc||Nc(4,n,t),tl(e,t,n);break;case 1:Kc||(Lc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Fc(n,t,r)),tl(e,t,n);break;case 21:tl(e,t,n);break;case 22:Kc=(r=Kc)||n.memoizedState!==null,tl(e,t,n),Kc=r;break;default:tl(e,t,n)}}function rl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Hu(t,t.return,e)}}}function il(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Hu(t,t.return,e)}}function al(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jc),t;default:throw Error(a(435,e.tag))}}function ol(e,t){var n=al(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=qu.bind(null,e,t);t.then(r,r)}})}function sl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){$c=c.stateNode,el=!1;break a}break;case 5:$c=c.stateNode,el=!1;break a;case 3:case 4:$c=c.stateNode.containerInfo,el=!0;break a}c=c.return}if($c===null)throw Error(a(160));nl(o,s,i),$c=null,el=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ll(t,e),t=t.sibling}var cl=null;function ll(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:sl(t,e),ul(e),r&4&&(Nc(3,e,e.return),Mc(3,e),Nc(5,e,e.return));break;case 1:sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),r&64&&Gc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=cl;if(sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[et]||o[qe]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Pd(o,r,n),o[qe]=e,ot(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[qe]=e,ot(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),n!==null&&r&4&&zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),e.flags&32){i=e.stateNode;try{Mt(i,``)}catch(t){Hu(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,zc(e,i,n===null?i:n.memoizedProps)),r&1024&&(qc=!0);break;case 6:if(sl(t,e),ul(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Hu(e,e.return,t)}}break;case 3:if(Bf=null,i=cl,cl=gf(t.containerInfo),sl(t,e),cl=i,ul(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Hu(e,e.return,t)}qc&&(qc=!1,dl(e));break;case 4:r=cl,cl=gf(e.stateNode.containerInfo),sl(t,e),ul(e),cl=r;break;case 12:sl(t,e),ul(e);break;case 31:sl(t,e),ul(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 13:sl(t,e),ul(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Xl=J()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Gc,d=Kc;if(Gc=u||i,Kc=d||l,sl(t,e),Kc=d,Gc=u,ul(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Gc||Kc||pl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Hu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Hu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Hu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ol(e,n))));break;case 19:sl(t,e),ul(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 30:break;case 21:break;default:sl(t,e),ul(e)}}function ul(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Bc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Uc(e,Vc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Mt(o,``),n.flags&=-33),Uc(e,Vc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Hc(e,Vc(e),s);break;default:throw Error(a(161))}}catch(t){Hu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function fl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zc(e,t.alternate,t),t=t.sibling}function pl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Nc(4,t,t.return),pl(t);break;case 1:Lc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Fc(t,t.return,n),pl(t);break;case 27:pf(t.stateNode);case 26:case 5:Lc(t,t.return),pl(t);break;case 22:t.memoizedState===null&&pl(t);break;case 30:pl(t);break;default:pl(t)}e=e.sibling}}function ml(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:ml(i,a,n),Mc(4,a);break;case 1:if(ml(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Hu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ra(c[i],s)}catch(e){Hu(r,r.return,e)}}n&&o&64&&Pc(a),Ic(a,a.return);break;case 27:Wc(a);case 26:case 5:ml(i,a,n),n&&r===null&&o&4&&Rc(a),Ic(a,a.return);break;case 12:ml(i,a,n);break;case 31:ml(i,a,n),n&&o&4&&rl(i,a);break;case 13:ml(i,a,n),n&&o&4&&il(i,a);break;case 22:a.memoizedState===null&&ml(i,a,n),Ic(a,a.return);break;case 30:break;default:ml(i,a,n)}t=t.sibling}}function hl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Zi(n))}function gl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zi(e))}function _l(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vl(e,t,n,r),t=t.sibling}function vl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:_l(e,t,n,r),i&2048&&Mc(9,t);break;case 1:_l(e,t,n,r);break;case 3:_l(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zi(e)));break;case 12:if(i&2048){_l(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Hu(t,t.return,e)}}else _l(e,t,n,r);break;case 31:_l(e,t,n,r);break;case 13:_l(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?_l(e,t,n,r):(a._visibility|=2,yl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?_l(e,t,n,r):bl(e,t),i&2048&&hl(o,t);break;case 24:_l(e,t,n,r),i&2048&&gl(t.alternate,t);break;default:_l(e,t,n,r)}}function yl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:yl(a,o,s,c,i),Mc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,yl(a,o,s,c,i)):u._visibility&2?yl(a,o,s,c,i):bl(a,o),i&&l&2048&&hl(o.alternate,o);break;case 24:yl(a,o,s,c,i),i&&l&2048&&gl(o.alternate,o);break;default:yl(a,o,s,c,i)}t=t.sibling}}function bl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:bl(n,r),i&2048&&hl(r.alternate,r);break;case 24:bl(n,r),i&2048&&gl(r.alternate,r);break;default:bl(n,r)}t=t.sibling}}var xl=8192;function Sl(e,t,n){if(e.subtreeFlags&xl)for(e=e.child;e!==null;)Cl(e,t,n),e=e.sibling}function Cl(e,t,n){switch(e.tag){case 26:Sl(e,t,n),e.flags&xl&&e.memoizedState!==null&&Gf(n,cl,e.memoizedState,e.memoizedProps);break;case 5:Sl(e,t,n);break;case 3:case 4:var r=cl;cl=gf(e.stateNode.containerInfo),Sl(e,t,n),cl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=xl,xl=16777216,Sl(e,t,n),xl=r):Sl(e,t,n));break;default:Sl(e,t,n)}}function wl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Tl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yc=r,Ol(r,e)}wl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)El(e),e=e.sibling}function El(e){switch(e.tag){case 0:case 11:case 15:Tl(e),e.flags&2048&&Nc(9,e,e.return);break;case 3:Tl(e);break;case 12:Tl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Dl(e)):Tl(e);break;default:Tl(e)}}function Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yc=r,Ol(r,e)}wl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Nc(8,t,t.return),Dl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Dl(t));break;default:Dl(t)}e=e.sibling}}function Ol(e,t){for(;Yc!==null;){var n=Yc;switch(n.tag){case 0:case 11:case 15:Nc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Zi(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Yc=r;else a:for(n=e;Yc!==null;){r=Yc;var i=r.sibling,a=r.return;if(Qc(r),r===n){Yc=null;break a}if(i!==null){i.return=a,Yc=i;break a}Yc=a}}}var kl={getCacheForType:function(e){var t=Ui(Yi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ui(Yi).controller.signal}},Al=typeof WeakMap==`function`?WeakMap:Map,jl=0,Ml=null,Nl=null,Pl=0,Fl=0,Il=null,Ll=!1,Rl=!1,zl=!1,Bl=0,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=null,Jl=null,Yl=!1,Xl=0,Zl=0,Ql=1/0,$l=null,eu=null,tu=0,nu=null,ru=null,iu=0,au=0,ou=null,su=null,cu=0,lu=null;function uu(){return jl&2&&Pl!==0?Pl&-Pl:P.T===null?We():ld()}function du(){if(Gl===0)if(!(Pl&536870912)||Si){var e=ke;ke<<=1,!(ke&3932160)&&(ke=262144),Gl=e}else Gl=536870912;return e=Ga.current,e!==null&&(e.flags|=32),Gl}function fu(e,t,n){(e===Ml&&(Fl===2||Fl===9)||e.cancelPendingCommit!==null)&&(yu(e,0),gu(e,Pl,Gl,!1)),Le(e,n),(!(jl&2)||e!==Ml)&&(e===Ml&&(!(jl&2)&&(Ul|=n),Vl===4&&gu(e,Pl,Gl,!1)),td(e))}function pu(e,t,n){if(jl&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ne(e,t),i=r?Du(e,t):Tu(e,t,!0),o=r;do{if(i===0){Rl&&!r&&gu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!hu(n)){i=Tu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=ql;var l=c.current.memoizedState.isDehydrated;if(l&&(yu(c,s).flags|=256),s=Tu(c,s,!1),s!==2){if(zl&&!l){c.errorRecoveryDisabledLanes|=o,Ul|=o,i=4;break a}o=Jl,Jl=i,o!==null&&(Jl===null?Jl=o:Jl.push.apply(Jl,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){yu(e,0),gu(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:gu(r,t,Gl,!Ll);break a;case 2:Jl=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=Xl+300-J(),10<i)){if(gu(r,t,Gl,!Ll),Me(r,0,!0)!==0)break a;iu=t,r.timeoutHandle=Kd(mu.bind(null,r,n,Jl,$l,Yl,t,Gl,Ul,Kl,Ll,o,`Throttled`,-0,0),i);break a}mu(r,n,Jl,$l,Yl,t,Gl,Ul,Kl,Ll,o,null,-0,0)}}break}while(1);td(e)}function mu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bt},Cl(t,a,d);var m=(a&62914560)===a?Xl-J():(a&4194048)===a?Zl-J():0;if(m=qf(d,m),m!==null){iu=a,e.cancelPendingCommit=m(Pu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),gu(e,a,o,!l);return}}Pu(e,t,a,n,r,i,o,s,c)}function hu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!lr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gu(e,t,n,r){t&=~Wl,t&=~Ul,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Te(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ze(e,n,t)}function _u(){return jl&6?!0:(nd(0,!1),!1)}function vu(){if(Nl!==null){if(Fl===0)var e=Nl.return;else e=Nl,Fi=Pi=null,bo(e),ba=null,xa=0,e=Nl;for(;e!==null;)jc(e.alternate,e),e=e.return;Nl=null}}function yu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),iu=0,vu(),Ml=e,Nl=n=Zr(e.current,null),Pl=t,Fl=0,Il=null,Ll=!1,Rl=Ne(e,t),zl=!1,Kl=Gl=Wl=Ul=Hl=Vl=0,Jl=ql=null,Yl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Te(r),a=1<<i;t|=e[i],r&=~a}return Bl=t,Br(),n}function bu(e,t){to=null,P.H=Os,t===ua||t===fa?(t=va(),Fl=3):t===da?(t=va(),Fl=4):Fl=t===Ks?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Il=t,Nl===null&&(Vl=1,Bs(e,ai(t,e.current)))}function xu(){var e=Ga.current;return e===null?!0:(Pl&4194048)===Pl?Ka===null:(Pl&62914560)===Pl||Pl&536870912?e===Ka:!1}function Su(){var e=P.H;return P.H=Os,e===null?Os:e}function Cu(){var e=P.A;return P.A=kl,e}function wu(){Vl=4,Ll||(Pl&4194048)!==Pl&&Ga.current!==null||(Rl=!0),!(Hl&134217727)&&!(Ul&134217727)||Ml===null||gu(Ml,Pl,Gl,!1)}function Tu(e,t,n){var r=jl;jl|=2;var i=Su(),a=Cu();(Ml!==e||Pl!==t)&&($l=null,yu(e,t)),t=!1;var o=Vl;a:do try{if(Fl!==0&&Nl!==null){var s=Nl,c=Il;switch(Fl){case 8:vu(),o=6;break a;case 3:case 2:case 9:case 6:Ga.current===null&&(t=!0);var l=Fl;if(Fl=0,Il=null,ju(e,s,c,l),n&&Rl){o=0;break a}break;default:l=Fl,Fl=0,Il=null,ju(e,s,c,l)}}Eu(),o=Vl;break}catch(t){bu(e,t)}while(1);return t&&e.shellSuspendCounter++,Fi=Pi=null,jl=r,P.H=i,P.A=a,Nl===null&&(Ml=null,Pl=0,Br()),o}function Eu(){for(;Nl!==null;)ku(Nl)}function Du(e,t){var n=jl;jl|=2;var r=Su(),i=Cu();Ml!==e||Pl!==t?($l=null,Ql=J()+500,yu(e,t)):Rl=Ne(e,t);a:do try{if(Fl!==0&&Nl!==null){t=Nl;var o=Il;b:switch(Fl){case 1:Fl=0,Il=null,ju(e,t,o,1);break;case 2:case 9:if(ma(o)){Fl=0,Il=null,Au(t);break}t=function(){Fl!==2&&Fl!==9||Ml!==e||(Fl=7),td(e)},o.then(t,t);break a;case 3:Fl=7;break a;case 4:Fl=5;break a;case 7:ma(o)?(Fl=0,Il=null,Au(t)):(Fl=0,Il=null,ju(e,t,o,7));break;case 5:var s=null;switch(Nl.tag){case 26:s=Nl.memoizedState;case 5:case 27:var c=Nl;if(s?Wf(s):c.stateNode.complete){Fl=0,Il=null;var l=c.sibling;if(l!==null)Nl=l;else{var u=c.return;u===null?Nl=null:(Nl=u,Mu(u))}break b}}Fl=0,Il=null,ju(e,t,o,5);break;case 6:Fl=0,Il=null,ju(e,t,o,6);break;case 8:vu(),Vl=6;break a;default:throw Error(a(462))}}Ou();break}catch(t){bu(e,t)}while(1);return Fi=Pi=null,P.H=r,P.A=i,jl=n,Nl===null?(Ml=null,Pl=0,Br(),Vl):0}function Ou(){for(;Nl!==null&&!fe();)ku(Nl)}function ku(e){var t=Sc(e.alternate,e,Bl);e.memoizedProps=e.pendingProps,t===null?Mu(e):Nl=t}function Au(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=oc(n,t,t.pendingProps,t.type,void 0,Pl);break;case 11:t=oc(n,t,t.pendingProps,t.type.render,t.ref,Pl);break;case 5:bo(t);default:jc(n,t),t=Nl=Qr(t,Bl),t=Sc(n,t,Bl)}e.memoizedProps=e.pendingProps,t===null?Mu(e):Nl=t}function ju(e,t,n,r){Fi=Pi=null,bo(t),ba=null,xa=0;var i=t.return;try{if(Gs(e,i,t,n,Pl)){Vl=1,Bs(e,ai(n,e.current)),Nl=null;return}}catch(t){if(i!==null)throw Nl=i,t;Vl=1,Bs(e,ai(n,e.current)),Nl=null;return}t.flags&32768?(Si||r===1?e=!0:Rl||Pl&536870912?e=!1:(Ll=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ga.current,r!==null&&r.tag===13&&(r.flags|=16384))),Nu(t,e)):Mu(t)}function Mu(e){var t=e;do{if(t.flags&32768){Nu(t,Ll);return}e=t.return;var n=kc(t.alternate,t,Bl);if(n!==null){Nl=n;return}if(t=t.sibling,t!==null){Nl=t;return}Nl=t=e}while(t!==null);Vl===0&&(Vl=5)}function Nu(e,t){do{var n=Ac(e.alternate,e);if(n!==null){n.flags&=32767,Nl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Nl=e;return}Nl=e=n}while(e!==null);Vl=6,Nl=null}function Pu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do zu();while(tu!==0);if(jl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=zr,Re(e,n,o,s,c,l),e===Ml&&(Nl=Ml=null,Pl=0),ru=t,nu=e,iu=n,au=o,ou=i,su=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Ju(_e,function(){return Bu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,s=jl,jl|=4;try{Xc(e,t,n)}finally{jl=s,F.p=i,P.T=r}}tu=1,Fu(),Iu(),Lu()}}function Fu(){if(tu===1){tu=0;var e=nu,t=ru,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=jl;jl|=4;try{ll(t,e);var a=zd,o=mr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&pr(s.ownerDocument.documentElement,s)){if(c!==null&&hr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=fr(s,h),v=fr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{jl=i,F.p=r,P.T=n}}e.current=t,tu=2}}function Iu(){if(tu===2){tu=0;var e=nu,t=ru,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=jl;jl|=4;try{Zc(e,t.alternate,t)}finally{jl=i,F.p=r,P.T=n}}tu=3}}function Lu(){if(tu===4||tu===3){tu=0,pe();var e=nu,t=ru,n=iu,r=su;t.subtreeFlags&10256||t.flags&10256?tu=5:(tu=0,ru=nu=null,Ru(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(eu=null),Ue(n),t=t.stateNode,Ce&&typeof Ce.onCommitFiberRoot==`function`)try{Ce.onCommitFiberRoot(Se,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}iu&3&&zu(),td(e),i=e.pendingLanes,n&261930&&i&42?e===lu?cu++:(cu=0,lu=e):cu=0,nd(0,!1)}}function Ru(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Zi(t)))}function zu(){return Fu(),Iu(),Lu(),Bu()}function Bu(){if(tu!==5)return!1;var e=nu,t=au;au=0;var n=Ue(iu),r=P.T,i=F.p;try{F.p=32>n?32:n,P.T=null,n=ou,ou=null;var o=nu,s=iu;if(tu=0,ru=nu=null,iu=0,jl&6)throw Error(a(331));var c=jl;if(jl|=4,El(o.current),vl(o,o.current,s,n),jl=c,nd(0,!1),Ce&&typeof Ce.onPostCommitFiberRoot==`function`)try{Ce.onPostCommitFiberRoot(Se,o)}catch{}return!0}finally{F.p=i,P.T=r,Ru(e,t)}}function Vu(e,t,n){t=ai(n,t),t=Hs(e.stateNode,t,2),e=Ma(e,t,2),e!==null&&(Le(e,2),td(e))}function Hu(e,t,n){if(e.tag===3)Vu(e,e,n);else for(;t!==null;){if(t.tag===3){Vu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(eu===null||!eu.has(r))){e=ai(n,e),n=Us(2),r=Ma(t,n,2),r!==null&&(Ws(n,r,t,e),Le(r,2),td(r));break}}t=t.return}}function Uu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Al;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(zl=!0,i.add(n),e=Wu.bind(null,e,t,n),t.then(e,e))}function Wu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ml===e&&(Pl&n)===n&&(Vl===4||Vl===3&&(Pl&62914560)===Pl&&300>J()-Xl?!(jl&2)&&yu(e,0):Wl|=n,Kl===Pl&&(Kl=0)),td(e)}function Gu(e,t){t===0&&(t=Fe()),e=Wr(e,t),e!==null&&(Le(e,t),td(e))}function Ku(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gu(e,n)}function qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Gu(e,n)}function Ju(e,t){return ue(e,t)}var Yu=null,Xu=null,Zu=!1,Qu=!1,$u=!1,ed=0;function td(e){e!==Xu&&e.next===null&&(Xu===null?Yu=Xu=e:Xu=Xu.next=e),Qu=!0,Zu||(Zu=!0,cd())}function nd(e,t){if(!$u&&Qu){$u=!0;do for(var n=!1,r=Yu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Te(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,sd(r,a))}else a=Pl,a=Me(r,r===Ml?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ne(r,a)||(n=!0,sd(r,a));r=r.next}while(n);$u=!1}}function rd(){id()}function id(){Qu=Zu=!1;var e=0;ed!==0&&Gd()&&(e=ed);for(var t=J(),n=null,r=Yu;r!==null;){var i=r.next,a=ad(r,t);a===0?(r.next=null,n===null?Yu=i:n.next=i,i===null&&(Xu=n)):(n=r,(e!==0||a&3)&&(Qu=!0)),r=i}tu!==0&&tu!==5||nd(e,!1),ed!==0&&(ed=0)}function ad(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Te(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Pe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ml,n=Pl,n=Me(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Fl===2||Fl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&de(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ne(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&de(r),Ue(n)){case 2:case 8:n=ge;break;case 32:n=_e;break;case 268435456:n=ye;break;default:n=_e}return r=od.bind(null,e),n=ue(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&de(r),e.callbackPriority=2,e.callbackNode=null,2}function od(e,t){if(tu!==0&&tu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zu()&&e.callbackNode!==n)return null;var r=Pl;return r=Me(e,e===Ml?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(pu(e,r,t),ad(e,J()),e.callbackNode!=null&&e.callbackNode===n?od.bind(null,e):null)}function sd(e,t){if(zu())return null;pu(e,t,!0)}function cd(){Yd(function(){jl&6?ue(he,rd):id()})}function ld(){if(ed===0){var e=ea;e===0&&(e=Oe,Oe<<=1,!(Oe&261888)&&(Oe=256)),ed=e}return ed}function ud(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:zt(``+e)}function dd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function fd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=ud((i[Je]||null).action),o=r.submitter;o&&(t=(t=o[Je]||null)?ud(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ed!==0){var e=o?dd(i,o):new FormData(i);ms(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?dd(i,o):new FormData(i),ms(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var pd=0;pd<Fr.length;pd++){var md=Fr[pd];Ir(md.toLowerCase(),`on`+(md[0].toUpperCase()+md.slice(1)))}Ir(Dr,`onAnimationEnd`),Ir(Or,`onAnimationIteration`),Ir(kr,`onAnimationStart`),Ir(`dblclick`,`onDoubleClick`),Ir(`focusin`,`onFocus`),Ir(`focusout`,`onBlur`),Ir(Ar,`onTransitionRun`),Ir(jr,`onTransitionStart`),Ir(Mr,`onTransitionCancel`),Ir(Nr,`onTransitionEnd`),ut(`onMouseEnter`,[`mouseout`,`mouseover`]),ut(`onMouseLeave`,[`mouseout`,`mouseover`]),ut(`onPointerEnter`,[`pointerout`,`pointerover`]),ut(`onPointerLeave`,[`pointerout`,`pointerover`]),lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var hd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),gd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(hd));function _d(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Lr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Lr(e)}i.currentTarget=null,a=c}}}}function vd(e,t){var n=t[Xe];n===void 0&&(n=t[Xe]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,st.forEach(function(t){t!==`selectionchange`&&(gd.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!Xt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=nt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}qt(function(){var r=a,i=Ht(n),o=[];a:{var c=Pr.get(e);if(c!==void 0){var l=cn,u=e;switch(e){case`keypress`:if(nn(n)===0)break a;case`keydown`:case`keyup`:l=En;break;case`focusin`:u=`focus`,l=_n;break;case`focusout`:u=`blur`,l=_n;break;case`beforeblur`:case`afterblur`:l=_n;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=On;break;case Dr:case Or:case kr:l=vn;break;case Nr:l=kn;break;case`scroll`:case`scrollend`:l=un;break;case`wheel`:l=An;break;case`copy`:case`cut`:case`paste`:l=yn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Dn;break;case`toggle`:case`beforetoggle`:l=jn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Jt(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Vt&&(u=n.relatedTarget||n.fromElement)&&(nt(u)||u[Ye]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?nt(u):null,u!==null&&(f=s(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Dn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:it(l),h=u==null?c:it(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,nt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(o,c,l,d,!1),u!==null&&f!==null&&Dd(o,f,u,d,!0)}}a:{if(c=r?it(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=Zn;else if(Gn(c))if(Qn)v=sr;else{v=ar;var y=ir}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&It(r.elementType)&&(v=Zn):v=or;if(v&&=v(e,r)){Kn(o,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ot(c,`number`,c.value)}switch(y=r?it(r):window,e){case`focusin`:(Gn(y)||y.contentEditable===`true`)&&(_r=y,vr=r,yr=null);break;case`focusout`:yr=vr=_r=null;break;case`mousedown`:br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:br=!1,xr(o,n,i);break;case`selectionchange`:if(gr)break;case`keydown`:case`keyup`:xr(o,n,i)}var b;if(Nn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Vn?zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(In&&n.locale!==`ko`&&(Vn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Vn&&(b=tn()):(Qt=i,$t=`value`in Qt?Qt.value:Qt.textContent,Vn=!0)),y=Td(r,x),0<y.length&&(x=new bn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Bn(n),b!==null&&(x.data=b)))),(b=Fn?Hn(e,n):Un(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new bn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),fd(o,e,r,n,i)}_d(o,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Jt(e,n),i!=null&&r.unshift(wd(e,i,a)),i=Jt(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Jt(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=Jt(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
10
|
+
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Mt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Mt(e,``+r);break;case`className`:gt(e,`class`,r);break;case`tabIndex`:gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:gt(e,n,r);break;case`style`:Ft(e,r,o);break;case`data`:if(t!==`object`){gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,i.name,i,null),Md(e,t,`formEncType`,i.formEncType,i,null),Md(e,t,`formMethod`,i.formMethod,i,null),Md(e,t,`formTarget`,i.formTarget,i,null)):(Md(e,t,`encType`,i.encType,i,null),Md(e,t,`method`,i.method,i,null),Md(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Bt);break;case`onScroll`:r!=null&&vd(`scroll`,e);break;case`onScrollEnd`:r!=null&&vd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:vd(`beforetoggle`,e),vd(`toggle`,e),ht(e,`popover`,r);break;case`xlinkActuate`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:_t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:_t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:_t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:ht(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Lt.get(n)||n,ht(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:Ft(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Mt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Mt(e,``+r);break;case`onScroll`:r!=null&&vd(`scroll`,e);break;case`onScrollEnd`:r!=null&&vd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Bt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[Je]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):ht(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:vd(`error`,e),vd(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,o,s,n,null)}}i&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:vd(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Md(e,t,r,d,n,null)}}Dt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in vd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&kt(e,!!r,n,!0):kt(e,!!r,t,!1);return;case`textarea`:for(s in vd(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Md(e,t,s,c,n,null)}jt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:vd(`beforetoggle`,e),vd(`toggle`,e),vd(`cancel`,e),vd(`close`,e);break;case`iframe`:case`object`:vd(`load`,e);break;case`video`:case`audio`:for(r=0;r<hd.length;r++)vd(hd[r],e);break;case`image`:vd(`error`,e),vd(`load`,e);break;case`details`:vd(`toggle`,e);break;case`embed`:case`source`:case`link`:vd(`error`,e),vd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,u,r,n,null)}return;default:if(It(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Et(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?kt(e,!!n,n?[]:``,!1):kt(e,!!n,t,!0)):kt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Md(e,t,s,i,r,o)}At(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(It(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);tt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=_u();return e||t}function yf(e){var t=rt(e);t!==null&&t.tag===5&&t.type===`form`?gs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Tt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),ot(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Tt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Tt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Tt(n.imageSizes)+`"]`)):i+=`[href="`+Tt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),ot(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Tt(r)+`"][href="`+Tt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),ot(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=at(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);ot(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=at(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ot(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=at(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ot(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=W.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=at(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=at(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=at(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Tt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),ot(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Tt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Tt(n.href)+`"]`);if(r)return t.instance=r,ot(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ot(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,ot(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,ot(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),ot(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[et]||a[qe]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ot(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:x,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ie(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ie(0),this.hiddenUpdates=Ie(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Yr(3,null,null,t),e.current=a,a.stateNode=e,t=Xi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ka(a),e}function tp(e){return e?(e=qr,e):qr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=ja(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ma(e,r,t),n!==null&&(fu(n,e,t),Na(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Wr(e,67108864);t!==null&&fu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=uu();t=He(t);var n=Wr(e,t);n!==null&&fu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=rt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=je(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Te(o);s.entanglements[1]|=c,o&=~c}td(a),!(jl&6)&&(Ql=J()+500,nd(0,!1))}}break;case 31:case 13:s=Wr(a,2),s!==null&&fu(s,a,2),_u(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Ht(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=nt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(me()){case he:return 2;case ge:return 8;case _e:case ve:return 32;case ye:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=rt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=nt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,Ge(e.priority,function(){op(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,Ge(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Vt=r,n.target.dispatchEvent(r),Vt=null}else return t=rt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=rt(n);a!==null&&(e.splice(t,3),t-=3,ms(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Je]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Je]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,uu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),_u(),t[Ye]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=We();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(a(527,Lp,`19.2.5`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Se=zp.inject(Rp),Ce=zp}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=Ls,s=Rs,c=zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,s,c,Pp),e[Ye]=t.current,xd(e),new Fp(t)}})),Ko=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Go()})),qo=Dr(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Jo=Dr(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Yo=Dr(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),Xo=Dr(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),Z=a(),Q=e(i(),1),Zo=e(Vr(),1),Qo=Ko(),$=o(),$o=[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]];Dr(`bot`,$o);var es=Dr(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),ts=Dr(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),ns=Dr(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),rs=Dr(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),is=Dr(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),as=Dr(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),os=Dr(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ss=Dr(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),cs=Dr(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),ls=Dr(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),us=Dr(`contrast`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 18a6 6 0 0 0 0-12v12z`,key:`j4l70d`}]]),ds=Dr(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),fs=Dr(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),ps=Dr(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),ms=Dr(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),hs=Dr(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),gs=Dr(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),_s=Dr(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),vs=Dr(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),ys=Dr(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),bs=Dr(`folder-cog`,[[`path`,{d:`M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3`,key:`128dxu`}],[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),xs=Dr(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ss=Dr(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Cs=Dr(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),ws=Dr(`grid-2x2-x`,[[`path`,{d:`M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3`,key:`11za1p`}],[`path`,{d:`m16 16 5 5`,key:`8tpb07`}],[`path`,{d:`m16 21 5-5`,key:`193jll`}]]),Ts=Dr(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Es=Dr(`highlighter`,[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]),Ds=Dr(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),Os=Dr(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ks=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],As=Dr(`link-2`,ks),js=Dr(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),Ms=Dr(`list-collapse`,[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]),Ns=Dr(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),Ps=Dr(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Fs=Dr(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),Is=Dr(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Ls=Dr(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Rs=Dr(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),zs=Dr(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Bs=Dr(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Vs=Dr(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),Hs=Dr(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),Us=Dr(`rat`,[[`path`,{d:`M13 22H4a2 2 0 0 1 0-4h12`,key:`bt3f23`}],[`path`,{d:`M13.236 18a3 3 0 0 0-2.2-5`,key:`1tbvmo`}],[`path`,{d:`M16 9h.01`,key:`1bdo4e`}],[`path`,{d:`M16.82 3.94a3 3 0 1 1 3.237 4.868l1.815 2.587a1.5 1.5 0 0 1-1.5 2.1l-2.872-.453a3 3 0 0 0-3.5 3`,key:`9ch7kn`}],[`path`,{d:`M17 4.988a3 3 0 1 0-5.2 2.052A7 7 0 0 0 4 14.015 4 4 0 0 0 8 18`,key:`3s7e9i`}]]),Ws=Dr(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Gs=Dr(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),Ks=Dr(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),qs=Dr(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Js=Dr(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ys=Dr(`shrimp`,[[`path`,{d:`M11 12h.01`,key:`1lr4k6`}],[`path`,{d:`M13 22c.5-.5 1.12-1 2.5-1-1.38 0-2-.5-2.5-1`,key:`fatpdi`}],[`path`,{d:`M14 2a3.28 3.28 0 0 1-3.227 1.798l-6.17-.561A2.387 2.387 0 1 0 4.387 8H15.5a1 1 0 0 1 0 13 1 1 0 0 0 0-5H12a7 7 0 0 1-7-7V8`,key:`kehrqe`}],[`path`,{d:`M14 8a8.5 8.5 0 0 1 0 8`,key:`1imjx2`}],[`path`,{d:`M16 16c2 0 4.5-4 4-6`,key:`z0nejz`}]]),Xs=Dr(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),Zs=Dr(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Qs=Dr(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),$s=Dr(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),ec=Dr(`squirrel`,[[`path`,{d:`M15.236 22a3 3 0 0 0-2.2-5`,key:`21bitc`}],[`path`,{d:`M16 20a3 3 0 0 1 3-3h1a2 2 0 0 0 2-2v-2a4 4 0 0 0-4-4V4`,key:`oh0fg0`}],[`path`,{d:`M18 13h.01`,key:`9veqaj`}],[`path`,{d:`M18 6a4 4 0 0 0-4 4 7 7 0 0 0-7 7c0-5 4-5 4-10.5a4.5 4.5 0 1 0-9 0 2.5 2.5 0 0 0 5 0C7 10 3 11 3 17c0 2.8 2.2 5 5 5h10`,key:`980v8a`}]]),tc=Dr(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),nc=Dr(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),rc=Dr(`table-properties`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),ic=Dr(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),ac=Dr(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),oc=Dr(`underline`,[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]),sc=Dr(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),cc=Dr(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),lc=Dr(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]);function uc(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=typeof window<`u`?window.okDesktop:void 0;if(!e)return;let t=!1;return e.state.query().then(e=>{t||n(e.channel)}).catch(dc),()=>{t=!0}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={channel:t},e[2]=t,e[3]=a),a}function dc(e){console.warn(`[use-update-channel] bridge.state.query() failed`,e)}function fc(e,t){return e instanceof Error&&e.message?e.message:t}async function pc(e,t,n,r=`action`){try{n(null),await e()}catch(e){console.error(`[${r}] action failed:`,e),n(fc(e,t))}}async function mc(e,t,n=Fa,r=`action`){await pc(e,t,e=>{e!==null&&n.error(e)},r)}async function hc(e){try{let t=await e.json(),n=Wt.safeParse(t);if(n.success)return n.data.title}catch{}}async function gc(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}function _c(e){let t=e.split(`
|
|
11
|
+
`);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function vc(){return{async status(e){let t=e?.host??`github.com`,n=await gc(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await hc(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t;return r.authenticated===!0&&typeof r.login==`string`?{authenticated:!0,host:i,login:r.login,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0}:{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0}},async repos(e){let t=e?.host??`github.com`,n=await gc(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await hc(n)??`Failed to fetch repositories`};let r=_c(await n.text());if(r&&r.type===`error`&&r.problem&&typeof r.problem==`object`){let e=r.problem;return{ok:!1,error:e.detail||e.title||`Failed to fetch repositories`}}if(!r||!Array.isArray(r.repos))return{ok:!1,error:`Failed to fetch repositories`};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}}}}function yc(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function bc(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
|
|
12
|
+
`);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function xc(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}function Sc(){return{start(){return xc((e,t)=>{(async()=>{try{let n=await fetch(`/api/local-op/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({json:!0}),signal:t});if(!n.ok){let t=`Failed to start sign-in — try again`;try{let e=await n.json(),r=Wt.safeParse(e);r.success&&(t=r.data.title)}catch{}e({type:`error`,message:t});return}if(!n.body){e({type:`error`,message:`Failed to start sign-in — try again`});return}!await bc(n.body,t=>{let n;try{n=JSON.parse(t)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,t.slice(0,100)),`continue`}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let t=n.problem;return e({type:`error`,message:t?.detail||t?.title||`Unknown error`}),`terminal`}let r=n;return e(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})&&!t.aborted&&e({type:`error`,message:`Sign-in stream ended without confirmation — please try again`})}catch(t){if(t instanceof Error&&t.name===`AbortError`)return;e({type:`error`,message:`Connection error — try again`})}})()})}}}function Cc(e){return{start(){return e.localOp.auth.start()}}}function wc(){return{start(e){return xc((t,n)=>{(async()=>{try{let r=await fetch(`/api/local-op/clone`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e.url,dir:e.dir||void 0}),signal:n});if(!r.ok){let e=`Clone failed — check the URL and try again (${r.status})`;try{let t=await r.json(),n=Wt.safeParse(t);n.success&&(e=`Clone failed: ${n.data.title}`)}catch{}t({type:`error`,message:e});return}if(!r.body){t({type:`error`,message:`Clone failed — empty response body`});return}let i=r.body.getReader(),a=new TextDecoder,o=``;for(;;){let{done:e,value:r}=await i.read();if(e)break;o+=a.decode(r,{stream:!0});let s=o.split(`
|
|
13
|
+
`);o=s.pop()??``;for(let e of s){if(!e.trim())continue;let n;try{n=JSON.parse(e)}catch{console.warn(`[clone-transport] Dropped unparseable NDJSON line:`,e.slice(0,100));continue}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let e=n.problem;t({type:`error`,message:e?.detail||e?.title||`Unknown error`});break}t(n)}if(n.aborted)break}n.aborted||t({type:`error`,message:`Clone stream ended unexpectedly — check if the clone completed`})}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;t({type:`error`,message:`Clone failed — connection error`})}})()})}}}function Tc(e){return{start(t){return e.localOp.clone.start(t)}}}var Ec=`ContextMenu`,[Dc,Oc]=Ir(Ec,[Vi]),kc=Vi(),[Ac,jc]=Dc(Ec),Mc=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=Q.useState(!1),c=kc(t),l=Rr(r),u=Q.useCallback(e=>{s(e),l(e)},[l]);return(0,Z.jsx)(Ac,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,Z.jsx)(Qi,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};Mc.displayName=Ec;var Nc=`ContextMenuTrigger`,Pc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=jc(Nc,n),o=kc(n),s=Q.useRef({x:0,y:0}),c=Q.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=Q.useRef(0),u=Q.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return Q.useEffect(()=>u,[u]),Q.useEffect(()=>void(r&&u()),[r,u]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($i,{...o,virtualRef:c}),(0,Z.jsx)(Nr.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:Mr(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:Mr(e.onPointerDown,ll(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:Mr(e.onPointerMove,ll(u)),onPointerCancel:r?e.onPointerCancel:Mr(e.onPointerCancel,ll(u)),onPointerUp:r?e.onPointerUp:Mr(e.onPointerUp,ll(u))})]})});Pc.displayName=Nc;var Fc=`ContextMenuPortal`,Ic=e=>{let{__scopeContextMenu:t,...n}=e,r=kc(t);return(0,Z.jsx)(Ji,{...r,...n})};Ic.displayName=Fc;var Lc=`ContextMenuContent`,Rc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=jc(Lc,n),a=kc(n),o=Q.useRef(!1);return(0,Z.jsx)(fa,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Rc.displayName=Lc;var zc=`ContextMenuGroup`,Bc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(Ui,{...i,...r,ref:t})});Bc.displayName=zc;var Vc=`ContextMenuLabel`,Hc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(Gi,{...i,...r,ref:t})});Hc.displayName=Vc;var Uc=`ContextMenuItem`,Wc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(na,{...i,...r,ref:t})});Wc.displayName=Uc;var Gc=`ContextMenuCheckboxItem`,Kc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(oa,{...i,...r,ref:t})});Kc.displayName=Gc;var qc=`ContextMenuRadioGroup`,Jc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(ca,{...i,...r,ref:t})});Jc.displayName=qc;var Yc=`ContextMenuRadioItem`,Xc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(ia,{...i,...r,ref:t})});Xc.displayName=Yc;var Zc=`ContextMenuItemIndicator`,Qc=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(ha,{...i,...r,ref:t})});Qc.displayName=Zc;var $c=`ContextMenuSeparator`,el=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(Xi,{...i,...r,ref:t})});el.displayName=$c;var tl=`ContextMenuArrow`,nl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(zi,{...i,...r,ref:t})});nl.displayName=tl;var rl=`ContextMenuSub`,il=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=kc(t),[s,c]=Br({prop:i,defaultProp:a??!1,onChange:r,caller:rl});return(0,Z.jsx)(Li,{...o,open:s,onOpenChange:c,children:n})};il.displayName=rl;var al=`ContextMenuSubTrigger`,ol=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(Ca,{...i,...r,ref:t})});ol.displayName=al;var sl=`ContextMenuSubContent`,cl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=kc(n);return(0,Z.jsx)(_a,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});cl.displayName=sl;function ll(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var ul=Mc,dl=Pc,fl=Ic,pl=Rc,ml=Wc,hl=`Radio`,[gl,_l]=Ir(hl),[vl,yl]=gl(hl),bl=Q.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,form:l,...u}=e,[d,f]=Q.useState(null),p=Hr(t,e=>f(e)),m=Q.useRef(!1),h=d?l||!!d.closest(`form`):!0;return(0,Z.jsxs)(vl,{scope:n,checked:i,disabled:o,children:[(0,Z.jsx)(Nr.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":Tl(i),"data-disabled":o?``:void 0,disabled:o,value:s,...u,ref:p,onClick:Mr(e.onClick,e=>{i||c?.(),h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),h&&(0,Z.jsx)(wl,{control:d,bubbles:!m.current,name:r,value:s,checked:i,required:a,disabled:o,form:l,style:{transform:`translateX(-100%)`}})]})});bl.displayName=hl;var xl=`RadioIndicator`,Sl=Q.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=yl(xl,n);return(0,Z.jsx)(Fr,{present:r||a.checked,children:(0,Z.jsx)(Nr.span,{"data-state":Tl(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});Sl.displayName=xl;var Cl=`RadioBubbleInput`,wl=Q.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=Q.useRef(null),s=Hr(o,a),c=Oa(n),l=Ra(t);return Q.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,Z.jsx)(Nr.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});wl.displayName=Cl;function Tl(e){return e?`checked`:`unchecked`}var El=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Dl=`RadioGroup`,[Ol,kl]=Ir(Dl,[Ha,_l]),Al=Ha(),jl=_l(),[Ml,Nl]=Ol(Dl),Pl=Q.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,p=Al(n),m=rn(l),[h,g]=Br({prop:a,defaultProp:i??null,onChange:d,caller:Dl});return(0,Z.jsx)(Ml,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,Z.jsx)(Ua,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,Z.jsx)(Nr.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});Pl.displayName=Dl;var Fl=`RadioGroupItem`,Il=Q.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=Nl(Fl,n),o=a.disabled||r,s=Al(n),c=jl(n),l=Q.useRef(null),u=Hr(t,l),d=a.value===i.value,f=Q.useRef(!1);return Q.useEffect(()=>{let e=e=>{El.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,Z.jsx)(Ga,{asChild:!0,...s,focusable:!o,active:d,children:(0,Z.jsx)(bl,{disabled:o,required:a.required,checked:d,...c,...i,name:a.name,ref:u,onCheck:()=>a.onValueChange(i.value),onKeyDown:Mr(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:Mr(i.onFocus,()=>{f.current&&l.current?.click()})})})});Il.displayName=Fl;var Ll=`RadioGroupIndicator`,Rl=Q.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Z.jsx)(Sl,{...jl(n),...r,ref:t})});Rl.displayName=Ll;var zl=Pl,Bl=Il,Vl=Rl;async function Hl(e){try{await navigator.clipboard.writeText(e)}catch{}}var Ul=120*1e3;function Wl(e){let t=(0,$.c)(26),{onSuccess:n,onCancel:r,transport:i}=e,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(`https://github.com/login/device`),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(Ul),_=(0,Q.useRef)(null),v=(0,Q.useRef)(null),y;t[0]!==n||t[1]!==i?(y=async function(){f(null),m(!0);try{let e=i.start();_.current=e.cancel;let t=e.events[Symbol.asyncIterator](),r=!1,a=await t.next();for(;!a.done;){let e=a.value;if(e.type===`verification`)o(e.user_code),c(e.verification_uri),g(e.expires_in*1e3),Hl(e.user_code).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)});else if(e.type===`complete`){r=!0,m(!1),n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){r=!0,f(e.message),m(!1);break}a=await t.next()}r||(f(`Sign-in stream ended without confirmation — please try again`),m(!1))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&f(`Connection error — try again`),m(!1)}},t[0]=n,t[1]=i,t[2]=y):y=t[2];let b=y,x;t[3]===b?x=t[4]:(x=()=>{let e=!1;return queueMicrotask(()=>{e||b()}),()=>{e=!0,_.current?.(),_.current=null,v.current&&clearInterval(v.current)}},t[3]=b,t[4]=x);let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[5]=S):S=t[5],(0,Q.useEffect)(x,S);let C,w;t[6]===a?(C=t[7],w=t[8]):(C=()=>{if(!a)return;let e=Date.now();return v.current=setInterval(()=>{let t=Ul-(Date.now()-e);t<=0?(g(0),v.current&&clearInterval(v.current),f(`Code expired — please try again`)):g(t)},1e3),()=>{v.current&&clearInterval(v.current)}},w=[a],t[6]=a,t[7]=C,t[8]=w),(0,Q.useEffect)(C,w);let T=Math.floor(h/6e4),E=Math.floor(h%6e4/1e3),D;t[9]===E?D=t[10]:(D=E.toString().padStart(2,`0`),t[9]=E,t[10]=D);let O=`${T}:${D}`,k;t[11]!==l||t[12]!==d||t[13]!==O||t[14]!==a||t[15]!==s?(k=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Open`,` `,(0,Z.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>xa(e,s),onAuxClick:e=>xa(e,s),className:`underline underline-offset-2`,children:s}),` `,`and enter this code:`]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`code`,{className:`flex-1 text-center text-2xl font-mono font-bold tracking-widest border rounded-md py-3 bg-muted`,children:a}),(0,Z.jsx)(zr,{variant:`outline`,size:`sm`,onClick:()=>void Hl(a).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)}),children:l?`Copied!`:`Copy`})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),`Waiting for authorization`]}),(0,Z.jsxs)(`span`,{children:[`Expires in `,O]})]})]}):(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:d?null:`Starting sign-in flow`}),t[11]=l,t[12]=d,t[13]=O,t[14]=a,t[15]=s,t[16]=k):k=t[16];let A;t[17]===d?A=t[18]:(A=d&&(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,children:d}),t[17]=d,t[18]=A);let j;t[19]!==r||t[20]!==p?(j=p&&(0,Z.jsx)(zr,{variant:`ghost`,size:`sm`,onClick:r,children:`Cancel`}),t[19]=r,t[20]=p,t[21]=j):j=t[21];let M;return t[22]!==k||t[23]!==A||t[24]!==j?(M=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[k,A,j]}),t[22]=k,t[23]=A,t[24]=j,t[25]=M):M=t[25],M}function Gl(e){let t=(0,$.c)(32),{onSuccess:n,onCancel:r}=e,[i,a]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(null),d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>()=>{u.current?.abort()},f=[],t[0]=d,t[1]=f):(d=t[0],f=t[1]),(0,Q.useEffect)(d,f);let p;t[2]!==n||t[3]!==i?(p=async function(){if(!i.trim()){l(`Paste a personal access token`);return}u.current?.abort();let e=new AbortController;u.current=e,s(!0),l(null);try{let t=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pat:i.trim()}),signal:e.signal});if(!t.ok){let e=`Invalid token — check that it has repo scope`;try{let n=await t.json(),r=Wt.safeParse(n);r.success&&(e=r.data.title)}catch{}l(e),s(!1);return}if(!t.body){l(`Invalid token — check that it has repo scope`),s(!1);return}await bc(t.body,e=>{let t;try{t=JSON.parse(e)}catch{return`continue`}return t.type===`complete`?(n({login:t.login,name:t.name,email:t.email}),s(!1),`terminal`):`continue`})||l(`No response — try again`)}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&l(`Connection error — try again`)}s(!1)},t[2]=n,t[3]=i,t[4]=p):p=t[4];let m=p,h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`a`,{href:`https://github.com/settings/tokens`,target:`_blank`,rel:`noopener noreferrer`,onClick:ql,onAuxClick:Kl,className:`underline underline-offset-2`,children:`github.com/settings/tokens`}),t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Create a token at`,` `,h,` `,`with `,(0,Z.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`,children:`repo`}),` scope.`]}),t[6]=g):g=t[6];let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>a(e.target.value),t[7]=_):_=t[7];let v;t[8]===m?v=t[9]:(v=e=>{e.key===`Enter`&&m()},t[8]=m,t[9]=v);let y;t[10]!==o||t[11]!==i||t[12]!==v?(y=(0,Z.jsx)(ao,{type:`password`,"aria-label":`Personal access token`,placeholder:`ghp_…`,value:i,onChange:_,disabled:o,onKeyDown:v}),t[10]=o,t[11]=i,t[12]=v,t[13]=y):y=t[13];let b;t[14]===c?b=t[15]:(b=c&&(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,children:c}),t[14]=c,t[15]=b);let x;t[16]===m?x=t[17]:(x=()=>void m(),t[16]=m,t[17]=x);let S=o?`Validating`:`Add token`,C;t[18]!==o||t[19]!==x||t[20]!==S?(C=(0,Z.jsx)(zr,{className:`flex-1`,onClick:x,disabled:o,children:S}),t[18]=o,t[19]=x,t[20]=S,t[21]=C):C=t[21];let w;t[22]!==o||t[23]!==r?(w=(0,Z.jsx)(zr,{variant:`ghost`,onClick:r,disabled:o,children:`Cancel`}),t[22]=o,t[23]=r,t[24]=w):w=t[24];let T;t[25]!==C||t[26]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[C,w]}),t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;return t[28]!==T||t[29]!==y||t[30]!==b?(E=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[g,y,b,T]}),t[28]=T,t[29]=y,t[30]=b,t[31]=E):E=t[31],E}function Kl(e){return xa(e,`https://github.com/settings/tokens`)}function ql(e){return xa(e,`https://github.com/settings/tokens`)}function Jl(e){let t=(0,$.c)(27),{login:n,onSave:r,onSkip:i}=e,[a,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(``),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Before syncing, set your identity for git commits:`}),t[0]=l):l=t[0];let u=`Name (e.g. ${n})`,d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[1]=d):d=t[1];let f;t[2]!==a||t[3]!==u?(f=(0,Z.jsx)(ao,{"aria-label":`Name`,placeholder:u,value:a,onChange:d}),t[2]=a,t[3]=u,t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>c(e.target.value),t[5]=p):p=t[5];let m;t[6]===s?m=t[7]:(m=(0,Z.jsx)(ao,{type:`email`,"aria-label":`Email`,placeholder:`Email`,value:s,onChange:p}),t[6]=s,t[7]=m);let h;t[8]!==s||t[9]!==a||t[10]!==r?(h=()=>r(a.trim(),s.trim()),t[8]=s,t[9]=a,t[10]=r,t[11]=h):h=t[11];let g;t[12]!==s||t[13]!==a?(g=!a.trim()||!s.trim(),t[12]=s,t[13]=a,t[14]=g):g=t[14];let _;t[15]!==h||t[16]!==g?(_=(0,Z.jsx)(zr,{className:`flex-1`,onClick:h,disabled:g,children:`Save`}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]===i?v=t[19]:(v=(0,Z.jsx)(zr,{variant:`ghost`,onClick:i,children:`Skip`}),t[18]=i,t[19]=v);let y;t[20]!==v||t[21]!==_?(y=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[_,v]}),t[20]=v,t[21]=_,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==f||t[25]!==m?(b=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[l,f,m,y]}),t[23]=y,t[24]=f,t[25]=m,t[26]=b):b=t[26],b}function Yl(e){let t=(0,$.c)(42),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s}=e,c;t[0]===s?c=t[1]:(c=s??Sc(),t[0]=s,t[1]=c);let l=c,[u,d]=(0,Q.useState)(`device`),[f,p]=(0,Q.useState)(`auth`),[m,h]=(0,Q.useState)(null),g,_;t[2]===n?(g=t[3],_=t[4]):(g=()=>{n&&(d(`device`),p(`auth`),h(null))},_=[n],t[2]=n,t[3]=g,t[4]=_),(0,Q.useEffect)(g,_);let v;t[5]!==a||t[6]!==r||t[7]!==i?(v=function(e){h(e),a&&(!e.name||!e.email)?p(`identity`):(p(`done`),i?.(e),r(!1),Fa.success(`Signed in as @${e.login}`))},t[5]=a,t[6]=r,t[7]=i,t[8]=v):v=t[8];let y=v,b;t[9]!==m||t[10]!==r||t[11]!==i?(b=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(Xl);let n={...m??{login:``},name:e,email:t};p(`done`),i?.(n),r(!1),Fa.success(`Signed in as @${n.login}`)},t[9]=m,t[10]=r,t[11]=i,t[12]=b):b=t[12];let x=b,S;t[13]!==m||t[14]!==r||t[15]!==i?(S=function(){m&&(p(`done`),i?.(m),r(!1),Fa.success(`Signed in as @${m.login}`))},t[13]=m,t[14]=r,t[15]=i,t[16]=S):S=t[16];let C=S,w;t[17]===r?w=t[18]:(w=function(){r(!1)},t[17]=r,t[18]=w);let T=w,E=o?`Re-authenticate with GitHub`:`Sign in to GitHub`,D;t[19]===E?D=t[20]:(D=(0,Z.jsx)(ro,{children:(0,Z.jsx)($a,{children:E})}),t[19]=E,t[20]=D);let O;t[21]!==y||t[22]!==T||t[23]!==l||t[24]!==f||t[25]!==u?(O=f===`auth`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex gap-1 border-b pb-2 mb-1`,children:[(0,Z.jsx)(zr,{variant:u===`device`?`secondary`:`ghost`,size:`sm`,onClick:()=>d(`device`),children:`GitHub App`}),(0,Z.jsx)(zr,{variant:u===`pat`?`secondary`:`ghost`,size:`sm`,onClick:()=>d(`pat`),children:`Token`})]}),u===`device`?(0,Z.jsx)(Wl,{onSuccess:y,onCancel:T,transport:l}):(0,Z.jsx)(Gl,{onSuccess:y,onCancel:T})]}),t[21]=y,t[22]=T,t[23]=l,t[24]=f,t[25]=u,t[26]=O):O=t[26];let k;t[27]!==m||t[28]!==x||t[29]!==C||t[30]!==f?(k=f===`identity`&&m&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-sm font-medium`,children:[`Signed in as @`,m.login]}),(0,Z.jsx)(Jl,{login:m.login,onSave:x,onSkip:C})]}),t[27]=m,t[28]=x,t[29]=C,t[30]=f,t[31]=k):k=t[31];let A;t[32]!==k||t[33]!==O?(A=(0,Z.jsxs)(to,{children:[O,k]}),t[32]=k,t[33]=O,t[34]=A):A=t[34];let j;t[35]!==A||t[36]!==D?(j=(0,Z.jsxs)(eo,{className:`sm:max-w-md`,children:[D,A]}),t[35]=A,t[36]=D,t[37]=j):j=t[37];let M;return t[38]!==r||t[39]!==n||t[40]!==j?(M=(0,Z.jsx)(io,{open:n,onOpenChange:r,children:j}),t[38]=r,t[39]=n,t[40]=j,t[41]=M):M=t[41],M}function Xl(){}function Zl(e){let t=(0,$.c)(2),{className:n}=e,{channel:r}=uc();if(r!==`beta`)return null;let i;return t[0]===n?i=t[1]:(i=(0,Z.jsx)(M,{variant:`secondary`,"aria-label":`Beta channel`,"data-testid":`beta-badge`,className:n,children:`BETA`}),t[0]=n,t[1]=i),i}function Ql(e){switch(e){case`receiving`:return`Receiving objects`;case`resolving`:return`Resolving deltas`;case`checking`:return`Checking out files`;case`init`:return`Initializing project`;case`done`:return`Complete`;default:return`Cloning`}}function $l(e){let t=e.trim();if(/^[\w.-]+\/[\w.-]+$/.test(t))return t.split(`/`)[1];try{return new URL(t.replace(/^git@([^:]+):/,`https://$1/`)).pathname.replace(/\.git$/,``).split(`/`).pop()??`repo`}catch{return t.split(`/`).pop()?.replace(/\.git$/,``)??`repo`}}function eu(e){let t=(0,$.c)(94),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c}=e,l;t[0]===o?l=t[1]:(l=o??wc(),t[0]=o,t[1]=l);let u=l,d;t[2]===s?d=t[3]:(d=s??vc(),t[2]=s,t[3]=d);let f=d,p=c!==void 0,[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(``),[w,T]=(0,Q.useState)(!1),[E,D]=(0,Q.useState)(!1),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),A;t[4]!==n||t[5]!==f?(A=()=>{if(!n)return;let e=!1;return f.status().then(t=>{e||T(t.authenticated)}).catch(()=>{e||T(!1)}),()=>{e=!0}},t[4]=n,t[5]=f,t[6]=A):A=t[6];let j;t[7]===n?j=t[8]:(j=[n],t[7]=n,t[8]=j),(0,Q.useEffect)(A,j);let M;t[9]!==w||t[10]!==n||t[11]!==f?(M=()=>{if(!w||!n)return;let e=!1;return x(!0),f.repos().then(t=>{e||(y(t.ok?t.repos:[]),x(!1))}).catch(()=>{e||(y([]),x(!1))}),()=>{e=!0}},t[9]=w,t[10]=n,t[11]=f,t[12]=M):M=t[12];let N;t[13]!==w||t[14]!==n?(N=[w,n],t[13]=w,t[14]=n,t[15]=N):N=t[15],(0,Q.useEffect)(M,N);let P;t[16]===p?P=t[17]:(P=function(e){if(h(e),p)return;let t=$l(e);t&&_(`~/Documents/${t}`)},t[16]=p,t[17]=P);let F=P,I;t[18]===p?I=t[19]:(I=function(e){if(h(e.clone_url),p)return;let t=e.full_name.split(`/`)[1];_(`~/Documents/${t}`)},t[18]=p,t[19]=I);let L=I,R;t[20]!==g||t[21]!==a||t[22]!==r||t[23]!==c||t[24]!==u||t[25]!==m?(R=async function(){let e=m.trim();if(!e){Fa.error(`Enter a repository URL or owner/repo`);return}let t=g||``;if(c){D(!0);let n=await c();if(!n){D(!1);return}let r=$l(e);t=`${n.replace(/\/$/,``)}/${r}`}else D(!0);let n=Fa.loading(`Starting clone`,{duration:1/0});k.current=n;let i=u.start({url:e,dir:t});O.current=i.cancel;try{let e=i.events[Symbol.asyncIterator](),t=await e.next();for(;!t.done;){let i=t.value;if(i.type===`progress`)Fa.loading(`${Ql(i.phase)} — ${i.pct}%`,{id:n});else if(i.type===`complete`){Fa.success(`Clone complete — opening project`,{id:n}),r(!1),D(!1),O.current=null;let e=`port`in i?i.port:void 0;a?a({port:e,dir:i.dir}):e!==void 0&&(window.location.href=`http://localhost:${e}`);return}else if(i.type===`error`){Fa.error(`Clone failed: ${i.message}`,{id:n}),D(!1),O.current=null;return}t=await e.next()}Fa.error(`Clone stream ended unexpectedly — check if the clone completed`,{id:n}),D(!1),O.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),Fa.error(`Clone failed — connection error`,{id:n}),D(!1),O.current=null}},t[20]=g,t[21]=a,t[22]=r,t[23]=c,t[24]=u,t[25]=m,t[26]=R):R=t[26];let z=R,B;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(B=function(){O.current?.(),O.current=null,D(!1),Fa.dismiss(k.current??void 0)},t[27]=B):B=t[27];let V=B,H;t[28]!==E||t[29]!==r||t[30]!==p?(H=function(e){E||(r(e),e||(h(``),p||_(``),C(``)))},t[28]=E,t[29]=r,t[30]=p,t[31]=H):H=t[31];let U=H,W,G,K,q,ee,te,ne,re,ie,ae;if(t[32]!==E||t[33]!==U||t[34]!==L||t[35]!==F||t[36]!==w||t[37]!==b||t[38]!==n||t[39]!==S||t[40]!==v||t[41]!==m){let e=v?.filter(e=>e.full_name.toLowerCase().includes(S.toLowerCase()));K=io,ie=n,ae=U,G=eo,ne=`sm:max-w-lg`,t[52]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(ro,{children:(0,Z.jsx)($a,{children:`Clone from GitHub`})}),t[52]=re):re=t[52],W=to,q=`flex flex-col gap-4`;let r;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`label`,{htmlFor:`clone-url`,className:`text-sm font-medium`,children:`Repository URL or owner/repo`}),t[53]=r):r=t[53];let i;t[54]===F?i=t[55]:(i=e=>F(e.target.value),t[54]=F,t[55]=i),t[56]!==E||t[57]!==i||t[58]!==m?(ee=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[r,(0,Z.jsx)(ao,{id:`clone-url`,placeholder:`https://github.com/owner/repo or owner/repo`,value:m,onChange:i,disabled:E})]}),t[56]=E,t[57]=i,t[58]=m,t[59]=ee):ee=t[59],te=w&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:`repo-filter`,className:`text-sm font-medium`,children:`Your repositories`}),(0,Z.jsx)(ao,{id:`repo-filter`,"aria-label":`Filter repositories`,placeholder:`Filter repositories`,value:S,onChange:e=>C(e.target.value),disabled:E||b&&v===null}),(0,Z.jsx)(`div`,{className:`border rounded-md max-h-40 overflow-y-auto subtle-scrollbar`,"aria-busy":b&&v===null,children:b&&v===null?(0,Z.jsxs)(`output`,{className:`flex flex-col gap-1.5 px-3 py-2`,"aria-label":`Loading repositories`,children:[(0,Z.jsx)(da,{className:`h-4 w-2/3`}),(0,Z.jsx)(da,{className:`h-4 w-1/2`}),(0,Z.jsx)(da,{className:`h-4 w-3/4`}),(0,Z.jsx)(da,{className:`h-4 w-2/5`}),(0,Z.jsx)(da,{className:`h-4 w-3/5`})]}):e?.length===0?(0,Z.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:v?.length===0?`No repositories found.`:`No matches.`}):e?.map(e=>(0,Z.jsxs)(`button`,{type:`button`,className:`w-full text-left px-3 py-1.5 text-sm hover:bg-muted flex items-center gap-2 truncate disabled:opacity-50`,onClick:()=>L(e),disabled:E,children:[e.private&&(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:`🔒`}),e.full_name]},e.full_name))})]}),t[32]=E,t[33]=U,t[34]=L,t[35]=F,t[36]=w,t[37]=b,t[38]=n,t[39]=S,t[40]=v,t[41]=m,t[42]=W,t[43]=G,t[44]=K,t[45]=q,t[46]=ee,t[47]=te,t[48]=ne,t[49]=re,t[50]=ie,t[51]=ae}else W=t[42],G=t[43],K=t[44],q=t[45],ee=t[46],te=t[47],ne=t[48],re=t[49],ie=t[50],ae=t[51];let oe;t[60]!==E||t[61]!==w||t[62]!==i?(oe=!w&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:`Browse your repos:`}),(0,Z.jsx)(zr,{variant:`link`,size:`sm`,className:`h-auto p-0`,onClick:()=>i?.(),disabled:E,children:`Sign in to GitHub`})]}),t[60]=E,t[61]=w,t[62]=i,t[63]=oe):oe=t[63];let se;t[64]!==E||t[65]!==g||t[66]!==p?(se=!p&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:`clone-path`,className:`text-sm font-medium`,children:`Local path`}),(0,Z.jsx)(ao,{id:`clone-path`,placeholder:`~/Documents/repo-name`,value:g,onChange:e=>_(e.target.value),disabled:E})]}),t[64]=E,t[65]=g,t[66]=p,t[67]=se):se=t[67];let ce;t[68]!==q||t[69]!==ee||t[70]!==te||t[71]!==oe||t[72]!==se?(ce=(0,Z.jsxs)(`div`,{className:q,children:[ee,te,oe,se]}),t[68]=q,t[69]=ee,t[70]=te,t[71]=oe,t[72]=se,t[73]=ce):ce=t[73];let le;t[74]!==W||t[75]!==ce?(le=(0,Z.jsx)(W,{children:ce}),t[74]=W,t[75]=ce,t[76]=le):le=t[76];let ue;t[77]!==E||t[78]!==z||t[79]!==U||t[80]!==m||t[81]!==p?(ue=(0,Z.jsx)(no,{children:E?(0,Z.jsx)(zr,{variant:`outline`,className:`font-mono uppercase`,onClick:V,children:`Cancel`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zr,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>U(!1),children:`Cancel`}),(0,Z.jsx)(zr,{onClick:()=>void z(),disabled:!m.trim(),"aria-describedby":p?`clone-picker-hint`:void 0,children:`Clone`}),p&&(0,Z.jsx)(`span`,{id:`clone-picker-hint`,className:`sr-only`,children:`Opens a folder picker to choose where to clone the repository.`})]})}),t[77]=E,t[78]=z,t[79]=U,t[80]=m,t[81]=p,t[82]=ue):ue=t[82];let de;t[83]!==G||t[84]!==ne||t[85]!==re||t[86]!==le||t[87]!==ue?(de=(0,Z.jsxs)(G,{className:ne,children:[re,le,ue]}),t[83]=G,t[84]=ne,t[85]=re,t[86]=le,t[87]=ue,t[88]=de):de=t[88];let fe;return t[89]!==K||t[90]!==ie||t[91]!==ae||t[92]!==de?(fe=(0,Z.jsx)(K,{open:ie,onOpenChange:ae,children:de}),t[89]=K,t[90]=ie,t[91]=ae,t[92]=de,t[93]=fe):fe=t[93],fe}var tu=(0,Q.lazy)(()=>r(()=>import(`./ConsentDialogBody-Nm0bF6eX.js`),__vite__mapDeps([5,1,6,7,8,9,10,11,12]),import.meta.url));function nu(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(so.subscribe,iu,ru))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(tu,{})}),e[0]=t):t=e[0],t}function ru(){return!1}function iu(){return so.getSnapshot()!==null}var au=180;function ou(e,t){if(e===``||t===``)return``;let n=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`;return`${e.replace(/[/\\]+$/,``)}${n}${t}`}function su(e){if(e===``)return``;let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}function cu(e){let{parent:t,sanitizedName:n,enclosingProject:r,enclosingGit:i,targetState:a}=e;return t===``||n===``?{kind:`idle`}:r===null?i!==null&&i.gitRoot!==t?{kind:`confirm-git`,gitRoot:i.gitRoot}:a===`exists-nonempty`?{kind:`block-nonempty`}:{kind:`free`}:{kind:`block-nested`,rootPath:r.rootPath}}function lu(e){let t=e instanceof Error?e.message:String(e);for(let e of mr)if(t.startsWith(`${e}:`)||t.includes(`${e}: `))return e===`nested-project`||e===`target-not-empty`?{reason:e}:{reason:e,message:t};return{reason:`unknown`,message:t}}function uu(e){switch(e.reason){case`nested-project`:return`A project already exists at this location. Pick a different parent folder.`;case`target-not-empty`:return`A non-empty folder with this name already exists. Use a different name.`;case`invalid-args`:return`Invalid input — please check the name and try again.`;case`mkdir-failed`:return`Could not create the project folder. Try a different name or location.`;case`git-init-failed`:return`Project folder created, but git init failed. Try again.`;case`init-failed`:return`Could not write project files. Try a different location.`;case`discovery-failed`:return`Could not finalize project setup. Try again.`;case`unknown`:return`Could not create project. Try again or pick a different location.`}}function du(e){let t=(0,$.c)(101),{open:n,onOpenChange:r,bridge:i}=e,[a,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(mu),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={kind:`idle`},t[0]=p):p=t[0];let[m,h]=(0,Q.useState)(p),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(null),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=new Map,t[1]=b):b=t[1];let x=(0,Q.useRef)(b),S;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=new Set,t[2]=S):S=t[2];let C=(0,Q.useRef)(S),w=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E=(0,Q.useRef)(null),D,O;t[3]!==i||t[4]!==n?(D=()=>{if(!n)return;x.current.clear(),C.current.clear(),y(null),h({kind:`idle`}),_(!1),o(``),f(new Set(tn));let e=!1;u(!0),i.fs.defaultProjectsRoot().then(t=>{e||c(t)}).catch(pu).finally(()=>{e||u(!1)});let t=requestAnimationFrame(()=>{E.current?.focus()});return()=>{e=!0,cancelAnimationFrame(t)}},O=[n,i],t[3]=i,t[4]=n,t[5]=D,t[6]=O):(D=t[5],O=t[6]),(0,Q.useEffect)(D,O);let k,A;t[7]!==i||t[8]!==a||t[9]!==n||t[10]!==s?(k=()=>{if(!n)return;T.current!==null&&clearTimeout(T.current),w.current!==null&&w.current.abort();let e=cn(a);if(s===``||e===``){h({kind:`idle`});return}let t=ou(s,e),r=x.current.get(t);if(r!==void 0){h(cu({parent:s,sanitizedName:e,enclosingProject:r.enclosingProject,enclosingGit:r.enclosingGit,targetState:r.targetState}));return}h({kind:`pending`});let o=new AbortController;return w.current=o,T.current=setTimeout(()=>{Promise.all([i.fs.findEnclosingProjectRoot(s),i.fs.findEnclosingGitRoot(s),i.fs.folderState(t)]).then(n=>{let[r,i,a]=n;o.signal.aborted||(x.current.set(t,{enclosingProject:r,enclosingGit:i,targetState:a}),h(cu({parent:s,sanitizedName:e,enclosingProject:r,enclosingGit:i,targetState:a})))}).catch(e=>{o.signal.aborted||(console.warn(`[CreateProjectDialog] cascade probe failed:`,e),h({kind:`free`}))})},au),()=>{T.current!==null&&clearTimeout(T.current),o.abort()}},A=[n,a,s,i],t[7]=i,t[8]=a,t[9]=n,t[10]=s,t[11]=k,t[12]=A):(k=t[11],A=t[12]),(0,Q.useEffect)(k,A);let j,M;t[13]!==i||t[14]!==m||t[15]!==n?(j=()=>{if(!n)return;let e=null;m.kind===`block-nested`?e=`nested`:m.kind===`block-nonempty`?e=`nonempty`:m.kind===`confirm-git`&&(e=`git-confirm`),e!==null&&(C.current.has(e)||(C.current.add(e),i.project.recordCreateNewBannerShown(e).catch(fu)))},M=[n,m,i],t[13]=i,t[14]=m,t[15]=n,t[16]=j,t[17]=M):(j=t[16],M=t[17]),(0,Q.useEffect)(j,M);let N,P;t[18]!==a||t[19]!==s?(N=cn(a),P=N===``||s===``?``:ou(s,N),t[18]=a,t[19]=s,t[20]=N,t[21]=P):(N=t[20],P=t[21]);let F=P,I=!g&&N!==``&&s!==``&&(m.kind===`free`||m.kind===`confirm-git`),L;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(L=function(e){f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[22]=L):L=t[22];let R=L,z;t[23]===i?z=t[24]:(z=async function(){try{let e=await i.dialog.openFolder();if(e===null)return;c(e)}catch(e){console.warn(`[CreateProjectDialog] dialog.openFolder failed:`,e)}},t[23]=i,t[24]=z);let B=z,V;t[25]!==i||t[26]!==I||t[27]!==d||t[28]!==r||t[29]!==s||t[30]!==N?(V=async function(e){if(e.preventDefault(),I){_(!0),y(null);try{await i.project.createNew({parent:s,name:N,editors:Array.from(d)}),r(!1)}catch(e){y(lu(e)),_(!1)}}},t[25]=i,t[26]=I,t[27]=d,t[28]=r,t[29]=s,t[30]=N,t[31]=V):V=t[31];let H=V,U;t[32]!==g||t[33]!==r?(U=function(e){g||r(e)},t[32]=g,t[33]=r,t[34]=U):U=t[34];let W=U,G;t[35]!==i||t[36]!==r?(G=async function(e){r(!1);try{await i.project.open({path:e,target:`new-window`,entryPoint:`create-new-nested-redirect`})}catch(e){console.warn(`[CreateProjectDialog] project.open failed:`,e)}},t[35]=i,t[36]=r,t[37]=G):G=t[37];let K=G,q;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsxs)(ro,{children:[(0,Z.jsx)($a,{children:`Create new project`}),(0,Z.jsx)(Qa,{children:`Make a new folder for a brand-new Open Knowledge project.`})]}),t[38]=q):q=t[38];let ee;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(qa,{htmlFor:`create-name`,className:`mb-1 block`,children:`Name`}),t[39]=ee):ee=t[39];let te;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(te=e=>{o(e.target.value),y(null)},t[40]=te):te=t[40];let ne;t[41]!==g||t[42]!==a?(ne=(0,Z.jsxs)(`div`,{children:[ee,(0,Z.jsx)(ao,{id:`create-name`,ref:E,value:a,onChange:te,disabled:g,placeholder:`My Notes`,autoComplete:`off`,spellCheck:!1,"aria-describedby":`create-target-caption`,"data-testid":`create-name`})]}),t[41]=g,t[42]=a,t[43]=ne):ne=t[43];let re;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(qa,{htmlFor:`create-location`,className:`mb-1 block`,children:`Location`}),t[44]=re):re=t[44];let ie=l?``:s,ae=l?`Loading`:``,oe;t[45]!==g||t[46]!==ie||t[47]!==ae?(oe=(0,Z.jsx)(ao,{id:`create-location`,value:ie,readOnly:!0,disabled:g,placeholder:ae,className:`flex-1`,"data-testid":`create-location`}),t[45]=g,t[46]=ie,t[47]=ae,t[48]=oe):oe=t[48];let se=g||l,ce;t[49]===B?ce=t[50]:(ce=()=>void B(),t[49]=B,t[50]=ce);let le;t[51]!==se||t[52]!==ce?(le=(0,Z.jsx)(zr,{type:`button`,variant:`outline`,disabled:se,onClick:ce,"data-testid":`create-browse`,children:`Browse`}),t[51]=se,t[52]=ce,t[53]=le):le=t[53];let ue;t[54]!==oe||t[55]!==le?(ue=(0,Z.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[oe,le]}),t[54]=oe,t[55]=le,t[56]=ue):ue=t[56];let de;t[57]===F?de=t[58]:(de=F===``?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`—`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`No target path yet`})]}):F,t[57]=F,t[58]=de);let fe;t[59]===de?fe=t[60]:(fe=(0,Z.jsx)(`p`,{id:`create-target-caption`,className:`mt-1 text-xs text-muted-foreground`,"aria-live":`polite`,"data-testid":`create-target-caption`,children:de}),t[59]=de,t[60]=fe);let pe;t[61]!==ue||t[62]!==fe?(pe=(0,Z.jsxs)(`div`,{children:[re,ue,fe]}),t[61]=ue,t[62]=fe,t[63]=pe):pe=t[63];let J;t[64]!==m||t[65]!==K?(J=(0,Z.jsx)(hu,{cascade:m,onOpenNested:K}),t[64]=m,t[65]=K,t[66]=J):J=t[66];let me,he;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(`legend`,{className:`text-sm font-medium`,children:`Connect AI editors`}),he=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`All editors are checked by default — uncheck the ones you don't use.`}),t[67]=me,t[68]=he):(me=t[67],he=t[68]);let ge;t[69]!==g||t[70]!==d?(ge=tn.map(e=>{let t=`create-editor-${e}`;return(0,Z.jsxs)(qa,{htmlFor:t,className:`text-sm font-normal`,children:[(0,Z.jsx)(Ba,{id:t,checked:d.has(e),onCheckedChange:()=>R(e),disabled:g,"data-testid":`create-editor-${e}`}),(0,Z.jsx)(`span`,{children:Ln[e]})]},e)}),t[69]=g,t[70]=d,t[71]=ge):ge=t[71];let _e;t[72]===ge?_e=t[73]:(_e=(0,Z.jsxs)(`fieldset`,{className:`space-y-2 pb-2`,children:[me,he,ge]}),t[72]=ge,t[73]=_e);let ve;t[74]===v?ve=t[75]:(ve=v===null?null:(0,Z.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,"data-testid":`create-submit-error`,children:uu(v)}),t[74]=v,t[75]=ve);let ye;t[76]!==ne||t[77]!==pe||t[78]!==J||t[79]!==_e||t[80]!==ve?(ye=(0,Z.jsxs)(to,{className:`space-y-4`,children:[ne,pe,J,_e,ve]}),t[76]=ne,t[77]=pe,t[78]=J,t[79]=_e,t[80]=ve,t[81]=ye):ye=t[81];let be;t[82]===r?be=t[83]:(be=()=>r(!1),t[82]=r,t[83]=be);let xe;t[84]!==g||t[85]!==be?(xe=(0,Z.jsx)(zr,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:be,disabled:g,"data-testid":`create-cancel`,children:`Cancel`}),t[84]=g,t[85]=be,t[86]=xe):xe=t[86];let Se=!I,Ce=g?`Creating`:`Create`,we;t[87]!==Se||t[88]!==Ce?(we=(0,Z.jsx)(zr,{type:`submit`,disabled:Se,"data-testid":`create-submit`,children:Ce}),t[87]=Se,t[88]=Ce,t[89]=we):we=t[89];let Te;t[90]!==xe||t[91]!==we?(Te=(0,Z.jsxs)(no,{children:[xe,we]}),t[90]=xe,t[91]=we,t[92]=Te):Te=t[92];let Y;t[93]!==H||t[94]!==ye||t[95]!==Te?(Y=(0,Z.jsxs)(eo,{className:`sm:max-w-lg motion-reduce:duration-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none`,"data-testid":`create-project-dialog`,children:[q,(0,Z.jsxs)(`form`,{onSubmit:H,"data-testid":`create-project-form`,className:`flex min-h-0 flex-1 flex-col`,children:[ye,Te]})]}),t[93]=H,t[94]=ye,t[95]=Te,t[96]=Y):Y=t[96];let Ee;return t[97]!==W||t[98]!==n||t[99]!==Y?(Ee=(0,Z.jsx)(io,{open:n,onOpenChange:W,children:Y}),t[97]=W,t[98]=n,t[99]=Y,t[100]=Ee):Ee=t[100],Ee}function fu(){}function pu(e){console.warn(`[CreateProjectDialog] defaultProjectsRoot probe failed:`,e)}function mu(){return new Set(tn)}function hu(e){let t=(0,$.c)(17),{cascade:n,onOpenNested:r}=e;if(n.kind===`idle`||n.kind===`pending`||n.kind===`free`)return null;if(n.kind===`block-nested`){let e;t[0]===n.rootPath?e=t[1]:(e=su(n.rootPath),t[0]=n.rootPath,t[1]=e);let i=e,a;t[2]===n.rootPath?a=t[3]:(a=(0,Z.jsxs)(`p`,{className:`mb-2`,children:[`Can't nest projects. An Open Knowledge project already exists at`,` `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:n.rootPath}),`. Choose a location outside it, or open that project instead.`]}),t[2]=n.rootPath,t[3]=a);let o;t[4]!==n.rootPath||t[5]!==r?(o=()=>r(n.rootPath),t[4]=n.rootPath,t[5]=r,t[6]=o):o=t[6];let s;t[7]!==i||t[8]!==o?(s=(0,Z.jsxs)(zr,{type:`button`,variant:`outline`,size:`sm`,onClick:o,"data-testid":`create-banner-nested-open`,children:[`Open `,i]}),t[7]=i,t[8]=o,t[9]=s):s=t[9];let c;return t[10]!==a||t[11]!==s?(c=(0,Z.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,"data-testid":`create-banner-nested`,children:[a,s]}),t[10]=a,t[11]=s,t[12]=c):c=t[12],c}if(n.kind===`confirm-git`){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`code`,{children:`.ok/config.yml`}),t[13]=e):e=t[13];let r;return t[14]===n.gitRoot?r=t[15]:(r=(0,Z.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`rounded-md border border-blue-300 bg-blue-50 px-3 py-2 text-sm text-blue-900 dark:border-blue-700 dark:bg-blue-950 dark:text-blue-200`,"data-testid":`create-banner-git-confirm`,children:(0,Z.jsxs)(`p`,{children:[`Open Knowledge initializes at the git root. Only the contents of your new folder will be tracked by Open Knowledge. The project file (`,e,`) is placed at`,` `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:n.gitRoot}),` — one project per git repo.`]})}),t[14]=n.gitRoot,t[15]=r),r}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,"data-testid":`create-banner-nonempty`,children:(0,Z.jsx)(`p`,{children:`A non-empty folder with this name already exists. Use "Open folder on disk" instead.`})}),t[16]=i):i=t[16],i}function gu(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`GitHub`}),r=(0,Z.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function _u(e){let t=(0,$.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Open Knowledge icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`g`,{filter:`url(#filter0_d_ok)`,children:[(0,Z.jsx)(`path`,{d:`M66.8902 16.1017C58.2694 3.86669 46.1739 -0.690239 29.9182 2.17749C21.3995 3.67813 13.4602 9.555 8.67934 17.9009C3.93974 26.1701 2.98514 35.6533 6.05714 43.9166C9.31574 52.6868 16.7168 58.4752 24.2299 63.4231C25.7973 64.4562 26.1351 65.7172 26.3551 68.9896C26.5221 71.4625 26.799 75.6011 30.6842 77.7204C31.8176 78.3372 33.0648 78.6515 34.3946 78.6515C37.0796 78.6515 39.4033 77.3649 40.5189 76.7482C47.1049 73.1046 68.8878 59.7147 72.6453 40.4027C74.3444 31.6679 70.9797 21.9019 66.8922 16.1017H66.8902Z`,fill:`white`}),(0,Z.jsx)(`path`,{d:`M37.4214 71.154C28.7888 75.929 36.787 64.0397 27.7458 58.0843C21.6372 54.0616 14.788 49.0568 12.0499 41.6911C6.74463 27.4192 17.5438 10.8473 31.028 8.47262C45.1977 5.97613 54.6946 9.8947 61.6635 19.7844C65.2089 24.8167 67.6013 32.8365 66.3658 39.1828C63.6906 52.9341 49.073 64.7075 37.4214 71.154Z`,fill:`#69A3FF`}),(0,Z.jsx)(`path`,{d:`M52.7244 29.2638C53.4665 28.5217 54.6697 28.5217 55.4119 29.2638V29.2638C56.154 30.0059 56.154 31.2091 55.4119 31.9513L49.2589 38.1042L46.5715 35.4167L52.7244 29.2638Z`,fill:`#D5E5FF`}),(0,Z.jsx)(`path`,{d:`M55.4119 38.8821C56.154 39.6242 56.154 40.8274 55.4119 41.5696V41.5696C54.6698 42.3117 53.4665 42.3117 52.7244 41.5696L46.5715 35.4166L49.259 32.7292L55.4119 38.8821Z`,fill:`#D5E5FF`})]}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`defs`,{children:(0,Z.jsxs)(`filter`,{id:`filter0_d_ok`,x:`-9.53674e-07`,y:`-0.0799994`,width:`77.3817`,height:`85.8743`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,Z.jsx)(`feFlood`,{floodOpacity:`0`,result:`BackgroundImageFix`}),(0,Z.jsx)(`feColorMatrix`,{in:`SourceAlpha`,type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0`,result:`hardAlpha`}),(0,Z.jsx)(`feOffset`,{dy:`2.85714`}),(0,Z.jsx)(`feGaussianBlur`,{stdDeviation:`2.14286`}),(0,Z.jsx)(`feComposite`,{in2:`hardAlpha`,operator:`out`}),(0,Z.jsx)(`feColorMatrix`,{type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in2:`BackgroundImageFix`,result:`effect1_dropShadow_ok`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in:`SourceGraphic`,in2:`effect1_dropShadow_ok`,result:`shape`})]})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,Z.jsxs)(`svg`,{role:`img`,"aria-label":`Open Knowledge icon`,fill:`none`,height:24,width:24,viewBox:`0 0 78 80`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var vu=(0,Q.lazy)(()=>r(()=>import(`./McpConsentDialogBody-0w9-K4mU.js`),__vite__mapDeps([13,1,6,7,14,15,16,8,17,9]),import.meta.url));function yu(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(za.subscribe,xu,bu))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(vu,{})}),e[0]=t):t=e[0],t}function bu(){return!1}function xu(){return za.getSnapshot()!==null}var Su=(e,t,n)=>pc(e,t,n,`NavigatorApp`);function Cu(e){let t=(0,$.c)(74),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(!0),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(`auth`),{channel:b}=uc(),{theme:x}=nn();Di(n,x??`system`);let S;t[1]===n.project?S=t[2]:(S=()=>{let e=!1;return n.project.listRecent().then(t=>{e||a(t)}).catch(t=>{console.error(`[NavigatorApp] listRecent failed:`,t),e||l(t instanceof Error?t.message:`Failed to load recent projects.`)}).finally(()=>{e||s(!1)}),()=>{e=!0}},t[1]=n.project,t[2]=S);let C;t[3]===n?C=t[4]:(C=[n],t[3]=n,t[4]=C),(0,Q.useEffect)(S,C);let w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=(e,t)=>Su(e,t,l),t[5]=w):w=t[5];let T=w,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>d(!0),t[6]=E):E=t[6];let D=E,O;t[7]===n?O=t[8]:(O=()=>T(async()=>{let e=await n.dialog.openFolder();e&&await Eu(n,e,`pick-existing`)},`Failed to open folder.`),t[7]=n,t[8]=O);let k=O,A;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>p(!0),t[9]=A):A=t[9];let j=A,N;t[10]===n?N=t[11]:(N=e=>T(async()=>{await Eu(n,e,`recents`)},`Failed to open project.`),t[10]=n,t[11]=N);let P=N,F=`mx-auto flex w-full max-w-5xl flex-1 flex-col overflow-hidden p-12 space-y-10 ${!o&&i.length===0?`justify-center`:``}`,I;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(_u,{className:`size-12 shrink-0`}),t[12]=I):I=t[12];let L;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`h1`,{className:`font-medium text-xl tracking-tight`,children:`Open Knowledge`}),(0,Z.jsx)(Zl,{})]}),t[13]=L):L=t[13];let R;t[14]===n.appVersion?R=t[15]:(R=(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]}),t[14]=n.appVersion,t[15]=R);let z;t[16]===b?z=t[17]:(z=b!==null&&(0,Z.jsx)(M,{variant:`gray`,className:`text-2xs font-mono`,children:b===`beta`?`Beta`:`Stable`}),t[16]=b,t[17]=z);let B;t[18]!==R||t[19]!==z?(B=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[I,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[L,(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[R,z]})]})]}),t[18]=R,t[19]=z,t[20]=B):B=t[20];let V;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(wu,{title:`Clone from GitHub`,description:`Bring a remote repository onto this machine.`,onClick:D,dataTestId:`nav-clone`,Icon:gu}),t[21]=V):V=t[21];let H;t[22]===k?H=t[23]:(H=(0,Z.jsx)(wu,{title:`Open folder on disk`,description:`Use a folder you already have.`,onClick:k,dataTestId:`nav-open`,Icon:xe}),t[22]=k,t[23]=H);let U;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(wu,{title:`Create new project`,description:`Make a new folder for a brand-new project.`,onClick:j,dataTestId:`nav-create-new`,Icon:si}),t[24]=U):U=t[24];let W;t[25]===H?W=t[26]:(W=(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[V,H,U]}),t[25]=H,t[26]=W);let G;t[27]===c?G=t[28]:(G=c===null?null:(0,Z.jsxs)(`div`,{className:`mb-3 flex shrink-0 items-start justify-between gap-3 rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2`,"data-testid":`nav-error-banner`,role:`alert`,children:[(0,Z.jsx)(`span`,{className:`text-red-700 text-xs dark:text-red-300`,children:c}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>l(null),className:`text-red-700 text-xs underline hover:no-underline dark:text-red-300`,"data-testid":`nav-error-dismiss`,children:`Dismiss`})]}),t[27]=c,t[28]=G);let K;t[29]!==o||t[30]!==P||t[31]!==i?(K=o?(0,Z.jsx)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,Z.jsx)(Re,{className:`size-4 animate-spin text-muted-foreground/60`})})}):i.length>0?(0,Z.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsx)(`h2`,{className:`mb-2 shrink-0 font-medium text-muted-foreground font-mono text-xs uppercase tracking-wide`,children:`Recent`}),(0,Z.jsx)(`ul`,{className:`min-h-0 flex-1 subtle-scrollbar overflow-y-auto space-y-0.5 -mx-4`,"data-testid":`nav-recent-list`,children:i.map(e=>(0,Z.jsx)(Tu,{project:e,onOpen:()=>P(e.path)},e.path))})]}):null,t[29]=o,t[30]=P,t[31]=i,t[32]=K):K=t[32];let q;t[33]!==B||t[34]!==W||t[35]!==G||t[36]!==K||t[37]!==F?(q=(0,Z.jsxs)(`div`,{className:F,children:[B,W,G,K]}),t[33]=B,t[34]=W,t[35]=G,t[36]=K,t[37]=F,t[38]=q):q=t[38];let ee,te;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(yu,{}),te=(0,Z.jsx)(nu,{}),t[39]=ee,t[40]=te):(ee=t[39],te=t[40]);let ne;t[41]!==n||t[42]!==f?(ne=(0,Z.jsx)(du,{open:f,onOpenChange:p,bridge:n}),t[41]=n,t[42]=f,t[43]=ne):ne=t[43];let re;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{h(e),e||_(!1)},t[44]=re):re=t[44];let ie;t[45]===n?ie=t[46]:(ie=Cc(n),t[45]=n,t[46]=ie);let ae=v===`identity`,oe;t[47]===g?oe=t[48]:(oe=()=>{h(!1),g&&(_(!1),d(!0))},t[47]=g,t[48]=oe);let se;t[49]!==m||t[50]!==ie||t[51]!==ae||t[52]!==oe?(se=(0,Z.jsx)(Yl,{open:m,onOpenChange:re,transport:ie,identityPrompt:ae,onSuccess:oe}),t[49]=m,t[50]=ie,t[51]=ae,t[52]=oe,t[53]=se):se=t[53];let ce;t[54]===n?ce=t[55]:(ce=Tc(n),t[54]=n,t[55]=ce);let le;t[56]===n?le=t[57]:(le=yc(n),t[56]=n,t[57]=le);let ue;t[58]===n.dialog?ue=t[59]:(ue=()=>n.dialog.openFolder(),t[58]=n.dialog,t[59]=ue);let de;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>{d(!1),y(`auth`),_(!0),h(!0)},t[60]=de):de=t[60];let fe;t[61]===n?fe=t[62]:(fe=e=>{let{dir:t}=e;T(()=>Eu(n,t,`pick-existing`),`Failed to open cloned project.`)},t[61]=n,t[62]=fe);let pe;t[63]!==u||t[64]!==ce||t[65]!==le||t[66]!==ue||t[67]!==fe?(pe=(0,Z.jsx)(eu,{open:u,onOpenChange:d,transport:ce,authQueryTransport:le,pickParentFolder:ue,onSignIn:de,onCloneComplete:fe}),t[63]=u,t[64]=ce,t[65]=le,t[66]=ue,t[67]=fe,t[68]=pe):pe=t[68];let J;return t[69]!==q||t[70]!==ne||t[71]!==se||t[72]!==pe?(J=(0,Z.jsxs)(`div`,{className:`flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[q,ee,te,ne,se,pe]}),t[69]=q,t[70]=ne,t[71]=se,t[72]=pe,t[73]=J):J=t[73],J}function wu(e){let t=(0,$.c)(14),{title:n,description:r,onClick:i,dataTestId:a,Icon:o}=e,s;t[0]===o?s=t[1]:(s=o?(0,Z.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground`}):null,t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=(0,Z.jsx)(`span`,{className:`font-medium text-gray-700 dark:text-foreground text-sm`,children:n}),t[2]=n,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs leading-snug`,children:r}),t[7]=r,t[8]=u);let d;return t[9]!==a||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsxs)(`button`,{type:`button`,onClick:i,"data-testid":a,className:`flex flex-col items-start gap-1.5 rounded-lg border border-border bg-card py-3.5 px-4 text-left transition-colors hover:bg-accent`,children:[l,u]}),t[9]=a,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Tu(e){let t=(0,$.c)(17),{project:n,onOpen:r}=e,i=`flex items-center justify-between ${n.missing?`opacity-50`:``}`,a;t[0]===n.name?a=t[1]:(a=(0,Z.jsx)(`span`,{className:`font-medium text-sm text-gray-700 dark:text-foreground`,children:n.name}),t[0]=n.name,t[1]=a);let o;t[2]===n.path?o=t[3]:(o=(0,Z.jsx)(`span`,{className:`truncate w-full text-muted-foreground text-xs`,children:n.path}),t[2]=n.path,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 truncate`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n.missing?c=t[8]:(c=n.missing?(0,Z.jsx)(M,{className:`text-2xs rounded-sm`,variant:`warning`,children:`Missing`}):null,t[7]=n.missing,t[8]=c);let l;t[9]!==r||t[10]!==n.missing||t[11]!==s||t[12]!==c?(l=(0,Z.jsxs)(`button`,{type:`button`,onClick:r,disabled:n.missing,className:`flex min-w-0 flex-1 items-center text-left disabled:cursor-not-allowed py-3.5 px-4 hover:bg-accent rounded-lg gap-2 justify-between`,children:[s,c]}),t[9]=r,t[10]=n.missing,t[11]=s,t[12]=c,t[13]=l):l=t[13];let u;return t[14]!==i||t[15]!==l?(u=(0,Z.jsx)(`li`,{className:i,children:l}),t[14]=i,t[15]=l,t[16]=u):u=t[16],u}async function Eu(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}var Du=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=nn(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(Kt,{className:`size-4`}),info:(0,Z.jsx)(tt,{className:`size-4`}),warning:(0,Z.jsx)(Er,{className:`size-4`}),error:(0,Z.jsx)(Rs,{className:`size-4`}),loading:(0,Z.jsx)(Re,{className:`size-4 animate-spin`})},o={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={classNames:{toast:`cn-toast`}},t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsx)(Aa,{theme:i,className:`toaster group`,icons:a,style:o,toastOptions:s,...n}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c};function Ou(e){let{apiOrigin:t}=e;if(!t)return;let n=Symbol.for(`ok.desktop.fetchRewrite`);if(window.fetch[n])return;let r=window.fetch.bind(window),i=((e,n)=>{if(typeof e==`string`)return r(ku(e,t),n);if(e instanceof URL)return e.pathname.startsWith(`/api/`)&&(e.origin===window.location.origin||e.protocol===`file:`)?r(t+(e.pathname+e.search+e.hash),n):r(e,n);try{let i=new URL(e.url,window.location.origin);if(i.pathname.startsWith(`/api/`)){let a=i.pathname+i.search+i.hash;return r(new Request(t+a,e),n)}}catch{}return r(e,n)});i[n]=!0,window.fetch=i}function ku(e,t){return e.startsWith(`/api/`)?t+e:e}function Au(e){return`#/${encodeURIComponent(e)}`}function ju(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e});return t.onDeepLink(e=>{n(Au(e.doc))})}var Mu=4e3;function Nu(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){Fa.success(`Opened existing OK project at ${e.ancestorPath}`,{duration:Mu});return}Fa.success(`Initialized OK at ${e.gitRoot} (scoped to ${e.contentDir}/)`,{duration:Mu})})}var Pu=!1;function Fu(e,t,n,r){let i=e[t];if(typeof i!=`function`){console.warn(`[cold-mount-instrumentation] target missing method "${t}"`);return}e[t]=function(...e){let t=performance.now(),a,o=!1;try{return a=i.apply(this,e),o=!0,a}finally{let e=performance.now()-t,i;if(o&&r)try{i=r(this,a,t,e)}catch(e){i={"instrumentation-error":e instanceof Error?e.message:String(e)}}try{W(n,{durationMs:Math.round(e*1e3)/1e3,threw:!o,...i},{startTime:t,duration:e})}catch{}}}}function Iu(e){return e?.doc?typeof e.doc.nodeSize==`number`?e.doc.nodeSize:e.doc.content&&typeof e.doc.content.size==`number`?e.doc.content.size:null:null}var Lu=0,Ru=0,zu=0,Bu=0,Vu=null,Hu=[`linkResolutionDecoration$`],Uu=new WeakSet,Wu=new WeakSet;function Gu(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function Ku(){return!1}function qu(){return!Ku()}function Ju(e,t){if(qu())return t;let n=`ok/cold/nodeview-factory-${Gu(e)}`;return function(...r){let i=performance.now();try{return t(...r)}finally{let t=performance.now()-i;W(n,{nodeType:e,durationMs:Math.round(t*1e3)/1e3},{startTime:i,duration:t})}}}function Yu(e){if(qu())return;let t=e.state.plugins;for(let e of t){if(Wu.has(e))continue;let t=e.spec?.key?.key;if(!t||!Hu.some(e=>t.startsWith(e)))continue;let n=e.props,r=n.decorations;if(typeof r!=`function`){Wu.add(e);continue}let i=`ok/cold/decoration-${Gu(t.replace(/\$\d*$/,``))}`;n.decorations=function(...e){let n=performance.now();try{return r.apply(this,e)}finally{let e=performance.now()-n;W(i,{pluginKey:t,durationMs:Math.round(e*1e3)/1e3},{startTime:n,duration:e})}},Wu.add(e)}}function Xu(e){if(qu())return;let t=e._props?.nodeViews;if(!(!t||typeof t!=`object`))for(let[e,n]of Object.entries(t)){if(typeof n!=`function`||n.__okWrapped===!0)continue;let r=Ju(e,n);r.__okWrapped=!0,t[e]=r}}function Zu(e){return qu()?e:e.map(e=>{let t=e.name??`unknown`,n=Gu(t);return e.extend({onBeforeCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;W(`ok/cold/ext-${n}-on-before-create`,{ext:t,hook:`onBeforeCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;W(`ok/cold/ext-${n}-on-create`,{ext:t,hook:`onCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onUpdate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;W(`ok/cold/ext-${n}-on-update`,{ext:t,hook:`onUpdate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onDestroy(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;W(`ok/cold/ext-${n}-on-destroy`,{ext:t,hook:`onDestroy`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}}})})}function Qu(){if(!Pu){Pu=!0,Fu(ir.prototype,`mount`,`ok/cold/editor-mount`,(e,t,n,r)=>{let i=e;return qu()||(Vu=performance.now()),{elementDefault:i.options?.element?.nodeName??null,docSize:Iu(i.editorState),durationMs:r}}),Fu(ir.prototype,`createView`,`ok/cold/editor-create-view`,e=>{let t=e;return!qu()&&!Uu.has(e)&&t.view&&(Yu(t.view),Xu(t.view),Uu.add(e)),{docSize:Iu(t.editorState)}}),Fu(ir.prototype,`createNodeViews`,`ok/cold/create-node-views`,(e,t,n,r)=>{Bu+=1;let i=e;return!qu()&&i.view&&Xu(i.view),{docSize:Iu(i.view),seq:Bu,durationMs:r}}),Fu(Mn.prototype,`updateState`,`ok/cold/pm-update-state`,(e,t,n,r)=>(Ru+=1,{seq:Ru,docSize:Iu(e.state),durationMs:r})),Fu(Mn.prototype,`setProps`,`ok/cold/pm-set-props`,(e,t,n,r)=>(zu+=1,{seq:zu,docSize:Iu(e.state),durationMs:r})),Fu(De.prototype,`_forceRerender`,`ok/cold/force-rerender`,(e,t,n,r)=>{Lu+=1;let i=e,a=(()=>{try{return i.type?.toArray?i.type.toArray().length:null}catch{return null}})();return{seq:Lu,topLevelYElements:a,durationMs:r}}),Fu(w.prototype,`init`,`ok/cold/ec-init`,e=>({editorPresent:!!e.props?.editor}));try{typeof PerformanceObserver<`u`&&new PerformanceObserver(e=>{for(let t of e.getEntries()){let e=t.name;if((e===`first-paint`||e===`first-contentful-paint`)&&(W(e===`first-paint`?`ok/cold/paint-fp`:`ok/cold/paint-fcp`,{entryType:t.entryType,startTime:Math.round(t.startTime*1e3)/1e3},{startTime:t.startTime,duration:0}),!qu()&&e===`first-paint`&&Vu!==null)){let e=Vu,n=Math.max(0,t.startTime-e);W(`ok/cold/append-to-paint`,{paintEntryType:t.entryType,durationMs:Math.round(n*1e3)/1e3,paintAt:Math.round(t.startTime*1e3)/1e3},{startTime:e,duration:n}),Vu=null}}}).observe({type:`paint`,buffered:!0})}catch{}globalThis.__okColdMountInstrumented=!0}}var $u=`Relaunch`,ed=`Release notes`,td=`Updates paused`,nd=`Download`,rd=`Reset to defaults`,id=`Relaunch failed — please restart manually`,ad=`Recovery action failed — please try again`;function od(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function sd(e){return`Version ${e} ready to install`}function cd(e){return`Updated to Version ${e}`}function ld(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var ud=0,dd=0,fd=1,pd=2,md=3;function hd(e,t,n=()=>{}){let r=[];return r.push(e.onUpdateDownloaded(({version:r})=>{let i=`update-downloaded-${r}`;t({id:i,body:sd(r),priority:pd,action:{label:$u,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{t({id:`relaunch-error-${r}`,body:od(id,e),variant:`error`,priority:fd})})}}})})),r.push(e.onWhatsNew(({version:n,releaseUrl:r})=>{t({id:`whats-new-${n}`,body:cd(n),priority:md,action:{label:ed,onClick:()=>{e.shell.openExternal(r)}}})})),r.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:td,priority:dd,action:{label:nd,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of r)e()}}function gd(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:od(ad,e),variant:`error`,priority:ud})};n({id:i,body:ld(t.currentBuild),priority:ud,action:{label:rd,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var _d=[],vd=new Set,yd=!1;function bd(){for(let e of vd)e()}function xd(e){let t=_d.findIndex(t=>t.id===e.id);if(t===-1)_d=[..._d,e];else{let n=_d.slice();n[t]=e,_d=n}bd()}function Sd(e){let t=_d.filter(t=>t.id!==e);t.length!==_d.length&&(_d=t,bd())}function Cd(){return _d}function wd(e){return vd.add(e),()=>{vd.delete(e)}}function Td(){if(yd||typeof window>`u`)return;let e=window.okDesktop;e&&(yd=!0,hd(e,xd,Sd),e.state.query().then(t=>{t.schemaIncompatibility&&gd(e,t.schemaIncompatibility,xd,Sd)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var Ed=`ok-omnibar-recents-v1`,Dd=10;function Od(e){return typeof e==`object`&&!!e&&(e.kind===`file`||e.kind===`folder`)&&typeof e.path==`string`&&typeof e.lastOpenedAt==`string`}function kd(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Ad(e,t){return`${e}:${t}`}function jd(e){let t=kd(e);if(!t)return[];try{let e=t.getItem(Ed);if(!e)return[];let n=JSON.parse(e);return Array.isArray(n)?n.filter(Od).slice(0,Dd):[]}catch{return[]}}function Md(e,t){let n=kd(t);if(n)try{n.setItem(Ed,JSON.stringify(e.slice(0,Dd)))}catch(e){console.warn(`[omnibar] Failed to save recent entries:`,e)}}function Nd(e,t){return[t,...e.filter(e=>e.kind!==t.kind||e.path!==t.path)].slice(0,Dd)}function Pd(e,t){return e.filter(e=>t.has(Ad(e.kind,e.path)))}var Fd=50,Id=30,Ld=``,Rd=null;function zd(e){return e.trim().toLowerCase()}function Bd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Vd(e){let t=e.trim();return t?[...new Set(t.split(/\s+/).filter(Boolean))].sort((e,t)=>t.length-e.length):[]}function Hd(e,t,n=new Map,r=new Map){let i=[];for(let t of e){let e=r.get(t)?.modified,a=n.get(t);i.push({kind:`file`,path:t,name:Ht(t),...a?{title:a}:{},...e?{modifiedTs:Date.parse(e)}:{}})}for(let e of t)i.push({kind:`folder`,path:e,name:Ht(e)});return i.sort((e,t)=>{let n=e.path.localeCompare(t.path);return n===0?e.kind===t.kind?0:e.kind===`folder`?-1:1:n}),i}function Ud(e){return Zn({kind:e.kind===`file`?`page`:`folder`,path:e.path,title:e.title??e.name,modifiedTs:e.modifiedTs??0})}function Wd(e){return{entries:e,byId:new Map(e.map(e=>[`${e.kind===`file`?`page`:`folder`}:${e.path}`,e])),corpus:Pn(e.map(Ud))}}function Gd(e){return e.map(e=>`${e.kind}\u0000${e.path}\u0000${e.title??``}\u0000${e.modifiedTs??0}`).join(``)}function Kd(e){let t=Gd(e);return Rd&&Ld===t?Rd:(Ld=t,Rd=Wd(e),Rd)}function qd(e,t,n=Fd){return Jd(Kd(e),t,n)}function Jd(e,t,n=Fd){let r=zd(t);return r?lr(e.corpus,r,{intent:`omnibar`,limit:n,scopes:[`page`,`folder`]}).map(t=>e.byId.get(t.document.id)).filter(e=>e!==void 0):e.entries.slice(0,20)}function Yd(e,t){let n=Vd(t);if(n.length===0||e.length===0)return[{text:e,match:!1,start:0}];let r=RegExp(`(${n.map(Bd).join(`|`)})`,`gi`),i=[],a=0;for(let t of e.matchAll(r)){let n=t.index??0;n>a&&i.push({text:e.slice(a,n),match:!1,start:a}),i.push({text:t[0],match:!0,start:n}),a=n+t[0].length}return a<e.length&&i.push({text:e.slice(a),match:!1,start:a}),i.length>0?i:[{text:e,match:!1,start:0}]}function Xd(e){if(e.kind!==`page`&&e.kind!==`folder`||typeof e.path!=`string`)return null;let t=Ht(e.path);return{kind:e.kind===`page`?`file`:`folder`,path:e.path,name:t,...e.title&&{title:e.title},...e.snippet&&{snippet:e.snippet},...typeof e.score==`number`&&{score:e.score}}}async function Zd(e,t={}){let n=e.trim();if(!n)return[];let r=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:n,intent:`full_text`,scopes:[`page`,`folder`,`content`],limit:t.limit??Id}),signal:t.signal});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(An(e)??`Search failed with status ${r.status}`)}return((await r.json()).results??[]).map(Xd).filter(e=>!!e)}function Qd(e,t,n=[]){let r=zd(t);return r?zd([e,...n].join(` `)).includes(r):!0}var $d=`tag:`;function ef(e,t){if(!e.toLowerCase().startsWith(`tag:`))return{kind:`normal`,query:e};let n=e.slice(4).replace(/^\s+/,``).trim();return n&&t.has(n)?{kind:`tag-docs`,tagName:n}:{kind:`tag-list`,query:n}}function tf(e,t){return k(e,t)}var nf=m;async function rf(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`/api/tags/${e} responded with ${t.status}`);let n=await t.json();return Array.isArray(n.docs)?n.docs:[]}var af=`open-knowledge:doc-panel-tab`,of=null;function sf(){let e=of;return of=null,e}function cf(e,t=typeof window>`u`?new EventTarget:window){of=e,t.dispatchEvent(new CustomEvent(af,{detail:{tab:e}}))}function lf(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(af,n),()=>t.removeEventListener(af,n)}function uf(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`grid w-full gap-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(zl,{"data-slot":`radio-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function df(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Vl,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:(0,Z.jsx)(`span`,{className:`absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground`})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Z.jsx)(Bl,{"data-slot":`radio-group-item`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}var ff=[`.md`,`.mdx`];function pf(e){let t=e.toLowerCase();for(let e of ff)if(t.endsWith(e))return e;return null}function mf(e){let t=pf(e);return t?e.slice(0,-t.length):e}var hf=`__blank__`,gf={local:0,inherited:1,user:2};function _f(e){return[...e].sort((e,t)=>{let n=gf[e.scope]-gf[t.scope];if(n!==0)return n;let r=(e.title??e.name).toLowerCase(),i=(t.title??t.name).toLowerCase();return r.localeCompare(i)})}function vf(e){return e.trim()?e.includes(`..`)?`Path cannot contain ".."`:e.startsWith(`/`)?`Path cannot start with "/"`:e.includes(`\\`)?`Path cannot contain backslashes`:e.includes(`\0`)?`Path cannot contain null bytes`:null:`Name cannot be empty`}function yf(e){let t=e.fileName.trim(),n=pf(t)?t:`${t}${e.fileExtension??`.md`}`;if(e.kind===`folder`){let t=(e.folderName??``).trim();return`${e.initialDir?`${e.initialDir}/${t}`:t}/${n}`}return e.initialDir?`${e.initialDir}/${n}`:n}function bf(e){let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable?!1:!!((e.metaKey||e.ctrlKey)&&e.altKey&&e.key.toLowerCase()===`n`)}function xf(e){let t=e.value.lastIndexOf(`.`);t>0?e.setSelectionRange(0,t):e.select()}function Sf(e){let t=(0,$.c)(137),{open:n,onOpenChange:r,kind:i,initialDir:a,suggestedName:o,description:s,onCreated:c}=e,{addPage:l}=hr(),u=aa(a),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(`.md`),[_,v]=(0,Q.useState)(hf),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(null),T=(0,Q.useId)(),E=(0,Q.useId)(),D=(0,Q.useId)(),O=(0,Q.useId)(),k=(0,Q.useRef)(null),A=(0,Q.useRef)(null),j,M;t[0]!==i||t[1]!==n||t[2]!==o?(j=()=>{if(n){b(null),w(null),S(!1),m(``),v(hf);let e=i===`file`?o??`untitled`:`index`,t=pf(e);g(t??`.md`),f(t?mf(e):e)}},M=[n,i,o],t[0]=i,t[1]=n,t[2]=o,t[3]=j,t[4]=M):(j=t[3],M=t[4]),(0,Q.useEffect)(j,M);let N,P,F,I,L,R,B,V,H,U,W,G,K;if(t[5]!==l||t[6]!==x||t[7]!==s||t[8]!==h||t[9]!==d||t[10]!==u.state.data||t[11]!==u.state.message||t[12]!==u.state.status||t[13]!==p||t[14]!==a||t[15]!==i||t[16]!==c||t[17]!==r||t[18]!==n||t[19]!==_||t[20]!==O){let e=u.state.status===`ready`?_f(u.state.data.folder.templates_available??[]):[],o=i===`file`,m=u.state.status===`loading`||u.state.status===`idle`,y=u.state.status===`error`?u.state.message:null,C;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(C=function(e){let t=pf(e);t?(g(t),f(mf(e))):f(e),b(null)},t[34]=C):C=t[34],L=C;let T;t[35]!==h||t[36]!==d||t[37]!==p||t[38]!==a||t[39]!==i?(T=function(){return yf({kind:i,initialDir:a,fileName:d,fileExtension:h,folderName:p})},t[35]=h,t[36]=d,t[37]=p,t[38]=a,t[39]=i,t[40]=T):T=t[40];let E=T,D;t[41]!==d||t[42]!==p||t[43]!==i?(D=function(){if(i===`folder`){let e=vf(p.trim());if(e)return{message:`Folder name: ${e}`,field:`folder`}}let e=vf(d.trim());return e?{message:e,field:`file`}:null},t[41]=d,t[42]=p,t[43]=i,t[44]=D):D=t[44];let k=D,A;t[45]!==x||t[46]!==d||t[47]!==p||t[48]!==i?(A=x||!d.trim()||i===`folder`&&!p.trim(),t[45]=x,t[46]=d,t[47]=p,t[48]=i,t[49]=A):A=t[49],R=A;let j;t[50]!==l||t[51]!==E||t[52]!==k||t[53]!==i||t[54]!==c||t[55]!==r||t[56]!==_?(j=async function(){let e=k();if(e){b(e.message),w(e.field);return}S(!0),b(null),w(null);let t=E(),n=i===`file`&&_!==hf?_:void 0,a={path:t};n!==void 0&&(a.template=n);try{let e=await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)}),t=await z(e,`Server error (HTTP ${e.status})`);if(!t.ok){S(!1),b(t.title),w(`form`);return}let n=or.safeParse(t.body);if(S(!1),!n.success){b(`Failed to create ${i}`),w(`form`);return}let o=n.data.docName;r(!1),window.location.hash=`#/${o}`,l(o),zn([`files`,`backlinks`,`graph`]),c?.(o)}catch(e){console.warn(`[NewItemDialog] create failed:`,e),S(!1),b(`Network error — please try again`),w(`form`)}},t[50]=l,t[51]=E,t[52]=k,t[53]=i,t[54]=c,t[55]=r,t[56]=_,t[57]=j):j=t[57],I=j;let M=a||`(root)`,q=i===`file`?`New file`:`New folder`;F=io,G=n,K=r,P=eo,H=`sm:max-w-md`,U=``;let ee;t[58]===q?ee=t[59]:(ee=(0,Z.jsx)($a,{children:q}),t[58]=q,t[59]=ee);let te;t[60]!==s||t[61]!==M?(te=s??(0,Z.jsxs)(Z.Fragment,{children:[`Create in `,(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:M})]}),t[60]=s,t[61]=M,t[62]=te):te=t[62];let ne;t[63]===te?ne=t[64]:(ne=(0,Z.jsx)(Qa,{children:te}),t[63]=te,t[64]=ne),t[65]!==ee||t[66]!==ne?(W=(0,Z.jsxs)(ro,{children:[ee,ne]}),t[65]=ee,t[66]=ne,t[67]=W):W=t[67],N=to,B=`space-y-3`,V=o&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{id:O,className:`mb-1.5 text-sm font-medium`,children:`Start from`}),m?(0,Z.jsx)(`div`,{className:`rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground`,children:`Loading templates`}):(0,Z.jsxs)(Z.Fragment,{children:[y?(0,Z.jsxs)(`p`,{role:`alert`,className:`mb-1.5 text-xs text-destructive`,children:[`Could not load templates: `,y,`. You can still create a blank note.`]}):null,(0,Z.jsxs)(uf,{value:_,onValueChange:v,"aria-labelledby":O,className:`max-h-56 overflow-y-auto rounded-md border border-border bg-card subtle-scrollbar`,children:[(0,Z.jsx)(Ef,{value:hf,title:`Blank note`,description:`Empty starting content`}),e.length===0&&!y?(0,Z.jsx)(`p`,{className:`px-3 pb-2 text-xs text-muted-foreground`,children:`No templates resolve here. Add one in this folder's Templates section, or in Settings → User templates.`}):e.map(Tf)]})]})]}),t[5]=l,t[6]=x,t[7]=s,t[8]=h,t[9]=d,t[10]=u.state.data,t[11]=u.state.message,t[12]=u.state.status,t[13]=p,t[14]=a,t[15]=i,t[16]=c,t[17]=r,t[18]=n,t[19]=_,t[20]=O,t[21]=N,t[22]=P,t[23]=F,t[24]=I,t[25]=L,t[26]=R,t[27]=B,t[28]=V,t[29]=H,t[30]=U,t[31]=W,t[32]=G,t[33]=K}else N=t[21],P=t[22],F=t[23],I=t[24],L=t[25],R=t[26],B=t[27],V=t[28],H=t[29],U=t[30],W=t[31],G=t[32],K=t[33];let q;t[68]!==y||t[69]!==C||t[70]!==T||t[71]!==E||t[72]!==p||t[73]!==i?(q=i===`folder`&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:E,children:`Folder name`}),(0,Z.jsx)(ao,{ref:A,id:E,value:p,onChange:e=>{m(e.target.value),b(null)},placeholder:`folder-name`,autoFocus:!0,"aria-describedby":y&&(C===`folder`||C===`form`)?T:void 0,"aria-invalid":y&&(C===`folder`||C===`form`)?!0:void 0,onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault();let t=vf(p.trim());if(t){b(`Folder name: ${t}`),w(`folder`);return}k.current?.focus()}}})]}),t[68]=y,t[69]=C,t[70]=T,t[71]=E,t[72]=p,t[73]=i,t[74]=q):q=t[74];let ee=i===`folder`?`First file name`:`File name`,te;t[75]!==D||t[76]!==ee?(te=(0,Z.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:D,children:ee}),t[75]=D,t[76]=ee,t[77]=te):te=t[77];let ne;t[78]===L?ne=t[79]:(ne=e=>L(e.target.value),t[78]=L,t[79]=ne);let re=i===`file`,ie=y&&(C===`file`||C===`form`)?T:void 0,ae=y&&(C===`file`||C===`form`)?!0:void 0,oe;t[80]!==I||t[81]!==R?(oe=e=>{e.key===`Enter`&&!R&&I()},t[80]=I,t[81]=R,t[82]=oe):oe=t[82];let se;t[83]!==D||t[84]!==d||t[85]!==ne||t[86]!==re||t[87]!==ie||t[88]!==ae||t[89]!==oe?(se=(0,Z.jsx)(ao,{ref:k,id:D,value:d,onChange:ne,placeholder:`my-note`,autoFocus:re,"aria-describedby":ie,"aria-invalid":ae,onFocus:wf,onKeyDown:oe,className:`flex-1`}),t[83]=D,t[84]=d,t[85]=ne,t[86]=re,t[87]=ie,t[88]=ae,t[89]=oe,t[90]=se):se=t[90];let ce;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(ce=e=>{(e===`.md`||e===`.mdx`)&&g(e)},t[91]=ce):ce=t[91];let le;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(le=ff.map(Cf),t[92]=le):le=t[92];let ue;t[93]===h?ue=t[94]:(ue=(0,Z.jsx)(Ka,{type:`single`,value:h,onValueChange:ce,variant:`outline`,size:`sm`,"aria-label":`File extension`,className:`shrink-0`,children:le}),t[93]=h,t[94]=ue);let de;t[95]!==se||t[96]!==ue?(de=(0,Z.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[se,ue]}),t[95]=se,t[96]=ue,t[97]=de):de=t[97];let fe;t[98]!==y||t[99]!==T?(fe=y&&(0,Z.jsx)(`p`,{id:T,role:`alert`,className:`text-xs text-red-600 dark:text-red-400`,children:y}),t[98]=y,t[99]=T,t[100]=fe):fe=t[100];let pe;t[101]!==te||t[102]!==de||t[103]!==fe?(pe=(0,Z.jsxs)(`div`,{children:[te,de,fe]}),t[101]=te,t[102]=de,t[103]=fe,t[104]=pe):pe=t[104];let J;t[105]!==q||t[106]!==pe||t[107]!==B||t[108]!==V?(J=(0,Z.jsxs)(`div`,{className:B,children:[V,q,pe]}),t[105]=q,t[106]=pe,t[107]=B,t[108]=V,t[109]=J):J=t[109];let me;t[110]!==N||t[111]!==J?(me=(0,Z.jsx)(N,{children:J}),t[110]=N,t[111]=J,t[112]=me):me=t[112];let he;t[113]===r?he=t[114]:(he=()=>r(!1),t[113]=r,t[114]=he);let ge;t[115]!==x||t[116]!==he?(ge=(0,Z.jsx)(zr,{variant:`outline`,className:`font-mono uppercase`,onClick:he,disabled:x,children:`Cancel`}),t[115]=x,t[116]=he,t[117]=ge):ge=t[117];let _e=x?`Creating`:`Create`,ve;t[118]!==I||t[119]!==R||t[120]!==_e?(ve=(0,Z.jsx)(zr,{onClick:I,disabled:R,children:_e}),t[118]=I,t[119]=R,t[120]=_e,t[121]=ve):ve=t[121];let ye;t[122]!==ge||t[123]!==ve?(ye=(0,Z.jsxs)(no,{children:[ge,ve]}),t[122]=ge,t[123]=ve,t[124]=ye):ye=t[124];let be;t[125]!==P||t[126]!==me||t[127]!==ye||t[128]!==H||t[129]!==U||t[130]!==W?(be=(0,Z.jsxs)(P,{className:H,"data-ok-layer-spawned":U,children:[W,me,ye]}),t[125]=P,t[126]=me,t[127]=ye,t[128]=H,t[129]=U,t[130]=W,t[131]=be):be=t[131];let xe;return t[132]!==F||t[133]!==be||t[134]!==G||t[135]!==K?(xe=(0,Z.jsx)(F,{open:G,onOpenChange:K,children:be}),t[132]=F,t[133]=be,t[134]=G,t[135]=K,t[136]=xe):xe=t[136],xe}function Cf(e){return(0,Z.jsx)(Wa,{value:e,"aria-label":`Use ${e} extension`,children:e},e)}function wf(e){return xf(e.currentTarget)}function Tf(e){return(0,Z.jsx)(Ef,{value:e.name,title:e.title??e.name,subName:e.title&&e.title!==e.name?e.name:void 0,description:e.description,scope:e.scope,sourceFolder:e.source_folder},`${e.scope}:${e.source_folder}:${e.name}`)}function Ef(e){let t=(0,$.c)(26),{value:n,title:r,subName:i,description:a,scope:o,sourceFolder:s}=e,c=(0,Q.useId)(),l;t[0]!==c||t[1]!==n?(l=(0,Z.jsx)(df,{id:c,value:n,className:`mt-1`}),t[0]=c,t[1]=n,t[2]=l):l=t[2];let u;t[3]===r?u=t[4]:(u=(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:r}),t[3]=r,t[4]=u);let d;t[5]===i?d=t[6]:(d=i?(0,Z.jsx)(`code`,{className:`font-mono text-2xs text-muted-foreground shrink-0`,children:i}):null,t[5]=i,t[6]=d);let f;t[7]!==o||t[8]!==s?(f=o===`inherited`&&s?(0,Z.jsx)(M,{variant:`gray`,className:`ml-auto shrink-0 text-2xs`,children:s||`root`}):null,t[7]=o,t[8]=s,t[9]=f):f=t[9];let p;t[10]===o?p=t[11]:(p=o===`user`?(0,Z.jsx)(M,{variant:`primary`,className:`ml-auto shrink-0 text-2xs`,children:`user`}):null,t[10]=o,t[11]=p);let m;t[12]!==u||t[13]!==d||t[14]!==f||t[15]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u,d,f,p]}),t[12]=u,t[13]=d,t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;t[17]===a?h=t[18]:(h=a?(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:a}):null,t[17]=a,t[18]=h);let g;t[19]!==m||t[20]!==h?(g=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[m,h]}),t[19]=m,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==c||t[23]!==l||t[24]!==g?(_=(0,Z.jsxs)(`label`,{htmlFor:c,className:`flex cursor-pointer items-start gap-3 px-3 py-2 transition-colors hover:bg-muted/50 has-data-[state=checked]:bg-muted/70`,children:[l,g]}),t[22]=c,t[23]=l,t[24]=g,t[25]=_):_=t[25],_}var Df=1,Of=.9,kf=.8,Af=.17,jf=.1,Mf=.999,Nf=.9999,Pf=.99,Ff=/[\\\/_+.#"@\[\(\{&]/,If=/[\\\/_+.#"@\[\(\{&]/g,Lf=/[\s-]/,Rf=/[\s-]/g;function zf(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Df:Pf;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=zf(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Df:Ff.test(e.charAt(l-1))?(d*=kf,p=e.slice(i,l-1).match(If),p&&i>0&&(d*=Mf**+p.length)):Lf.test(e.charAt(l-1))?(d*=Of,m=e.slice(i,l-1).match(Rf),m&&i>0&&(d*=Mf**+m.length)):(d*=Af,i>0&&(d*=Mf**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Nf)),(d<jf&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=zf(e,t,n,r,l+1,a+2,o),f*jf>d&&(d=f*jf)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Bf(e){return e.toLowerCase().replace(Rf,` `)}function Vf(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,zf(e,t,Bf(e),Bf(t),0,0,{})}var Hf=`[cmdk-group=""]`,Uf=`[cmdk-group-items=""]`,Wf=`[cmdk-group-heading=""]`,Gf=`[cmdk-item=""]`,Kf=`${Gf}:not([aria-disabled="true"])`,qf=`cmdk-item-select`,Jf=`data-value`,Yf=(e,t,n)=>Vf(e,t,n),Xf=Q.createContext(void 0),Zf=()=>Q.useContext(Xf),Qf=Q.createContext(void 0),$f=()=>Q.useContext(Qf),ep=Q.createContext(void 0),tp=Q.forwardRef((e,t)=>{let n=hp(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=hp(()=>new Set),i=hp(()=>new Map),a=hp(()=>new Map),o=hp(()=>new Set),s=pp(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=jr(),y=jr(),b=jr(),x=Q.useRef(null),S=vp();mp(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),mp(()=>{S(6,k)},[]);let C=Q.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=Q.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Yf;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Uf);t?t.appendChild(e.parentElement===t?e:e.closest(`${Uf} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Uf} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Hf}[${Jf}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Jf);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Hf)?.querySelector(Wf))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Gf}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(Kf)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(Jf))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Jf))}function P(e){let t=A()?.closest(Hf),n;for(;t&&!n;)t=e>0?dp(t,Hf):fp(t,Hf),n=t?.querySelector(Kf);n?C.setState(`value`,n.getAttribute(Jf)):N(e)}let F=()=>M(j().length-1),I=e=>{e.preventDefault(),e.metaKey?F():e.altKey?P(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return Q.createElement(Nr.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),F();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(qf);t.dispatchEvent(e)}}}}},Q.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:xp},c),bp(e,e=>Q.createElement(Qf.Provider,{value:C},Q.createElement(Xf.Provider,{value:w},e))))}),np=Q.forwardRef((e,t)=>{let n=jr(),r=Q.useRef(null),i=Q.useContext(ep),a=Zf(),o=pp(e),s=o.current?.forceMount??i?.forceMount;mp(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=_p(n,r,[e.value,e.children,r],e.keywords),l=$f(),u=gp(e=>e.value&&e.value===c.current),d=gp(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);Q.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(qf,f),()=>t.removeEventListener(qf,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return Q.createElement(Nr.div,{ref:Ar(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),rp=Q.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=jr(),s=Q.useRef(null),c=Q.useRef(null),l=jr(),u=Zf(),d=gp(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);mp(()=>u.group(o),[]),_p(o,s,[e.value,e.heading,c]);let f=Q.useMemo(()=>({id:o,forceMount:i}),[i]);return Q.createElement(Nr.div,{ref:Ar(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&Q.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),bp(e,e=>Q.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Q.createElement(ep.Provider,{value:f},e))))}),ip=Q.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Q.useRef(null),a=gp(e=>!e.search);return!n&&!a?null:Q.createElement(Nr.div,{ref:Ar(i,t),...r,"cmdk-separator":``,role:`separator`})}),ap=Q.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=$f(),o=gp(e=>e.search),s=gp(e=>e.selectedItemId),c=Zf();return Q.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Q.createElement(Nr.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),op=Q.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Q.useRef(null),o=Q.useRef(null),s=gp(e=>e.selectedItemId),c=Zf();return Q.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),Q.createElement(Nr.div,{ref:Ar(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},bp(e,e=>Q.createElement(`div`,{ref:Ar(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),sp=Q.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Q.createElement(Pa,{open:n,onOpenChange:r},Q.createElement(ka,{container:o},Q.createElement(ja,{"cmdk-overlay":``,className:i}),Q.createElement(Na,{"aria-label":e.label,"cmdk-dialog":``,className:a},Q.createElement(tp,{ref:t,...s}))))}),cp=Q.forwardRef((e,t)=>gp(e=>e.filtered.count===0)?Q.createElement(Nr.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),lp=Q.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Q.createElement(Nr.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},bp(e,e=>Q.createElement(`div`,{"aria-hidden":!0},e)))}),up=Object.assign(tp,{List:op,Item:np,Input:ap,Group:rp,Separator:ip,Dialog:sp,Empty:cp,Loading:lp});function dp(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fp(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function pp(e){let t=Q.useRef(e);return mp(()=>{t.current=e}),t}var mp=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function hp(e){let t=Q.useRef();return t.current===void 0&&(t.current=e()),t}function gp(e){let t=$f(),n=()=>e(t.snapshot());return Q.useSyncExternalStore(t.subscribe,n,n)}function _p(e,t,n,r=[]){let i=Q.useRef(),a=Zf();return mp(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Jf,s),i.current=s}),i}var vp=()=>{let[e,t]=Q.useState(),n=hp(()=>new Map);return mp(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function yp(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function bp({asChild:e,children:t},n){return e&&Q.isValidElement(t)?Q.cloneElement(yp(t),{ref:t.ref},n(t.props.children)):n(t)}var xp={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Sp(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(up,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Cp(e){let t=(0,$.c)(36),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({title:o,description:s,children:n,className:r,showCloseButton:c,commandProps:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?`Command Palette`:o,u=s===void 0?`Search for a command to run`:s,d=c===void 0?!0:c,f;t[8]===i?f=t[9]:(f=i??{},t[8]=i,t[9]=f);let p,m;t[10]===f?(p=t[11],m=t[12]):({className:p,...m}=f,t[10]=f,t[11]=p,t[12]=m);let h;t[13]===l?h=t[14]:(h=(0,Z.jsx)($a,{children:l}),t[13]=l,t[14]=h);let g;t[15]===u?g=t[16]:(g=(0,Z.jsx)(Qa,{children:u}),t[15]=u,t[16]=g);let _;t[17]!==h||t[18]!==g?(_=(0,Z.jsxs)(ro,{className:`sr-only`,children:[h,g]}),t[17]=h,t[18]=g,t[19]=_):_=t[19];let v;t[20]===r?v=t[21]:(v=X(`overflow-hidden p-0`,r),t[20]=r,t[21]=v);let y;t[22]===p?y=t[23]:(y=X(`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,p),t[22]=p,t[23]=y);let b;t[24]!==n||t[25]!==m||t[26]!==y?(b=(0,Z.jsx)(Sp,{className:y,...m,children:n}),t[24]=n,t[25]=m,t[26]=y,t[27]=b):b=t[27];let x;t[28]!==d||t[29]!==b||t[30]!==v?(x=(0,Z.jsx)(eo,{className:v,showCloseButton:d,children:b}),t[28]=d,t[29]=b,t[30]=v,t[31]=x):x=t[31];let S;return t[32]!==a||t[33]!==x||t[34]!==_?(S=(0,Z.jsxs)(io,{...a,children:[_,x]}),t[32]=a,t[33]=x,t[34]=_,t[35]=S):S=t[35],S}function wp(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(qs,{className:`size-4 shrink-0 opacity-50`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=X(`flex w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,Z.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex items-center gap-2 border-b px-3`,children:[i,(0,Z.jsx)(up.Input,{"data-slot":`command-input`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function Tp(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(up.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ep(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(up.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e}),t[0]=e,t[1]=n),n}function Dp(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-mono [&_[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(up.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Op(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(up.Item,{"data-slot":`command-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function kp(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`ml-auto text-muted-foreground text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Ap=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0},{id:`claude-code`,displayName:`Claude Code`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`}],jp=`#settings`;function Mp(e){let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable?!1:!!((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key===`,`)}function Np(e){return e.replace(/^#/,``)===`settings`}function Pp(){return typeof window>`u`?``:window.location.hash}function Fp(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(Lp),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=()=>{n(Np(Pp()))};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a=Ip,o;return e[2]===t?o=e[3]:(o={open:t,close:a},e[2]=t,e[3]=o),o}function Ip(){typeof window>`u`||Np(Pp())&&window.history.back()}function Lp(){return Np(Pp())}function Rp(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(Vp),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||typeof window>`u`||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(Bp);if(!e||!t.ok)return;let i=vn.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(zp),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),t}function zp(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function Bp(){return null}function Vp(){return Hp()}function Hp(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}function Up(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Wp(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=An(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Gp(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Up(e):Wp()}var Kp=`ok:skill:cowork:installed`,qp=`1`,Jp=250,Yp=`/api/skill/install-state`;function Xp(e){return`${Kp}:v${e}`}var Zp=new Map;async function Qp(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Zp.get(n);if(r)return r;let i=$p(e,t);return Zp.set(n,i),i.finally(()=>{Zp.get(n)===i&&Zp.delete(n)}),i}async function $p(e,t){let n=e.installer===void 0?Gp():e.installer,r=em(e.storage),i=e.fetchSnapshot??nm,a=e.serverTimeoutMs??Jp,o=null;if(!t.force){try{o=await rm(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Xp(o?.currentVersion??e.fallbackSkillVersion??tm());if(!t.force&&r?.getItem(s)===qp)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,qp)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function em(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function tm(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function nm(){let e;try{e=await fetch(Yp,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function rm(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function im(e){return Qp({},e)}function am(){return Qp({},{force:!0})}async function om(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:sm(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:sm(e)}}}function sm(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var cm=`codex://new`,lm=1500;function um(e){return new Promise(t=>setTimeout(t,e))}async function dm(e,t={}){let n=Tn(e),r=await om(cm,t.openExternalDeps);return r.ok?(await(t.sleep??um)(lm),om(n,t.openExternalDeps)):r}var fm=1e3,pm=1500;function mm(e){return new Promise(t=>setTimeout(t,e))}function hm(e){return async t=>{let n;try{n=await e(`/api/spawn-cursor`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t})})}catch{return{ok:!1,reason:`spawn-error`}}if(n.status===200)return{ok:!0};if(n.status===404)return{ok:!1,reason:`not-installed`};let r;try{r=await n.json()}catch{return{ok:!1,reason:`spawn-error`}}let i=Wt.safeParse(r);return i.success?gm(i.data.type):{ok:!1,reason:`spawn-error`}}}function gm(e){let t=an(e,`ok:shell:spawn-cursor`);switch(t.kind){case`mapped`:return{ok:!1,reason:t.reason};case`http-only`:case`unknown`:return{ok:!1,reason:`spawn-error`};default:return en(t)}}function _m(e){if(e.spawnCursor)return e.spawnCursor;let t=typeof window<`u`?window.okDesktop?.shell.spawnCursor:void 0;if(t)return t;let n=e.fetch??(typeof globalThis<`u`?globalThis.fetch:void 0);if(n)return hm(n)}async function vm(e,t={}){let n=_m(t);if(!n)return{ok:!1,reason:`web-host-cursor-unsupported`};let r=await n(e.projectDir);if(!r.ok)return bm(r.reason);let i=t.isCursorRunning&&await t.isCursorRunning().catch(()=>!1)?fm:pm;return await(t.sleep??mm)(i),om(mn(e),t.openExternalDeps)}function ym(e){throw Error(`Unhandled cursor SpawnFailureReason: ${JSON.stringify(e)}`)}function bm(e){switch(e){case`not-installed`:return{ok:!1,reason:`not-installed`,detail:`cursor binary not found`};case`invalid-path`:return{ok:!1,reason:`invalid-payload`,detail:`cursor spawn: invalid path`};case`timeout`:return{ok:!1,reason:`dispatch-error`,detail:`cursor spawn: timeout`};case`spawn-error`:return{ok:!1,reason:`dispatch-error`,detail:`cursor spawn: spawn-error`};default:return ym(e)}}async function xm(e,t={}){switch(e.target){case`claude-cowork`:return om(Sn({mode:`cowork`},e),t.openExternalDeps);case`claude-code`:return om(Sn({mode:`code`},e),t.openExternalDeps);case`codex`:return dm(e,{...t.codexDeps,openExternalDeps:t.codexDeps?.openExternalDeps??t.openExternalDeps});case`cursor`:return vm(e,{...t.cursorDeps,openExternalDeps:t.cursorDeps?.openExternalDeps??t.openExternalDeps});default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function Sm(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function Cm(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function wm(e){return`${e}.md`}function Tm(e){if(!e.docName||!e.workspace)return null;let t=wm(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:Cm(n,t,r)}}function Em(e){return`Opened in ${e}.`}function Dm(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function Om(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function km(e,t,n,r){return t.ok?{target:e,host:n,outcome:`ok`,ts:r}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason}}async function Am(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`Open Knowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:Kn(t.docContext)},a=await n.dispatchHandoff(i),o=km(e,a,n.isElectronHost()?`electron`:`web`,n.now().toISOString());await n.recordHandoff(o);let s=n.getDisplayName(e);if(a.ok)n.toast.success(Em(s));else{let i=Om(r),a=Dm(s,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Am(e,t,n,r+1)}}})}return a}function jm(e){return Ap.find(t=>t.id===e)?.displayName??e}function Mm(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Nm(){return{dispatchHandoff:xm,recordHandoff:Sm,toast:{success:e=>{Fa.success(e)},error:(e,t)=>{Fa.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Mm(),getDisplayName:jm,ensureCoworkSkillInstalled:im}}function Pm(){return{dispatch:(e,t)=>Am(e,t,Nm()),reinstallCoworkSkill:am}}var Fm=[...new Set(Ap.flatMap(e=>e.schemes))];function Im(e,t){let n=t.now?.()??Date.now(),r={};for(let t of Ap){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Lm(e){return Im({},e)}async function Rm(e){let t=e.schemes??Fm,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var zm=Object.fromEntries(Fm.map(e=>[e,{installed:!1}]));async function Bm(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return zm}if(!t.ok)return zm;let n;try{n=await t.json()}catch{return zm}if(typeof n!=`object`||!n||Array.isArray(n))return zm;let r=n,i={};for(let e of Fm)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Vm(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Hm(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Lm({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Im(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Vm(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Um(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Wm(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Rm({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Bm({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Gm(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Km),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Hm(Wm());r.current=e;let t=e.subscribe(n);return e.probe(),()=>{t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Km(){return Lm({isElectronHost:Um(),now:Date.now})}var qm=3e3,Jm=(e,t,n)=>mc(e,t,n,`CommandPalette`);function Ym(e){window.location.assign(Gn(e))}function Xm(e,t){return e?.kind===`folder`||e?.kind===`folder-index`?e.folderPath:Bn(t)}function Zm(e){let t=(0,$.c)(23),{entry:n,query:r,onSelect:i}=e,a=r===void 0?``:r,o=n.kind===`folder`?xe:_s,s;t[0]===n?s=t[1]:(s=`title`in n&&n.title?n.title:n.path.split(`/`).pop()??n.path,t[0]=n,t[1]=s);let c=s,l=`snippet`in n?n.snippet:void 0,u=`${n.kind} ${n.path}`,d=`command-palette-nav-${n.kind}-${n.path}`,f;t[2]===o?f=t[3]:(f=(0,Z.jsx)(o,{className:`mt-0.5`}),t[2]=o,t[3]=f);let p;t[4]!==a||t[5]!==c?(p=(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:(0,Z.jsx)(Qm,{query:a,text:c})}),t[4]=a,t[5]=c,t[6]=p):p=t[6];let m;t[7]!==n.path||t[8]!==a?(m=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:(0,Z.jsx)(Qm,{query:a,text:n.path})}),t[7]=n.path,t[8]=a,t[9]=m):m=t[9];let h;t[10]!==a||t[11]!==l?(h=l?(0,Z.jsx)(`span`,{className:`max-h-10 overflow-hidden text-muted-foreground text-xs leading-relaxed`,children:(0,Z.jsx)(Qm,{query:a,text:l})}):null,t[10]=a,t[11]=l,t[12]=h):h=t[12];let g;t[13]!==p||t[14]!==m||t[15]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[p,m,h]}),t[13]=p,t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;return t[17]!==i||t[18]!==u||t[19]!==d||t[20]!==f||t[21]!==g?(_=(0,Z.jsxs)(Op,{value:u,onSelect:i,"data-testid":d,className:`items-start`,children:[f,g]}),t[17]=i,t[18]=u,t[19]=d,t[20]=f,t[21]=g,t[22]=_):_=t[22],_}function Qm(e){let t=(0,$.c)(5),{text:n,query:r}=e,i;t[0]!==r||t[1]!==n?(i=Yd(n,r).map($m),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[3]=i,t[4]=a),a}function $m(e){let t=`${e.start}:${e.match?`match`:`plain`}`;return e.match?(0,Z.jsx)(`mark`,{className:`rounded-sm bg-primary/10 px-0.5 font-semibold text-primary`,children:e.text},t):(0,Z.jsx)(`span`,{children:e.text},t)}function eh({searchResults:e,fallbackSearchResults:t,searchStatus:n}){return e.length>0?e:n===`success`?[]:t}function th(e){let t=(0,$.c)(104),{bridge:n,open:r,onOpenChange:i}=e,a=n===void 0?null:n,[o,s]=(0,Q.useState)(``),c=(0,Q.useDeferredValue)(o),l=c.trim(),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[0]=u):u=t[0];let[d,f]=(0,Q.useState)(u),[p,m]=(0,Q.useState)(`idle`),h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[1]=h):h=t[1];let[g,_]=(0,Q.useState)(h),v;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[2]=v):v=t[2];let[y,b]=(0,Q.useState)(v),[x,S]=(0,Q.useState)(null),C;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[3]=C):C=t[3];let[w,T]=(0,Q.useState)(C),[E,D]=(0,Q.useState)(`idle`),O;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],t[4]=O):O=t[4];let[k,A]=(0,Q.useState)(O),[j,M]=(0,Q.useState)(`idle`),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),{activeDocName:I,activeTarget:L}=Pe(),{pages:R,pageTitles:z,pageMeta:B,folderPaths:V}=hr(),H=Rp(),{states:U,refresh:W}=Gm(),{dispatch:G}=Pm(),K=Tm({docName:I,workspace:H}),q=Hd(R,V,z,B),ee=Pd(y,new Set(q.map(ih))),te=a?.config.projectPath??null,re=a?g.filter(e=>e.path!==te):[],ie;t[5]!==I||t[6]!==L?(ie=Xm(L,I),t[5]=I,t[6]=L,t[7]=ie):ie=t[7];let ae=ie,oe=l===``?[]:qd(q,l,8),se,ce;t[8]!==i||t[9]!==r?(se=()=>{let e=function(e){e.key===`k`&&(Pr()?e.metaKey:e.ctrlKey)&&(e.preventDefault(),i(!r))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},ce=[i,r],t[8]=i,t[9]=r,t[10]=se,t[11]=ce):(se=t[10],ce=t[11]),(0,Q.useEffect)(se,ce);let le,ue;t[12]!==a||t[13]!==r||t[14]!==W?(le=()=>{if(r){if(b(jd()),W(),a){let e=!1;return Jm(async()=>{let t=await a.project.listRecent();e||_(t)},`Failed to load recent projects.`),()=>{e=!0}}return}s(``),T([]),D(`idle`),N.current=!1,A([]),M(`idle`)},ue=[r,a,W],t[12]=a,t[13]=r,t[14]=W,t[15]=le,t[16]=ue):(le=t[15],ue=t[16]),(0,Q.useEffect)(le,ue);let de;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>{P.current&&(P.current.scrollTop=0)},t[17]=de):de=t[17];let fe;t[18]===o?fe=t[19]:(fe=[o],t[18]=o,t[19]=fe),(0,Q.useEffect)(de,fe);let pe=ef(c,new Set(w.map(rh))),J=pe.kind!==`normal`,me,he;t[20]!==J||t[21]!==r?(me=()=>{if(!r||!J||N.current)return;N.current=!0,D(`loading`);let e=!1;return nf().then(t=>{e||(T(t),D(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tags failed`,t),T([]),D(`error`))}),()=>{e=!0}},he=[r,J],t[20]=J,t[21]=r,t[22]=me,t[23]=he):(me=t[22],he=t[23]),(0,Q.useEffect)(me,he);let ge=pe.kind===`tag-docs`?pe.tagName:null;(0,Q.useEffect)(()=>{if(!r||ge===null){A([]),M(`idle`);return}M(`loading`),A([]);let e=!1;return rf(ge).then(t=>{e||(A(t),M(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tag docs failed`,t),A([]),M(`error`))}),()=>{e=!0}},[r,ge]),(0,Q.useEffect)(()=>{if(!r||!l||J){f([]),m(`idle`);return}let e=new AbortController;m(`loading`);let t=!1,n=window.setTimeout(()=>{t=!0,e.abort(),f([]),m(`error`)},qm);return Zd(l,{signal:e.signal}).then(e=>{window.clearTimeout(n),f(e),m(`success`)}).catch(e=>{window.clearTimeout(n),!(e instanceof Error&&e.name===`AbortError`&&!t)&&(f([]),m(`error`))}),()=>{window.clearTimeout(n),e.abort()}},[r,l,J]);let _e;t[24]===i?_e=t[25]:(_e=(e,t)=>{let n=t===void 0?`Command failed.`:t;i(!1),Jm(async()=>{await e()},n)},t[24]=i,t[25]=_e);let ve=_e,ye;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ye=function(e){let t={kind:e.kind,path:e.path,lastOpenedAt:new Date().toISOString()},n=Nd(jd(),t);Md(n),b(n)},t[26]=ye):ye=t[26];let be=ye,Se;t[27]===i?Se=t[28]:(Se=function(e){i(!1),be(e),Ym(e.path)},t[27]=i,t[28]=Se);let Ce=Se,we=!J&&l===``&&ee.length>0,Te=eh({searchResults:d,fallbackSearchResults:oe,searchStatus:p}),Y=!J&&Te.length>0,Ee=!J&&l!==``&&p===`loading`&&!Y,De;t[29]!==c||t[30]!==J?(De=!J&&Qd(`New file`,c,[`create file`]),t[29]=c,t[30]=J,t[31]=De):De=t[31];let Oe=De,ke;t[32]!==c||t[33]!==J?(ke=!J&&Qd(`New folder`,c,[`create folder`]),t[32]=c,t[33]=J,t[34]=ke):ke=t[34];let Ae=ke,je;t[35]!==I||t[36]!==c||t[37]!==J?(je=!J&&I!==null&&Qd(`Open graph`,c,[`graph panel network`]),t[35]=I,t[36]=c,t[37]=J,t[38]=je):je=t[38];let Ne=je,Fe=!J&&a!==null&&Qd(`Open folder on disk`,c,[`project`]),Ie=!J&&a!==null&&Qd(`Switch Project`,c,[`switch project navigator projects`]),Le=!J&&Qd(`Settings`,c,[`preferences config`]),Re=!J&&Qd(`Install for Claude Chat & Cowork (Desktop App)`,c,[`claude desktop install cowork`]),ze=!J&&a!==null&&re.length>0&&(l===``||re.some(e=>Qd(`${e.name} ${e.path}`,c,[`recent project`]))),Be=!J&&K!==null&&(l===``||Ap.some(e=>Qd(`Open in ${e.displayName}`,c,[e.id,`agent handoff`]))),Ve=pe.kind===`tag-list`?tf(w,pe.query):[],He=pe.kind===`tag-list`&&E!==`loading`&&Ve.length===0,Ue=pe.kind===`tag-docs`&&j===`success`&&k.length===0,We=J||we||Y||Ee||Oe||Ae||Ne||Fe||Ie||Le||Re||ze||Be,Ge;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=function(e){s(`${$d}${e}`)},t[39]=Ge):Ge=t[39];let Ke=Ge,qe=Cp,Je;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(Je={shouldFilter:!1,className:`[&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4`},t[40]=Je):Je=t[40];let Ye;t[41]===o?Ye=t[42]:(Ye=(0,Z.jsx)(wp,{ref:F,value:o,onValueChange:s,placeholder:`Search files, folders, or commands`}),t[41]=o,t[42]=Ye);let Xe;t[43]===J?Xe=t[44]:(Xe=()=>{s(J?``:$d),F.current?.focus()},t[43]=J,t[44]=Xe);let Ze=J?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`,Qe;t[45]===Ze?Qe=t[46]:(Qe=X(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors`,Ze),t[45]=Ze,t[46]=Qe);let $e,et;t[47]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,Z.jsx)(Me,{className:`size-3.5`}),et=(0,Z.jsx)(`span`,{children:`By tag`}),t[47]=$e,t[48]=et):($e=t[47],et=t[48]);let tt;t[49]!==J||t[50]!==Xe||t[51]!==Qe?(tt=(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1.5 border-b px-3 py-2`,children:(0,Z.jsxs)(`button`,{type:`button`,onClick:Xe,"data-testid":`command-palette-filter-tag`,"data-active":J,"aria-pressed":J,className:Qe,children:[$e,et]})}),t[49]=J,t[50]=Xe,t[51]=Qe,t[52]=tt):tt=t[52];let nt=Tp,rt;t[53]!==Y||t[54]!==Ee?(rt=Ee&&!Y?(0,Z.jsx)(Ep,{children:`Searching`}):null,t[53]=Y,t[54]=Ee,t[55]=rt):rt=t[55];let it=We?null:(0,Z.jsx)(Ep,{children:p===`error`?`Search failed.`:`No matching commands.`}),at=pe.kind===`tag-list`?(0,Z.jsxs)(Dp,{heading:pe.query?`Tags matching "${pe.query}"`:`All tags`,children:[E===`loading`?(0,Z.jsx)(Ep,{children:`Loading tags`}):null,E===`error`?(0,Z.jsx)(Ep,{children:`Failed to load tags. Press Escape and re-open to retry.`}):null,He?(0,Z.jsx)(Ep,{children:pe.query?`No tags match "${pe.query}".`:"No tags yet — author `#tagname` in any doc to populate the index."}):null,Ve.map(e=>(0,Z.jsxs)(Op,{value:`tag ${e.name}`,onSelect:()=>Ke(e.name),"data-testid":`command-palette-tag-${e.name}`,children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),(0,Z.jsxs)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:[e.count,` `,e.count===1?`doc`:`docs`]})]},`tag:${e.name}`))]}):null,ot;t[56]!==i||t[57]!==pe||t[58]!==Ue||t[59]!==k||t[60]!==j?(ot=pe.kind===`tag-docs`?(0,Z.jsxs)(Dp,{heading:`Docs tagged #${pe.tagName}`,children:[j===`loading`?(0,Z.jsx)(Ep,{children:`Loading docs`}):null,j===`error`?(0,Z.jsx)(Ep,{children:`Failed to load docs. Press Escape and re-open to retry.`}):null,Ue?(0,Z.jsx)(Ep,{children:`No docs registered under #${pe.tagName}.`}):null,k.map(e=>{let t=e.title||e.docName.split(`/`).pop()||e.docName;return(0,Z.jsxs)(Op,{value:`tag-doc ${e.docName}`,onSelect:()=>{i(!1),Ym(e.docName)},"data-testid":`command-palette-tag-doc-${e.docName}`,className:`items-start`,children:[(0,Z.jsx)(_s,{className:`mt-0.5`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:t}),(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:e.docName}),e.matchingTags.length>0&&e.matchingTags.some(e=>e!==pe.tagName)?(0,Z.jsxs)(`span`,{className:`truncate text-muted-foreground text-[11px]`,children:[`via`,` `,e.matchingTags.filter(e=>e!==pe.tagName).map(nh).join(`, `)]}):null]})]},`tag-doc:${e.docName}`)})]}):null,t[56]=i,t[57]=pe,t[58]=Ue,t[59]=k,t[60]=j,t[61]=ot):ot=t[61];let st=we?(0,Z.jsx)(Dp,{heading:`Recently opened`,children:ee.map(e=>(0,Z.jsx)(Zm,{entry:e,onSelect:()=>Ce(e)},Ad(e.kind,e.path)))}):null,ct;t[62]!==I||t[63]!==i||t[64]!==S||t[65]!==Oe||t[66]!==Ae||t[67]!==Ne?(ct=Oe||Ae||Ne?(0,Z.jsxs)(Dp,{heading:`Commands`,children:[Oe?(0,Z.jsxs)(Op,{value:`new file create file`,onSelect:()=>{i(!1),S(`file`)},"data-testid":`command-palette-new-file`,children:[(0,Z.jsx)(ne,{}),(0,Z.jsx)(`span`,{children:`New file`})]}):null,Ae?(0,Z.jsxs)(Op,{value:`new folder create folder`,onSelect:()=>{i(!1),S(`folder`)},"data-testid":`command-palette-new-folder`,children:[(0,Z.jsx)(xs,{}),(0,Z.jsx)(`span`,{children:`New folder`})]}):null,Ne?(0,Z.jsxs)(Op,{value:`open graph graph panel network`,onSelect:()=>{I&&(i(!1),cf(`graph`))},"data-testid":`command-palette-open-graph`,children:[(0,Z.jsx)(Ls,{}),(0,Z.jsx)(`span`,{children:`Open graph`})]}):null]}):null,t[62]=I,t[63]=i,t[64]=S,t[65]=Oe,t[66]=Ae,t[67]=Ne,t[68]=ct):ct=t[68];let lt=Be?(0,Z.jsx)(Dp,{heading:`Open in agent`,children:Ap.filter(e=>Qd(`Open in ${e.displayName}`,c,[e.id,`agent handoff`])).map(e=>{let t=U[e.id],n=t.installed===!0&&K!==null,r=t.installed===null?`Detecting`:t.installed===!1?`Not installed`:null,a=r?`Open in ${e.displayName}, ${r}`:`Open in ${e.displayName}`;return(0,Z.jsxs)(Op,{value:`open in ${e.displayName} ${e.id} agent`,disabled:!n,onSelect:()=>{!n||!K||(i(!1),G(e.id,K))},"data-testid":`command-palette-open-in-${e.id}`,"aria-label":a,children:[(0,Z.jsxs)(`span`,{className:`flex-1`,children:[`Open in `,e.displayName]}),r?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-auto text-muted-foreground text-xs`,children:r}):null]},e.id)})}):null,ut=Fe||Ie||Le||Re||ze?(0,Z.jsxs)(Dp,{heading:`Project`,children:[Fe&&a?(0,Z.jsxs)(Op,{value:`open folder on disk project`,onSelect:()=>ve(async()=>{let e=await a.dialog.openFolder();e&&await a.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})}),"data-testid":`command-palette-open-folder`,children:[(0,Z.jsx)(xe,{}),(0,Z.jsx)(`span`,{children:`Open folder on disk`}),(0,Z.jsx)(kp,{children:`⌘O`})]}):null,Ie&&a?(0,Z.jsxs)(Op,{value:`switch-project navigator projects`,onSelect:()=>ve(()=>a.navigator.open(),`Failed to open Project Navigator.`),"data-testid":`command-palette-switch-project`,children:[(0,Z.jsx)(Os,{}),(0,Z.jsx)(`span`,{children:`Switch Project`}),(0,Z.jsx)(kp,{children:`⌘⇧N`})]}):null,Le?(0,Z.jsxs)(Op,{value:`settings preferences config`,onSelect:()=>{i(!1),window.location.hash!==`#settings`&&(window.location.hash=jp)},"data-testid":`command-palette-settings`,children:[(0,Z.jsx)(Js,{}),(0,Z.jsx)(`span`,{children:`Settings`}),(0,Z.jsx)(kp,{children:`⌘,`})]}):null,Re?(0,Z.jsxs)(Op,{value:`install claude desktop cowork app`,onSelect:()=>{i(!1),window.location.hash=`#install-claude-desktop`},"data-testid":`command-palette-install-claude-desktop`,children:[(0,Z.jsx)(di,{}),(0,Z.jsx)(`span`,{children:`Install for Claude Chat & Cowork (Desktop App)`})]}):null,ze&&a?re.filter(e=>Qd(`${e.name} ${e.path}`,c,[`recent project`])).slice(0,10).map(e=>(0,Z.jsxs)(Op,{value:`${e.name} ${e.path} recent project`,disabled:e.missing,onSelect:()=>ve(()=>a.project.open({path:e.path,target:`new-window`,entryPoint:`recents`}),`Failed to open project.`),"data-testid":`command-palette-recent-${e.path}`,children:[(0,Z.jsx)(Qr,{}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),(0,Z.jsxs)(`span`,{className:`truncate text-muted-foreground text-xs`,children:[e.path,e.missing?` (missing)`:``]})]})]},e.path)):null]}):null,dt=Y?(0,Z.jsx)(Dp,{heading:`Search`,children:Te.map(e=>(0,Z.jsx)(Zm,{entry:e,query:l,onSelect:()=>Ce(e)},Ad(e.kind,e.path)))}):null,ft;t[69]!==nt||t[70]!==rt||t[71]!==it||t[72]!==at||t[73]!==ot||t[74]!==st||t[75]!==ct||t[76]!==lt||t[77]!==ut||t[78]!==dt?(ft=(0,Z.jsxs)(nt,{ref:P,className:`subtle-scrollbar`,children:[rt,it,at,ot,st,ct,lt,ut,dt]}),t[69]=nt,t[70]=rt,t[71]=it,t[72]=at,t[73]=ot,t[74]=st,t[75]=ct,t[76]=lt,t[77]=ut,t[78]=dt,t[79]=ft):ft=t[79];let pt;t[80]!==qe||t[81]!==i||t[82]!==r||t[83]!==Je||t[84]!==Ye||t[85]!==tt||t[86]!==ft?(pt=(0,Z.jsxs)(qe,{open:r,onOpenChange:i,title:`Workspace Command Palette`,description:`Search files, folders, and commands for the current workspace.`,className:`sm:max-w-2xl`,commandProps:Je,children:[Ye,tt,ft]}),t[80]=qe,t[81]=i,t[82]=r,t[83]=Je,t[84]=Ye,t[85]=tt,t[86]=ft,t[87]=pt):pt=t[87];let mt=x===`file`,ht;t[88]===S?ht=t[89]:(ht=e=>{e||S(null)},t[88]=S,t[89]=ht);let gt;t[90]!==ae||t[91]!==mt||t[92]!==ht?(gt=(0,Z.jsx)(Sf,{open:mt,onOpenChange:ht,kind:`file`,initialDir:ae}),t[90]=ae,t[91]=mt,t[92]=ht,t[93]=gt):gt=t[93];let _t=x===`folder`,vt;t[94]===S?vt=t[95]:(vt=e=>{e||S(null)},t[94]=S,t[95]=vt);let yt;t[96]!==ae||t[97]!==_t||t[98]!==vt?(yt=(0,Z.jsx)(Sf,{open:_t,onOpenChange:vt,kind:`folder`,initialDir:ae}),t[96]=ae,t[97]=_t,t[98]=vt,t[99]=yt):yt=t[99];let bt;return t[100]!==pt||t[101]!==gt||t[102]!==yt?(bt=(0,Z.jsxs)(Z.Fragment,{children:[pt,gt,yt]}),t[100]=pt,t[101]=gt,t[102]=yt,t[103]=bt):bt=t[103],bt}function nh(e){return`#${e}`}function rh(e){return e.name}function ih(e){return Ad(e.kind,e.path)}var ah=500;function oh(e,t,n){return t?`terminal`:e===null&&n?`retrying`:`hidden`}function sh(e){return e===null?`no response`:e.kind===`null-collab`?`ok ui responded but server.lock has no port yet`:e.code===`network`?"network error (is `ok ui` running?)":e.code===`invalid-body`?`/api/config returned a malformed body`:`/api/config returned HTTP ${e.code}`}function ch(){let e=(0,$.c)(16),{collabUrl:t,collabTerminal:n,collabLastError:r,retryCollab:i}=Pe(),[a,o]=(0,Q.useState)(!1),s,c;e[0]!==n||e[1]!==t?(s=()=>{if(t!==null||n){o(!1);return}let e=setTimeout(()=>o(!0),ah);return()=>clearTimeout(e)},c=[t,n],e[0]=n,e[1]=t,e[2]=s,e[3]=c):(s=e[2],c=e[3]),(0,Q.useEffect)(s,c);let l=oh(t,n,a);if(l===`hidden`)return null;if(l===`terminal`){let t;e[4]===r?t=e[5]:(t=sh(r),e[4]=r,e[5]=t);let n;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`,children:`ok status`}),e[6]=n):n=e[6];let a;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`,children:`.ok/local/last-spawn-error.log`}),e[7]=a):a=e[7];let o;e[8]===t?o=e[9]:(o=(0,Z.jsxs)(`span`,{children:[`Couldn't reach collab server — `,t,`. Try`,` `,n,` or check`,` `,a,`.`]}),e[8]=t,e[9]=o);let s;e[10]===i?s=e[11]:(s=(0,Z.jsx)(`button`,{type:`button`,onClick:i,className:`bg-red-950 text-red-50 px-2 py-0.5 rounded text-xs font-medium hover:bg-red-900`,children:`Retry`}),e[10]=i,e[11]=s);let c;return e[12]!==o||e[13]!==s?(c=(0,Z.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,className:`fixed top-0 inset-x-0 z-50 bg-red-500/95 text-red-950 text-sm text-center py-2 px-4 shadow-md flex items-center justify-center gap-3 flex-wrap`,children:[o,s]}),e[12]=o,e[13]=s,e[14]=c):c=e[14],c}let u;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed top-0 inset-x-0 z-50 bg-amber-500/95 text-amber-950 text-sm text-center py-2 px-4 shadow-md`,children:`Connecting — waiting for collab server`}),e[15]=u):u=e[15],u}async function lh(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok){let e=await t.json().catch(()=>null);throw Error(An(e)??`Server error: ${t.status} ${t.statusText}`)}return(await t.json()).docs??[]}function uh(){let e=(0,$.c)(15),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={kind:`idle`},e[0]=a):a=e[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(0),l,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=function(e){let t=e.detail;if(!t||typeof t.value!=`string`)return;let r=c.current+=1;i(t.value),n(!0),s({kind:`loading`}),lh(t.value).then(e=>{c.current===r&&s({kind:`ready`,docs:e})}).catch(e=>{c.current===r&&s({kind:`error`,message:e instanceof Error?e.message:String(e)})})};return document.addEventListener(je,e),()=>document.removeEventListener(je,e)},u=[],e[1]=l,e[2]=u):(l=e[1],u=e[2]),(0,Q.useEffect)(l,u);let d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=function(e){n(!1),window.location.assign(Gn(e))},e[3]=d):d=e[3];let f=d,p=r??``,m;e[4]===p?m=e[5]:(m=(0,Z.jsx)(ro,{children:(0,Z.jsxs)($a,{children:[`Documents tagged `,(0,Z.jsxs)(`span`,{className:`font-mono`,children:[`#`,p]})]})}),e[4]=p,e[5]=m);let h=r??``,g;e[6]!==o||e[7]!==h?(g=(0,Z.jsx)(to,{children:(0,Z.jsx)(dh,{fetchState:o,tag:h,onSelectDoc:f})}),e[6]=o,e[7]=h,e[8]=g):g=e[8];let _;e[9]!==m||e[10]!==g?(_=(0,Z.jsxs)(eo,{children:[m,g]}),e[9]=m,e[10]=g,e[11]=_):_=e[11];let v;return e[12]!==t||e[13]!==_?(v=(0,Z.jsx)(io,{open:t,onOpenChange:n,children:_}),e[12]=t,e[13]=_,e[14]=v):v=e[14],v}function dh(e){let t=(0,$.c)(12),{fetchState:n,tag:r,onSelectDoc:i}=e;if(n.kind===`idle`||n.kind===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`tag-dialog-loading`,children:`Loading`}),t[0]=e):e=t[0],e}if(n.kind===`error`){let e;return t[1]===n.message?e=t[2]:(e=(0,Z.jsx)(`p`,{className:`text-destructive text-sm`,"data-testid":`tag-dialog-error`,children:n.message}),t[1]=n.message,t[2]=e),e}if(n.docs.length===0){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`tag-dialog-empty`,children:[`Only the current document uses `,(0,Z.jsxs)(`span`,{className:`font-mono`,children:[`#`,r]}),`.`]}),t[3]=r,t[4]=e),e}let a;if(t[5]!==n.docs||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>{let t=e.matchingTags??[];return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`w-full rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring`,onClick:()=>i(e.docName),"data-testid":`tag-dialog-row`,children:[(0,Z.jsx)(`span`,{className:`block truncate font-medium`,children:e.title}),e.docName===e.title?null:(0,Z.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.docName}),t.length>0?(0,Z.jsx)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1`,"data-testid":`tag-dialog-row-matches`,children:t.map(fh)}):null]})},e.docName)},t[8]=i,t[9]=e),a=n.docs.map(e),t[5]=n.docs,t[6]=i,t[7]=a}else a=t[7];let o;return t[10]===a?o=t[11]:(o=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,"data-testid":`tag-dialog-list`,children:a}),t[10]=a,t[11]=o),o}function fh(e){return(0,Z.jsxs)(`span`,{"data-testid":`tag-dialog-row-match`,"data-tag":e,className:`tag pointer-events-none text-xs`,children:[`#`,e]},e)}var ph=`raw-mdx-nav`,mh=`ok-editor-mode-v1`,hh=[`wysiwyg`,`source`],gh=`wysiwyg`;function _h(e){return hh.includes(e)}function vh(e=localStorage){try{let t=e.getItem(mh);if(t===null)return gh;if(_h(t))return t;console.warn(`[editor-mode] invalid persisted value, falling back to default`,{raw:t})}catch{}return gh}function yh(e=window,t=localStorage){let n=e.__OK_EDITOR_MODE__;return _h(n)?n:vh(t)}function bh(e,t=localStorage){try{return t.setItem(mh,e),!0}catch(e){return console.warn(`[editor-mode] persist failed`,e),!1}}function xh(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(yh),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=function(e){n(e),bh(e)},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a=[t,i],e[1]=t,e[2]=a),a}function Sh(e){let t=(0,$.c)(21),{open:n,onResolved:r}=e,i=Pi(),a;t[0]!==r||t[1]!==i?(a=function(e){if(i===null){Fa.error(`Sync settings not yet loaded — try again in a moment`);return}let t=i(e);if(!t.ok){Fa.error(`Could not ${e?`enable sync`:`save sync preference`}: ${t.error}`);return}r()},t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=a,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(ro,{children:(0,Z.jsx)(Ni,{})}),t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(to,{children:(0,Z.jsx)(Fi,{})}),t[4]=c):c=t[4];let l;t[5]===o?l=t[6]:(l=()=>o(!1),t[5]=o,t[6]=l);let u=i===null,d;t[7]!==l||t[8]!==u?(d=(0,Z.jsx)(zr,{variant:`ghost`,className:`uppercase font-mono`,onClick:l,disabled:u,children:`Keep disabled`}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;t[10]===o?f=t[11]:(f=()=>o(!0),t[10]=o,t[11]=f);let p=i===null,m;t[12]!==f||t[13]!==p?(m=(0,Z.jsx)(zr,{onClick:f,disabled:p,children:`Enable auto-sync`}),t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;t[15]!==d||t[16]!==m?(h=(0,Z.jsxs)(eo,{className:`sm:max-w-lg`,showCloseButton:!1,children:[s,c,(0,Z.jsxs)(no,{children:[d,m]})]}),t[15]=d,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==n||t[19]!==h?(g=(0,Z.jsx)(io,{open:n,onOpenChange:Ch,children:h}),t[18]=n,t[19]=h,t[20]=g):g=t[20],g}function Ch(){}function wh(e){let t=(0,$.c)(9),{onOpenResolver:n}=e,r=Ki();if(!r||r.state!==`conflict`)return null;let i=r.conflictCount,a=i>0?`${i} page${i===1?``:`s`}`:`Some pages`,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Er,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s=i===1?`has`:`have`,c;t[1]!==a||t[2]!==s?(c=(0,Z.jsxs)(`span`,{className:`flex-1`,children:[a,` `,s,` conflicting changes.`]}),t[1]=a,t[2]=s,t[3]=c):c=t[3];let l;t[4]===n?l=t[5]:(l=(0,Z.jsx)(zr,{variant:`outline`,size:`xs`,className:`shrink-0 border-amber-400 dark:border-amber-700 text-amber-800 dark:text-amber-300 hover:bg-amber-100 dark:hover:bg-amber-900/50`,onClick:n,children:`Review and resolve`}),t[4]=n,t[5]=l);let u;return t[6]!==c||t[7]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm border-b bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 shrink-0`,children:[o,c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8],u}var Th=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function Eh(e,t,n,r,i,a){if(e==r)return[];let o=Ih(e,t,n,r,i,a),s=Lh(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new Th(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new Th(t,t+o,i,i),new Th(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new Th(t,t,i,i+o),new Th(n,n,i+o+c,a)]}if(c==1||l==1)return[new Th(t,n,i,a)];let u=zh(e,t,n,r,i,a);if(u){let[o,s,c]=u;return Eh(e,t,o,r,i,s).concat(Eh(e,o+c,n,r,s+c,a))}return Ah(e,t,n,r,i,a)}var Dh=1e9,Oh=0,kh=!1;function Ah(e,t,n,r,i,a){let o=n-t,s=a-i;if(Dh<1e9&&Math.min(o,s)>Dh*16||Oh>0&&Date.now()>Oh)return Math.min(o,s)>Dh*64?[new Th(t,n,i,a)]:Bh(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);Mh.reset(c),Nh.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:Nh,f=d?null:Mh;for(let p=0;p<c;p++){if(p>Dh||Oh>0&&!(p&63)&&Date.now()>Oh)return Bh(e,t,n,r,i,a);let m=Mh.advance(p,o,s,c,d,!1,l)||Nh.advance(p,o,s,c,f,!0,u);if(m)return Ph(e,t,n,t+m[0],r,i,a,i+m[1])}return[new Th(t,n,i,a)]}var jh=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1)if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}return null}},Mh=new jh,Nh=new jh;function Ph(e,t,n,r,i,a,o,s){let c=!1;return!tg(e,r)&&++r==n&&(c=!0),!tg(i,s)&&++s==o&&(c=!0),c?[new Th(t,n,a,o)]:Eh(e,t,r,i,a,s).concat(Eh(e,r,n,i,s,o))}function Fh(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function Ih(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=Fh(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!tg(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function Lh(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=Fh(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!tg(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function Rh(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){tg(e,s)||s++;let u=s+o;if(tg(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=Ih(e,u,n,r,i+f+d.length,a),c=Lh(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function zh(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=zh(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:Rh(e,t,n,r,i,a,Math.floor(o/4),-1)}function Bh(e,t,n,r,i,a){kh=!0;let o=n-t,s=a-i,c;if(o<s){let s=Rh(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=Rh(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new Th(t,n,i,a)];let[l,u,d]=c;return Eh(e,t,l,r,i,u).concat(Eh(e,l+d,n,r,u+d,a))}function Vh(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new Th(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function Hh(e,t,n){for(;;){Vh(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=Ih(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new Th(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=Lh(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new Th(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new Th(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new Th(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function Uh(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=Xh(t,a.fromA,l),f=Yh(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new Th(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=Yh(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new Th(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=Xh(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new Th(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=Qh(n,a.fromB,a.toB),r,o=t<0?-1:Zh(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=Qh(t,a.fromA,a.toA),r,o=n<0?-1:Zh(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return Vh(e,3),e}var Wh;try{Wh=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function Gh(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Kh(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!Gh(n):Wh?!$h(n)||t==e.length-1?+!!Wh.test(String.fromCharCode(n)):Wh.test(e.slice(t,t+2))?2:0:0}function qh(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!Gh(n):Wh?!eg(n)||t==1?+!!Wh.test(String.fromCharCode(n)):Wh.test(e.slice(t-2,t))?2:0:0}var Jh=8;function Yh(e,t,n){if(t==e.length||!qh(e,t))return t;for(let r=t,i=t+n,a=0;a<Jh;a++){let t=Kh(e,r);if(!t||r+t>i)return r;r+=t}return t}function Xh(e,t,n){if(!t||!Kh(e,t))return t;for(let r=t,i=t-n,a=0;a<Jh;a++){let t=qh(e,r);if(!t||r-t<i)return r;r-=t}return t}function Zh(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function Qh(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var $h=e=>e>=55296&&e<=56319,eg=e=>e>=56320&&e<=57343;function tg(e,t){return!t||t==e.length||!$h(e.charCodeAt(t-1))||!eg(e.charCodeAt(t))}function ng(e,t,n){let r=n?.override;return r?r(e,t):(Dh=(n?.scanLimit??1e9)>>1,Oh=n?.timeout?Date.now()+n.timeout:0,kh=!1,Hh(e,t,Eh(e,0,e.length,t,0,t.length)))}function rg(){return!kh}function ig(e,t,n){return Uh(ng(e,t,n),e,t)}var ag=vo.define({combine:e=>e[0]}),og=yo.define(),sg=vo.define(),cg=po.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(og)&&(e=n.value);for(let n of t.state.facet(sg))e=n(e,t);return e}});function lg(e){let t=e.field(cg,!1);if(!t)return null;let n=e.facet(ag);return{chunks:t,side:n?n.side:null}}var ug=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return pg(ig(e.toString(),t.toString(),n),e,t,0,0,rg())}static updateA(e,t,n,r,i){return _g(gg(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return _g(gg(e,r,!1,t.length),e,t,n,i)}};function dg(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function fg(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function pg(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=dg(c.fromA+r,c.fromB+i,t,n),[d,f]=fg(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=dg(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=fg(a.toA+r,a.toB+i,t,n),s++}o.push(new ug(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var mg=1e3;function hg(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function gg(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>mg&&([l,d]=hg(e,a-mg,n,!0)),o<t.length-mg&&([u,f]=hg(e,o+mg,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function _g(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=ig(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of pg(h,n,r,d,f,rg()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var vg={scanLimit:500},yg=bo.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=kg(e))}update(e){(e.docChanged||e.viewportChanged||xg(e.startState,e.state)||Sg(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=kg(e.view))}},{decorations:e=>e.deco}),bg=lo.low(wo({class:`cm-changeGutter`,markers:e=>e.plugin(yg)?.gutter||Eo.empty}));function xg(e,t){return e.field(cg,!1)!=t.field(cg,!1)}function Sg(e,t){return e.facet(ag)!=t.facet(ag)}var Cg=go.line({class:`cm-changedLine`}),wg=go.mark({class:`cm-changedText`}),Tg=go.mark({tagName:`ins`,class:`cm-insertedLine`}),Eg=go.mark({tagName:`del`,class:`cm-deletedLine`}),Dg=new class extends Co{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function Og(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,Cg),i.add(o,s,n?Eg:Tg),a&&a.add(o,o,Dg);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,Cg),a&&a.add(u,u,Dg);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,wg),s<t)c++;else break}u=t}}}function kg(e){let t=e.state.field(cg),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(ag),o=n==`a`,s=new _o,c=i?new _o:null,{from:l,to:u}=e.viewport;for(let n of t){if((o?n.fromA:n.fromB)>=u)break;(o?n.toA:n.toB)>l&&(!a||!a(e.state,n,s,c))&&Og(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var Ag=class extends co{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},jg=yo.define({map:(e,t)=>e.map(t)}),Mg=po.define({create:()=>go.none,update:(e,t)=>{for(let e of t.effects)if(e.is(jg))return e.value;return e.map(t.changes)},provide:e=>So.decorations.from(e)}),Ng=.01;function Pg(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function Fg(e,t,n){let r=new _o,i=new _o,a=e.state.field(Mg).iter(),o=t.state.field(Mg).iter(),s=0,c=0,l=0,u=0,d=e.viewport,f=t.viewport;for(let p=0;;p++){let m=p<n.length?n[p]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(s<h){let n=e.lineBlockAt(s).top+l-(t.lineBlockAt(c).top+u);n<-Ng?(l-=n,r.add(s,s,go.widget({widget:new Ag(-n),block:!0,side:-1}))):n>Ng&&(u+=n,i.add(c,c,go.widget({widget:new Ag(n),block:!0,side:-1})))}if(h>s+1e3&&s<d.from&&h>d.from&&c<f.from&&g>f.from){let e=Math.min(d.from-s,f.from-c);s+=e,c+=e,p--}else if(m)s=m.toA,c=m.toB;else break;for(;a.value&&a.from<s;)l-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next()}for(;a.value;)l-=a.value.spec.widget.height,a.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let p=e.contentHeight+l-(t.contentHeight+u);p<Ng?r.add(e.state.doc.length,e.state.doc.length,go.widget({widget:new Ag(-p),block:!0,side:1})):p>Ng&&i.add(t.state.doc.length,t.state.doc.length,go.widget({widget:new Ag(p),block:!0,side:1}));let m=r.finish(),h=i.finish();Pg(m,e.state.field(Mg))||e.dispatch({effects:jg.of(m)}),Pg(h,t.state.field(Mg))||t.dispatch({effects:jg.of(h)})}var Ig=yo.define({map:(e,t)=>t.mapPos(e)}),Lg=class extends co{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:Ig.of(n)});let{side:r,sibling:i}=e.state.facet(ag);i&&i().dispatch({effects:Ig.of(Rg(n,e.state.field(cg),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function Rg(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var zg=po.define({create(e){return go.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(Ig)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>So.decorations.from(e)});function Bg({margin:e=3,minSize:t=4}){return zg.init(n=>Vg(n,e,t))}function Vg(e,t,n){let r=new _o,i=e.facet(ag).side==`a`,a=e.field(cg),o=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,l=s?o+t:1,u=c?e.doc.lineAt(i?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=n&&r.add(e.doc.line(l).from,e.doc.line(u).to,go.replace({widget:new Lg(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var Hg=So.styleModule.of(new To({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),Ug=So.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),Wg=new xo,Gg=new xo,Kg=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||vg;let t=[lo.low(yg),Ug,Hg,Mg,So.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(jg)))&&this.measure()})],n=[ag.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(bg);let r=fo.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],So.editorAttributes.of({class:`cm-merge-a`}),Gg.of(n),t]}),i=[ag.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(bg);let a=fo.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],So.editorAttributes.of({class:`cm-merge-b`}),Gg.of(i),t]});this.chunks=ug.build(r.doc,a.doc,this.diffConf);let o=[cg.init(()=>this.chunks),Wg.of(e.collapseUnchanged?Bg(e.collapseUnchanged):[])];r=r.update({effects:yo.appendConfig.of(o)}).state,a=a.update({effects:yo.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new So({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new So({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),uo.empty(e[0].startState.doc.length));this.chunks=t==this.a?ug.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):ug.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:og.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:og.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(ag),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(Gg.reconfigure([ag.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?bg:[]])),a.push(Gg.reconfigure([ag.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?bg:[]]))}if(r){let t=Wg.reconfigure(e.collapseUnchanged?Bg(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){this.measuring<0&&(this.measuring=(this.dom.ownerDocument.defaultView||window).requestAnimationFrame(()=>{this.measuring=-1,this.measure()}))}measure(){Fg(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=qg(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=qg(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function qg(e){let t=e.nextSibling;return e.remove(),t}var Jg=new class extends Co{constructor(){super(...arguments),this.elementClass=`cm-deletedLineGutter`}},Yg=lo.low(wo({class:`cm-changeGutter`,markers:e=>e.plugin(yg)?.gutter||Eo.empty,widgetMarker:(e,t)=>t instanceof e_?Jg:null}));function Xg(e){let t=typeof e.original==`string`?ho.of(e.original.split(/\r?\n/)):e.original,n=e.diffConfig||vg;return[lo.low(yg),a_,Ug,So.editorAttributes.of({class:`cm-merge-b`}),sg.of((e,t)=>{let r=t.effects.find(e=>e.is(Zg));return r&&(e=ug.updateA(e,r.value.doc,t.startState.doc,r.value.changes,n)),t.docChanged&&(e=ug.updateB(e,t.state.field(Qg),t.newDoc,t.changes,n)),e}),ag.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:e.mergeControls??!0,overrideChunk:e.allowInlineDiffs?d_:void 0,side:`b`}),Qg.init(()=>t),e.gutter===!1?[]:Yg,e.collapseUnchanged?Bg(e.collapseUnchanged):[],cg.init(e=>ug.build(t,e.doc,n))]}var Zg=yo.define(),Qg=po.define({create:()=>ho.empty,update(e,t){for(let n of t.effects)n.is(Zg)&&(e=n.value.doc);return e}}),$g=new WeakMap,e_=class extends co{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||=this.buildDOM(e)}};function t_(e,t,n){let r=$g.get(t.changes);if(r)return r;let i=go.widget({block:!0,side:-1,widget:new e_(r=>{let{highlightChanges:i,syntaxHighlightDeletions:a,syntaxHighlightDeletionsMaxLength:o,mergeControls:s}=e.facet(ag),c=document.createElement(`div`);if(c.className=`cm-deletedChunk`,s){let t=c.appendChild(document.createElement(`div`));t.className=`cm-chunkButtons`;let n=e=>{e.preventDefault(),n_(r,r.posAtDOM(c))},i=e=>{e.preventDefault(),r_(r,r.posAtDOM(c))};if(typeof s==`function`)t.appendChild(s(`accept`,n)),t.appendChild(s(`reject`,i));else{let r=t.appendChild(document.createElement(`button`));r.name=`accept`,r.textContent=e.phrase(`Accept`),r.onmousedown=n;let a=t.appendChild(document.createElement(`button`));a.name=`reject`,a.textContent=e.phrase(`Reject`),a.onmousedown=i}}if(n||t.fromA>=t.toA)return c;let l=r.state.field(Qg).sliceString(t.fromA,t.endA),u=a&&e.facet(Do),d=h(),f=t.changes,p=0,m=!1;function h(){let e=c.appendChild(document.createElement(`div`));return e.className=`cm-deletedLine`,e.appendChild(document.createElement(`del`))}function g(e,t,n){for(let r=e;r<t;){if(l.charAt(r)==`
|
|
14
|
+
`){d.firstChild||d.appendChild(document.createElement(`br`)),d=h(),r++;continue}let e=t,a=n+(m?` cm-deletedText`:``),o=!1,s=l.indexOf(`
|
|
15
|
+
`,r);if(s>-1&&s<t&&(e=s),i&&p<f.length){let t=Math.max(0,m?f[p].toA:f[p].fromA);t<=e&&(e=t,m&&p++,o=!0)}if(e>r){let t=document.createTextNode(l.slice(r,e));if(a){let e=d.appendChild(document.createElement(`span`));e.className=a,e.appendChild(t)}else d.appendChild(t);r=e}o&&(m=!m)}}if(u&&t.toA-t.fromA<=o){let t=u.parser.parse(l),n=0;mo(t,{style:t=>Oo(e,t)},(e,t,r)=>{e>n&&g(n,e,``),g(e,t,r),n=t}),g(n,l.length,``)}else g(0,l.length,``);return d.firstChild||d.appendChild(document.createElement(`br`)),c})});return $g.set(t.changes,i),i}function n_(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(cg).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=e.state.field(Qg);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=uo.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:Zg.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function r_(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(cg).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(Qg).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(a+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:a},userEvent:`revert`}),!0}function i_(e){let t=new _o;for(let n of e.field(cg)){let r=e.facet(ag).overrideChunk&&s_(e,n);t.add(n.fromB,n.fromB,t_(e,n,!!r))}return t.finish()}var a_=po.define({create:e=>i_(e),update(e,t){return t.state.field(cg,!1)==t.startState.field(cg,!1)?e:i_(t.state)},provide:e=>So.decorations.from(e)}),o_=new WeakMap;function s_(e,t){let n=o_.get(t);if(n!==void 0)return n;n=null;let r=e.field(Qg),i=e.doc,a=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,o=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;abort:if(a==o&&a<10){let e=[],i=0,o=t.fromA,s=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(o+n.fromA,o+n.toA);if(/\n/.test(t))break abort;e.push(go.widget({widget:new c_(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(wg.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return o_.set(t,n),n}var c_=class extends co{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement(`del`);return t.className=`cm-deletedText`,t.textContent=this.text,t}},l_=new class extends Co{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},u_=go.line({class:`cm-inlineChangedLine`});function d_(e,t,n,r){let i=s_(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,l_),n.add(o.from,o.from,u_);a<i.length&&i[a].to<=o.to;){let e=i[a++];n.add(e.from,e.to,e.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var f_=P({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),p_=st({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function m_(e){let t=(0,$.c)(20),{oldContent:n,newContent:r,layout:i,conflictMode:a,onResolve:o,onAbort:s}=e,c=(0,Q.useRef)(null),l=(0,Q.useRef)(null),{resolvedTheme:u}=nn(),d=(0,Q.useRef)(o),f=(0,Q.useRef)(s),[p,m]=(0,Q.useState)(null),g;t[0]!==s||t[1]!==o?(g=()=>{d.current=o,f.current=s},t[0]=s,t[1]=o,t[2]=g):g=t[2],(0,Q.useEffect)(g);let _,v;t[3]!==a||t[4]!==i||t[5]!==r||t[6]!==n||t[7]!==u?(_=()=>{if(!c.current)return;let e=u===`dark`?f_:p_,t=[So.editable.of(!1),fo.readOnly.of(!0)],o=[jo,h(),...t,e,So.lineWrapping];if(l.current&&=(l.current.destroy(),null),a){let t=new So({doc:r,extensions:[jo,h(),So.editable.of(!1),e,So.lineWrapping,Xg({original:n,highlightChanges:!0,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),So.updateListener.of(e=>{let t=lg(e.state);m(t?t.chunks.length:0)})],parent:c.current});l.current=t;let i=lg(t.state);m(i?i.chunks.length:0)}else i===`split`?l.current=new Kg({a:{doc:n,extensions:o},b:{doc:r,extensions:o},parent:c.current,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):l.current=new So({doc:r,extensions:[...o,Xg({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:c.current});return()=>{l.current&&=(l.current.destroy(),null)}},v=[n,r,i,u,a],t[3]=a,t[4]=i,t[5]=r,t[6]=n,t[7]=u,t[8]=_,t[9]=v):(_=t[8],v=t[9]),(0,Q.useEffect)(_,v);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=function(){let e=l.current;!e||!(e instanceof So)||d.current?.(e.state.doc.toString())},t[10]=y):y=t[10];let b=y,x=p===0,S=p===null?``:p===0?`All hunks resolved`:`${p} unresolved hunk${p===1?``:`s`}`,C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(`div`,{ref:c,className:`diff-view min-h-0 flex-1 overflow-y-auto subtle-scrollbar`}),t[11]=C):C=t[11];let w;t[12]!==x||t[13]!==a||t[14]!==S||t[15]!==s||t[16]!==o?(w=a&&(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 border-t shrink-0`,children:[(0,Z.jsx)(`span`,{className:`text-xs ${x?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:S}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s&&(0,Z.jsx)(zr,{variant:`ghost`,size:`sm`,onClick:s,children:`Exit merge`}),o&&(0,Z.jsx)(zr,{variant:`default`,size:`sm`,disabled:!x,onClick:b,children:`Save resolution`})]})]}),t[12]=x,t[13]=a,t[14]=S,t[15]=s,t[16]=o,t[17]=w):w=t[17];let T;return t[18]===w?T=t[19]:(T=(0,Z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[C,w]}),t[18]=w,t[19]=T),T}function h_(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Pa,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function g_(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(ka,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function __(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ja,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function v_(e){let t=(0,$.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,side:a,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`right`:a,c=o===void 0?!0:o,l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(__,{}),t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=X(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,r),t[7]=r,t[8]=u);let d;t[9]===c?d=t[10]:(d=c&&(0,Z.jsx)(La,{"data-slot":`sheet-close`,asChild:!0,children:(0,Z.jsxs)(zr,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,Z.jsx)(Ma,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})}),t[9]=c,t[10]=d);let f;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==u||t[15]!==d?(f=(0,Z.jsxs)(g_,{children:[l,(0,Z.jsxs)(Na,{"data-slot":`sheet-content`,"data-side":s,className:u,...i,children:[n,d]})]}),t[11]=n,t[12]=i,t[13]=s,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function y_(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex flex-col gap-0.5 p-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sheet-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function b_(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`font-heading text-base font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Ia,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function x_(){try{let e=await fetch(`/api/sync/conflicts`);return e.ok?{conflicts:(await e.json()).conflicts??[]}:{conflicts:[],error:`server`}}catch{return{conflicts:[],error:`network`}}}async function S_(e){try{let t=await fetch(`/api/sync/conflict-content?file=${encodeURIComponent(e)}`);if(!t.ok)return{ours:``,theirs:``,base:``};let n=await t.json();return{ours:n.ours??``,theirs:n.theirs??``,base:n.base??``}}catch{return{ours:``,theirs:``,base:``}}}async function C_(e,t,n){try{let r={file:e,strategy:t};return n!==void 0&&(r.content=n),(await fetch(`/api/sync/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})).ok}catch{return!1}}var w_=`w-[98vw] !max-w-[98vw] h-[96vh] flex flex-col gap-0 sm:!max-w-[98vw]`;function T_(e){let t=(0,$.c)(31),{file:n,onResolve:r,onAbort:i}=e,[a,o]=(0,Q.useState)(null),s,c;if(t[0]===n?(s=t[1],c=t[2]):(s=()=>{let e=!1;return S_(n).then(t=>{e||o(t)}),()=>{e=!0}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Q.useEffect)(s,c),a===null){let e;t[3]===i?e=t[4]:(e=e=>!e&&i(),t[3]=i,t[4]=e);let r;t[5]===n?r=t[6]:(r=(0,Z.jsx)(ro,{className:`shrink-0`,children:(0,Z.jsxs)($a,{children:[`Resolving: `,n]})}),t[5]=n,t[6]=r);let a;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-sm text-muted-foreground`,children:`Loading`}),t[7]=a):a=t[7];let o;t[8]===r?o=t[9]:(o=(0,Z.jsxs)(eo,{className:w_,children:[r,a]}),t[8]=r,t[9]=o);let s;return t[10]!==e||t[11]!==o?(s=(0,Z.jsx)(io,{open:!0,onOpenChange:e,children:o}),t[10]=e,t[11]=o,t[12]=s):s=t[12],s}let l;t[13]===i?l=t[14]:(l=e=>!e&&i(),t[13]=i,t[14]=l);let u;t[15]===n?u=t[16]:(u=(0,Z.jsxs)($a,{className:`text-sm font-medium`,children:[`Resolving: `,n]}),t[15]=n,t[16]=u);let d;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Red = your version (ours). Green = team's version (theirs). Accept each hunk to take theirs, reject to keep yours, then save.`}),t[17]=d):d=t[17];let f;t[18]===u?f=t[19]:(f=(0,Z.jsxs)(ro,{className:`px-4 pt-4 pb-2 shrink-0`,children:[u,d]}),t[18]=u,t[19]=f);let p;t[20]!==i||t[21]!==r||t[22]!==a.ours||t[23]!==a.theirs?(p=(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,Z.jsx)(m_,{oldContent:a.ours,newContent:a.theirs,layout:`unified`,conflictMode:!0,onResolve:r,onAbort:i})}),t[20]=i,t[21]=r,t[22]=a.ours,t[23]=a.theirs,t[24]=p):p=t[24];let m;t[25]!==f||t[26]!==p?(m=(0,Z.jsxs)(eo,{className:`${w_} p-0`,children:[f,p]}),t[25]=f,t[26]=p,t[27]=m):m=t[27];let h;return t[28]!==l||t[29]!==m?(h=(0,Z.jsx)(io,{open:!0,onOpenChange:l,children:m}),t[28]=l,t[29]=m,t[30]=h):h=t[30],h}function E_(e){let t=(0,$.c)(50),{open:n,onOpenChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],t[0]=i):i=t[0];let[a,o]=(0,Q.useState)(i),[s,c]=(0,Q.useState)(null),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Set,t[1]=l):l=t[1];let[u,d]=(0,Q.useState)(l),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[2]=f):f=t[2];let[p,m]=(0,Q.useState)(f),[h,g]=(0,Q.useState)(null),_;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(){x_().then(e=>{let{conflicts:t,error:n}=e;c(n??null),o(t),d(e=>{let n=new Set(t.map(D_));return new Set([...e].filter(e=>!n.has(e)))})})},t[3]=_):_=t[3];let v=_,y,b;t[4]===n?(y=t[5],b=t[6]):(y=()=>{n&&v()},b=[n],t[4]=n,t[5]=y,t[6]=b),(0,Q.useEffect)(y,b);let x,S;t[7]===n?(x=t[8],S=t[9]):(x=()=>sr(e=>{e.includes(`sync-status`)&&n&&v()}),S=[n],t[7]=n,t[8]=x,t[9]=S),(0,Q.useEffect)(x,S);let C,w;t[10]!==a.length||t[11]!==r||t[12]!==n||t[13]!==u.size?(w=()=>{n&&a.length>0&&u.size>=a.length&&(Fa.success(`All conflicts resolved — sync resuming`),r(!1),d(new Set))},C=[n,a.length,u.size,r],t[10]=a.length,t[11]=r,t[12]=n,t[13]=u.size,t[14]=C,t[15]=w):(C=t[14],w=t[15]),(0,Q.useEffect)(w,C);let T;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(T=async function(e,t,n){m(t=>new Set([...t,e]));let r=await C_(e,t,n);m(t=>{let n=new Set(t);return n.delete(e),n}),r?d(t=>new Set([...t,e])):Fa.error(`Failed to resolve ${e}`)},t[16]=T):T=t[16];let E=T,D;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(e){g(e)},t[17]=D):D=t[17];let O=D,k;t[18]===h?k=t[19]:(k=async function(e){if(!h)return;let t=h;g(null),await E(t,`content`,e)},t[18]=h,t[19]=k);let A=k,j;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){g(null)},t[20]=j):j=t[20];let M=j,N;t[21]===r?N=t[22]:(N=async function(){try{(await fetch(`/api/sync/abort-merge`,{method:`POST`})).ok?Fa.info(`Merge aborted — sync paused`):Fa.error(`Failed to abort merge`)}catch{Fa.error(`Failed to abort merge — connection error`)}r(!1),d(new Set)},t[21]=r,t[22]=N);let P=N,F=a.length,I=u.size,L;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(b_,{className:`text-sm font-medium`,children:`Resolve conflicts`}),t[23]=L):L=t[23];let R;t[24]!==I||t[25]!==F?(R=F>0&&(0,Z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[I,` of `,F,` resolved`]}),t[24]=I,t[25]=F,t[26]=R):R=t[26];let z;t[27]===R?z=t[28]:(z=(0,Z.jsxs)(y_,{className:`px-4 py-3 border-b shrink-0`,children:[L,R]}),t[27]=R,t[28]=z);let B;t[29]!==a||t[30]!==s||t[31]!==u||t[32]!==p?(B=(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto subtle-scrollbar`,children:s?(0,Z.jsxs)(`div`,{className:`px-4 py-6 text-sm text-center space-y-2`,children:[(0,Z.jsx)(`p`,{className:`text-destructive`,children:s===`network`?`Could not reach the sync server — check your connection.`:`Sync server error — try again in a moment.`}),(0,Z.jsx)(zr,{variant:`outline`,size:`sm`,onClick:v,children:`Retry`})]}):a.length===0?(0,Z.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground text-center`,children:`No conflicts found.`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:a.map(e=>{let t=u.has(e.file),n=p.has(e.file),r=e.file.split(`/`).pop()??e.file;return(0,Z.jsxs)(`li`,{className:`px-4 py-3 ${t?`opacity-50`:``}`,children:[(0,Z.jsxs)(`p`,{className:`text-sm font-medium truncate mb-2`,title:e.file,children:[t?`✓ `:``,r]}),!t&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,Z.jsx)(zr,{variant:`outline`,size:`xs`,disabled:n,onClick:()=>void E(e.file,`mine`),children:`Keep my version`}),(0,Z.jsx)(zr,{variant:`outline`,size:`xs`,disabled:n,onClick:()=>void E(e.file,`theirs`),children:`Keep team's version`}),(0,Z.jsx)(zr,{variant:`ghost`,size:`xs`,disabled:n,onClick:()=>O(e.file),children:`Resolve manually`})]})]},e.file)})})}),t[29]=a,t[30]=s,t[31]=u,t[32]=p,t[33]=B):B=t[33];let V;t[34]===P?V=t[35]:(V=(0,Z.jsx)(`div`,{className:`px-4 py-3 border-t shrink-0`,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:P,children:`Exit merge`})}),t[34]=P,t[35]=V);let H;t[36]!==z||t[37]!==B||t[38]!==V?(H=(0,Z.jsxs)(v_,{side:`right`,className:`w-80 sm:w-96 flex flex-col gap-0 p-0`,children:[z,B,V]}),t[36]=z,t[37]=B,t[38]=V,t[39]=H):H=t[39];let U;t[40]!==r||t[41]!==n||t[42]!==H?(U=(0,Z.jsx)(h_,{open:n,onOpenChange:r,children:H}),t[40]=r,t[41]=n,t[42]=H,t[43]=U):U=t[43];let W;t[44]!==A||t[45]!==h?(W=h&&(0,Z.jsx)(T_,{file:h,onResolve:e=>void A(e),onAbort:M}),t[44]=A,t[45]=h,t[46]=W):W=t[46];let G;return t[47]!==U||t[48]!==W?(G=(0,Z.jsxs)(Z.Fragment,{children:[U,W]}),t[47]=U,t[48]=W,t[49]=G):G=t[49],G}function D_(e){return e.file}var O_=5;async function k_(e){let t=await fetch(`/api/backlinks?docName=${encodeURIComponent(e)}`),n=await t.json().catch(()=>null);if(!t.ok){let e=Wt.safeParse(n);throw e.success?Error(e.data.title):new Ie(`Failed to parse backlinks error response (HTTP ${t.status})`,{status:t.status})}let r=sn.safeParse(n);if(!r.success)throw new Ie(`Backlinks response did not match expected shape.`,{status:t.status});return r.data.backlinks}async function A_(e){let t=await fetch(`/api/forward-links?docName=${encodeURIComponent(e)}`),n=await t.json().catch(()=>null);if(!t.ok){let e=Wt.safeParse(n);throw e.success?Error(e.data.title):new Ie(`Failed to parse forward-links error response (HTTP ${t.status})`,{status:t.status})}let r=Wn.safeParse(n);if(!r.success)throw new Ie(`Forward-links response did not match expected shape.`,{status:t.status});return r.data.forwardLinks}function j_(e){let t=e.split(`/`);return t.length<=2?e:`…/${t.slice(-2).join(`/`)}`}function M_(e){window.location.hash=Gn(e)}function N_(e){let t=(0,$.c)(9),{title:n,count:r,isLoading:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(F,{className:`size-3.5 text-muted-foreground transition-transform group-data-[state=closed]:-rotate-90`}),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[a,(0,Z.jsx)(Ft,{children:n})]}),t[1]=n,t[2]=o);let s;t[3]!==r||t[4]!==i?(s=!i&&(0,Z.jsx)(Pt,{children:r}),t[3]=r,t[4]=i,t[5]=s):s=t[5];let c;return t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(_,{className:`group flex w-full cursor-pointer items-center justify-between px-5 py-3 text-left transition-colors hover:bg-muted/40`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function P_(e){let t=(0,$.c)(7),{total:n,expanded:r,onToggle:i}=e;if(n<=O_)return null;let a=n-O_,o;t[0]===r?o=t[1]:(o=r?(0,Z.jsx)(F,{className:`size-3`}):(0,Z.jsx)(ct,{className:`size-3`}),t[0]=r,t[1]=o);let s=r?`Show fewer`:`Show ${a} more`,c;return t[2]!==r||t[3]!==i||t[4]!==o||t[5]!==s?(c=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,className:`mt-2 inline-flex cursor-pointer items-center gap-1 px-3 text-xs text-muted-foreground transition-colors hover:text-foreground`,onClick:i,children:[o,s]}),t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function F_(e){let t=(0,$.c)(38),{icon:n,iconColorClass:r,rowTooltip:i,title:a,path:o,anchor:s,snippet:c,titleHover:l,ariaLabel:u,href:d,external:f,disabled:p,onClick:m,hoverAction:h}=e,g=o!==void 0&&o!==a,_=r??`text-muted-foreground`,v;t[0]===_?v=t[1]:(v=X(`mt-0.5 shrink-0`,_),t[0]=_,t[1]=v);let y;t[2]!==n||t[3]!==v?(y=(0,Z.jsx)(`span`,{className:v,children:n}),t[2]=n,t[3]=v,t[4]=y):y=t[4];let b=y,x;t[5]!==u||t[6]!==p||t[7]!==f||t[8]!==d||t[9]!==m||t[10]!==a||t[11]!==l?(x=d?(0,Z.jsxs)(`a`,{href:d,target:f?`_blank`:void 0,rel:f?`noopener noreferrer`:void 0,"aria-label":u,title:l,onClick:m,className:`block w-full truncate text-left font-medium text-foreground no-underline outline-none after:absolute after:inset-0 after:rounded-md focus-visible:after:ring-2 focus-visible:after:ring-ring`,children:[a,f?(0,Z.jsx)(`span`,{className:`sr-only`,children:` (opens in new tab)`}):null]}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":u,title:l,disabled:p,onClick:m,className:X(`block w-full truncate text-left font-medium text-foreground no-underline outline-none after:absolute after:inset-0 after:rounded-md focus-visible:after:ring-2 focus-visible:after:ring-ring`,`cursor-pointer bg-transparent p-0 disabled:cursor-not-allowed disabled:opacity-60`),children:a}),t[5]=u,t[6]=p,t[7]=f,t[8]=d,t[9]=m,t[10]=a,t[11]=l,t[12]=x):x=t[12];let S=x,C;t[13]===b?C=t[14]:(C=(0,Z.jsx)(`div`,{className:`mt-px flex items-center`,children:b}),t[13]=b,t[14]=C);let w;t[15]!==s||t[16]!==o||t[17]!==g?(w=g?(0,Z.jsxs)(`div`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[o,s?(0,Z.jsxs)(`span`,{className:`ml-1`,children:[`· #`,s]}):null]}):null,t[15]=s,t[16]=o,t[17]=g,t[18]=w):w=t[18];let T;t[19]===c?T=t[20]:(T=c?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-muted-foreground`,children:c}):null,t[19]=c,t[20]=T);let E;t[21]!==S||t[22]!==w||t[23]!==T?(E=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5 text-1sm`,children:[S,w,T]}),t[21]=S,t[22]=w,t[23]=T,t[24]=E):E=t[24];let D;t[25]===h?D=t[26]:(D=h?(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":h.tooltip,disabled:h.disabled,className:`relative z-10 shrink-0 cursor-pointer rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground group-hover:opacity-100`,onClick:h.onClick,children:h.icon})}),(0,Z.jsx)(Ya,{side:`top`,children:h.tooltip})]}):null,t[25]=h,t[26]=D);let O;t[27]!==C||t[28]!==E||t[29]!==D?(O=(0,Z.jsxs)(`div`,{className:`group relative flex items-start gap-2.5 rounded-md px-3 py-2.5 transition-colors hover:bg-muted/80`,children:[C,E,D]}),t[27]=C,t[28]=E,t[29]=D,t[30]=O):O=t[30];let k=O;if(i){let e;t[31]===k?e=t[32]:(e=(0,Z.jsx)(Ja,{asChild:!0,children:k}),t[31]=k,t[32]=e);let n;t[33]===i?n=t[34]:(n=(0,Z.jsx)(Ya,{side:`top`,children:i}),t[33]=i,t[34]=n);let r;return t[35]!==e||t[36]!==n?(r=(0,Z.jsxs)(Za,{children:[e,n]}),t[35]=e,t[36]=n,t[37]=r):r=t[37],r}return k}function I_(e){let t=(0,$.c)(33),{docName:n}=e,{folderPaths:r,pages:i,loading:a}=hr(),o,s;t[0]===n?(o=t[1],s=t[2]):(o=[`backlinks`,n],s=()=>k_(n),t[0]=n,t[1]=o,t[2]=s);let c;t[3]!==n||t[4]!==a||t[5]!==i?(c=!a&&i.has(n),t[3]=n,t[4]=a,t[5]=i,t[6]=c):c=t[6];let l;t[7]!==o||t[8]!==s||t[9]!==c?(l={queryKey:o,queryFn:s,enabled:c},t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10];let{data:u,isLoading:d,error:f}=Ct(l),p;t[11]===u?p=t[12]:(p=u===void 0?[]:u,t[11]=u,t[12]=p);let m=p,[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(n);_!==n&&(v(n),g(!1));let y;t[13]!==m||t[14]!==h?(y=h?m:m.slice(0,O_),t[13]=m,t[14]=h,t[15]=y):y=t[15];let b=y,x;t[16]!==m.length||t[17]!==d?(x=(0,Z.jsx)(N_,{title:`Backlinks`,count:m.length,isLoading:d}),t[16]=m.length,t[17]=d,t[18]=x):x=t[18];let S;t[19]!==m.length||t[20]!==f||t[21]!==h||t[22]!==r||t[23]!==d||t[24]!==i||t[25]!==b?(S=f?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(xt,{children:f instanceof Error?f.message:`Failed to load backlinks`})}):m.length===0&&!d?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(Ot,{children:`No pages link here yet.`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:b.map((e,t)=>{let n=Da(e.source,{pages:i,folderPaths:r});return(0,Z.jsx)(F_,{icon:(0,Z.jsx)(ve,{className:`size-3.5`}),title:e.title,path:j_(e.source),titleHover:e.source,anchor:e.anchor,snippet:e.snippet,href:Gn(n.hashDocName,e.anchor)},`${e.source}-${t}`)})}),(0,Z.jsx)(P_,{total:m.length,expanded:h,onToggle:()=>g(L_)})]}),t[19]=m.length,t[20]=f,t[21]=h,t[22]=r,t[23]=d,t[24]=i,t[25]=b,t[26]=S):S=t[26];let C;t[27]!==d||t[28]!==S?(C=(0,Z.jsx)(A,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":d,children:S})}),t[27]=d,t[28]=S,t[29]=C):C=t[29];let w;return t[30]!==C||t[31]!==x?(w=(0,Z.jsxs)(D,{defaultOpen:!0,children:[x,C]}),t[30]=C,t[31]=x,t[32]=w):w=t[32],w}function L_(e){return!e}function R_(e){let t=(0,$.c)(42),{docName:n}=e,{addPage:r,folderPaths:i,pages:a,pagesBySlug:o,loading:s}=hr(),c,l;t[0]===n?(c=t[1],l=t[2]):(c=[`forward-links`,n],l=()=>A_(n),t[0]=n,t[1]=c,t[2]=l);let u;t[3]!==n||t[4]!==a||t[5]!==s?(u=!s&&a.has(n),t[3]=n,t[4]=a,t[5]=s,t[6]=u):u=t[6];let d;t[7]!==c||t[8]!==l||t[9]!==u?(d={queryKey:c,queryFn:l,enabled:u},t[7]=c,t[8]=l,t[9]=u,t[10]=d):d=t[10];let{data:f,isLoading:p,error:m}=Ct(d),h;t[11]===f?h=t[12]:(h=f===void 0?[]:f,t[11]=f,t[12]=h);let g=h,[_,v]=(0,Q.useState)(null),[y,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(n);S!==n&&(C(n),x(!1),v(null));let w;t[13]!==y||t[14]!==g?(w=y?g:g.slice(0,O_),t[13]=y,t[14]=g,t[15]=w):w=t[15];let T=w,E;t[16]!==r||t[17]!==_?(E=async function(e,t){if(!_){v(t);try{await b(e,{addPage:r,onCreated:M_}),v(null)}catch(e){let t=e;Fa.error(t instanceof Error?t.message:`Failed to create page`),v(null)}}},t[16]=r,t[17]=_,t[18]=E):E=t[18];let O=E,k;t[19]!==_||t[20]!==i||t[21]!==O||t[22]!==a||t[23]!==o||t[24]!==s?(k=function(e){if(e.kind===`external`){let t=e.title===e.url;return(0,Z.jsx)(F_,{icon:(0,Z.jsx)(Ea,{className:`size-3.5`}),rowTooltip:`Opens in a new tab`,title:e.title,path:t?void 0:e.url,titleHover:e.url,snippet:e.snippet,href:e.url,external:!0},`ext:${e.url}`)}let t=H(e.docName,{pages:a,folderPaths:i,pagesBySlug:o}),n=!s&&t.kind===`create`,r=!s&&t.kind===`navigate`&&t.displayState===`folder`,c=j_(e.docName),l=e.title===e.docName?c:e.title,u=`doc:${e.docName}:${e.anchor??``}`,d=Gn(t.kind===`navigate`?t.hashDocName:e.docName,e.anchor);if(n&&t.kind===`create`){let n={initialDir:t.initialDir,suggestedName:t.suggestedName};return(0,Z.jsx)(F_,{icon:(0,Z.jsx)(Er,{className:`size-3.5`}),iconColorClass:`text-amber-600 dark:text-amber-400`,rowTooltip:_===u?`Creating page`:`Missing page — click to create`,ariaLabel:_===u?`Creating page: ${e.title}.`:`Missing page: ${e.title}. Click to create.`,title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,disabled:_!==null,onClick:()=>void O(n,u)},u)}if(r&&t.kind===`navigate`){let n=B(t);return(0,Z.jsx)(F_,{icon:(0,Z.jsx)(Ss,{className:`size-3.5`}),iconColorClass:`text-sky-600 dark:text-sky-400`,ariaLabel:`Folder target: ${e.title}. Click to open the overview.`,title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,href:d,hoverAction:{icon:(0,Z.jsx)(si,{className:`size-3.5`}),tooltip:_===u?`Creating index note`:`Create index note`,disabled:_!==null||n===null,onClick:()=>{n&&O(n,u)}}},u)}return(0,Z.jsx)(F_,{icon:(0,Z.jsx)(ve,{className:`size-3.5`}),title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,href:d},u)},t[19]=_,t[20]=i,t[21]=O,t[22]=a,t[23]=o,t[24]=s,t[25]=k):k=t[25];let j=k,M;t[26]!==p||t[27]!==g.length?(M=(0,Z.jsx)(N_,{title:`Outgoing`,count:g.length,isLoading:p}),t[26]=p,t[27]=g.length,t[28]=M):M=t[28];let N;t[29]!==m||t[30]!==y||t[31]!==p||t[32]!==g.length||t[33]!==j||t[34]!==T?(N=m?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(xt,{children:m instanceof Error?m.message:`Failed to load outgoing links`})}):g.length===0&&!p?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(Ot,{children:`This page doesn't link to anything yet.`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:T.map(j)}),(0,Z.jsx)(P_,{total:g.length,expanded:y,onToggle:()=>x(z_)})]}),t[29]=m,t[30]=y,t[31]=p,t[32]=g.length,t[33]=j,t[34]=T,t[35]=N):N=t[35];let P;t[36]!==p||t[37]!==N?(P=(0,Z.jsx)(A,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":p,children:N})}),t[36]=p,t[37]=N,t[38]=P):P=t[38];let F;return t[39]!==M||t[40]!==P?(F=(0,Z.jsxs)(D,{defaultOpen:!0,children:[M,P]}),t[39]=M,t[40]=P,t[41]=F):F=t[41],F}function z_(e){return!e}function B_(e){let t=(0,$.c)(11),{docName:n,className:r}=e,i=r===void 0?``:r,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(I_,{docName:n}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(la,{}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Z.jsx)(R_,{docName:n}),t[3]=n,t[4]=s);let c;t[5]!==a||t[6]!==s?(c=(0,Z.jsxs)(Mt,{className:`px-0 py-0`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==c?(l=(0,Z.jsx)(It,{className:i,children:c}),t[8]=i,t[9]=c,t[10]=l):l=t[10],l}var V_=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends V_{};function H_(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function U_(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function W_(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function G_(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function K_(e,t){return W_(e,t,``)}function q_(e,t){return G_(e,t,``)}function J_(e,t){return t.slice(0,Y_(e,t))}function Y_(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function X_(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Z_(e,t){if(t)return $_(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Q_(e,t){if(t)return $_(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function $_(e,t){if(!t)return[Q_(e),Z_(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=X_(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var ev=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,tv=RegExp(`[${ev}]+|\\s+|[^${ev}]`,`ug`);new class extends V_{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=X_(e,r)}else n=e.match(tv)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&nv(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&nv(n,i,r,null,t.intlSegmenter),e}};function nv(e,t,n,r,i){if(t&&n){let[a,o]=$_(t.value,i),[s,c]=$_(n.value,i);if(e){let r=H_(a,s);e.value=G_(e.value,s,r),t.value=K_(t.value,r),n.value=K_(n.value,r)}if(r){let e=U_(o,c);r.value=W_(r.value,c,e),t.value=q_(t.value,e),n.value=q_(n.value,e)}}else if(n){if(e){let e=Q_(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Q_(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Q_(r.value,i),[a,o]=$_(t.value,i),s=H_(n,a);t.value=K_(t.value,s);let c=U_(K_(n,s),o);t.value=q_(t.value,c),r.value=W_(r.value,n,c),e.value=G_(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Q_(r.value,i),n=J_(Z_(t.value,i),e);t.value=q_(t.value,n)}else if(e){let n=J_(Z_(e.value,i),Q_(t.value,i));t.value=K_(t.value,n)}}new class extends V_{tokenize(e){let t=RegExp(`(\\r?\\n)|[${ev}]+|[^\\S\\n\\r]+|[^${ev}]`,`ug`);return e.match(t)||[]}};var rv=new class extends V_{constructor(){super(...arguments),this.tokenize=av}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
16
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
17
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
18
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
19
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function iv(e,t,n){return rv.diff(e,t,n)}function av(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
20
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function ov(e){return e==`.`||e==`!`||e==`?`}new class extends V_{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(ov(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends V_{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends V_{constructor(){super(...arguments),this.tokenize=av}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(sv(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function sv(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=sv(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=sv(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends V_{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var cv={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function lv(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;iv(n,r,Object.assign(Object.assign({},s),{callback:t=>{e(l(t))}}))}else return l(iv(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||pv(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s)if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
21
|
+
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function uv(e,t){if(t||=cv,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>uv(e,t)).join(`
|
|
22
|
+
`)}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`),t.includeFileHeaders&&(n.push(`--- `+e.oldFileName+(e.oldHeader===void 0?``:` `+e.oldHeader)),n.push(`+++ `+e.newFileName+(e.newHeader===void 0?``:` `+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t];r.oldLines===0&&--r.oldStart,r.newLines===0&&--r.newStart,n.push(`@@ -`+r.oldStart+`,`+r.oldLines+` +`+r.newStart+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
23
|
+
`)+`
|
|
24
|
+
`}function dv(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;lv(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?uv(e,o.headerOptions):void 0)}}))}else{let s=lv(e,t,n,r,i,a,o);return s?uv(s,o?.headerOptions):void 0}}function fv(e,t,n,r,i,a){return dv(e,e,t,n,r,i,a)}function pv(e){let t=e.endsWith(`
|
|
25
|
+
`),n=e.split(`
|
|
26
|
+
`).map(e=>e+`
|
|
27
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function mv(e,t){return`${e}\u0000${t}`}function hv(e,t,n){let r=Cn(e).body,i=Cn(t).body;return r===i?``:fv(n,r,i,``,``,{context:3})}function gv(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=Pe(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=mv(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=hv(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var _v=(0,Q.lazy)(async()=>({default:(await r(()=>import(`./ActivityPanelDiffView-DeDaG2lq.js`),__vite__mapDeps([18,1,7,19]),import.meta.url)).ActivityPanelDiffView}));function vv(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return`just now`;if(r<3600)return`${Math.floor(r/60)} min ago`;if(r<86400)return`${Math.floor(r/3600)}h ago`;if(r<86400*2)return`yesterday`;let i=Math.floor(r/86400);return i<7?`${i} days ago`:t.toLocaleDateString()}function yv(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function bv(e){return e.slice(0,7)}function xv(e){return e.type===`upstream`?`Upstream sync`:e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?`Auto-save`:e.author}function Sv(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(Gr,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(Zr,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(Ur,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(Jr,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(ni,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(ei,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(Qr,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function Cv(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Cs,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=qt(i),t[1]=i,t[2]=a);let o=a,s=r?yn[o]??Gt[o]:Gt[o],c;t[3]!==s||t[4]!==i?(c=s??fr(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(Sv,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ts,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`Open Knowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(qo,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(lc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Qr,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(qo,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(lc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function wv(e){let t=(0,$.c)(20),{entries:n,defaultExpanded:r,isDark:i,diffLayout:a,cache:o,docName:s,expandedShas:c,onToggleExpanded:l,onRestoreSuccess:u}=e,[d,f]=(0,Q.useState)(r);if(n.length===0)return null;let p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>f(Tv),t[0]=p):p=t[0];let m;t[1]===d?m=t[2]:(m=d?(0,Z.jsx)(F,{className:`size-3`}):(0,Z.jsx)(ct,{className:`size-3`}),t[1]=d,t[2]=m);let h=d?`Hide ${n.length} auto-save${n.length>1?`s`:``}`:`Show ${n.length} auto-save${n.length>1?`s`:``}`,g;t[3]!==d||t[4]!==m||t[5]!==h?(g=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors text-left`,onClick:p,children:[m,h]}),t[3]=d,t[4]=m,t[5]=h,t[6]=g):g=t[6];let _;t[7]!==o||t[8]!==a||t[9]!==s||t[10]!==n||t[11]!==d||t[12]!==c||t[13]!==i||t[14]!==u||t[15]!==l?(_=d&&n.map(e=>(0,Z.jsx)(zv,{entry:e,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c.has(e.sha),onToggleExpanded:l,onRestoreSuccess:u},e.sha)),t[7]=o,t[8]=a,t[9]=s,t[10]=n,t[11]=d,t[12]=c,t[13]=i,t[14]=u,t[15]=l,t[16]=_):_=t[16];let v;return t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[g,_]}),t[17]=g,t[18]=_,t[19]=v):v=t[19],v}function Tv(e){return!e}function Ev(e){return e.checkpoint?e.checkpoint.kind:`save`}function Dv(e){let t=Ev(e);if(t===`save`)return`Save Version`;let n=e.checkpoint?.size??null,r=n!=null&&n>0?` (${Ov(n)})`:``;return t===`bridge-merge-loss`?`Auto-saved before a concurrent edit${r}`:`Recovered from an external change${r}`}function Ov(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/104857.6)/10} MB`}function kv(e){return e.type===`checkpoint`?Ev(e)===`save`?`version`:`auto-save`:`wip`}var Av={version:`Restore this version`,"auto-save":`Restore this auto-save`,wip:`Restore to this point`},jv={version:`Restore this version?`,"auto-save":`Restore this auto-save?`,wip:`Restore to this point?`};function Mv(e){return Av[kv(e)]}function Nv(e){return jv[kv(e)]}function Pv(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function Fv(e){let t=(0,$.c)(20),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,s;t[0]===n?(o=t[1],s=t[2]):([o,...s]=n,t[0]=n,t[1]=o,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=c):c=t[3];let l;t[4]===o?l=t[5]:(l=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[c,o]}),t[4]=o,t[5]=l);let u;t[6]!==r||t[7]!==s?(u=r&&s.map(Lv),t[6]=r,t[7]=s,t[8]=u):u=t[8];let d;t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[l,u]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==r||t[14]!==a||t[15]!==s.length?(f=s.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(Iv)},children:[r?(0,Z.jsx)(F,{className:`size-3`}):(0,Z.jsx)(ct,{className:`size-3`}),r?`Hide`:`Show ${s.length} more`]}),t[13]=r,t[14]=a,t[15]=s.length,t[16]=f):f=t[16];let p;return t[17]!==d||t[18]!==f?(p=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[d,f]}),t[17]=d,t[18]=f,t[19]=p):p=t[19],p}function Iv(e){return!e}function Lv(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function Rv(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,s=gv(n,r,i),c;t[0]===s.status?c=t[1]:(c=s.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Re,{className:`size-3 animate-spin`}),`Loading diff`]}),t[0]=s.status,t[1]=c);let l;t[2]===s.status?l=t[3]:(l=s.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:`Diff unavailable`}),t[2]=s.status,t[3]=l);let u;t[4]!==a||t[5]!==s.diff||t[6]!==s.status?(u=s.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Re,{className:`size-3 animate-spin`}),`Loading diff renderer`]}),children:(0,Z.jsx)(_v,{diff:s.diff,viewType:a})}),t[4]=a,t[5]=s.diff,t[6]=s.status,t[7]=u):u=t[7];let d;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[c,l,u]}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function zv(e){let t=(0,$.c)(128),{entry:n,prominent:r,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c,onToggleExpanded:l,onRestoreSuccess:u}=e,d=r===void 0?!1:r,f;t[0]===n.timestamp?f=t[1]:(f=vv(n.timestamp),t[0]=n.timestamp,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=xv(n),t[2]=n,t[3]=m);let h=m,g=n.contributors.flatMap(Bv),_;t[4]===n?_=t[5]:(_=Pv(n),t[4]=n,t[5]=_);let v=_,[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null),w=(0,Q.useId)(),T,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>C.current?.abort(),E=[],t[6]=T,t[7]=E):(T=t[6],E=t[7]),(0,Q.useEffect)(T,E);let D;t[8]!==n.sha||t[9]!==l?(D=()=>l(n.sha),t[8]=n.sha,t[9]=l,t[10]=D):D=t[10];let O=D,k;t[11]===b?k=t[12]:(k=function(){C.current?.abort(),C.current=null,S(!1),b(!1)},t[11]=b,t[12]=k);let A=k,j;t[13]!==s||t[14]!==n.sha||t[15]!==u||t[16]!==b?(j=async function(){S(!0);let e=new AbortController;C.current=e;let t=function(){e.signal.aborted||S(!1),C.current===e&&(C.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:s,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:s,sha:n.sha,err:i}),Fa.error(`Restore failed — document unchanged`,{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)b(!1),u();else{let e=`HTTP ${r.status}`;try{let t=Wt.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:s,sha:n.sha,status:r.status,detail:e}),Fa.error(`Restore failed`,{description:e,duration:6e3})}t()},t[13]=s,t[14]=n.sha,t[15]=u,t[16]=b,t[17]=j):j=t[17];let M=j,N;t[18]!==n||t[19]!==i||t[20]!==d?(N=d?(()=>{let e=Ev(n);return e===`bridge-merge-loss`?(0,Z.jsx)(Er,{className:`size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":`true`}):e===`external-change-rescue`?(0,Z.jsx)(hs,{className:`size-3.5 shrink-0 text-sky-600 dark:text-sky-400`,"aria-hidden":`true`}):(0,Z.jsx)(fs,{className:`size-3.5 shrink-0 text-muted-foreground`})})():(0,Z.jsx)(Cv,{entry:n,isDark:i}),t[18]=n,t[19]=i,t[20]=d,t[21]=N):N=t[21];let P=N,F=c?w:void 0,I=c?`bg-muted`:`hover:bg-muted/80`,L;t[22]===I?L=t[23]:(L=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,I],t[22]=I,t[23]=L);let R=L.join(` `),z;t[24]===O?z=t[25]:(z=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),O())},t[24]=O,t[25]=z);let B;t[26]===P?B=t[27]:(B=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:P}),t[26]=P,t[27]=B);let V;t[28]!==h||t[29]!==n||t[30]!==d?(V=d?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-xs text-foreground truncate`,children:Dv(n)}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground/50`,children:`·`}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:h})]}):(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:h}),t[28]=h,t[29]=n,t[30]=d,t[31]=V):V=t[31];let H;t[32]!==n.timestamp||t[33]!==p?(H=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:p}),t[32]=n.timestamp,t[33]=p,t[34]=H):H=t[34];let U;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[35]=U):U=t[35];let W;t[36]===n?W=t[37]:(W=Mv(n),t[36]=n,t[37]=W);let G;t[38]===b?G=t[39]:(G=e=>{e.stopPropagation(),b(!0)},t[38]=b,t[39]=G);let K;t[40]===x?K=t[41]:(K=x?(0,Z.jsx)(Re,{className:`size-3 animate-spin`}):(0,Z.jsx)(Kr,{className:`size-3`}),t[40]=x,t[41]=K);let q;t[42]!==x||t[43]!==W||t[44]!==G||t[45]!==K?(q=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":W,disabled:x,onClick:G,children:K})}),t[42]=x,t[43]=W,t[44]=G,t[45]=K,t[46]=q):q=t[46];let ee;t[47]===n?ee=t[48]:(ee=Mv(n),t[47]=n,t[48]=ee);let te;t[49]===ee?te=t[50]:(te=(0,Z.jsx)(Ya,{side:`top`,children:ee}),t[49]=ee,t[50]=te);let ne;t[51]!==q||t[52]!==te?(ne=(0,Z.jsxs)(Za,{children:[q,te]}),t[51]=q,t[52]=te,t[53]=ne):ne=t[53];let re;t[54]!==V||t[55]!==H||t[56]!==ne?(re=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[V,H,U,ne]}),t[54]=V,t[55]=H,t[56]=ne,t[57]=re):re=t[57];let ie;t[58]===v?ie=t[59]:(ie=v.length>0&&(0,Z.jsx)(Fv,{summaries:v}),t[58]=v,t[59]=ie);let ae=g.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:g.join(`, `),children:g.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),oe;t[60]!==re||t[61]!==ie||t[62]!==ae?(oe=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[re,ie,ae]}),t[60]=re,t[61]=ie,t[62]=ae,t[63]=oe):oe=t[63];let se;t[64]!==c||t[65]!==O||t[66]!==F||t[67]!==R||t[68]!==z||t[69]!==B||t[70]!==oe?(se=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":c,"aria-controls":F,"data-testid":`timeline-entry-expand`,className:R,onClick:O,onKeyDown:z,children:[B,oe]}),t[64]=c,t[65]=O,t[66]=F,t[67]=R,t[68]=z,t[69]=B,t[70]=oe,t[71]=se):se=t[71];let ce;t[72]!==o||t[73]!==a||t[74]!==w||t[75]!==s||t[76]!==n.sha||t[77]!==c?(ce=c&&(0,Z.jsx)(Rv,{sha:n.sha,docName:s,cache:o,diffLayout:a,panelId:w}),t[72]=o,t[73]=a,t[74]=w,t[75]=s,t[76]=n.sha,t[77]=c,t[78]=ce):ce=t[78];let le;t[79]!==se||t[80]!==ce?(le=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[se,ce]}),t[79]=se,t[80]=ce,t[81]=le):le=t[81];let ue;t[82]!==A||t[83]!==b?(ue=e=>{e?b(!0):A()},t[82]=A,t[83]=b,t[84]=ue):ue=t[84];let de;t[85]===n?de=t[86]:(de=Nv(n),t[85]=n,t[86]=de);let fe;t[87]===de?fe=t[88]:(fe=(0,Z.jsx)($a,{children:de}),t[87]=de,t[88]=fe);let pe;t[89]===n.timestamp?pe=t[90]:(pe=yv(n.timestamp),t[89]=n.timestamp,t[90]=pe);let J;t[91]===n.sha?J=t[92]:(J=bv(n.sha),t[91]=n.sha,t[92]=J);let me;t[93]!==p||t[94]!==pe||t[95]!==J?(me=(0,Z.jsxs)(`span`,{className:`font-medium text-foreground`,children:[p,` (`,pe,`, `,J,`)`]}),t[93]=p,t[94]=pe,t[95]=J,t[96]=me):me=t[96];let he;t[97]===h?he=t[98]:(he=(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:h}),t[97]=h,t[98]=he);let ge;t[99]!==me||t[100]!==he?(ge=(0,Z.jsxs)(Qa,{children:[`This will replace the current document content with the version from`,` `,me,` `,`by `,he,`. Your current content is already saved in the timeline — you can restore it anytime.`]}),t[99]=me,t[100]=he,t[101]=ge):ge=t[101];let _e;t[102]!==fe||t[103]!==ge?(_e=(0,Z.jsxs)(ro,{children:[fe,ge]}),t[102]=fe,t[103]=ge,t[104]=_e):_e=t[104];let ve;t[105]===A?ve=t[106]:(ve=(0,Z.jsx)(zr,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:A,children:`Cancel`}),t[105]=A,t[106]=ve);let ye;t[107]===M?ye=t[108]:(ye=()=>M(),t[107]=M,t[108]=ye);let be;t[109]===x?be=t[110]:(be=x?(0,Z.jsx)(Re,{className:`mr-2 size-4 animate-spin`}):null,t[109]=x,t[110]=be);let xe;t[111]!==x||t[112]!==ye||t[113]!==be?(xe=(0,Z.jsxs)(zr,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:x,onClick:ye,children:[be,`Restore`]}),t[111]=x,t[112]=ye,t[113]=be,t[114]=xe):xe=t[114];let Se;t[115]!==ve||t[116]!==xe?(Se=(0,Z.jsxs)(no,{children:[ve,xe]}),t[115]=ve,t[116]=xe,t[117]=Se):Se=t[117];let Ce;t[118]!==_e||t[119]!==Se?(Ce=(0,Z.jsxs)(eo,{children:[_e,Se]}),t[118]=_e,t[119]=Se,t[120]=Ce):Ce=t[120];let we;t[121]!==y||t[122]!==ue||t[123]!==Ce?(we=(0,Z.jsx)(io,{open:y,onOpenChange:ue,children:Ce}),t[121]=y,t[122]=ue,t[123]=Ce,t[124]=we):we=t[124];let Te;return t[125]!==le||t[126]!==we?(Te=(0,Z.jsxs)(Z.Fragment,{children:[le,we]}),t[125]=le,t[126]=we,t[127]=Te):Te=t[127],Te}function Bv(e){return e.docs}function Vv(e){let t=(0,$.c)(63),{docName:n,diffLayout:r,onDiffLayoutChange:i}=e,{resolvedTheme:a}=nn(),o=a===`dark`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(null),m=(0,Q.useRef)(null),[h]=(0,Q.useState)(Gv),[g,_]=(0,Q.useState)(Wv),v;t[1]===h?v=t[2]:(v=()=>{_(new Set),h.clear()},t[1]=h,t[2]=v);let y;t[3]===n?y=t[4]:(y=[n],t[3]=n,t[4]=y),(0,Q.useEffect)(v,y);let b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=b):b=t[5];let x=b,S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(){_(new Set)},t[6]=S):S=t[6];let C=S,w,T;t[7]===n?(w=t[8],T=t[9]):(w=()=>{if(!n){l([]);return}let e=!1,t=async function(){if(n)try{let t=await fetch(`/api/history?docName=${encodeURIComponent(n)}&limit=100`);if(e)return;if(!t.ok){p(`History unavailable`);return}let r=await t.json();if(e)return;l(r.entries??[]),p(null)}catch(t){let n=t;if(e)return;p(`History unavailable`),console.error(`[timeline]`,n)}};return d(!0),t().finally(()=>{e||d(!1)}),m.current=setInterval(t,1e4),()=>{e=!0,m.current&&clearInterval(m.current)}},T=[n],t[7]=n,t[8]=w,t[9]=T),(0,Q.useEffect)(w,T);let E,D,O,k,A,j,M,N;if(t[10]!==h||t[11]!==r||t[12]!==n||t[13]!==c||t[14]!==f||t[15]!==g||t[16]!==o||t[17]!==u||t[18]!==i){let e=[],a=[],s=!1;for(let t of c)t.type===`checkpoint`?(a.length>0&&(e.push({kind:`wip-group`,entries:a,isPreCheckpoint:!s}),a=[]),e.push({kind:`checkpoint`,entry:t}),s=!0):a.push(t);a.length>0&&e.push({kind:`wip-group`,entries:a,isPreCheckpoint:!s});let l;t[27]===c?l=t[28]:(l=c.some(Uv),t[27]=c,t[28]=l);let d=!l,p=!u&&!f&&c.length>0;A=`flex h-full flex-col`,t[29]!==r||t[30]!==p||t[31]!==i?(j=p&&(0,Z.jsx)(`div`,{className:`flex items-center justify-end gap-1 px-2 py-1.5`,children:(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsxs)(Ka,{type:`single`,value:r,onValueChange:e=>{e&&i(e)},"aria-label":`Diff layout`,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(Wa,{value:`unified`,"aria-label":`Unified diff`,className:`size-6 px-0`,children:(0,Z.jsx)(Gs,{className:`size-3.5`})}),(0,Z.jsx)(Wa,{value:`split`,"aria-label":`Split diff`,className:`size-6 px-0`,children:(0,Z.jsx)(cs,{className:`size-3.5`})})]})}),(0,Z.jsx)(Ya,{children:r===`unified`?`Unified diff`:`Split diff`})]})}),t[29]=r,t[30]=p,t[31]=i,t[32]=j):j=t[32],M=`flex-1 overflow-y-auto subtle-scrollbar`,t[33]===u?N=t[34]:(N=u&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":`Loading timeline history`,children:[1,2,3].map(Hv)}),t[33]=u,t[34]=N),t[35]!==f||t[36]!==u?(E=!u&&f&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:f})}),t[35]=f,t[36]=u,t[37]=E):E=t[37],t[38]!==c.length||t[39]!==f||t[40]!==u?(D=!u&&!f&&c.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No history yet`})}),t[38]=c.length,t[39]=f,t[40]=u,t[41]=D):D=t[41],t[42]!==h||t[43]!==r||t[44]!==n||t[45]!==c||t[46]!==f||t[47]!==g||t[48]!==d||t[49]!==o||t[50]!==u?(O=!u&&!f&&d&&c.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:c.map(e=>(0,Z.jsx)(zv,{entry:e,isDark:o,diffLayout:r,cache:h,docName:n,expanded:g.has(e.sha),onToggleExpanded:x,onRestoreSuccess:C},e.sha))}),t[42]=h,t[43]=r,t[44]=n,t[45]=c,t[46]=f,t[47]=g,t[48]=d,t[49]=o,t[50]=u,t[51]=O):O=t[51],k=!u&&!f&&!d&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:e.map((e,t)=>e.kind===`checkpoint`?(0,Z.jsx)(zv,{entry:e.entry,prominent:!0,isDark:o,diffLayout:r,cache:h,docName:n,expanded:g.has(e.entry.sha),onToggleExpanded:x,onRestoreSuccess:C},e.entry.sha):(0,Z.jsx)(wv,{entries:e.entries,defaultExpanded:e.isPreCheckpoint,isDark:o,diffLayout:r,cache:h,docName:n,expandedShas:g,onToggleExpanded:x,onRestoreSuccess:C},e.entries[0]?.sha??`wip-${t}`))}),t[10]=h,t[11]=r,t[12]=n,t[13]=c,t[14]=f,t[15]=g,t[16]=o,t[17]=u,t[18]=i,t[19]=E,t[20]=D,t[21]=O,t[22]=k,t[23]=A,t[24]=j,t[25]=M,t[26]=N}else E=t[19],D=t[20],O=t[21],k=t[22],A=t[23],j=t[24],M=t[25],N=t[26];let P;t[52]!==E||t[53]!==D||t[54]!==O||t[55]!==k||t[56]!==M||t[57]!==N?(P=(0,Z.jsxs)(`div`,{className:M,children:[N,E,D,O,k]}),t[52]=E,t[53]=D,t[54]=O,t[55]=k,t[56]=M,t[57]=N,t[58]=P):P=t[58];let F;return t[59]!==A||t[60]!==j||t[61]!==P?(F=(0,Z.jsxs)(`div`,{className:A,children:[j,P]}),t[59]=A,t[60]=j,t[61]=P,t[62]=F):F=t[62],F}function Hv(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(da,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(da,{className:`h-3 w-28`}),(0,Z.jsx)(da,{className:`h-3 w-40`})]})]},e)}function Uv(e){return e.type===`checkpoint`}function Wv(){return new Set}function Gv(){return new qr(32)}var Kv=[{id:`outline`,label:`Outline`,icon:Ps},{id:`links`,label:`Links`,icon:As},{id:`graph`,label:`Graph`,icon:Ls},{id:`timeline`,label:`Timeline`,icon:is}];function qv(){return r(()=>import(`./GraphPanel-lypmG_hQ.js`),__vite__mapDeps([20,1,21,3,6,7,16,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url)}var Jv=(0,Q.lazy)(async()=>({default:(await qv()).GraphPanel})),Yv=(0,Q.lazy)(async()=>({default:(await r(()=>import(`./ActivityModeContent-B9qJjoag.js`),__vite__mapDeps([35,1,2,36,37,38,22,39,40,41,42,21,3,6,7,16,4,8,15,10,24,43,9]),import.meta.url)).ActivityModeContent}));function Xv(e){let t=(0,$.c)(13),{docName:n,isSourceMode:r,activeTab:i,onActiveTabChange:a,mode:o}=e,[s,c]=(0,Q.useState)(`unified`),l;t[0]!==i||t[1]!==o||t[2]!==a?(l=o===`doc`?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 border-b border-border/60 p-2`,children:(0,Z.jsx)(Ka,{type:`single`,variant:`outline`,value:i,onValueChange:e=>{e&&a(e)},"aria-label":`Document panels`,children:Kv.map(Zv)})}):null,t[0]=i,t[1]=o,t[2]=a,t[3]=l):l=t[3];let u;t[4]!==i||t[5]!==s||t[6]!==n||t[7]!==r||t[8]!==o?(u=o===`doc`?(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-${i}`,"aria-labelledby":`tab-${i}`,className:`min-h-0 flex-1`,children:[i===`outline`&&(0,Z.jsx)(ko,{docName:n,isSourceMode:r}),i===`links`&&(0,Z.jsx)(B_,{docName:n}),i===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading graph`}),children:(0,Z.jsx)(Jv,{activeDocName:n})}),i===`timeline`&&(0,Z.jsx)(Vv,{docName:n,diffLayout:s,onDiffLayoutChange:c})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading agent activity`}),children:(0,Z.jsx)(Yv,{})})}),t[4]=i,t[5]=s,t[6]=n,t[7]=r,t[8]=o,t[9]=u):u=t[9];let d;return t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(Z.Fragment,{children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function Zv(e){let{id:t,label:n,icon:r}=e;return(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Wa,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":n,asChild:!0,children:(0,Z.jsx)(Ja,{children:(0,Z.jsx)(r,{})})}),(0,Z.jsx)(Ya,{side:`bottom`,children:n})]},t)}function Qv(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function $v(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function ey(e){return e/100*window.innerHeight}function ty(e){return e/100*window.innerWidth}function ny(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function ry({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=ny(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=$v(t,i);break;case`em`:r=Qv(t,i);break;case`vh`:r=ey(i);break;case`vw`:r=ty(i);break}return r}function iy(e){return parseFloat(e.toFixed(3))}function ay({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function oy(e){let{panels:t}=e,n=ay({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=iy(ry({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=iy(ry({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=iy(ry({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=iy(ry({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function sy(e,t=`Assertion error`){if(!e)throw Error(t)}function cy(e,t){return Array.from(t).sort(e===`horizontal`?ly:uy)}function ly(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function uy(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function dy(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function fy(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function py({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=fy(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return sy(i,`No rect found`),i}var my;function hy(){return my===void 0&&(my=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),my}function gy(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=cy(n,Array.from(t.children).filter(dy).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,py({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=hy()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:ay({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var _y=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},vy=new Map,yy=new _y;function by(e){vy=new Map(vy),vy.delete(e)}function xy(e,t){for(let[t]of vy)if(t.id===e)return t}function Sy(e,t){for(let[t,n]of vy)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Cy(){return vy}function wy(e,t){return yy.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function Ty(e,t){let n=vy.get(e);vy=new Map(vy),vy.set(e,t),yy.emit(`groupChange`,{group:e,prev:n,next:t})}function Ey(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=fy(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Dy(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Oy(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Py(e),b:Py(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();sy(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Ny(My(n.a)),b:Ny(My(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var ky=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Ay(e){let t=getComputedStyle(Fy(e)??e).display;return t===`flex`||t===`inline-flex`}function jy(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Ay(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||ky.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function My(e){let t=e.length;for(;t--;){let n=e[t];if(sy(n,`Missing node`),jy(n))return n}return null}function Ny(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Py(e){let t=[];for(;e;)t.push(e),e=Fy(e);return t}function Fy(e){let{parentNode:t}=e;return Dy(t)?t.host:t}function Iy(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Ly({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!dy(n)||n.contains(e)||e.contains(n))return!0;if(Oy(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Iy(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Ry(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=gy(r),a=Ey(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Ly({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function zy(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function By(e,t,n=0){return Math.abs(iy(e)-iy(t))<=n}function Vy(e,t){return By(e,t)?0:e>t?1:-1}function Hy({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(Vy(r,c)<0)if(a){let e=(i+c)/2;r=Vy(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=iy(r),r}function Uy({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(By(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;sy(u!=null,`Invalid first pivot index`),sy(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];sy(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(sy(n!=null,`Previous layout not found for panel index ${t}`),By(n,i)){let t=o-n;Vy(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];sy(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(sy(n!=null,`Previous layout not found for panel index ${t}`),By(n,o)){let t=n-i;Vy(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];sy(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&Vy(i,c)<0)if(e>0){let t=c-o,n=t/2;Vy(i+e,c)<0&&(e=Vy(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;Vy(i-e,c)<0&&(e=Vy(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];sy(e!=null,`Previous layout not found for panel index ${r}`);let a=Hy({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];sy(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Hy({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!By(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(zy(c,l))return i;{let t=e<0?d:u,r=s[t];sy(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Hy({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!By(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];sy(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Hy({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(By(i,s)||(t-=s-i,l[r]=s),By(t,0))break;e>0?r--:r++}}}if(!By(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function Wy(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Vy(e[n],t[n])!==0)return!1;return!0}function Gy({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!By(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];sy(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];sy(i!=null,`No layout data found for index ${e}`);let o=r[e];sy(o!=null,`No layout data found for index ${e}`);let s=Hy({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!By(a,0))for(let e=0;e<t.length;e++){let n=r[e];sy(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Hy({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,By(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function Ky({groupId:e,panelId:t}){let n=()=>{let t=Cy();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=Gy({layout:Uy({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});Wy(l,p)||Ty(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&By(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=ay({group:t});o(iy(ry({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function qy(e){e.defaultPrevented||Ry(e,Cy()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=Ky({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function Jy(e){let t=Cy();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function Yy({groupId:e}){let t=()=>{let t=Cy();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=Gy({layout:e,panelConstraints:r});return n?o:(Wy(o,c)||Ty(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function Xy(e,t){let n=Jy(e),r=Sy(n.id,!0),i=n.separators.find(t=>t.element===e);sy(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);sy(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=Yy({groupId:n.id}).getLayout(),c=Gy({layout:Uy({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});Wy(s,c)||Ty(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function Zy(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Jy(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&Xy(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&Xy(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&Xy(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&Xy(t,-5);break;case`End`:e.preventDefault(),Xy(t,100);break;case`Enter`:{e.preventDefault();let n=Jy(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=Sy(n.id,!0),o=n.separators.find(e=>e.element===t);sy(o,`Matching separator not found`);let s=a.get(o);sy(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(sy(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];Xy(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=Jy(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);sy(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),Xy(t,-100);break}}var Qy={cursorFlags:0,state:`inactive`},$y=new _y;function eb(){return Qy}function tb(e){return $y.addListener(`change`,e)}function nb(e){let t=Qy,n={...Qy};n.cursorFlags=e,Qy=n,$y.emit(`change`,{prev:t,next:n})}function rb(e){let t=Qy;Qy=e,$y.emit(`change`,{prev:t,next:e})}function ib(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Cy(),n=Ry(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),rb({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var ab=e=>e,ob=()=>{},sb=1,cb=2,lb=4,ub=8,db=3,fb=12,pb;function mb(){return pb===void 0&&(pb=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(pb=!0)),pb}function hb({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&mb()){let t=(e&sb)!==0,n=(e&cb)!==0,r=(e&lb)!==0,i=(e&ub)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return mb()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var gb=new WeakMap;function _b(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=gb.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=eb();switch(r.state){case`active`:case`hover`:{let e=hb({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}gb.set(e,{prevStyle:t,styleSheet:n})}function vb({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=Uy({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(Wy(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?sb:cb;break;case`vertical`:s|=d<0?lb:ub;break}}else Ty(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&db:c|=s&db,t.movementY===0?c|=o&fb:c|=s&fb,nb(c),_b(e)}function yb(e){let t=Cy(),n=eb();switch(n.state){case`active`:vb({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function bb(e){if(e.defaultPrevented)return;let t=eb(),n=Cy();switch(t.state){case`active`:if(e.buttons===0){rb({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=Sy(e.group.id,!0);Ty(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}vb({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=Ry(e,n);r.length===0?t.state!==`inactive`&&rb({cursorFlags:0,state:`inactive`}):rb({cursorFlags:0,hitRegions:r,state:`hover`}),_b(e.currentTarget);break}}}function xb(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(eb().state){case`hover`:rb({cursorFlags:0,state:`inactive`})}}function Sb(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=eb();switch(t.state){case`active`:rb({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(_b(e.currentTarget),t.hitRegions.forEach(e=>{let t=Sy(e.group.id,!0);Ty(e.group,t)}),e.preventDefault())}}function Cb(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=iy(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=iy((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function wb(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=ay({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:iy(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Tb(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Eb({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=iy(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=iy((r[e]??0)/a*l);else{let e=iy(l/c.length);for(let t of c)u[t]=e}return u}function Db(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Ob=new Map;function kb(e){let t=!0;sy(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=ay({group:e});if(t===0)return;let n=Sy(e.id);if(!n)return;let r=oy(e),i=n.defaultLayoutDeferred?Cb(r):n.layout,a=Gy({layout:Eb({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&Wy(n.layout,a)&&Tb(n.derivedPanelConstraints,r)&&n.groupSize===t)return;Ty(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else wb(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{sy(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=ay({group:e}),s=oy(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(Db(e.panels,l)||(l=void 0));let u=Gy({layout:e.mutableState.layouts[c]??l??Cb(s),panelConstraints:s}),d=e.element.ownerDocument;Ob.set(d,(Ob.get(d)??0)+1);let f=new Map;return gy(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),Ty(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{sy(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Zy)}),Ob.get(d)===1&&(d.addEventListener(`dblclick`,qy,!0),d.addEventListener(`pointerdown`,ib,!0),d.addEventListener(`pointerleave`,yb),d.addEventListener(`pointermove`,bb),d.addEventListener(`pointerout`,xb),d.addEventListener(`pointerup`,Sb,!0)),function(){t=!1,Ob.set(d,Math.max(0,(Ob.get(d)??0)-1)),by(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Zy)}),Ob.get(d)||(d.removeEventListener(`dblclick`,qy,!0),d.removeEventListener(`pointerdown`,ib,!0),d.removeEventListener(`pointerleave`,yb),d.removeEventListener(`pointermove`,bb),d.removeEventListener(`pointerout`,xb),d.removeEventListener(`pointerup`,Sb,!0)),a.disconnect()}}function Ab(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function jb(e){let t=(0,Q.useId)();return`${e??t}`}var Mb=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function Nb(e){let t=(0,Q.useRef)(e);return Mb(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function Pb(...e){return Nb(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function Fb(e){let t=(0,Q.useRef)({...e});return Mb(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Ib=(0,Q.createContext)(null);function Lb(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:ab});(0,Q.useImperativeHandle)(t,()=>n.current,[]),Mb(()=>{Object.assign(n.current,Yy({groupId:e}))})}function Rb({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Nb(e=>{Wy(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Nb(e=>{Wy(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=jb(s),v=(0,Q.useRef)(null),[y,b]=Ab(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=Pb(v,a);Lb(_,o);let C=Nb((e,t)=>{let r=eb(),i=xy(e),a=Sy(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=Fb({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=cy(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=cy(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=xy(_),i=Sy(_);r&&i&&Ty(r,{...i,derivedPanelConstraints:oy(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return Mb(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=kb(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=Sy(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=wy(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=By(t.collapsedSize,i[t.panelId]),a=By(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=eb().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(Ib.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}Rb.displayName=`Group`;function zb(){let e=(0,Q.useContext)(Ib);return sy(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Bb(e,t){let{id:n}=zb(),r=(0,Q.useRef)({collapse:ob,expand:ob,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:ob});(0,Q.useImperativeHandle)(t,()=>r.current,[]),Mb(()=>{Object.assign(r.current,Ky({groupId:n,panelId:e}))})}function Vb({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=jb(c),_=Fb({disabled:a}),v=(0,Q.useRef)(null),y=Pb(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=zb(),T=d!==null,E=Nb((e,t,n)=>{d?.(e,c,n)});Mb(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),Bb(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>wy(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...Hb,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}Vb.displayName=`Panel`;var Hb={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Ub(){return(0,Q.useRef)(null)}function Wb({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=Gy({layout:Uy({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=Gy({layout:Uy({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Gb({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=jb(a),l=Fb({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=Pb(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=zb(),x=v===`horizontal`?`vertical`:`horizontal`;Mb(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=tb(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=wy(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(Wb({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Gb.displayName=`Separator`;function Kb(e){return`/api/asset?path=${encodeURIComponent(e)}`}function qb(e){let t=(0,$.c)(14),{assetPath:n,mediaKind:r}=e,i;t[0]===n?i=t[1]:(i=Kb(n),t[0]=n,t[1]=i);let a=i,o;t[2]===n?o=t[3]:(o=n.split(`/`).pop()??n,t[2]=n,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=s.includes(`.`)?s.split(`.`).pop()?.toUpperCase()??`FILE`:`FILE`,t[4]=s,t[5]=c);let l=c,u;t[6]!==l||t[7]!==s||t[8]!==r||t[9]!==a?(u=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:r===`image`?(0,Z.jsx)(`img`,{src:a,alt:s,className:`max-h-full max-w-full object-contain`,draggable:!1}):r===`video`?(0,Z.jsx)(`video`,{src:a,controls:!0,className:`max-h-full max-w-full`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-md border bg-muted font-medium text-muted-foreground text-sm`,children:l}),(0,Z.jsx)(`div`,{className:`max-w-full break-words font-medium text-sm`,children:s}),(0,Z.jsx)(`a`,{href:a,className:`rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:`Open file`})]})}),t[6]=l,t[7]=s,t[8]=r,t[9]=a,t[10]=u):u=t[10];let d;return t[11]!==s||t[12]!==u?(d=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":s,children:u}),t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function Jb(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":`Loading document`,children:(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(da,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(da,{className:`h-4 w-full`}),(0,Z.jsx)(da,{className:`h-4 w-3/4`})]})}),e[0]=t):t=e[0],t}var Yb=1700,Xb=3;function Zb(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??Xb;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var Qb={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:250,durationMin:620,durationMax:1400}},$b=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function ex(e,t={}){let n=t.rng??Math.random,r=t.colors??$b,i=Qb[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var tx=1.8,nx=90,rx=16,ix=380,ax=.025,ox=.1,sx=.18,cx=400,lx=9.2736,ux=18.1799,dx=14.5244,fx={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function px(e,t){let{halfWidth:n,apexLift:r}=fx[t];return`M${e-n} ${dx+.3} Q${e} ${dx-r}, ${e+n} ${dx+.3}`}function mx(e){let t=1.5,n=.3;return`M${e-t} ${dx-n} Q${e} ${dx+1.4}, ${e+t} ${dx-n}`}var hx=15,gx=15;function _x(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function vx(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=Zb(g,t);_(n),y(Sx),S(ex(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Yb)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(xx),S(ex(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Yb))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(r){e=r.clientX,t=r.clientY,n=!0};function u(){if(s=requestAnimationFrame(u),!n)return;let c=f.current,l=d.current;if(!c||!l)return;let m=c.getBoundingClientRect(),g=m.left+m.width/2,_=m.top+m.height*.48,v=e-g,y=t-_,b=Math.hypot(v,y),x=Math.max(-1,Math.min(1,v/ix)),S=Math.max(-1,Math.min(1,y/ix)),C=x*rx,w=-S*rx;r+=(w-r)*ox,i+=(C-i)*ox,l.style.transform=`perspective(${cx}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`;let T=0,E=0;if(b>=1){let e=Math.min(b/nx,1)*tx;T=v/b*e,E=y/b*e}a+=(T-a)*sx,o+=(E-o)*sx;let D=i*ax,O=-r*ax,k=a+D,A=o+O;h.current.x=k,h.current.y=A,p.current?.setAttribute(`transform`,`translate(${k.toFixed(3)} ${A.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),s=requestAnimationFrame(u),()=>{document.removeEventListener(`mousemove`,l),cancelAnimationFrame(s),d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=X(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=X(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let W=(F||T)&&`ok-blob-eye-hidden`,G;t[22]===W?G=t[23]:(G=X(`ok-blob-eye`,W),t[22]=W,t[23]=G);let K;t[24]===G?K=t[25]:(K=(0,Z.jsx)(`ellipse`,{cx:lx,cy:dx,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=K);let q=(F||T)&&`ok-blob-eye-hidden`,ee;t[26]===q?ee=t[27]:(ee=X(`ok-blob-eye ok-blob-eye-right`,q),t[26]=q,t[27]=ee);let te;t[28]===ee?te=t[29]:(te=(0,Z.jsx)(`ellipse`,{cx:ux,cy:dx,rx:1.2722,ry:1.9083,className:ee}),t[28]=ee,t[29]=te);let ne;t[30]===I?ne=t[31]:(ne=px(lx,I),t[30]=I,t[31]=ne);let re=(!F||T)&&`ok-blob-eye-hidden`,ie;t[32]===re?ie=t[33]:(ie=X(`ok-blob-happy-eye`,re),t[32]=re,t[33]=ie);let ae;t[34]!==ne||t[35]!==ie?(ae=(0,Z.jsx)(`path`,{d:ne,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ie}),t[34]=ne,t[35]=ie,t[36]=ae):ae=t[36];let oe;t[37]===I?oe=t[38]:(oe=px(ux,I),t[37]=I,t[38]=oe);let se=(!F||T)&&`ok-blob-eye-hidden`,ce;t[39]===se?ce=t[40]:(ce=X(`ok-blob-happy-eye`,se),t[39]=se,t[40]=ce);let le;t[41]!==oe||t[42]!==ce?(le=(0,Z.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[41]=oe,t[42]=ce,t[43]=le):le=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:mx(lx),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:mx(ux),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==K||t[47]!==te||t[48]!==ae||t[49]!==le||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[K,te,ae,le,ue]}),t[46]=K,t[47]=te,t[48]=ae,t[49]=le,t[50]=ue,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let J;t[58]!==v||t[59]!==x?(J=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(yx)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=J):J=t[60];let me;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==J?(me=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:bx,children:[fe,pe,J]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=J,t[67]=me):me=t[67];let he;return t[68]!==R||t[69]!==me?(he=(0,Z.jsx)(`span`,{ref:d,className:R,children:me}),t[68]=R,t[69]=me,t[70]=he):he=t[70],he}function yx(e){return(0,Z.jsx)(`circle`,{cx:hx+e.originDx,cy:gx+e.originDy,r:e.size,className:`ok-blob-firework`,style:_x(e)},e.id)}function bx(e){return e.preventDefault()}function xx(e){return e+1}function Sx(e){return e+1}var Cx=`knowledge-base`;async function wx(e){let t=await e.json().catch(()=>null),n=Wt.safeParse(t);if(!n.success)return{kind:`internal`,message:`HTTP ${e.status}`};let r=n.data.detail??n.data.title,i=n.data.type;return i===`urn:ok:error:seed-prerequisite-missing`?{kind:`prerequisite-missing`,message:r}:i===`urn:ok:error:seed-invalid-root`?{kind:`invalid-root`,message:r}:i===`urn:ok:error:no-project-dir`?{kind:`no-project`,message:r}:{kind:`internal`,message:r}}function Tx(){let e=typeof window<`u`?window.okDesktop:void 0;return e?.seed?{plan:e.seed.plan,apply:e.seed.apply,listPacks:e.seed.listPacks}:{plan:async e=>{let t=new URLSearchParams;e?.rootDir&&t.set(`rootDir`,e.rootDir),e?.packId&&t.set(`packId`,e.packId),e?.includePersonalTemplates&&t.set(`includePersonalTemplates`,`true`);let n=t.toString(),r=await fetch(`/api/seed/plan${n?`?${n}`:``}`);if(!r.ok)return{ok:!1,error:await wx(r)};let i=await r.json().catch(()=>null);return i?.plan?{ok:!0,plan:i.plan}:{ok:!1,error:{kind:`internal`,message:`Malformed plan response`}}},apply:async(e,t)=>{let n=await fetch(`/api/seed/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({plan:e,packId:t?.packId,includePersonalTemplates:t?.includePersonalTemplates})});if(!n.ok)return{ok:!1,error:await wx(n)};let r=await n.json().catch(()=>null);return r?.result?{ok:!0,result:r.result,personalTemplates:r.personalTemplates}:{ok:!1,error:{kind:`internal`,message:`Malformed apply response`}}},listPacks:async()=>{let e=await fetch(`/api/seed/packs`);if(!e.ok)return{ok:!1,error:{kind:`internal`,message:`HTTP ${e.status}`}};let t=await e.json().catch(()=>null);return!t||!Array.isArray(t.packs)?{ok:!1,error:{kind:`internal`,message:`Malformed listPacks response`}}:{ok:!0,packs:t.packs}}}}function Ex(e){let t=(0,$.c)(70),{open:n,onOpenChange:r,onSeedApplied:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={kind:`loading`},t[0]=a):a=t[0];let[o,s]=(0,Q.useState)(a),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(Cx),[f,p]=(0,Q.useState)(!0),[m,h]=(0,Q.useState)(`project-root`),[g,_]=(0,Q.useState)(``),v=(0,Q.useRef)(!0),y;t[1]!==c||t[2]!==u?(y=c?.find(e=>e.id===u),t[1]=c,t[2]=u,t[3]=y):y=t[3];let b=y,x,S;t[4]!==n||t[5]!==c?(x=()=>{if(!n||c!==null)return;let e=!1;return(async()=>{try{let t=await Tx().listPacks();if(e)return;t.ok?l(t.packs):(l([]),s({kind:`error`,message:t.error.message}))}catch(t){let n=t;if(e)return;l([]),s({kind:`error`,message:n instanceof Error?n.message:String(n)})}})(),()=>{e=!0}},S=[n,c],t[4]=n,t[5]=c,t[6]=x,t[7]=S):(x=t[6],S=t[7]),(0,Q.useEffect)(x,S);let C,w;t[8]===n?(C=t[9],w=t[10]):(C=()=>{n&&(d(Cx),p(!0),h(`project-root`),_(``),v.current=!0)},w=[n],t[8]=n,t[9]=C,t[10]=w),(0,Q.useEffect)(C,w);let T,E;t[11]===b?(T=t[12],E=t[13]):(T=()=>{b&&_(b.defaultSubfolder??``)},E=[b],t[11]=b,t[12]=T,t[13]=E),(0,Q.useEffect)(T,E);let D;t[14]===g?D=t[15]:(D=g.trim(),t[14]=g,t[15]=D);let O=D,k=m===`subfolder`&&O===``,A,j;t[16]!==f||t[17]!==n||t[18]!==c||t[19]!==m||t[20]!==u||t[21]!==k||t[22]!==O?(A=()=>{if(!n||c===null)return;if(k){s({kind:`error`,message:`Enter a folder name (e.g. brain).`});return}let e=m===`project-root`?void 0:O,t=v.current?0:200;v.current=!1;let r=!1,i=setTimeout(()=>{r||(s(Dx),Tx().plan({rootDir:e,packId:u,includePersonalTemplates:f}).then(e=>{if(!r){if(!e.ok){s({kind:`error`,message:e.error.message});return}s(e.plan.created.length>0||(e.plan.personalTemplates?.willWrite.length??0)>0?{kind:`plan`,plan:e.plan}:{kind:`already-seeded`,plan:e.plan})}}).catch(e=>{r||s({kind:`error`,message:e instanceof Error?e.message:String(e)})}))},t);return()=>{r=!0,clearTimeout(i)}},j=[n,c,u,f,m,O,k],t[16]=f,t[17]=n,t[18]=c,t[19]=m,t[20]=u,t[21]=k,t[22]=O,t[23]=A,t[24]=j):(A=t[23],j=t[24]),(0,Q.useEffect)(A,j);let M;t[25]!==f||t[26]!==r||t[27]!==i||t[28]!==o.kind||t[29]!==o.plan||t[30]!==b?.name||t[31]!==u?(M=async function(){if(o.kind!==`plan`)return;let e=o.plan;s({kind:`applying`,plan:e});let t;try{t=await Tx().apply(e,{packId:u,includePersonalTemplates:f})}catch(t){let n=t,r=n instanceof Error?n.message:String(n);Fa.error(`Initialize failed: ${r}`),s({kind:`plan`,plan:e});return}if(t.ok){let e=b?.name??`starter pack`,n=t.result.applied,a=t.personalTemplates?.written.length??0,o=n===0&&a>0?`${a} personal template${a===1?``:`s`} written to ~/.ok/templates/`:n===0?`${e} was already set up — nothing to do.`:a>0?`${e} initialized (${n} ${n===1?`entry`:`entries`}) + ${a} personal template${a===1?``:`s`}`:`${e} initialized (${n} ${n===1?`entry`:`entries`})`;Fa.success(o),i?.(),r(!1)}else Fa.error(`Initialize failed: ${t.error.message}`),s({kind:`plan`,plan:e})},t[25]=f,t[26]=r,t[27]=i,t[28]=o.kind,t[29]=o.plan,t[30]=b?.name,t[31]=u,t[32]=M):M=t[32];let N=M,P;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsxs)(ro,{children:[(0,Z.jsxs)($a,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Qr,{"aria-hidden":`true`,className:`h-4 w-4 text-foreground opacity-70`}),`Initialize a starter pack`]}),(0,Z.jsx)(Qa,{children:`Pick a layout that matches what you're building. Each pack ships with folders, templates, and agent-readable descriptions. You can mix and match later.`})]}),t[33]=P):P=t[33];let F;t[34]!==c||t[35]!==u?(F=(0,Z.jsx)(Ox,{packs:c,selectedPackId:u,onSelect:d}),t[34]=c,t[35]=u,t[36]=F):F=t[36];let I;t[37]===f?I=t[38]:(I=(0,Z.jsx)(Ax,{checked:f,onCheckedChange:p}),t[37]=f,t[38]=I);let L=b?.defaultSubfolder??`subfolder`,R;t[39]!==m||t[40]!==g||t[41]!==L?(R=(0,Z.jsx)(jx,{choice:m,subfolder:g,placeholder:L,onChoiceChange:h,onSubfolderChange:_}),t[39]=m,t[40]=g,t[41]=L,t[42]=R):R=t[42];let z;t[43]!==o||t[44]!==b?(z=(0,Z.jsx)(Mx,{phase:o,selectedPack:b}),t[43]=o,t[44]=b,t[45]=z):z=t[45];let B;t[46]!==F||t[47]!==I||t[48]!==R||t[49]!==z?(B=(0,Z.jsxs)(to,{className:`space-y-6`,children:[F,I,R,z]}),t[46]=F,t[47]=I,t[48]=R,t[49]=z,t[50]=B):B=t[50];let V;t[51]===r?V=t[52]:(V=()=>r(!1),t[51]=r,t[52]=V);let H=o.kind===`already-seeded`||o.kind===`error`?`Close`:`Cancel`,U;t[53]!==V||t[54]!==H?(U=(0,Z.jsx)(zr,{className:`uppercase font-mono`,variant:`ghost`,onClick:V,children:H}),t[53]=V,t[54]=H,t[55]=U):U=t[55];let W;t[56]!==N||t[57]!==o.kind||t[58]!==k?(W=o.kind===`plan`?(0,Z.jsx)(zr,{onClick:N,disabled:k,children:`Initialize`}):o.kind===`applying`?(0,Z.jsxs)(zr,{disabled:!0,children:[(0,Z.jsx)(Re,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Setting up`]}):null,t[56]=N,t[57]=o.kind,t[58]=k,t[59]=W):W=t[59];let G;t[60]!==U||t[61]!==W?(G=(0,Z.jsxs)(no,{children:[U,W]}),t[60]=U,t[61]=W,t[62]=G):G=t[62];let K;t[63]!==B||t[64]!==G?(K=(0,Z.jsxs)(eo,{className:`sm:max-w-2xl`,"data-ok-layer-spawned":``,children:[P,B,G]}),t[63]=B,t[64]=G,t[65]=K):K=t[65];let q;return t[66]!==r||t[67]!==n||t[68]!==K?(q=(0,Z.jsx)(io,{open:n,onOpenChange:r,children:K}),t[66]=r,t[67]=n,t[68]=K,t[69]=q):q=t[69],q}function Dx(e){return e.kind===`plan`||e.kind===`already-seeded`?e:{kind:`loading`}}function Ox(e){let t=(0,$.c)(5),{packs:n,selectedPackId:r,onSelect:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:`Pick a starter pack`}),t[0]=a):a=t[0];let o;return t[1]!==i||t[2]!==n||t[3]!==r?(o=(0,Z.jsxs)(`div`,{className:`space-y-2 py-1`,children:[a,n===null?(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(Re,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Loading packs`]}):(0,Z.jsx)(uf,{className:`grid gap-2 sm:grid-cols-3`,value:r,onValueChange:e=>i(e),children:n.map(kx)})]}),t[1]=i,t[2]=n,t[3]=r,t[4]=o):o=t[4],o}function kx(e){return(0,Z.jsx)(pi,{htmlFor:`pack-${e.id}`,children:(0,Z.jsxs)(mi,{orientation:`horizontal`,className:`h-full`,children:[(0,Z.jsxs)(Ai,{children:[(0,Z.jsx)(_i,{className:`text-sm`,children:e.name}),(0,Z.jsx)(Mi,{className:`text-xs`,children:e.description})]}),(0,Z.jsx)(df,{value:e.id,id:`pack-${e.id}`})]})},e.id)}function Ax(e){let t=(0,$.c)(7),{checked:n,onCheckedChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(_i,{children:`Include personal templates`}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(Ai,{children:[i,(0,Z.jsxs)(Mi,{children:[`Adds daily journal, reading log, recipes, and more to `,(0,Z.jsx)(`code`,{children:`~/.ok/templates/`}),`. Idempotent — never overwrites your edits.`]})]}),t[1]=a):a=t[1];let o;t[2]===r?o=t[3]:(o=e=>r(e===!0),t[2]=r,t[3]=o);let s;return t[4]!==n||t[5]!==o?(s=(0,Z.jsx)(pi,{htmlFor:`seed-include-personal-templates`,className:`cursor-pointer`,children:(0,Z.jsxs)(mi,{orientation:`horizontal`,children:[a,(0,Z.jsx)(Ba,{id:`seed-include-personal-templates`,checked:n,onCheckedChange:o})]})}),t[4]=n,t[5]=o,t[6]=s):s=t[6],s}function jx(e){let t=(0,$.c)(22),{choice:n,subfolder:r,placeholder:i,onChoiceChange:a,onSubfolderChange:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:`Where should it live?`}),t[0]=s):s=t[0];let c;t[1]===a?c=t[2]:(c=e=>a(e),t[1]=a,t[2]=c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(pi,{htmlFor:`seed-root-project-root`,children:(0,Z.jsxs)(mi,{orientation:`horizontal`,children:[(0,Z.jsxs)(Ai,{children:[(0,Z.jsx)(_i,{children:`Project root`}),(0,Z.jsx)(Mi,{children:`Scaffold the pack's folders directly under this project.`})]}),(0,Z.jsx)(df,{value:`project-root`,id:`seed-root-project-root`})]})}),t[3]=l):l=t[3];let u,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(_i,{children:`In a subfolder`}),d=(0,Z.jsx)(Mi,{className:`nth-last-2:mt-0`,children:`Created if missing. Reuses the folder if it already exists.`}),t[4]=u,t[5]=d):(u=t[4],d=t[5]);let f;t[6]===o?f=t[7]:(f=e=>o(e.target.value),t[6]=o,t[7]=f);let p;t[8]===a?p=t[9]:(p=()=>a(`subfolder`),t[8]=a,t[9]=p);let m;t[10]!==i||t[11]!==r||t[12]!==f||t[13]!==p?(m=(0,Z.jsxs)(Ai,{children:[u,d,(0,Z.jsx)(ao,{value:r,onChange:f,onFocus:p,placeholder:i,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`mt-1.5 font-mono text-xs bg-background`})]}),t[10]=i,t[11]=r,t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(df,{value:`subfolder`,id:`seed-root-subfolder`}),t[15]=h):h=t[15];let g;t[16]===m?g=t[17]:(g=(0,Z.jsx)(pi,{htmlFor:`seed-root-subfolder`,children:(0,Z.jsxs)(mi,{orientation:`horizontal`,children:[m,h]})}),t[16]=m,t[17]=g);let _;return t[18]!==n||t[19]!==g||t[20]!==c?(_=(0,Z.jsxs)(`div`,{className:`space-y-2 py-1`,children:[s,(0,Z.jsxs)(uf,{className:`sm:flex`,value:n,onValueChange:c,children:[l,g]})]}),t[18]=n,t[19]=g,t[20]=c,t[21]=_):_=t[21],_}function Mx(e){let t=(0,$.c)(12),{phase:n,selectedPack:r}=e;if(n.kind===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-4 text-sm text-muted-foreground`,children:[(0,Z.jsx)(Re,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Computing scaffold plan`]}),t[0]=e):e=t[0],e}if(n.kind===`error`){let e;return t[1]===n.message?e=t[2]:(e=(0,Z.jsx)(`div`,{className:`rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:n.message}),t[1]=n.message,t[2]=e),e}if(n.kind===`already-seeded`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`py-2 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`This pack is already set up here.`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`The folders and templates are in place — there's nothing left to scaffold.`})]}),t[3]=e):e=t[3],e}let i;t[4]!==n.plan||t[5]!==r?(i=(0,Z.jsx)(Ix,{plan:n.plan,selectedPack:r}),t[4]=n.plan,t[5]=r,t[6]=i):i=t[6];let a;t[7]===n.plan.warnings?a=t[8]:(a=n.plan.warnings.length>0?(0,Z.jsx)(`div`,{className:`rounded-md bg-warning/10 p-3 text-xs text-warning-foreground`,children:n.plan.warnings.map(Nx)}):null,t[7]=n.plan.warnings,t[8]=a);let o;return t[9]!==i||t[10]!==a?(o=(0,Z.jsxs)(`div`,{className:`space-y-6 py-1 text-sm`,children:[i,a]}),t[9]=i,t[10]=a,t[11]=o):o=t[11],o}function Nx(e){return(0,Z.jsx)(`p`,{children:e},e)}function Px(e){return e.split(`/`).pop()??e}function Fx(e,t){let n=new Map;for(let e of t?.folders??[])n.set(e.path,e.summary);let r=e.created.filter(e=>e.kind===`folder`).map(e=>({kind:`folder`,name:`${e.path}/`,description:n.get(Px(e.path))??``})),i=e.created.filter(e=>e.kind===`file`).map(e=>({kind:`file`,name:e.path,description:Px(e.path)===`log.md`?`Append-only timeline`:``}));return[...r,...i]}function Ix(e){let t=(0,$.c)(18),{plan:n,selectedPack:r}=e,i,a,o,s,c;if(t[0]!==n||t[1]!==r){let e=Fx(n,r);i=n.personalTemplates?.willWrite.length??0,s=`space-y-3`,t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-primary`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center justify-center`,children:`◇`}),`What gets created`]}),t[7]=c):c=t[7],a=`space-y-3 overflow-y-auto subtle-scrollbar max-h-full`,o=e.map(Lx),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6];let l;t[8]===i?l=t[9]:(l=i>0?(0,Z.jsxs)(`li`,{className:`flex items-start gap-3 rounded-md border border-dashed border-border/60 bg-muted/10 p-3`,children:[(0,Z.jsx)(_s,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`,strokeWidth:1.5}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,Z.jsxs)(`code`,{className:`font-mono text-1sm`,children:[`~/.ok/templates/ (`,i,` `,i===1?`template`:`templates`,`)`]}),(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:`Personal templates: daily journal, reading log, weekly review, recipes, and more.`})]})]}):null,t[8]=i,t[9]=l);let u;t[10]!==a||t[11]!==o||t[12]!==l?(u=(0,Z.jsxs)(`ul`,{className:a,children:[o,l]}),t[10]=a,t[11]=o,t[12]=l,t[13]=u):u=t[13];let d;return t[14]!==s||t[15]!==c||t[16]!==u?(d=(0,Z.jsxs)(`section`,{className:s,children:[c,u]}),t[14]=s,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function Lx(e){return(0,Z.jsxs)(`li`,{className:`flex items-start gap-3 rounded-md border border-border/60 bg-muted/20 p-3`,children:[e.kind===`folder`?(0,Z.jsx)(Ss,{"aria-hidden":`true`,className:`mt-1 h-4 w-4 shrink-0 text-muted-foreground`,strokeWidth:1.5}):(0,Z.jsx)(_s,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`,strokeWidth:1.5}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,Z.jsx)(`code`,{className:`font-mono text-1sm`,children:e.name}),e.description?(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:e.description}):null]})]},e.name)}function Rx(){let e=(0,$.c)(14),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(0),s=(0,Q.useRef)(!1),c=(0,Q.useRef)(void 0),l,u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/documents`),n=await t.json().catch(Hx);if(e)return;let r=t.ok?br.safeParse(n):null;r?.success?(i(Ux(r.data.documents)),s.current=!0):s.current||=(i(1),!0)}catch{!e&&!s.current&&(i(1),s.current=!0)}};t();let n=sr(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(c.current)}},u=[],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Q.useEffect)(l,u);let d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=function(){clearTimeout(c.current),c.current=setTimeout(()=>o(Vx),250),fetch(`/api/documents`).then(async e=>{let t=await e.json().catch(Bx);if(!e.ok)return;let n=br.safeParse(t);n.success&&i(Ux(n.data.documents))}).catch(zx)},e[2]=d):d=e[2];let f=d,p=r!==null,m=r===0,h;e[3]===a?h=e[4]:(h=(0,Z.jsx)(vx,{size:80,celebrateSignal:a}),e[3]=a,e[4]=h);let g;e[5]!==m||e[6]!==p?(g=p?m?(0,Z.jsx)(Wx,{onCtaClick:()=>n(!0)}):(0,Z.jsx)(Gx,{onCtaClick:()=>n(!0)}):null,e[5]=m,e[6]=p,e[7]=g):g=e[7];let _;e[8]===t?_=e[9]:(_=(0,Z.jsx)(Ex,{open:t,onOpenChange:n,onSeedApplied:f}),e[8]=t,e[9]=_);let v;return e[10]!==h||e[11]!==g||e[12]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-6 px-6`,children:[h,g,_]}),e[10]=h,e[11]=g,e[12]=_,e[13]=v):v=e[13],v}function zx(){}function Bx(){return null}function Vx(e){return e+1}function Hx(){return null}function Ux(e){return e.filter(e=>e.kind===`document`||e.kind===`folder`).length}function Wx(e){let t=(0,$.c)(5),{onCtaClick:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`h2`,{className:`text-base font-medium`,children:`Welcome to Open Knowledge`}),i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pick a starter pack to scaffold a folder layout — or skip and start writing in the sidebar. Packs ship with templates and agent-readable descriptions so AI tools work with your vault out of the box.`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Qr,{"aria-hidden":`true`,className:`h-4 w-4`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[r,i,(0,Z.jsxs)(zr,{className:`mt-1`,onClick:n,children:[a,`Pick a starter pack`]})]}),t[3]=n,t[4]=o),o}function Gx(e){let t=(0,$.c)(4),{onCtaClick:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`span`,{className:`select-none text-sm text-muted-foreground`,children:`Select a document to edit`}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Qr,{"aria-hidden":`true`,className:`h-4 w-4`}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[r,(0,Z.jsxs)(zr,{variant:`outline`,size:`sm`,onClick:n,children:[i,`Pick a starter pack`]})]}),t[2]=n,t[3]=a),a}var Kx=365.2425,qx=6048e5,Jx=864e5,Yx=6e4,Xx=36e5,Zx=1e3,Qx=3600*24;Qx*7,Qx*Kx/12*3;var $x=Symbol.for(`constructDateFrom`);function eS(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&$x in e?e[$x](t):e instanceof Date?new e.constructor(t):new Date(t)}function tS(e,t){return eS(t||e,e)}function nS(e,t,n){let r=tS(e,n?.in);return isNaN(t)?eS(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function rS(e,t,n){let r=tS(e,n?.in);if(isNaN(t))return eS(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=eS(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}var iS={};function aS(){return iS}function oS(e,t){let n=aS(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=tS(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function sS(e,t){return oS(e,{...t,weekStartsOn:1})}function cS(e,t){let n=tS(e,t?.in),r=n.getFullYear(),i=eS(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=sS(i),o=eS(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=sS(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function lS(e){let t=tS(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function uS(e,...t){let n=eS.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function dS(e,t){let n=tS(e,t?.in);return n.setHours(0,0,0,0),n}function fS(e,t,n){let[r,i]=uS(n?.in,e,t),a=dS(r),o=dS(i),s=+a-lS(a),c=+o-lS(o);return Math.round((s-c)/Jx)}function pS(e,t){let n=cS(e,t),r=eS(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),sS(r)}function mS(e,t,n){return nS(e,t*7,n)}function hS(e,t,n){return rS(e,t*12,n)}function gS(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=eS.bind(null,e));let t=tS(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),eS(r,n||NaN)}function _S(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=eS.bind(null,e));let t=tS(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),eS(r,n||NaN)}function vS(e,t,n){let[r,i]=uS(n?.in,e,t);return+dS(r)==+dS(i)}function yS(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function bS(e){return!(!yS(e)&&typeof e!=`number`||isNaN(+tS(e)))}function xS(e,t,n){let[r,i]=uS(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function SS(e,t){let n=tS(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function CS(e,t){let[n,r]=uS(e,t.start,t.end);return{start:n,end:r}}function wS(e,t){let{start:n,end:r}=CS(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(eS(n,o)),o.setMonth(o.getMonth()+s);return i?c.reverse():c}function TS(e,t){let n=tS(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function ES(e,t){let n=tS(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function DS(e,t){let n=tS(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function OS(e,t){let{start:n,end:r}=CS(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(eS(n,o)),o.setFullYear(o.getFullYear()+s);return i?c.reverse():c}function kS(e,t){let n=aS(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=tS(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function AS(e,t){return kS(e,{...t,weekStartsOn:1})}var jS={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},MS=(e,t,n)=>{let r,i=jS[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function NS(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var PS={date:NS({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:NS({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:NS({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},FS={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},IS=(e,t,n,r)=>FS[e];function LS(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var RS={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:LS({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:LS({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:LS({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:LS({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:LS({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function zS(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?VS(s,e=>e.test(o)):BS(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function BS(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function VS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function HS(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var US={code:`en-US`,formatDistance:MS,formatLong:PS,formatRelative:IS,localize:RS,match:{ordinalNumber:HS({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:zS({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:zS({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:zS({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:zS({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:zS({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function WS(e,t){let n=tS(e,t?.in);return fS(n,DS(n))+1}function GS(e,t){let n=tS(e,t?.in),r=sS(n)-+pS(n);return Math.round(r/qx)+1}function KS(e,t){let n=tS(e,t?.in),r=n.getFullYear(),i=aS(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=eS(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=oS(o,t),c=eS(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=oS(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function qS(e,t){let n=aS(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=KS(e,t),a=eS(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),oS(a,t)}function JS(e,t){let n=tS(e,t?.in),r=oS(n,t)-+qS(n,t);return Math.round(r/qx)+1}function YS(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var XS={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return YS(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):YS(n+1,2)},d(e,t){return YS(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return YS(e.getHours()%12||12,t.length)},H(e,t){return YS(e.getHours(),t.length)},m(e,t){return YS(e.getMinutes(),t.length)},s(e,t){return YS(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return YS(Math.trunc(r*10**(n-3)),t.length)}},ZS={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},QS={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return XS.y(e,t)},Y:function(e,t,n,r){let i=KS(e,r),a=i>0?i:1-i;return t===`YY`?YS(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):YS(a,t.length)},R:function(e,t){return YS(cS(e),t.length)},u:function(e,t){return YS(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return YS(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return YS(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return XS.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return YS(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=JS(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):YS(i,t.length)},I:function(e,t,n){let r=GS(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):YS(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):XS.d(e,t)},D:function(e,t,n){let r=WS(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):YS(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return YS(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return YS(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return YS(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?ZS.noon:r===0?ZS.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?ZS.evening:r>=12?ZS.afternoon:r>=4?ZS.morning:ZS.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return XS.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):XS.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):YS(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):YS(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):XS.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):XS.s(e,t)},S:function(e,t){return XS.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return eC(r);case`XXXX`:case`XX`:return tC(r);default:return tC(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return eC(r);case`xxxx`:case`xx`:return tC(r);default:return tC(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+$S(r,`:`);default:return`GMT`+tC(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+$S(r,`:`);default:return`GMT`+tC(r,`:`)}},t:function(e,t,n){return YS(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return YS(+e,t.length)}};function $S(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+YS(a,2)}function eC(e,t){return e%60==0?(e>0?`-`:`+`)+YS(Math.abs(e)/60,2):tC(e,t)}function tC(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=YS(Math.trunc(r/60),2),a=YS(r%60,2);return n+i+t+a}var nC=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},rC=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},iC={p:rC,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return nC(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,nC(r,t)).replace(`{{time}}`,rC(i,t))}},aC=/^D+$/,oC=/^Y+$/,sC=[`D`,`DD`,`YY`,`YYYY`];function cC(e){return aC.test(e)}function lC(e){return oC.test(e)}function uC(e,t,n){let r=dC(e,t,n);if(console.warn(r),sC.includes(e))throw RangeError(r)}function dC(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var fC=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pC=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mC=/^'([^]*?)'?$/,hC=/''/g,gC=/[a-zA-Z]/;function _C(e,t,n){let r=aS(),i=n?.locale??r.locale??US,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=tS(e,n?.in);if(!bS(s))throw RangeError(`Invalid time value`);let c=t.match(pC).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=iC[t];return n(e,i.formatLong)}return e}).join(``).match(fC).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:vC(e)};if(QS[t])return{isToken:!0,value:e};if(t.match(gC))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&lC(a)||!n?.useAdditionalDayOfYearTokens&&cC(a))&&uC(a,t,String(e));let o=QS[a[0]];return o(s,a,i.localize,l)}).join(``)}function vC(e){let t=e.match(mC);return t?t[1].replace(hC,`'`):e}function yC(e,t){let n=tS(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=eS(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function bC(){return Object.assign({},aS())}function xC(e,t){let n=tS(e,t?.in).getDay();return n===0?7:n}function SC(e,t){return tS(e,t?.in).getMonth()}function CC(e,t){return tS(e,t?.in).getFullYear()}function wC(e,t){return+tS(e)>+tS(t)}function TC(e,t){return+tS(e)<+tS(t)}function EC(e,t){let n=DC(t)?new t(0):eS(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function DC(e){return typeof e==`function`&&e.prototype?.constructor===e}var OC=10,kC=class{subPriority=0;validate(e,t){return!0}},AC=class extends kC{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},jC=class extends kC{priority=OC;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>eS(t,e))}set(e,t){return t.timestampIsSet?e:eS(e,EC(e,this.context))}},MC=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new AC(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},NC=class extends MC{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]},PC={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},FC={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function IC(e,t){return e&&{value:t(e.value),rest:e.rest}}function LC(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function RC(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*Xx+a*Yx+o*Zx),rest:t.slice(n[0].length)}}function zC(e){return LC(PC.anyDigitsSigned,e)}function BC(e,t){switch(e){case 1:return LC(PC.singleDigit,t);case 2:return LC(PC.twoDigits,t);case 3:return LC(PC.threeDigits,t);case 4:return LC(PC.fourDigits,t);default:return LC(RegExp(`^\\d{1,`+e+`}`),t)}}function VC(e,t){switch(e){case 1:return LC(PC.singleDigitSigned,t);case 2:return LC(PC.twoDigitsSigned,t);case 3:return LC(PC.threeDigitsSigned,t);case 4:return LC(PC.fourDigitsSigned,t);default:return LC(RegExp(`^-?\\d{1,`+e+`}`),t)}}function HC(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function UC(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function WC(e){return e%400==0||e%4==0&&e%100!=0}var GC=class extends MC{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return IC(BC(4,e),r);case`yo`:return IC(n.ordinalNumber(e,{unit:`year`}),r);default:return IC(BC(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=UC(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},KC=class extends MC{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return IC(BC(4,e),r);case`Yo`:return IC(n.ordinalNumber(e,{unit:`year`}),r);default:return IC(BC(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=KS(e,r);if(n.isTwoDigitYear){let t=UC(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),oS(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),oS(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]},qC=class extends MC{priority=130;parse(e,t){return VC(t===`R`?4:t.length,e)}set(e,t,n){let r=eS(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),sS(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},JC=class extends MC{priority=130;parse(e,t){return VC(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]},YC=class extends MC{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return BC(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},XC=class extends MC{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return BC(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},ZC=class extends MC{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return IC(LC(PC.month,e),r);case`MM`:return IC(BC(2,e),r);case`Mo`:return IC(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},QC=class extends MC{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return IC(LC(PC.month,e),r);case`LL`:return IC(BC(2,e),r);case`Lo`:return IC(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]};function $C(e,t,n){let r=tS(e,n?.in),i=JS(r,n)-t;return r.setDate(r.getDate()-i*7),tS(r,n?.in)}var ew=class extends MC{priority=100;parse(e,t,n){switch(t){case`w`:return LC(PC.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return BC(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return oS($C(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function tw(e,t,n){let r=tS(e,n?.in),i=GS(r,n)-t;return r.setDate(r.getDate()-i*7),r}var nw=class extends MC{priority=100;parse(e,t,n){switch(t){case`I`:return LC(PC.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return BC(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return sS(tw(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},rw=[31,28,31,30,31,30,31,31,30,31,30,31],iw=[31,29,31,30,31,30,31,31,30,31,30,31],aw=class extends MC{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return LC(PC.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return BC(t.length,e)}}validate(e,t){let n=WC(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=iw[r]:t>=1&&t<=rw[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]},ow=class extends MC{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return LC(PC.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return BC(t.length,e)}}validate(e,t){return WC(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]};function sw(e,t,n){let r=aS(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=tS(e,n?.in),o=a.getDay(),s=(t%7+7)%7,c=7-i;return nS(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7,n)}var cw=class extends MC{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sw(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},lw=class extends MC{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return IC(BC(t.length,e),i);case`eo`:return IC(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sw(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]},uw=class extends MC{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return IC(BC(t.length,e),i);case`co`:return IC(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=sw(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]};function dw(e,t,n){let r=tS(e,n?.in);return nS(r,t-xC(r,n),n)}var fw=class extends MC{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return BC(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return IC(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return IC(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return IC(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);default:return IC(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=dw(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]},pw=class extends MC{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(HC(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},mw=class extends MC{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(HC(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},hw=class extends MC{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(HC(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},gw=class extends MC{priority=70;parse(e,t,n){switch(t){case`h`:return LC(PC.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return BC(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]},_w=class extends MC{priority=70;parse(e,t,n){switch(t){case`H`:return LC(PC.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return BC(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]},vw=class extends MC{priority=70;parse(e,t,n){switch(t){case`K`:return LC(PC.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return BC(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]},yw=class extends MC{priority=70;parse(e,t,n){switch(t){case`k`:return LC(PC.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return BC(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]},bw=class extends MC{priority=60;parse(e,t,n){switch(t){case`m`:return LC(PC.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return BC(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]},xw=class extends MC{priority=50;parse(e,t,n){switch(t){case`s`:return LC(PC.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return BC(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]},Sw=class extends MC{priority=30;parse(e,t){return IC(BC(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]},Cw=class extends MC{priority=10;parse(e,t){switch(t){case`X`:return RC(FC.basicOptionalMinutes,e);case`XX`:return RC(FC.basic,e);case`XXXX`:return RC(FC.basicOptionalSeconds,e);case`XXXXX`:return RC(FC.extendedOptionalSeconds,e);default:return RC(FC.extended,e)}}set(e,t,n){return t.timestampIsSet?e:eS(e,e.getTime()-lS(e)-n)}incompatibleTokens=[`t`,`T`,`x`]},ww=class extends MC{priority=10;parse(e,t){switch(t){case`x`:return RC(FC.basicOptionalMinutes,e);case`xx`:return RC(FC.basic,e);case`xxxx`:return RC(FC.basicOptionalSeconds,e);case`xxxxx`:return RC(FC.extendedOptionalSeconds,e);default:return RC(FC.extended,e)}}set(e,t,n){return t.timestampIsSet?e:eS(e,e.getTime()-lS(e)-n)}incompatibleTokens=[`t`,`T`,`X`]},Tw=class extends MC{priority=40;parse(e){return zC(e)}set(e,t,n){return[eS(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},Ew=class extends MC{priority=20;parse(e){return zC(e)}set(e,t,n){return[eS(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`},Dw={G:new NC,y:new GC,Y:new KC,R:new qC,u:new JC,Q:new YC,q:new XC,M:new ZC,L:new QC,w:new ew,I:new nw,d:new aw,D:new ow,E:new cw,e:new lw,c:new uw,i:new fw,a:new pw,b:new mw,B:new hw,h:new gw,H:new _w,K:new vw,k:new yw,m:new bw,s:new xw,S:new Sw,X:new Cw,x:new ww,t:new Tw,T:new Ew},Ow=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Aw=/^'([^]*?)'?$/,jw=/''/g,Mw=/\S/,Nw=/[a-zA-Z]/;function Pw(e,t,n,r){let i=()=>eS(r?.in||n,NaN),a=bC(),o=r?.locale??a.locale??US,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():tS(n,r?.in);let l={firstWeekContainsDate:s,weekStartsOn:c,locale:o},u=[new jC(r?.in,n)],d=t.match(kw).map(e=>{let t=e[0];if(t in iC){let n=iC[t];return n(e,o.formatLong)}return e}).join(``).match(Ow),f=[];for(let n of d){!r?.useAdditionalWeekYearTokens&&lC(n)&&uC(n,t,e),!r?.useAdditionalDayOfYearTokens&&cC(n)&&uC(n,t,e);let a=n[0],s=Dw[a];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=f.find(e=>t.includes(e.token)||e.token===a);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if(s.incompatibleTokens===`*`&&f.length>0)throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);f.push({token:a,fullToken:n});let r=s.run(e,n,o.match,l);if(!r)return i();u.push(r.setter),e=r.rest}else{if(a.match(Nw))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=Fw(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&Mw.test(e))return i();let p=u.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>u.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),m=tS(n,r?.in);if(isNaN(+m))return i();let h={};for(let e of p){if(!e.validate(m,l))return i();let t=e.set(m,h,l);Array.isArray(t)?(m=t[0],Object.assign(h,t[1])):m=t}return m}function Fw(e){return e.match(Aw)[1].replace(jw,`'`)}function Iw(e,t,n){let[r,i]=uS(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Lw(e,t,n){let[r,i]=uS(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function Rw(e,t){let n=()=>eS(t?.in,NaN),r=t?.additionalDigits??2,i=Uw(e),a;if(i.date){let e=Ww(i.date,r);a=Gw(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=qw(i.time),isNaN(s)))return n();if(i.timezone){if(c=Yw(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=tS(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return tS(o+s+c,t?.in)}var zw={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Bw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Vw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Hw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Uw(e){let t={},n=e.split(zw.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],zw.timeZoneDelimiter.test(t.date)&&(t.date=e.split(zw.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=zw.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function Ww(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function Gw(e,t){if(t===null)return new Date(NaN);let n=e.match(Bw);if(!n)return new Date(NaN);let r=!!n[4],i=Kw(n[1]),a=Kw(n[2])-1,o=Kw(n[3]),s=Kw(n[4]),c=Kw(n[5])-1;if(r)return tT(t,s,c)?Xw(t,s,c):new Date(NaN);{let e=new Date(0);return!$w(t,a,o)||!eT(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function Kw(e){return e?parseInt(e):1}function qw(e){let t=e.match(Vw);if(!t)return NaN;let n=Jw(t[1]),r=Jw(t[2]),i=Jw(t[3]);return nT(n,r,i)?n*Xx+r*Yx+i*1e3:NaN}function Jw(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function Yw(e){if(e===`Z`)return 0;let t=e.match(Hw);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return rT(r,i)?n*(r*Xx+i*Yx):NaN}function Xw(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var Zw=[31,null,31,30,31,30,31,31,30,31,30,31];function Qw(e){return e%400==0||e%4==0&&e%100!=0}function $w(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Zw[t]||(Qw(e)?29:28))}function eT(e,t){return t>=1&&t<=(Qw(e)?366:365)}function tT(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function nT(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function rT(e,t){return t>=0&&t<=59}function iT(e,t,n){let r=tS(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=eS(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=yC(o);return r.setMonth(t,Math.min(a,s)),r}function aT(e,t,n){let r=tS(e,n?.in);return isNaN(+r)?eS(n?.in||e,NaN):(r.setFullYear(t),r)}function oT(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var sT={},cT={};function lT(e,t){try{let n=(sT[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in cT?cT[n]:dT(n,n.split(`:`))}catch{if(e in cT)return cT[e];let t=e?.match(uT);return t?dT(e,t.slice(1)):NaN}}var uT=/([+-]\d\d):?(\d\d)?/;function dT(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return cT[e]=n*60+r>0?n*60+r+i:n*60-r-i}var fT=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(lT(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),gT(this,NaN),mT(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-lT(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),mT(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},pT=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!pT.test(e))return;let t=e.replace(pT,`$1UTC`);fT.prototype[t]&&(e.startsWith(`get`)?fT.prototype[e]=function(){return this.internal[t]()}:(fT.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),hT(this),+this},fT.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),mT(this),+this}))});function mT(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-lT(e.timeZone,e)*60))}function hT(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),gT(e)}function gT(e){let t=lT(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(lT(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=lT(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=lT(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var _T=class e extends fT{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${oT(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},vT=5,yT=4;function bT(e,t){let n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),a=t.addDays(i,vT*7-1);return t.getMonth(e)===t.getMonth(a)?vT:yT}function xT(e,t){let n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function ST(e,t){let n=xT(e,t),r=bT(e,t);return t.addDays(n,r*7-1)}var CT={...US,labels:{labelDayButton:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>_C(e,t,{locale:US,...n});let a=i(e,`PPPP`);return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:`Choose the Month`,labelNext:`Go to the Next Month`,labelPrevious:`Go to the Previous Month`,labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:`Choose the Year`,labelGrid:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>_C(e,n,{locale:US,...t}),r(e,`LLLL yyyy`)},labelGridcell:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>_C(e,t,{locale:US,...n});let a=i(e,`PPPP`);return t?.today&&(a=`Today, ${a}`),a},labelNav:`Navigation bar`,labelWeekNumberHeader:`Week Number`,labelWeekday:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>_C(e,n,{locale:US,...t}),r(e,`cccc`)}}},wT=class e{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?_T.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new _T(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):nS(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):rS(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):mS(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):hS(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):fS(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):xS(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):wS(e),this.eachYearOfInterval=e=>{let t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):OS(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;let r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):ST(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):AS(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):SS(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):kS(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):ES(e),this.format=(e,t,n)=>{let r=this.overrides?.format?this.overrides.format(e,t,this.options):_C(e,t,this.options);return this.options.numerals&&this.options.numerals!==`latn`?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):GS(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):SC(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):CC(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):JS(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):wC(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):TC(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):yS(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):vS(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):Iw(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):Lw(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):gS(e),this.min=e=>this.overrides?.min?this.overrides.min(e):_S(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):iT(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):aT(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):xT(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):dS(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):sS(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):TS(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):oS(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):DS(e),this.options={locale:CT,...e},this.overrides=t}getDigitMap(){let{numerals:e=`latn`}=this.options,t=new Intl.NumberFormat(`en-US`,{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){let t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){let t=this.options.locale?.code;return t&&e.yearFirstLocales.has(t)?`year-first`:`month-first`}formatMonthYear(t){let{locale:n,timeZone:r,numerals:i}=this.options,a=n?.code;if(a&&e.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`,timeZone:r,numberingSystem:i}).format(t)}catch{}let o=this.getMonthYearOrder()===`year-first`?`y LLLL`:`LLLL y`;return this.format(t,o)}};wT.yearFirstLocales=new Set([`eu`,`hu`,`ja`,`ja-Hira`,`ja-JP`,`ko`,`ko-KR`,`lt`,`lt-LT`,`lv`,`lv-LV`,`mn`,`mn-MN`,`zh`,`zh-CN`,`zh-HK`,`zh-TW`]);var TT=new wT,ET=class{constructor(e,t,n=TT){this.date=e,this.displayMonth=t,this.outside=!!(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,`yyyy-MM-dd`),this.displayMonthId=n.format(t,`yyyy-MM`),this.dateMonthId=n.format(e,`yyyy-MM`)}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}},DT=class{constructor(e,t){this.date=e,this.weeks=t}},OT=class{constructor(e,t){this.days=t,this.weekNumber=e}};function kT(e){return Q.createElement(`button`,{...e})}function AT(e){return Q.createElement(`span`,{...e})}function jT(e){let{size:t=24,orientation:n=`left`,className:r}=e;return Q.createElement(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`},n===`up`&&Q.createElement(`polygon`,{points:`6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28`}),n===`down`&&Q.createElement(`polygon`,{points:`6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72`}),n===`left`&&Q.createElement(`polygon`,{points:`16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20`}),n===`right`&&Q.createElement(`polygon`,{points:`8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20`}))}function MT(e){let{day:t,modifiers:n,...r}=e;return Q.createElement(`td`,{...r})}function NT(e){let{day:t,modifiers:n,...r}=e,i=Q.useRef(null);return Q.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),Q.createElement(`button`,{ref:i,...r})}var PT;(function(e){e.Root=`root`,e.Chevron=`chevron`,e.Day=`day`,e.DayButton=`day_button`,e.CaptionLabel=`caption_label`,e.Dropdowns=`dropdowns`,e.Dropdown=`dropdown`,e.DropdownRoot=`dropdown_root`,e.Footer=`footer`,e.MonthGrid=`month_grid`,e.MonthCaption=`month_caption`,e.MonthsDropdown=`months_dropdown`,e.Month=`month`,e.Months=`months`,e.Nav=`nav`,e.NextMonthButton=`button_next`,e.PreviousMonthButton=`button_previous`,e.Week=`week`,e.Weeks=`weeks`,e.Weekday=`weekday`,e.Weekdays=`weekdays`,e.WeekNumber=`week_number`,e.WeekNumberHeader=`week_number_header`,e.YearsDropdown=`years_dropdown`})(PT||={});var FT;(function(e){e.disabled=`disabled`,e.hidden=`hidden`,e.outside=`outside`,e.focused=`focused`,e.today=`today`})(FT||={});var IT;(function(e){e.range_end=`range_end`,e.range_middle=`range_middle`,e.range_start=`range_start`,e.selected=`selected`})(IT||={});var LT;(function(e){e.weeks_before_enter=`weeks_before_enter`,e.weeks_before_exit=`weeks_before_exit`,e.weeks_after_enter=`weeks_after_enter`,e.weeks_after_exit=`weeks_after_exit`,e.caption_after_enter=`caption_after_enter`,e.caption_after_exit=`caption_after_exit`,e.caption_before_enter=`caption_before_enter`,e.caption_before_exit=`caption_before_exit`})(LT||={});function RT(e){let{options:t,className:n,components:r,classNames:i,...a}=e,o=[i[PT.Dropdown],n].join(` `),s=t?.find(({value:e})=>e===a.value);return Q.createElement(`span`,{"data-disabled":a.disabled,className:i[PT.DropdownRoot]},Q.createElement(r.Select,{className:o,...a},t?.map(({value:e,label:t,disabled:n})=>Q.createElement(r.Option,{key:e,value:e,disabled:n},t))),Q.createElement(`span`,{className:i[PT.CaptionLabel],"aria-hidden":!0},s?.label,Q.createElement(r.Chevron,{orientation:`down`,size:18,className:i[PT.Chevron]})))}function zT(e){return Q.createElement(`div`,{...e})}function BT(e){return Q.createElement(`div`,{...e})}function VT(e){let{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement(`div`,{...r},e.children)}function HT(e){let{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement(`div`,{...r})}function UT(e){return Q.createElement(`table`,{...e})}function WT(e){return Q.createElement(`div`,{...e})}var GT=(0,Q.createContext)(void 0);function KT(){let e=(0,Q.useContext)(GT);if(e===void 0)throw Error(`useDayPicker() must be used within a custom component.`);return e}function qT(e){let{components:t}=KT();return Q.createElement(t.Dropdown,{...e})}function JT(e){let{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...a}=e,{components:o,classNames:s,labels:{labelPrevious:c,labelNext:l}}=KT(),u=(0,Q.useCallback)(e=>{i&&n?.(e)},[i,n]),d=(0,Q.useCallback)(e=>{r&&t?.(e)},[r,t]);return Q.createElement(`nav`,{...a},Q.createElement(o.PreviousMonthButton,{type:`button`,className:s[PT.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},Q.createElement(o.Chevron,{disabled:r?void 0:!0,className:s[PT.Chevron],orientation:`left`})),Q.createElement(o.NextMonthButton,{type:`button`,className:s[PT.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":l(i),onClick:u},Q.createElement(o.Chevron,{disabled:i?void 0:!0,orientation:`right`,className:s[PT.Chevron]})))}function YT(e){let{components:t}=KT();return Q.createElement(t.Button,{...e})}function XT(e){return Q.createElement(`option`,{...e})}function ZT(e){let{components:t}=KT();return Q.createElement(t.Button,{...e})}function QT(e){let{rootRef:t,...n}=e;return Q.createElement(`div`,{...n,ref:t})}function $T(e){return Q.createElement(`select`,{...e})}function eE(e){let{week:t,...n}=e;return Q.createElement(`tr`,{...n})}function tE(e){return Q.createElement(`th`,{...e})}function nE(e){return Q.createElement(`thead`,{"aria-hidden":!0},Q.createElement(`tr`,{...e}))}function rE(e){let{week:t,...n}=e;return Q.createElement(`th`,{...n})}function iE(e){return Q.createElement(`th`,{...e})}function aE(e){return Q.createElement(`tbody`,{...e})}function oE(e){let{components:t}=KT();return Q.createElement(t.Dropdown,{...e})}var sE=t({Button:()=>kT,CaptionLabel:()=>AT,Chevron:()=>jT,Day:()=>MT,DayButton:()=>NT,Dropdown:()=>RT,DropdownNav:()=>zT,Footer:()=>BT,Month:()=>VT,MonthCaption:()=>HT,MonthGrid:()=>UT,Months:()=>WT,MonthsDropdown:()=>qT,Nav:()=>JT,NextMonthButton:()=>YT,Option:()=>XT,PreviousMonthButton:()=>ZT,Root:()=>QT,Select:()=>$T,Week:()=>eE,WeekNumber:()=>rE,WeekNumberHeader:()=>iE,Weekday:()=>tE,Weekdays:()=>nE,Weeks:()=>aE,YearsDropdown:()=>oE});function cE(e,t,n=!1,r=TT){let{from:i,to:a}=e,{differenceInCalendarDays:o,isSameDay:s}=r;return i&&a?(o(a,i)<0&&([i,a]=[a,i]),o(t,i)>=+!!n&&o(a,t)>=+!!n):!n&&a?s(a,t):!n&&i?s(i,t):!1}function lE(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function uE(e){return!!(e&&typeof e==`object`&&`from`in e)}function dE(e){return!!(e&&typeof e==`object`&&`after`in e)}function fE(e){return!!(e&&typeof e==`object`&&`before`in e)}function pE(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function mE(e,t){return Array.isArray(e)&&e.every(t.isDate)}function hE(e,t,n=TT){let r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:a,isAfter:o}=n;return r.some(t=>{if(typeof t==`boolean`)return t;if(n.isDate(t))return i(e,t);if(mE(t,n))return t.some(t=>i(e,t));if(uE(t))return cE(t,e,!1,n);if(pE(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(lE(t)){let n=a(t.before,e),r=a(t.after,e),i=n>0,s=r<0;return o(t.before,t.after)?s&&i:i||s}return dE(t)?a(e,t.after)>0:fE(t)?a(t.before,e)>0:typeof t==`function`?t(e):!1})}function gE(e,t,n,r,i){let{disabled:a,hidden:o,modifiers:s,showOutsideDays:c,broadcastCalendar:l,today:u=i.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=i,_=n&&p(n),v=r&&h(r),y={[FT.focused]:[],[FT.outside]:[],[FT.disabled]:[],[FT.hidden]:[],[FT.today]:[]},b={};for(let t of e){let{date:e,displayMonth:n}=t,r=!!(n&&!f(e,n)),p=!!(_&&m(e,_)),h=!!(v&&g(e,v)),x=!!(a&&hE(e,a,i)),S=!!(o&&hE(e,o,i))||p||h||!l&&!c&&r||l&&c===!1&&r,C=d(e,u);r&&y.outside.push(t),x&&y.disabled.push(t),S&&y.hidden.push(t),C&&y.today.push(t),s&&Object.keys(s).forEach(n=>{let r=s?.[n];r&&hE(e,r,i)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{let t={[FT.focused]:!1,[FT.disabled]:!1,[FT.hidden]:!1,[FT.outside]:!1,[FT.today]:!1},n={};for(let n in y)t[n]=y[n].some(t=>t===e);for(let t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}function _E(e,t,n={}){return Object.entries(e).filter(([,e])=>e===!0).reduce((e,[r])=>(n[r]?e.push(n[r]):t[FT[r]]?e.push(t[FT[r]]):t[IT[r]]&&e.push(t[IT[r]]),e),[t[PT.Day]])}function vE(e){return{...sE,...e}}function yE(e){let t={"data-mode":e.mode??void 0,"data-required":`required`in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith(`data-`)&&(t[e]=n)}),t}function bE(){let e={};for(let t in PT)e[PT[t]]=`rdp-${PT[t]}`;for(let t in FT)e[FT[t]]=`rdp-${FT[t]}`;for(let t in IT)e[IT[t]]=`rdp-${IT[t]}`;for(let t in LT)e[LT[t]]=`rdp-${LT[t]}`;return e}function xE(e,t,n){return(n??new wT(t)).formatMonthYear(e)}var SE=xE;function CE(e,t,n){return(n??new wT(t)).format(e,`d`)}function wE(e,t=TT){return t.format(e,`LLLL`)}function TE(e,t,n){return(n??new wT(t)).format(e,`cccccc`)}function EE(e,t=TT){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function DE(){return``}function OE(e,t=TT){return t.format(e,`yyyy`)}var kE=OE,AE=t({formatCaption:()=>xE,formatDay:()=>CE,formatMonthCaption:()=>SE,formatMonthDropdown:()=>wE,formatWeekNumber:()=>EE,formatWeekNumberHeader:()=>DE,formatWeekdayName:()=>TE,formatYearCaption:()=>kE,formatYearDropdown:()=>OE});function jE(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...AE,...e}}function ME(e,t,n,r){let i=(r??new wT(n)).format(e,`PPPP`);return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}var NE=ME;function PE(e,t,n){return(n??new wT(t)).formatMonthYear(e)}var FE=PE;function IE(e,t,n,r){let i=(r??new wT(n)).format(e,`PPPP`);return t?.today&&(i=`Today, ${i}`),i}function LE(e){return`Choose the Month`}function RE(){return``}var zE=`Go to the Next Month`;function BE(e,t){return zE}function VE(e){return`Go to the Previous Month`}function HE(e,t,n){return(n??new wT(t)).format(e,`cccc`)}function UE(e,t){return`Week ${e}`}function WE(e){return`Week Number`}function GE(e){return`Choose the Year`}var KE=t({labelCaption:()=>FE,labelDay:()=>NE,labelDayButton:()=>ME,labelGrid:()=>PE,labelGridcell:()=>IE,labelMonthDropdown:()=>LE,labelNav:()=>RE,labelNext:()=>BE,labelPrevious:()=>VE,labelWeekNumber:()=>UE,labelWeekNumberHeader:()=>WE,labelWeekday:()=>HE,labelYearDropdown:()=>GE}),qE=(e,t,n)=>t||(n?typeof n==`function`?n:(...e)=>n:e);function JE(e,t){let n=t.locale?.labels??{};return{...KE,...e??{},labelDayButton:qE(ME,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:qE(LE,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:qE(BE,e?.labelNext,n.labelNext),labelPrevious:qE(VE,e?.labelPrevious,n.labelPrevious),labelWeekNumber:qE(UE,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:qE(GE,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:qE(PE,e?.labelGrid,n.labelGrid),labelGridcell:qE(IE,e?.labelGridcell,n.labelGridcell),labelNav:qE(RE,e?.labelNav,n.labelNav),labelWeekNumberHeader:qE(WE,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:qE(HE,e?.labelWeekday,n.labelWeekday)}}function YE(e,t,n,r,i){let{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=i;return c({start:o(e),end:s(e)}).map(e=>{let o=r.formatMonthDropdown(e,i);return{value:l(e),label:o,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function XE(e,t={},n={}){let r={...t?.[PT.Day]};return Object.entries(e).filter(([,e])=>e===!0).forEach(([e])=>{r={...r,...n?.[e]}}),r}function ZE(e,t,n,r){let i=r??e.today(),a=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),o=[];for(let t=0;t<7;t++){let n=e.addDays(a,t);o.push(n)}return o}function QE(e,t,n,r,i=!1){if(!e||!t)return;let{startOfYear:a,endOfYear:o,eachYearOfInterval:s,getYear:c}=r,l=s({start:a(e),end:o(t)});return i&&l.reverse(),l.map(e=>{let t=n.formatYearDropdown(e,r);return{value:c(e),label:t,disabled:!1}})}function $E(e,t={}){let{weekStartsOn:n,locale:r}=t,i=n??r?.options?.weekStartsOn??0,a=t=>{let n=typeof t==`number`||typeof t==`string`?new Date(t):t;return new _T(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},o=e=>{let t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(_T.tz(e)),newDate:(t,n,r)=>new _T(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{let n=a(e),r=t?.weekStartsOn??i,o=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-o),n},startOfISOWeek:e=>{let t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{let t=a(e);return t.setDate(1),t},startOfYear:e=>{let t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{let n=a(e),r=(((t?.weekStartsOn??i)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{let t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{let t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{let t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new _T(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=r.getFullYear()*12+r.getMonth();for(;o.getFullYear()*12+o.getMonth()<=s;)i.push(new _T(o,e)),o.setMonth(o.getMonth()+1,1);return i},addDays:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t*7),n},addMonths:(e,t)=>{let n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{let n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new _T(n.getFullYear(),0,1,12,0,0,e);for(;o.getFullYear()<=r.getFullYear();)i.push(new _T(o,e)),o.setFullYear(o.getFullYear()+1,0,1);return i},getWeek:(e,t)=>JS(o(e),{weekStartsOn:t?.weekStartsOn??i,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>GS(o(e)),differenceInCalendarDays:(e,t)=>fS(o(e),o(t)),differenceInCalendarMonths:(e,t)=>xS(o(e),o(t))}}var eD=e=>e instanceof HTMLElement?e:null,tD=e=>[...e.querySelectorAll(`[data-animated-month]`)??[]],nD=e=>eD(e.querySelector(`[data-animated-month]`)),rD=e=>eD(e.querySelector(`[data-animated-caption]`)),iD=e=>eD(e.querySelector(`[data-animated-weeks]`)),aD=e=>eD(e.querySelector(`[data-animated-nav]`)),oD=e=>eD(e.querySelector(`[data-animated-weekdays]`));function sD(e,t,{classNames:n,months:r,focused:i,dateLib:a}){let o=(0,Q.useRef)(null),s=(0,Q.useRef)(r),c=(0,Q.useRef)(!1);(0,Q.useLayoutEffect)(()=>{let l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;let u=a.isSameMonth(r[0].date,l[0].date),d=a.isAfter(r[0].date,l[0].date),f=d?n[LT.caption_after_enter]:n[LT.caption_before_enter],p=d?n[LT.weeks_after_enter]:n[LT.weeks_before_enter],m=o.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(tD(h).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=nD(e);t&&e.contains(t)&&e.removeChild(t);let n=rD(e);n&&n.classList.remove(f);let r=iD(e);r&&r.classList.remove(p)}),o.current=h):o.current=null,c.current||u||i)return;let g=m instanceof HTMLElement?tD(m):[],_=tD(e.current);if(_?.every(e=>e instanceof HTMLElement)&&g&&g.every(e=>e instanceof HTMLElement)){c.current=!0;let t=[];e.current.style.isolation=`isolate`;let r=aD(e.current);r&&(r.style.zIndex=`1`),_.forEach((i,a)=>{let o=g[a];if(!o)return;i.style.position=`relative`,i.style.overflow=`hidden`;let s=rD(i);s&&s.classList.add(f);let l=iD(i);l&&l.classList.add(p);let u=()=>{c.current=!1,e.current&&(e.current.style.isolation=``),r&&(r.style.zIndex=``),s&&s.classList.remove(f),l&&l.classList.remove(p),i.style.position=``,i.style.overflow=``,i.contains(o)&&i.removeChild(o)};t.push(u),o.style.pointerEvents=`none`,o.style.position=`absolute`,o.style.overflow=`hidden`,o.setAttribute(`aria-hidden`,`true`);let m=oD(o);m&&(m.style.opacity=`0`);let h=rD(o);h&&(h.classList.add(d?n[LT.caption_before_exit]:n[LT.caption_after_exit]),h.addEventListener(`animationend`,u));let _=iD(o);_&&_.classList.add(d?n[LT.weeks_before_exit]:n[LT.weeks_after_exit]),i.insertBefore(o,i.firstChild)})}})}function cD(e,t,n,r){let i=e[0],a=e[e.length-1],{ISOWeek:o,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:v,startOfWeek:y}=r,b=c?_(i,r):o?v(i):y(i),x=c?f(a):o?p(m(a)):h(m(a)),S=t&&(c?f(t):o?p(t):h(t)),C=u(S&&g(x,S)?S:x,b),w=d(a,i)+1,T=[];for(let e=0;e<=C;e++){let t=l(b,e);T.push(t)}let E=(c?35:42)*w;if(s&&T.length<E){let e=E-T.length;for(let t=0;t<e;t++){let e=l(T[T.length-1],1);T.push(e)}}return T}function lD(e){let t=[];return e.reduce((e,n)=>{let r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}function uD(e,t,n,r){let{numberOfMonths:i=1}=n,a=[];for(let n=0;n<i;n++){let i=r.addMonths(e,n);if(t&&i>t)break;a.push(i)}return a}function dD(e,t,n,r){let{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e,c=i||a||o,{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;return n&&l(n,c)<s-1&&(c=u(n,-1*(s-1))),t&&l(c,t)<0&&(c=t),d(c)}function fD(e,t,n,r){let{addDays:i,endOfBroadcastWeek:a,endOfISOWeek:o,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{let h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?o(s(m)):c(s(m)),_=t.filter(e=>e>=h&&e<=g),v=n.broadcastCalendar?35:42;if(n.fixedWeeks&&_.length<v){let e=t.filter(e=>{let t=v-_.length;return e>g&&e<=i(g,t)});_.push(...e)}let y=new DT(m,_.reduce((e,t)=>{let i=n.ISOWeek?l(t):u(t),a=e.find(e=>e.weekNumber===i),o=new ET(t,m,r);return a?a.days.push(o):e.push(new OT(i,[o])),e},[]));return e.push(y),e},[]);return n.reverseMonths?m.reverse():m}function pD(e,t){let{startMonth:n,endMonth:r}=e,{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:c,endOfYear:l,newDate:u,today:d}=t,{fromYear:f,toYear:p,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&p&&(r=u(p,11,31));let g=e.captionLayout===`dropdown`||e.captionLayout===`dropdown-years`;return n?n=o(n):f?n=u(f,0,1):!n&&g&&(n=i(c(e.today??d(),-100))),r?r=s(r):p?r=u(p,11,31):!r&&g&&(r=l(e.today??d())),[n&&a(n),r&&a(r)]}function mD(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a=1}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a:1,u=o(e);if(!t||!(c(t,e)<a))return s(u,l)}function hD(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a??1:1,u=o(e);if(!t||!(c(u,t)<=0))return s(u,-l)}function gD(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}function _D(e,t){let[n,r]=(0,Q.useState)(e);return[t===void 0?n:t,r]}function vD(e,t){let[n,r]=pD(e,t),{startOfMonth:i,endOfMonth:a}=t,o=dD(e,n,r,t),[s,c]=_D(o,e.month?o:void 0);(0,Q.useEffect)(()=>{c(dD(e,n,r,t))},[e.timeZone]);let{months:l,weeks:u,days:d,previousMonth:f,nextMonth:p}=(0,Q.useMemo)(()=>{let i=uD(s,r,{numberOfMonths:e.numberOfMonths},t),o=fD(i,cD(i,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t);return{months:o,weeks:gD(o),days:lD(o),previousMonth:hD(s,n,e,t),nextMonth:mD(s,r,e,t)}},[t,s.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:m,onMonthChange:h}=e,g=e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))),_=e=>{if(m)return;let t=i(e);n&&t<i(n)&&(t=i(n)),r&&t>i(r)&&(t=i(r)),c(t),h?.(t)};return{months:l,weeks:u,days:d,navStart:n,navEnd:r,previousMonth:f,nextMonth:p,goToMonth:_,goToDay:e=>{g(e)||_(e.date)}}}var yD;(function(e){e[e.Today=0]=`Today`,e[e.Selected=1]=`Selected`,e[e.LastFocused=2]=`LastFocused`,e[e.FocusedModifier=3]=`FocusedModifier`})(yD||={});function bD(e){return!e[FT.disabled]&&!e[FT.hidden]&&!e[FT.outside]}function xD(e,t,n,r){let i,a=-1;for(let o of e){let e=t(o);bD(e)&&(e[FT.focused]&&a<yD.FocusedModifier?(i=o,a=yD.FocusedModifier):r?.isEqualTo(o)&&a<yD.LastFocused?(i=o,a=yD.LastFocused):n(o.date)&&a<yD.Selected?(i=o,a=yD.Selected):e[FT.today]&&a<yD.Today&&(i=o,a=yD.Today))}return i||=e.find(e=>bD(t(e))),i}function SD(e,t,n,r,i,a,o){let{ISOWeek:s,broadcastCalendar:c}=a,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:_,startOfBroadcastWeek:v,startOfISOWeek:y,startOfWeek:b}=o,x={day:l,week:d,month:u,year:f,startOfWeek:e=>c?v(e,o):s?y(e):b(e),endOfWeek:e=>c?p(e):s?m(e):h(e)}[e](n,t===`after`?1:-1);return t===`before`&&r?x=g([r,x]):t===`after`&&i&&(x=_([i,x])),x}function CD(e,t,n,r,i,a,o,s=0){if(s>365)return;let c=SD(e,t,n.date,r,i,a,o),l=!!(a.disabled&&hE(c,a.disabled,o)),u=!!(a.hidden&&hE(c,a.hidden,o)),d=new ET(c,c,o);return!l&&!u?d:CD(e,t,d,r,i,a,o,s+1)}function wD(e,t,n,r,i){let{autoFocus:a}=e,[o,s]=(0,Q.useState)(),c=xD(t.days,n,r||(()=>!1),o),[l,u]=(0,Q.useState)(a?c:void 0);return{isFocusTarget:e=>!!c?.isEqualTo(e),setFocused:u,focused:l,blur:()=>{s(l),u(void 0)},moveFocus:(n,r)=>{if(!l)return;let a=CD(n,r,l,t.navStart,t.navEnd,e,i);a&&(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(a))||(t.goToDay(a),u(a)))}}}function TD(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=_D(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t,l=e=>s?.some(t=>c(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(l(e)){if(s?.length===u||r&&s?.length===1)return;a=s?.filter(t=>!c(t,e))}else a=s?.length===d?[e]:[...a,e];return i||o(a),i?.(a,e,t,n),a},isSelected:l}}function ED(e,t,n=0,r=0,i=!1,a=TT){let{from:o,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=a,d;if(!o&&!s)d={from:e,to:n>0?void 0:e};else if(o&&!s)d=c(o,e)?n===0?{from:o,to:e}:i?{from:o,to:void 0}:void 0:u(e,o)?{from:e,to:o}:{from:o,to:e};else if(o&&s)if(c(o,e)&&c(s,e))d=i?{from:o,to:s}:void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,o))d={from:e,to:s};else if(l(e,o))d={from:o,to:e};else if(l(e,s))d={from:o,to:e};else throw Error(`Invalid range`);if(d?.from&&d?.to){let t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}function DD(e,t,n=TT){let r=Array.isArray(t)?t:[t],i=e.from,a=n.differenceInCalendarDays(e.to,e.from),o=Math.min(a,6);for(let e=0;e<=o;e++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function OD(e,t,n=TT){return cE(e,t.from,!1,n)||cE(e,t.to,!1,n)||cE(t,e.from,!1,n)||cE(t,e.to,!1,n)}function kD(e,t,n=TT){let r=Array.isArray(t)?t:[t];if(r.filter(e=>typeof e!=`function`).some(t=>typeof t==`boolean`?t:n.isDate(t)?cE(e,t,!1,n):mE(t,n)?t.some(t=>cE(e,t,!1,n)):uE(t)?t.from&&t.to?OD(e,{from:t.from,to:t.to},n):!1:pE(t)?DD(e,t.dayOfWeek,n):lE(t)?n.isAfter(t.before,t.after)?OD(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):hE(e.from,t,n)||hE(e.to,t,n):dE(t)||fE(t)?hE(e.from,t,n)||hE(e.to,t,n):!1))return!0;let i=r.filter(e=>typeof e==`function`);if(i.length){let t=e.from,r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function AD(e,t){let{disabled:n,excludeDisabled:r,resetOnSelect:i,selected:a,required:o,onSelect:s}=e,[c,l]=_D(a,s?a:void 0),u=s?a:c;return{selected:u,select:(a,c,d)=>{let{min:f,max:p}=e,m;if(a){let e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=i&&(r||!u?.from)?!o&&s?void 0:{from:a,to:void 0}:ED(a,u,f,p,o,t)}return r&&n&&m?.from&&m.to&&kD({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||l(m),s?.(m,a,c,d),m},isSelected:e=>u&&cE(u,e,!1,t)}}function jD(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=_D(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&c(e,s)&&(a=void 0),i||o(a),i?.(a,e,t,n),a},isSelected:e=>s?c(s,e):!1}}function MD(e,t){let n=jD(e,t),r=TD(e,t),i=AD(e,t);switch(e.mode){case`single`:return n;case`multiple`:return r;case`range`:return i;default:return}}function ND(e,t){return e instanceof _T&&e.timeZone===t?e:new _T(e,t)}function PD(e,t,n){if(!n)return ND(e,t);let r=ND(e,t),i=new _T(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(i.getTime())}function FD(e,t,n){return typeof e==`boolean`||typeof e==`function`?e:e instanceof Date?PD(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?PD(e,t,n):e):uE(e)?{...e,from:e.from?ND(e.from,t):e.from,to:e.to?ND(e.to,t):e.to}:lE(e)?{before:PD(e.before,t,n),after:PD(e.after,t,n)}:dE(e)?{after:PD(e.after,t,n)}:fE(e)?{before:PD(e.before,t,n)}:e}function ID(e,t,n){return e&&(Array.isArray(e)?e.map(e=>FD(e,t,n)):FD(e,t,n))}function LD(e){let t=e,n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&=ND(t.today,n),t.month&&=ND(t.month,n),t.defaultMonth&&=ND(t.defaultMonth,n),t.startMonth&&=ND(t.startMonth,n),t.endMonth&&=ND(t.endMonth,n),t.mode===`single`&&t.selected?t.selected=ND(t.selected,n):t.mode===`multiple`&&t.selected?t.selected=t.selected?.map(e=>ND(e,n)):t.mode===`range`&&t.selected&&(t.selected={from:t.selected.from?ND(t.selected.from,n):t.selected.from,to:t.selected.to?ND(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=ID(t.disabled,n)),t.hidden!==void 0&&(t.hidden=ID(t.hidden,n)),t.modifiers)){let e={};Object.keys(t.modifiers).forEach(r=>{e[r]=ID(t.modifiers?.[r],n)}),t.modifiers=e}let{components:r,formatters:i,labels:a,dateLib:o,locale:s,classNames:c}=(0,Q.useMemo)(()=>{let e={...CT,...t.locale},n=t.broadcastCalendar?1:t.weekStartsOn,r=t.noonSafe&&t.timeZone?$E(t.timeZone,{weekStartsOn:n,locale:e}):void 0,i=t.dateLib&&r?{...r,...t.dateLib}:t.dateLib??r,a=new wT({locale:e,weekStartsOn:n,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},i);return{dateLib:a,components:vE(t.components),formatters:jE(t.formatters),labels:JE(t.labels,a.options),locale:e,classNames:{...bE(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});let{captionLayout:l,mode:u,navLayout:d,numberOfMonths:f=1,onDayBlur:p,onDayClick:m,onDayFocus:h,onDayKeyDown:g,onDayMouseEnter:_,onDayMouseLeave:v,onNextClick:y,onPrevClick:b,showWeekNumber:x,styles:S}=t,{formatCaption:C,formatDay:w,formatMonthDropdown:T,formatWeekNumber:E,formatWeekNumberHeader:D,formatWeekdayName:O,formatYearDropdown:k}=i,A=vD(t,o),{days:j,months:M,navStart:N,navEnd:P,previousMonth:F,nextMonth:I,goToMonth:L}=A,R=gE(j,t,N,P,o),{isSelected:z,select:B,selected:V}=MD(t,o)??{},{blur:H,focused:U,isFocusTarget:W,moveFocus:G,setFocused:K}=wD(t,A,R,z??(()=>!1),o),{labelDayButton:q,labelGridcell:ee,labelGrid:te,labelMonthDropdown:ne,labelNav:re,labelPrevious:ie,labelNext:ae,labelWeekday:oe,labelWeekNumber:se,labelWeekNumberHeader:ce,labelYearDropdown:le}=a,ue=(0,Q.useMemo)(()=>ZE(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),de=u!==void 0||m!==void 0,fe=(0,Q.useCallback)(()=>{F&&(L(F),b?.(F))},[F,L,b]),pe=(0,Q.useCallback)(()=>{I&&(L(I),y?.(I))},[L,I,y]),J=(0,Q.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),K(e),!t.disabled&&(B?.(e.date,t,n),m?.(e.date,t,n))},[B,m,K]),me=(0,Q.useCallback)((e,t)=>n=>{K(e),h?.(e.date,t,n)},[h,K]),he=(0,Q.useCallback)((e,t)=>n=>{H(),p?.(e.date,t,n)},[H,p]),ge=(0,Q.useCallback)((e,n)=>r=>{let i={ArrowLeft:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`after`:`before`],ArrowRight:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`before`:`after`],ArrowDown:[r.shiftKey?`year`:`week`,`after`],ArrowUp:[r.shiftKey?`year`:`week`,`before`],PageUp:[r.shiftKey?`year`:`month`,`before`],PageDown:[r.shiftKey?`year`:`month`,`after`],Home:[`startOfWeek`,`before`],End:[`endOfWeek`,`after`]};if(i[r.key]){r.preventDefault(),r.stopPropagation();let[e,t]=i[r.key];G(e,t)}g?.(e.date,n,r)},[G,g,t.dir]),_e=(0,Q.useCallback)((e,t)=>n=>{_?.(e.date,t,n)},[_]),ve=(0,Q.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),ye=(0,Q.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setMonth(o.startOfMonth(e),n))},[o,L]),be=(0,Q.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setYear(o.startOfMonth(e),n))},[o,L]),{className:xe,style:Se}=(0,Q.useMemo)(()=>({className:[c[PT.Root],t.className].filter(Boolean).join(` `),style:{...S?.[PT.Root],...t.style}}),[c,t.className,t.style,S]),Ce=yE(t),we=(0,Q.useRef)(null);sD(we,!!t.animate,{classNames:c,months:M,focused:U,dateLib:o});let Te={dayPickerProps:t,selected:V,select:B,isSelected:z,months:M,nextMonth:I,previousMonth:F,goToMonth:L,getModifiers:R,components:r,classNames:c,styles:S,labels:a,formatters:i};return Q.createElement(GT.Provider,{value:Te},Q.createElement(r.Root,{rootRef:t.animate?we:void 0,className:xe,style:Se,dir:t.dir,id:t.id,lang:t.lang??s.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t[`aria-label`],"aria-labelledby":t[`aria-labelledby`],...Ce},Q.createElement(r.Months,{className:c[PT.Months],style:S?.[PT.Months]},!t.hideNavigation&&!d&&Q.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[PT.Nav],style:S?.[PT.Nav],"aria-label":re(),onPreviousClick:fe,onNextClick:pe,previousMonth:F,nextMonth:I}),M.map((e,n)=>Q.createElement(r.Month,{"data-animated-month":t.animate?`true`:void 0,className:c[PT.Month],style:S?.[PT.Month],key:n,displayIndex:n,calendarMonth:e},d===`around`&&!t.hideNavigation&&n===0&&Q.createElement(r.PreviousMonthButton,{type:`button`,className:c[PT.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":ie(F),onClick:fe,"data-animated-button":t.animate?`true`:void 0},Q.createElement(r.Chevron,{disabled:F?void 0:!0,className:c[PT.Chevron],orientation:t.dir===`rtl`?`right`:`left`})),Q.createElement(r.MonthCaption,{"data-animated-caption":t.animate?`true`:void 0,className:c[PT.MonthCaption],style:S?.[PT.MonthCaption],calendarMonth:e,displayIndex:n},l?.startsWith(`dropdown`)?Q.createElement(r.DropdownNav,{className:c[PT.Dropdowns],style:S?.[PT.Dropdowns]},(()=>{let n=l===`dropdown`||l===`dropdown-months`?Q.createElement(r.MonthsDropdown,{key:`month`,className:c[PT.MonthsDropdown],"aria-label":ne(),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:ye(e.date),options:YE(e.date,N,P,i,o),style:S?.[PT.Dropdown],value:o.getMonth(e.date)}):Q.createElement(`span`,{key:`month`},T(e.date,o)),a=l===`dropdown`||l===`dropdown-years`?Q.createElement(r.YearsDropdown,{key:`year`,className:c[PT.YearsDropdown],"aria-label":le(o.options),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:be(e.date),options:QE(N,P,i,o,!!t.reverseYears),style:S?.[PT.Dropdown],value:o.getYear(e.date)}):Q.createElement(`span`,{key:`year`},k(e.date,o));return o.getMonthYearOrder()===`year-first`?[a,n]:[n,a]})(),Q.createElement(`span`,{role:`status`,"aria-live":`polite`,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`}},C(e.date,o.options,o))):Q.createElement(r.CaptionLabel,{className:c[PT.CaptionLabel],role:`status`,"aria-live":`polite`},C(e.date,o.options,o))),d===`around`&&!t.hideNavigation&&n===f-1&&Q.createElement(r.NextMonthButton,{type:`button`,className:c[PT.NextMonthButton],tabIndex:I?void 0:-1,"aria-disabled":I?void 0:!0,"aria-label":ae(I),onClick:pe,"data-animated-button":t.animate?`true`:void 0},Q.createElement(r.Chevron,{disabled:I?void 0:!0,className:c[PT.Chevron],orientation:t.dir===`rtl`?`left`:`right`})),n===f-1&&d===`after`&&!t.hideNavigation&&Q.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[PT.Nav],style:S?.[PT.Nav],"aria-label":re(),onPreviousClick:fe,onNextClick:pe,previousMonth:F,nextMonth:I}),Q.createElement(r.MonthGrid,{role:`grid`,"aria-multiselectable":u===`multiple`||u===`range`,"aria-label":te(e.date,o.options,o)||void 0,className:c[PT.MonthGrid],style:S?.[PT.MonthGrid]},!t.hideWeekdays&&Q.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?`true`:void 0,className:c[PT.Weekdays],style:S?.[PT.Weekdays]},x&&Q.createElement(r.WeekNumberHeader,{"aria-label":ce(o.options),className:c[PT.WeekNumberHeader],style:S?.[PT.WeekNumberHeader],scope:`col`},D()),ue.map(e=>Q.createElement(r.Weekday,{"aria-label":oe(e,o.options,o),className:c[PT.Weekday],key:String(e),style:S?.[PT.Weekday],scope:`col`},O(e,o.options,o)))),Q.createElement(r.Weeks,{"data-animated-weeks":t.animate?`true`:void 0,className:c[PT.Weeks],style:S?.[PT.Weeks]},e.weeks.map(e=>Q.createElement(r.Week,{className:c[PT.Week],key:e.weekNumber,style:S?.[PT.Week],week:e},x&&Q.createElement(r.WeekNumber,{week:e,style:S?.[PT.WeekNumber],"aria-label":se(e.weekNumber,{locale:s}),className:c[PT.WeekNumber],scope:`row`,role:`rowheader`},E(e.weekNumber,o)),e.days.map(e=>{let{date:n}=e,i=R(e);if(i[FT.focused]=!i.hidden&&!!U?.isEqualTo(e),i[IT.selected]=z?.(n)||i.selected,uE(V)){let{from:e,to:t}=V;i[IT.range_start]=!!(e&&t&&o.isSameDay(n,e)),i[IT.range_end]=!!(e&&t&&o.isSameDay(n,t)),i[IT.range_middle]=cE(V,n,!0,o)}let a=XE(i,S,t.modifiersStyles),s=_E(i,c,t.modifiersClassNames),l=!de&&!i.hidden?ee(n,i,o.options,o):void 0;return Q.createElement(r.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:i,className:s.join(` `),style:a,role:`gridcell`,"aria-selected":i.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":i.selected||void 0,"data-disabled":i.disabled||void 0,"data-hidden":i.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":i.focused||void 0,"data-today":i.today||void 0},!i.hidden&&de?Q.createElement(r.DayButton,{className:c[PT.DayButton],style:S?.[PT.DayButton],type:`button`,day:e,modifiers:i,disabled:!i.focused&&i.disabled||void 0,"aria-disabled":i.focused&&i.disabled||void 0,tabIndex:W(e)?0:-1,"aria-label":q(n,i,o.options,o),onClick:J(e,i),onBlur:he(e,i),onFocus:me(e,i),onKeyDown:ge(e,i),onMouseEnter:_e(e,i),onMouseLeave:ve(e,i)},w(n,o.options,o)):!i.hidden&&w(e.date,o.options,o))})))))))),t.footer&&Q.createElement(r.Footer,{className:c[PT.Footer],style:S?.[PT.Footer],role:`status`,"aria-live":`polite`},t.footer)))}function RD(e){let t=(0,$.c)(97),n,r,i,a,o,s,c,l,u;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]):({className:n,classNames:r,showOutsideDays:c,captionLayout:l,buttonVariant:u,locale:o,formatters:a,components:i,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u);let d=c===void 0?!0:c,f=l===void 0?`label`:l,p=u===void 0?`ghost`:u,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W;if(t[10]!==p||t[11]!==f||t[12]!==n||t[13]!==a||t[14]!==o||t[15]!==s.showWeekNumber||t[16]!==d){let e=bE();m=LD,P=d,t[48]===n?F=t[49]:(F=X(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,n),t[48]=n,t[49]=F),I=f,L=o;let r;t[50]===o?.code?r=t[51]:(r=e=>e.toLocaleString(o?.code,{month:`short`}),t[50]=o?.code,t[51]=r),t[52]!==a||t[53]!==r?(R={formatMonthDropdown:r,...a},t[52]=a,t[53]=r,t[54]=R):R=t[54],z=X(`w-fit`,e.root),B=X(`relative flex flex-col gap-4 md:flex-row`,e.months),V=X(`flex w-full flex-col gap-4`,e.month),H=X(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,e.nav),U=X(Lr({variant:p}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,e.button_previous),W=X(Lr({variant:p}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,e.button_next),h=X(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,e.month_caption),g=X(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,e.dropdowns),_=X(`relative rounded-(--cell-radius)`,e.dropdown_root),v=X(`absolute inset-0 bg-popover opacity-0`,e.dropdown),y=X(`font-medium select-none`,f===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,e.caption_label),b=`w-full border-collapse`,x=X(`flex`,e.weekdays),S=X(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,e.weekday),C=X(`mt-2 flex w-full`,e.week),w=X(`w-(--cell-size) select-none`,e.week_number_header),T=X(`text-[0.8rem] text-muted-foreground select-none`,e.week_number),E=X(`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,s.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)`,e.day),D=X(`relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted`,e.range_start),O=X(`rounded-none`,e.range_middle),k=X(`relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted`,e.range_end),A=X(`rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none`,e.today),j=X(`text-muted-foreground aria-selected:text-muted-foreground`,e.outside),M=X(`text-muted-foreground opacity-50`,e.disabled),N=X(`invisible`,e.hidden),t[10]=p,t[11]=f,t[12]=n,t[13]=a,t[14]=o,t[15]=s.showWeekNumber,t[16]=d,t[17]=m,t[18]=h,t[19]=g,t[20]=_,t[21]=v,t[22]=y,t[23]=b,t[24]=x,t[25]=S,t[26]=C,t[27]=w,t[28]=T,t[29]=E,t[30]=D,t[31]=O,t[32]=k,t[33]=A,t[34]=j,t[35]=M,t[36]=N,t[37]=P,t[38]=F,t[39]=I,t[40]=L,t[41]=R,t[42]=z,t[43]=B,t[44]=V,t[45]=H,t[46]=U,t[47]=W}else m=t[17],h=t[18],g=t[19],_=t[20],v=t[21],y=t[22],b=t[23],x=t[24],S=t[25],C=t[26],w=t[27],T=t[28],E=t[29],D=t[30],O=t[31],k=t[32],A=t[33],j=t[34],M=t[35],N=t[36],P=t[37],F=t[38],I=t[39],L=t[40],R=t[41],z=t[42],B=t[43],V=t[44],H=t[45],U=t[46],W=t[47];let G;t[55]!==r||t[56]!==h||t[57]!==g||t[58]!==_||t[59]!==v||t[60]!==y||t[61]!==b||t[62]!==x||t[63]!==S||t[64]!==C||t[65]!==w||t[66]!==T||t[67]!==E||t[68]!==D||t[69]!==O||t[70]!==k||t[71]!==A||t[72]!==j||t[73]!==M||t[74]!==N||t[75]!==z||t[76]!==B||t[77]!==V||t[78]!==H||t[79]!==U||t[80]!==W?(G={root:z,months:B,month:V,nav:H,button_previous:U,button_next:W,month_caption:h,dropdowns:g,dropdown_root:_,dropdown:v,caption_label:y,table:b,weekdays:x,weekday:S,week:C,week_number_header:w,week_number:T,day:E,range_start:D,range_middle:O,range_end:k,today:A,outside:j,disabled:M,hidden:N,...r},t[55]=r,t[56]=h,t[57]=g,t[58]=_,t[59]=v,t[60]=y,t[61]=b,t[62]=x,t[63]=S,t[64]=C,t[65]=w,t[66]=T,t[67]=E,t[68]=D,t[69]=O,t[70]=k,t[71]=A,t[72]=j,t[73]=M,t[74]=N,t[75]=z,t[76]=B,t[77]=V,t[78]=H,t[79]=U,t[80]=W,t[81]=G):G=t[81];let K;t[82]===o?K=t[83]:(K=e=>{let{...t}=e;return(0,Z.jsx)(HD,{locale:o,...t})},t[82]=o,t[83]=K);let q;t[84]!==i||t[85]!==K?(q={Root:VD,Chevron:BD,DayButton:K,WeekNumber:zD,...i},t[84]=i,t[85]=K,t[86]=q):q=t[86];let ee;return t[87]!==m||t[88]!==s||t[89]!==P||t[90]!==F||t[91]!==I||t[92]!==L||t[93]!==R||t[94]!==G||t[95]!==q?(ee=(0,Z.jsx)(m,{showOutsideDays:P,className:F,captionLayout:I,locale:L,formatters:R,classNames:G,components:q,...s}),t[87]=m,t[88]=s,t[89]=P,t[90]=F,t[91]=I,t[92]=L,t[93]=R,t[94]=G,t[95]=q,t[96]=ee):ee=t[96],ee}function zD(e){let{children:t,...n}=e;return(0,Z.jsx)(`td`,{...n,children:(0,Z.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:t})})}function BD(e){let{className:t,orientation:n,...r}=e;return n===`left`?(0,Z.jsx)(ns,{className:X(`size-4`,t),...r}):n===`right`?(0,Z.jsx)(ct,{className:X(`size-4`,t),...r}):(0,Z.jsx)(F,{className:X(`size-4`,t),...r})}function VD(e){let{className:t,rootRef:n,...r}=e;return(0,Z.jsx)(`div`,{"data-slot":`calendar`,ref:n,className:X(t),...r})}function HD(e){let t=(0,$.c)(21),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,day:r,modifiers:a,locale:i,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=bE(),c=Q.useRef(null),l,u;t[6]===a.focused?(l=t[7],u=t[8]):(l=()=>{a.focused&&c.current?.focus()},u=[a.focused],t[6]=a.focused,t[7]=l,t[8]=u),Q.useEffect(l,u);let d=zr,f;t[9]!==r.date||t[10]!==i?.code?(f=r.date.toLocaleDateString(i?.code),t[9]=r.date,t[10]=i?.code,t[11]=f):f=t[11];let p=a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,m=a.range_start,h=a.range_end,g=a.range_middle,_=X(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70`,s.day,n),v;return t[12]!==d||t[13]!==a.range_end||t[14]!==a.range_middle||t[15]!==a.range_start||t[16]!==o||t[17]!==_||t[18]!==f||t[19]!==p?(v=(0,Z.jsx)(d,{ref:c,variant:`ghost`,size:`icon`,"data-day":f,"data-selected-single":p,"data-range-start":m,"data-range-end":h,"data-range-middle":g,className:_,...o}),t[12]=d,t[13]=a.range_end,t[14]=a.range_middle,t[15]=a.range_start,t[16]=o,t[17]=_,t[18]=f,t[19]=p,t[20]=v):v=t[20],v}function UD(e){let t=(0,$.c)(16),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(r),s=(0,Q.useRef)(!1),c=(0,Q.useRef)(!1),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{s.current||o(r)},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d=`${n} value`,f,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>o(e.target.value),p=()=>{s.current=!0},t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m,h;t[5]!==a||t[6]!==i||t[7]!==r?(m=()=>{if(s.current=!1,c.current){c.current=!1;return}a!==r&&i(a)},h=e=>{e.key===`Enter`&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey?(e.preventDefault(),a!==r&&i(a),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),c.current=!0,o(r),e.currentTarget.blur())},t[5]=a,t[6]=i,t[7]=r,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g;return t[10]!==a||t[11]!==n||t[12]!==d||t[13]!==m||t[14]!==h?(g=(0,Z.jsx)(`textarea`,{"data-testid":`text-widget`,"data-key":n,rows:1,value:a,placeholder:`Empty`,"aria-label":d,onChange:f,onFocus:p,onBlur:m,onKeyDown:h,className:`block w-full min-h-7 resize-none field-sizing-content border-transparent bg-transparent px-2 py-1 text-sm leading-tight shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:outline-none focus-visible:ring-0 rounded-sm dark:bg-transparent dark:focus-visible:bg-muted`}),t[10]=a,t[11]=n,t[12]=d,t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function WD(e){let t=(0,$.c)(17),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(String(r)),s=(0,Q.useRef)(!1),c=(0,Q.useRef)(!1),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{s.current||o(String(r))},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d=`${n} value`,f,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>o(e.target.value),p=()=>{s.current=!0},t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m;t[5]!==a||t[6]!==i||t[7]!==r?(m=()=>{if(s.current=!1,c.current){c.current=!1,o(String(r));return}let e=Number.parseFloat(a),t=Number.isFinite(e)?e:0;t===r?o(String(r)):i(t)},t[5]=a,t[6]=i,t[7]=r,t[8]=m):m=t[8];let h;t[9]===r?h=t[10]:(h=e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),c.current=!0,o(String(r)),e.currentTarget.blur())},t[9]=r,t[10]=h);let g;return t[11]!==a||t[12]!==n||t[13]!==d||t[14]!==m||t[15]!==h?(g=(0,Z.jsx)(ao,{"data-testid":`number-widget`,"data-key":n,type:`number`,value:a,"aria-label":d,onChange:f,onFocus:p,onBlur:m,onKeyDown:h,className:`h-7 border-transparent bg-transparent dark:bg-transparent px-2 text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[11]=a,t[12]=n,t[13]=d,t[14]=m,t[15]=h,t[16]=g):g=t[16],g}function GD(e){let t=(0,$.c)(7),{keyName:n,value:r,onCommit:i}=e,a;t[0]===i?a=t[1]:(a=e=>i(e===!0),t[0]=i,t[1]=a);let o=`${n} value`,s;return t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==r?(s=(0,Z.jsx)(`div`,{className:`flex h-7 items-center px-2`,children:(0,Z.jsx)(Ba,{"data-testid":`boolean-widget`,"data-key":n,checked:r,onCheckedChange:a,"aria-label":o,className:`size-5 rounded-full`})}),t[2]=n,t[3]=a,t[4]=o,t[5]=r,t[6]=s):s=t[6],s}function KD(e){let t=(0,$.c)(42),{keyName:n,value:r,onCommit:i}=e,a,o,s;t[0]===r?(a=t[1],o=t[2],s=t[3]):(a=JD(r),o=Q.useState,s=YD(a),t[0]=r,t[1]=a,t[2]=o,t[3]=s);let[c,l]=o(s),[u,d]=(0,Q.useState)(a),[f,p]=(0,Q.useState)(!1),m=(0,Q.useRef)(!1),h=(0,Q.useRef)(!1),g,_;t[4]===r?(g=t[5],_=t[6]):(g=()=>{if(!m.current){let e=JD(r);l(YD(e)),d(e)}},_=[r],t[4]=r,t[5]=g,t[6]=_),(0,Q.useEffect)(g,_);let v;t[7]!==a||t[8]!==c||t[9]!==i||t[10]!==r?(v=function(){let e=ZD(c);if(e){let t=_C(e,`yyyy-MM-dd`);t!==r&&i(t),l(YD(e)),d(e)}else l(YD(a)),d(a)},t[7]=a,t[8]=c,t[9]=i,t[10]=r,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==r?(b=function(e){if(!e)return;let t=_C(e,`yyyy-MM-dd`);t!==r&&i(t),l(YD(e)),d(e),p(!1)},t[12]=i,t[13]=r,t[14]=b):b=t[14];let S=b,C=`${n} value`,w,E;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{l(e.target.value);let t=ZD(e.target.value);t&&d(t)},E=()=>{m.current=!0},t[15]=w,t[16]=E):(w=t[15],E=t[16]);let D;t[17]===y?D=t[18]:(D=()=>{if(m.current=!1,h.current){h.current=!1;return}y()},t[17]=y,t[18]=D);let O;t[19]!==y||t[20]!==a?(O=e=>{e.key===`Enter`?(e.preventDefault(),y(),e.currentTarget.blur()):e.key===`Escape`?(e.preventDefault(),h.current=!0,l(YD(a)),e.currentTarget.blur()):e.key===`ArrowDown`&&(e.preventDefault(),p(!0))},t[19]=y,t[20]=a,t[21]=O):O=t[21];let k;t[22]!==c||t[23]!==D||t[24]!==O||t[25]!==C?(k=(0,Z.jsx)(ao,{type:`text`,value:c,placeholder:`Empty`,"aria-label":C,onChange:w,onFocus:E,onBlur:D,onKeyDown:O,className:`h-7 border-transparent bg-transparent dark:bg-transparent pr-7 pl-2 text-sm shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[22]=c,t[23]=D,t[24]=O,t[25]=C,t[26]=k):k=t[26];let A=`Open date picker for ${n}`,j;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(es,{className:`size-3.5`}),t[27]=j):j=t[27];let M;t[28]===A?M=t[29]:(M=(0,Z.jsx)(N,{asChild:!0,children:(0,Z.jsx)(zr,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":A,className:`absolute right-0 size-6 p-0 text-muted-foreground hover:bg-muted hover:text-foreground`,children:j})}),t[28]=A,t[29]=M);let P;t[30]!==a||t[31]!==S||t[32]!==u?(P=(0,Z.jsx)(T,{className:`w-auto overflow-hidden p-0`,align:`end`,children:(0,Z.jsx)(RD,{mode:`single`,selected:a,month:u,onMonthChange:d,onSelect:S,captionLayout:`dropdown`})}),t[30]=a,t[31]=S,t[32]=u,t[33]=P):P=t[33];let F;t[34]!==f||t[35]!==M||t[36]!==P?(F=(0,Z.jsxs)(x,{open:f,onOpenChange:p,children:[M,P]}),t[34]=f,t[35]=M,t[36]=P,t[37]=F):F=t[37];let I;return t[38]!==n||t[39]!==k||t[40]!==F?(I=(0,Z.jsxs)(`div`,{"data-testid":`date-widget`,"data-key":n,className:`relative flex h-7 items-center`,children:[k,F]}),t[38]=n,t[39]=k,t[40]=F,t[41]=I):I=t[41],I}var qD=`MMM d, yyyy`;function JD(e){if(!e)return;let t=Rw(e);return Number.isNaN(t.getTime())?void 0:t}function YD(e){return e?_C(e,qD):``}var XD=[`MMM d, yyyy`,`MMMM d, yyyy`,`yyyy-MM-dd`,`M/d/yyyy`,`MM/dd/yyyy`];function ZD(e){let t=e.trim();if(!t)return;let n=new Date;for(let e of XD){let r=Pw(t,e,n);if(!Number.isNaN(r.getTime()))return r}}function QD(e){let t=(0,$.c)(32),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(``),s;t[0]!==i||t[1]!==r?(s=function(e){let t=e.trim();t&&(i([...r,t]),o(``))},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]!==i||t[4]!==r?(l=function(e){let t=r.slice();t.splice(e,1),i(t)},t[3]=i,t[4]=r,t[5]=l):l=t[5];let u=l,d=n===`tags`,f;if(t[6]!==d||t[7]!==u||t[8]!==r){let e;t[10]!==d||t[11]!==u?(e=(e,t)=>{let n=d&&nr.test(e);return(0,Z.jsxs)(`span`,{"data-testid":`list-chip`,"data-index":t,className:X(`inline-flex items-center text-1sm gap-0.5 rounded-full py-0.5 pl-2 pr-1.5 transition-colors`,n?`bg-primary/10 font-medium text-primary has-[button[data-tag]:hover]:bg-primary/20 has-[button[data-tag]:active]:bg-primary/25`:`bg-muted `),children:[n?(0,Z.jsxs)(`button`,{type:`button`,"data-tag":e,"aria-label":`Open documents tagged #${e}`,onClick:()=>be(e),className:`cursor-pointer rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[`#`,e]}):(0,Z.jsx)(`span`,{children:e}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,onClick:()=>u(t),className:X(`inline-flex items-center justify-center rounded-sm p-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,n?`text-primary opacity-70 hover:text-primary hover:opacity-100`:`text-muted-foreground hover:text-foreground`),children:(0,Z.jsx)(Ma,{className:`size-3`,"aria-hidden":`true`})})]},`${t}-${e}`)},t[10]=d,t[11]=u,t[12]=e):e=t[12],f=r.map(e),t[6]=d,t[7]=u,t[8]=r,t[9]=f}else f=t[9];let p=r.length===0?`Empty`:``,m=`${n} value`,h;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>o(e.target.value),t[13]=h):h=t[13];let g;t[14]!==c||t[15]!==a||t[16]!==u||t[17]!==r.length?(g=e=>{e.key===`Enter`?(e.preventDefault(),c(a)):e.key===`Backspace`&&a===``&&r.length>0?(e.preventDefault(),u(r.length-1)):e.key===`Escape`&&(e.preventDefault(),o(``),e.currentTarget.blur())},t[14]=c,t[15]=a,t[16]=u,t[17]=r.length,t[18]=g):g=t[18];let _;t[19]!==c||t[20]!==a?(_=()=>{a&&c(a)},t[19]=c,t[20]=a,t[21]=_):_=t[21];let v;t[22]!==a||t[23]!==p||t[24]!==m||t[25]!==g||t[26]!==_?(v=(0,Z.jsx)(`input`,{"data-testid":`list-chip-input`,type:`text`,value:a,placeholder:p,"aria-label":m,onChange:h,onKeyDown:g,onBlur:_,className:`min-w-16 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60`}),t[22]=a,t[23]=p,t[24]=m,t[25]=g,t[26]=_,t[27]=v):v=t[27];let y;return t[28]!==n||t[29]!==f||t[30]!==v?(y=(0,Z.jsxs)(`div`,{"data-testid":`list-widget`,"data-key":n,className:`flex min-h-7 w-full min-w-0 flex-wrap items-center gap-1 rounded-md px-2 py-1 focus-within:bg-background`,children:[f,v]}),t[28]=n,t[29]=f,t[30]=v,t[31]=y):y=t[31],y}var $D={text:ac,number:Me,boolean:Zs,date:es,list:Ye},eO={text:`Text`,number:`Number`,boolean:`Checkbox`,date:`Date`,list:`List`};function tO(e){let t=(0,$.c)(27),{keyName:n,type:r,onChangeType:i,disabled:a}=e,o=a===void 0?!1:a,s=$D[r];if(o){let e=`${n} type: ${eO[r]} (inherited from folder defaults; not editable here)`,i;t[0]===s?i=t[1]:(i=(0,Z.jsx)(s,{className:`size-3.5`}),t[0]=s,t[1]=i);let a;t[2]!==n||t[3]!==e||t[4]!==i||t[5]!==r?(a=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`inline-flex`,children:(0,Z.jsx)(`button`,{type:`button`,disabled:!0,"data-testid":`type-icon-button`,"data-key":n,"data-type":r,"aria-label":e,className:`flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground disabled:cursor-default`,children:i})})}),t[2]=n,t[3]=e,t[4]=i,t[5]=r,t[6]=a):a=t[6];let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Ya,{children:`Inherited — set a value to override.`}),t[7]=o):o=t[7];let c;return t[8]===a?c=t[9]:(c=(0,Z.jsxs)(Za,{children:[a,o]}),t[8]=a,t[9]=c),c}let c=`${n} type: ${eO[r]}. Click to change.`,l;t[10]===s?l=t[11]:(l=(0,Z.jsx)(s,{className:`size-3.5`}),t[10]=s,t[11]=l);let u;t[12]!==n||t[13]!==c||t[14]!==l||t[15]!==r?(u=(0,Z.jsx)(ii,{"data-testid":`type-icon-button`,"data-key":n,"data-type":r,"aria-label":c,className:`flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:l}),t[12]=n,t[13]=c,t[14]=l,t[15]=r,t[16]=u):u=t[16];let d;t[17]===i?d=t[18]:(d=e=>i(e),t[17]=i,t[18]=d);let f;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(f=Object.keys($D),t[19]=f):f=t[19];let p;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(p=f.map(nO),t[20]=p):p=t[20];let m;t[21]!==d||t[22]!==r?(m=(0,Z.jsx)(ba,{align:`start`,"data-testid":`type-picker-menu`,children:(0,Z.jsx)(va,{value:r,onValueChange:d,children:p})}),t[21]=d,t[22]=r,t[23]=m):m=t[23];let h;return t[24]!==u||t[25]!==m?(h=(0,Z.jsxs)(Bi,{children:[u,m]}),t[24]=u,t[25]=m,t[26]=h):h=t[26],h}function nO(e){let t=$D[e];return(0,Z.jsxs)(Oi,{value:e,"data-testid":`type-picker-item`,"data-type":e,children:[(0,Z.jsx)(t,{className:`size-3.5 text-muted-foreground`}),(0,Z.jsx)(`span`,{children:eO[e]})]},e)}function rO(e,t){switch(t){case`text`:return Array.isArray(e)?e.join(`, `):String(e);case`number`:{if(typeof e==`number`)return e;let t=Array.isArray(e)?e[0]:String(e),n=Number.parseFloat(t??``);return Number.isFinite(n)?n:0}case`boolean`:return typeof e==`boolean`?e:typeof e==`number`?e!==0:((Array.isArray(e)?e[0]:String(e))??``).toLowerCase()===`true`;case`date`:return typeof e==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:new Date().toISOString().slice(0,10);case`list`:{if(Array.isArray(e))return e;let t=String(e);return t?[t]:[]}}}function iO(e,t){return Array.isArray(e)?`list`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:t===`list`?`text`:t}function aO(e){let t=(0,$.c)(21),{keyName:n,value:r,declared:i,error:a,resetCounter:o,sortableId:s,rename:l,isDuplicate:u,badge:d,isInherited:f,onCommit:p,onChangeType:m,onRemove:h}=e,g=o===void 0?0:o,_=u===void 0?!1:u,v=f===void 0?!1:f,y;t[0]!==d||t[1]!==i||t[2]!==a||t[3]!==_||t[4]!==v||t[5]!==n||t[6]!==m||t[7]!==p||t[8]!==h||t[9]!==l||t[10]!==g||t[11]!==r?(y=e=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-1`,children:[e,(0,Z.jsxs)(`div`,{className:`flex items-center gap-1${v?` opacity-60`:``}`,"data-testid":`property-row-identity`,children:[(0,Z.jsx)(tO,{keyName:n,type:i,onChangeType:m,disabled:v}),(0,Z.jsx)(`div`,{className:`w-32 shrink-0`,children:l?.state?(0,Z.jsx)(cO,{keyName:n,draft:l.state.draft,error:l.state.error,onChangeDraft:l.onChangeDraft,onCommit:l.onCommit,onCancel:l.onCancel}):(0,Z.jsx)(lO,{keyName:n,onBegin:l?.onBegin,disabled:!l,isInherited:v})})]}),_?(0,Z.jsx)(`span`,{"data-testid":`property-duplicate-marker`,"data-key":n,title:`Duplicate name "${n}"`,className:`flex size-4 items-center justify-center text-amber-600`,children:(0,Z.jsx)(Er,{className:`size-3.5`})}):null,(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:v&&i===`list`?(0,Z.jsx)(pO,{keyName:n,value:Array.isArray(r)?r:[]}):(0,Z.jsx)(dO,{keyName:n,value:r,widgetType:i,onCommit:p},`widget-${g}`)}),d?(0,Z.jsx)(`div`,{className:`shrink-0 min-h-7 flex items-center`,children:d}):null,h?(0,Z.jsx)(zr,{type:`button`,"data-testid":`property-remove-button`,"data-key":n,"aria-label":`Remove ${n}`,onClick:h,variant:`ghost`,size:`icon-sm`,className:`flex shrink-0 items-center justify-center rounded text-muted-foreground/0 hover:bg-muted hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:text-muted-foreground`,children:(0,Z.jsx)(c,{className:`size-3.5`})}):null]}),a?(0,Z.jsx)(`div`,{role:`alert`,"data-testid":`property-error`,"data-key":n,className:`pl-9 text-[10px] text-destructive`,children:a}):null]}),t[0]=d,t[1]=i,t[2]=a,t[3]=_,t[4]=v,t[5]=n,t[6]=m,t[7]=p,t[8]=h,t[9]=l,t[10]=g,t[11]=r,t[12]=y):y=t[12];let b;return t[13]!==i||t[14]!==a||t[15]!==_||t[16]!==v||t[17]!==n||t[18]!==s||t[19]!==y?(b=(0,Z.jsx)(oO,{sortableId:s,keyName:n,declared:i,error:a,isDuplicate:_,isInherited:v,children:y}),t[13]=i,t[14]=a,t[15]=_,t[16]=v,t[17]=n,t[18]=s,t[19]=y,t[20]=b):b=t[20],b}function oO(e){let t=(0,$.c)(19),{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,isInherited:s,children:c}=e;if(n){let e;return t[0]!==c||t[1]!==i||t[2]!==a||t[3]!==o||t[4]!==r||t[5]!==n?(e=(0,Z.jsx)(sO,{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,children:c}),t[0]=c,t[1]=i,t[2]=a,t[3]=o,t[4]=r,t[5]=n,t[6]=e):e=t[6],e}let l;t[7]===s?l=t[8]:(l=s?(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}):null,t[7]=s,t[8]=l);let u=l,d=a??void 0,f=o||void 0,p=s||void 0,m;t[9]!==c||t[10]!==u?(m=c(u),t[9]=c,t[10]=u,t[11]=m):m=t[11];let h;return t[12]!==i||t[13]!==r||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(h=(0,Z.jsx)(`div`,{className:`group py-0.5`,"data-testid":`property-row`,"data-key":r,"data-widget-type":i,"data-error":d,"data-duplicate":f,"data-inherited":p,children:m}),t[12]=i,t[13]=r,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=h):h=t[18],h}function sO(e){let t=(0,$.c)(27),{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,children:s}=e,c;t[0]===n?c=t[1]:(c={id:n},t[0]=n,t[1]=c);let{attributes:l,listeners:u,setNodeRef:d,transform:f,transition:p,isDragging:m}=bi(c),h;t[2]===f?h=t[3]:(h=ji.Transform.toString(f),t[2]=f,t[3]=h);let g=m?.5:void 0,_=m?1:void 0,v;t[4]!==h||t[5]!==g||t[6]!==_||t[7]!==p?(v={transform:h,transition:p,opacity:g,zIndex:_},t[4]=h,t[5]=g,t[6]=_,t[7]=p,t[8]=v):v=t[8];let y=v,b=`Drag ${r} to reorder`,x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(ya,{className:`size-3.5`}),t[9]=x):x=t[9];let S;t[10]!==l||t[11]!==r||t[12]!==u||t[13]!==b?(S=(0,Z.jsx)(zr,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`property-drag-handle`,"data-key":r,"aria-label":b,...l,...u,className:`h-7 w-4 shrink-0 cursor-grab touch-none px-0 text-muted-foreground/0 hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing group-hover:text-muted-foreground/60`,children:x}),t[10]=l,t[11]=r,t[12]=u,t[13]=b,t[14]=S):S=t[14];let C=S,w=a??void 0,T=o||void 0,E=m||void 0,D;t[15]!==s||t[16]!==C?(D=s(C),t[15]=s,t[16]=C,t[17]=D):D=t[17];let O;return t[18]!==i||t[19]!==r||t[20]!==d||t[21]!==y||t[22]!==T||t[23]!==E||t[24]!==D||t[25]!==w?(O=(0,Z.jsx)(`div`,{ref:d,style:y,className:`group py-0.5`,"data-testid":`property-row`,"data-key":r,"data-widget-type":i,"data-error":w,"data-duplicate":T,"data-dragging":E,children:D}),t[18]=i,t[19]=r,t[20]=d,t[21]=y,t[22]=T,t[23]=E,t[24]=D,t[25]=w,t[26]=O):O=t[26],O}function cO(e){let t=(0,$.c)(20),{keyName:n,draft:r,error:i,onChangeDraft:a,onCommit:o,onCancel:s}=e,c=i?`property-rename-error-${n}`:void 0,l=`Rename ${n}`,u=i?!0:void 0,d;t[0]===a?d=t[1]:(d=e=>a(e.target.value),t[0]=a,t[1]=d);let f;t[2]!==s||t[3]!==o?(f=e=>{e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),s())},t[2]=s,t[3]=o,t[4]=f):f=t[4];let p;t[5]!==r||t[6]!==c||t[7]!==n||t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==f?(p=(0,Z.jsx)(ao,{"data-testid":`property-name-rename-input`,"data-key":n,type:`text`,value:r,autoFocus:!0,"aria-label":l,"aria-invalid":u,"aria-describedby":c,onChange:d,onBlur:o,onKeyDown:f,className:`h-7 border-transparent bg-transparent dark:bg-transparent px-2 text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[5]=r,t[6]=c,t[7]=n,t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]!==i||t[15]!==c?(m=i?(0,Z.jsx)(`div`,{id:c,"data-testid":`property-name-rename-error`,className:`text-[10px] text-destructive`,children:i}):null,t[14]=i,t[15]=c,t[16]=m):m=t[16];let h;return t[17]!==p||t[18]!==m?(h=(0,Z.jsxs)(`div`,{children:[p,m]}),t[17]=p,t[18]=m,t[19]=h):h=t[19],h}function lO(e){let t=(0,$.c)(9),{keyName:n,onBegin:r,disabled:i,isInherited:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==r?(o=(0,Z.jsx)(zr,{type:`button`,variant:`ghost`,"data-testid":`property-name-button`,"data-key":n,onClick:r,disabled:i,className:`block h-7 w-full truncate px-2 py-0.5 text-left text-sm rounded-sm font-normal text-muted-foreground hover:bg-transparent hover:text-foreground disabled:opacity-100 disabled:cursor-default`,children:n}),t[0]=i,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s=o;if(!a)return s;let c;t[4]===s?c=t[5]:(c=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`block w-full`,children:s})}),t[4]=s,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Ya,{children:`Inherited — set a value to override.`}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,Z.jsxs)(Za,{children:[c,l]}),t[7]=c,t[8]=u),u}function uO(e){let t=(0,$.c)(35),{draft:n,onChangeName:r,onChangeType:i,onChangeValue:a,onCommit:o,onCancel:s}=e,c=n.error?`add-property-error-id`:void 0,l;t[0]!==n.type||t[1]!==i?(l=(0,Z.jsx)(tO,{keyName:`__add__`,type:n.type,onChangeType:i}),t[0]=n.type,t[1]=i,t[2]=l):l=t[2];let u=n.error?!0:void 0,d;t[3]===r?d=t[4]:(d=e=>r(e.target.value),t[3]=r,t[4]=d);let f;t[5]!==s||t[6]!==o?(f=e=>{e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),s())},t[5]=s,t[6]=o,t[7]=f):f=t[7];let p;t[8]!==n.name||t[9]!==c||t[10]!==u||t[11]!==d||t[12]!==f?(p=(0,Z.jsx)(ao,{"data-testid":`add-property-name-input`,type:`text`,value:n.name,autoFocus:!0,placeholder:`Property name`,"aria-label":`New property name`,"aria-invalid":u,"aria-describedby":c,onChange:d,onKeyDown:f,className:`h-7 w-32 border-transparent bg-transparent px-2 text-sm shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm`}),t[8]=n.name,t[9]=c,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]!==n.type||t[15]!==n.value||t[16]!==a?(m=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(dO,{keyName:`__add__`,value:n.value,widgetType:n.type,onCommit:a})}),t[14]=n.type,t[15]=n.value,t[16]=a,t[17]=m):m=t[17];let h;t[18]===o?h=t[19]:(h=(0,Z.jsx)(zr,{type:`button`,"data-testid":`add-property-commit`,onClick:o,size:`sm`,className:`rounded bg-primary text-xs text-primary-foreground hover:bg-primary/90`,children:`Add`}),t[18]=o,t[19]=h);let g;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(Ma,{className:`size-3.5`}),t[20]=g):g=t[20];let _;t[21]===s?_=t[22]:(_=(0,Z.jsx)(zr,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`add-property-cancel`,onClick:s,"aria-label":`Cancel`,className:`rounded px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground`,children:g}),t[21]=s,t[22]=_);let v;t[23]!==l||t[24]!==p||t[25]!==m||t[26]!==h||t[27]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-start gap-1`,children:[l,p,m,h,_]}),t[23]=l,t[24]=p,t[25]=m,t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;t[29]!==n.error||t[30]!==c?(y=n.error?(0,Z.jsx)(`div`,{id:c,role:`alert`,"data-testid":`add-property-error`,className:`mt-0.5 pl-7 text-[10px] text-destructive`,children:n.error}):null,t[29]=n.error,t[30]=c,t[31]=y):y=t[31];let b;return t[32]!==v||t[33]!==y?(b=(0,Z.jsxs)(`div`,{className:`mt-1 rounded border border-dashed bg-background/40 p-1`,"data-testid":`add-property-row`,children:[v,y]}),t[32]=v,t[33]=y,t[34]=b):b=t[34],b}function dO(e){let t=(0,$.c)(24),{keyName:n,value:r,widgetType:i,onCommit:a}=e;if(i===`list`){let e;t[0]===r?e=t[1]:(e=Array.isArray(r)?r:[],t[0]=r,t[1]=e);let i=e,o;return t[2]!==i||t[3]!==n||t[4]!==a?(o=(0,Z.jsx)(QD,{keyName:n,value:i,onCommit:a}),t[2]=i,t[3]=n,t[4]=a,t[5]=o):o=t[5],o}if(i===`boolean`){let e=typeof r==`boolean`?r:!1,i;return t[6]!==e||t[7]!==n||t[8]!==a?(i=(0,Z.jsx)(GD,{keyName:n,value:e,onCommit:a}),t[6]=e,t[7]=n,t[8]=a,t[9]=i):i=t[9],i}if(i===`number`){let e=typeof r==`number`?r:0,i;return t[10]!==n||t[11]!==e||t[12]!==a?(i=(0,Z.jsx)(WD,{keyName:n,value:e,onCommit:a}),t[10]=n,t[11]=e,t[12]=a,t[13]=i):i=t[13],i}if(i===`date`){let e=typeof r==`string`?r:``,i;return t[14]!==n||t[15]!==a||t[16]!==e?(i=(0,Z.jsx)(KD,{keyName:n,value:e,onCommit:a}),t[14]=n,t[15]=a,t[16]=e,t[17]=i):i=t[17],i}let o;t[18]===r?o=t[19]:(o=typeof r==`string`?r:Array.isArray(r)?r.join(`, `):String(r),t[18]=r,t[19]=o);let s=o,c;return t[20]!==n||t[21]!==a||t[22]!==s?(c=(0,Z.jsx)(UD,{keyName:n,value:s,onCommit:a}),t[20]=n,t[21]=a,t[22]=s,t[23]=c):c=t[23],c}function fO(e){let t=(0,$.c)(2),{source:n}=e,r=`Inherited from ${n===``?`.ok/frontmatter.yml`:`${n}/.ok/frontmatter.yml`}`,i;return t[0]===r?i=t[1]:(i=(0,Z.jsx)(M,{variant:`gray`,"data-testid":`property-inherited-badge`,title:r,className:`text-2xs`,children:`inherited`}),t[0]=r,t[1]=i),i}function pO(e){let t=(0,$.c)(5),{keyName:n,value:r}=e,i;t[0]===r?i=t[1]:(i=r.length===0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground/60`,children:`Empty`}):r.map(mO),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`list-widget-readonly`,"data-key":n,className:`flex min-h-7 w-full min-w-0 flex-wrap items-center gap-1 rounded-md px-2`,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function mO(e,t){return(0,Z.jsx)(`span`,{"data-testid":`list-chip-readonly`,"data-index":t,className:`inline-flex items-center text-1sm rounded-full bg-muted py-0.5 px-2`,children:String(e)},`${t}-${String(e)}`)}var hO={text:``,number:0,boolean:!1,date:``,list:[]};function gO(e){let t=(0,$.c)(74),{folderPath:n,state:r,onChange:i}=e,[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(vO,{}),(0,Z.jsx)(da,{className:`h-7 w-full`}),(0,Z.jsx)(da,{className:`h-7 w-full`}),(0,Z.jsx)(da,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let e;return t[1]===r.message?e=t[2]:(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:[`Failed to load folder defaults: `,r.message]}),t[1]=r.message,t[2]=e),e}let d;t[3]===r.data.folder.frontmatter_defaults?d=t[4]:(d=r.data.folder.frontmatter_defaults??{},t[3]=r.data.folder.frontmatter_defaults,t[4]=d);let f=d,p;t[5]===r.data.frontmatterLocal?p=t[6]:(p=r.data.frontmatterLocal??{},t[5]=r.data.frontmatterLocal,t[6]=p);let m=p,h=r.data.frontmatterSources,g;t[7]===r.data.folder.path?g=t[8]:(g=Ii(r.data.folder.path),t[7]=r.data.folder.path,t[8]=g);let v=g,y,b,x,S,C,w,T,E,O,k,j,M,N;if(t[9]!==s||t[10]!==a||t[11]!==v||t[12]!==n||t[13]!==m||t[14]!==f||t[15]!==i||t[16]!==l||t[17]!==h){let e=Object.keys(f),r=async function(e,t){let r=await Sa(n,{[e]:t});if(!r.ok){Fa.error(`Save failed: ${r.error}`);return}i()},d=async function(e){let t=await Sa(n,{[e]:null});if(!t.ok){Fa.error(`Remove failed: ${t.error}`);return}i()},p=function(e,t){let n=f[e];r(e,rO(n,t))},g;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(g=function(){c({name:``,type:`text`,value:``,error:null}),o(!1)},t[31]=g):g=t[31],x=g;let P;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){c(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):hO[e];return{...t,type:e,value:n,error:null}})},t[32]=P):P=t[32],C=P;let F;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){c(t=>t&&{...t,value:e})},t[33]=F):F=t[33],w=F;let I;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){c(t=>t&&{...t,name:e,error:null})},t[34]=I):I=t[34],S=I;let L;t[35]!==s||t[36]!==n||t[37]!==f||t[38]!==i?(L=async function(){if(!s)return;let e=s.name.trim();if(!e){c({...s,error:`Name is required`});return}if(Object.hasOwn(f,e)){c({...s,error:`Key "${e}" already resolves here`});return}let t=await Sa(n,{[e]:s.value});if(!t.ok){c({...s,error:t.error});return}c(null),i()},t[35]=s,t[36]=n,t[37]=f,t[38]=i,t[39]=L):L=t[39],T=L;let R=function(e){u({key:e,draft:e,error:null})},z=function(e){u(t=>t&&{...t,draft:e,error:null})},B=async function(){if(!l)return;let e=l.draft.trim();if(!e){u({...l,error:`Name is required`});return}if(e===l.key){u(null);return}if(Object.hasOwn(f,e)){u({...l,error:`Key "${e}" already resolves here`});return}let t=f[l.key],r=await Sa(n,{[l.key]:null,[e]:t});if(!r.ok){u({...l,error:r.error});return}u(null),i()},V=function(){u(null)};N=`rounded-lg border bg-card`,b=D,k=!a,t[40]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>o(!e),t[40]=j):j=t[40];let H=`size-3 transition-transform ${a?``:`rotate-90`}`,U;t[41]===H?U=t[42]:(U=(0,Z.jsx)(ct,{className:H,"aria-hidden":!0}),t[41]=H,t[42]=U);let W;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(`span`,{children:`Folder defaults`}),t[43]=W):W=t[43];let G;t[44]===U?G=t[45]:(G=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[U,W]}),t[44]=U,t[45]=G);let K;t[46]===v?K=t[47]:(K=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:_O,children:v}),t[46]=v,t[47]=K),t[48]!==G||t[49]!==K?(M=(0,Z.jsxs)(_,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[G,K]}),t[48]=G,t[49]=K,t[50]=M):M=t[50],y=A,E=`px-2 py-2`,O=e.length===0&&!s?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:`No defaults declared. Add a property to set a value every doc in this folder inherits.`}):e.map(e=>{let t=f[e],n=Object.hasOwn(m,e);return(0,Z.jsx)(aO,{keyName:e,value:t,declared:iO(t,Jn(t)),rename:n?{state:l?.key===e?l:null,onBegin:()=>R(e),onChangeDraft:z,onCommit:B,onCancel:V}:void 0,badge:n?null:(0,Z.jsx)(fO,{source:h[e]??``}),isInherited:!n,onCommit:t=>void r(e,t),onChangeType:t=>p(e,t),onRemove:n?()=>void d(e):void 0},e)}),t[9]=s,t[10]=a,t[11]=v,t[12]=n,t[13]=m,t[14]=f,t[15]=i,t[16]=l,t[17]=h,t[18]=y,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T,t[25]=E,t[26]=O,t[27]=k,t[28]=j,t[29]=M,t[30]=N}else y=t[18],b=t[19],x=t[20],S=t[21],C=t[22],w=t[23],T=t[24],E=t[25],O=t[26],k=t[27],j=t[28],M=t[29],N=t[30];let P;t[51]!==s||t[52]!==x||t[53]!==S||t[54]!==C||t[55]!==w||t[56]!==T?(P=s?(0,Z.jsx)(uO,{draft:s,onChangeName:S,onChangeType:C,onChangeValue:w,onCommit:()=>void T(),onCancel:()=>c(null)}):(0,Z.jsxs)(zr,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:x,className:`mt-1 flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(si,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:`Add property`})]}),t[51]=s,t[52]=x,t[53]=S,t[54]=C,t[55]=w,t[56]=T,t[57]=P):P=t[57];let F;t[58]!==P||t[59]!==E||t[60]!==O?(F=(0,Z.jsxs)(`div`,{className:E,children:[O,P]}),t[58]=P,t[59]=E,t[60]=O,t[61]=F):F=t[61];let I;t[62]!==y||t[63]!==F?(I=(0,Z.jsx)(y,{children:F}),t[62]=y,t[63]=F,t[64]=I):I=t[64];let L;t[65]!==b||t[66]!==I||t[67]!==k||t[68]!==j||t[69]!==M?(L=(0,Z.jsxs)(b,{open:k,onOpenChange:j,children:[M,I]}),t[65]=b,t[66]=I,t[67]=k,t[68]=j,t[69]=M,t[70]=L):L=t[70];let R;return t[71]!==L||t[72]!==N?(R=(0,Z.jsx)(`section`,{className:N,children:L}),t[71]=L,t[72]=N,t[73]=R):R=t[73],R}function _O(e){return e.stopPropagation()}function vO(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(bs,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Folder defaults`})]}),e[0]=t):t=e[0],t}function yO(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function bO(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=yO(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function xO(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function SO(e,t){let n=`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:bO(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:xO(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:bO(e,t.pageTitles),children:a}}function CO(e){let t=(0,$.c)(46),{folderPath:n,state:r,onChange:i}=e,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(!1),p;t[0]===i?p=t[1]:(p=async function(e){u(!0);let t=e.scope===`user`?`user`:`project`,n=await ga(e.scope===`user`?``:e.source_folder,e.name,t);if(u(!1),!n.ok){Fa.error(`Delete failed: ${n.error}`);return}Fa.success(`Template "${e.name}" deleted`),c(null),i()},t[0]=i,t[1]=p);let m=p;if(r.status===`idle`||r.status===`loading`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Templates available`})}),(0,Z.jsx)(da,{className:`h-12 w-full`}),(0,Z.jsx)(da,{className:`h-12 w-full`})]}),t[2]=e):e=t[2],e}if(r.status===`error`){let e;return t[3]===r.message?e=t[4]:(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:[`Failed to load templates: `,r.message]}),t[3]=r.message,t[4]=e),e}let h;t[5]===r.data.folder.templates_available?h=t[6]:(h=r.data.folder.templates_available??[],t[5]=r.data.folder.templates_available,t[6]=h);let g=h,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Templates available`}),t[7]=_):_=t[7];let v;t[8]===g.length?v=t[9]:(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,(0,Z.jsx)(M,{className:`text-xs`,variant:`secondary`,children:g.length})]}),t[8]=g.length,t[9]=v);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsxs)(zr,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>f(!0),children:[(0,Z.jsx)(si,{className:`size-3.5`,"aria-hidden":!0}),`New template`]}),t[10]=y):y=t[10];let b;t[11]===v?b=t[12]:(b=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[v,y]}),t[11]=v,t[12]=b);let x;t[13]===g?x=t[14]:(x=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:g.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No templates resolve here. Add one to seed new docs in this folder.`}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:g.map(e=>(0,Z.jsx)(TO,{template:e,onEdit:()=>o(e),onDelete:()=>c(e)},e.path))})}),t[13]=g,t[14]=x);let S;t[15]!==b||t[16]!==x?(S=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[b,x]}),t[15]=b,t[16]=x,t[17]=S):S=t[17];let C;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{e||o(null)},t[18]=C):C=t[18];let w=a?.scope===`user`?`user`:`project`,T;t[19]!==a||t[20]!==n||t[21]!==i||t[22]!==w?(T=(0,Z.jsx)(ra,{folderPath:n,template:a,onOpenChange:C,onSaved:i,target:w}),t[19]=a,t[20]=n,t[21]=i,t[22]=w,t[23]=T):T=t[23];let E=!!s,D;t[24]===l?D=t[25]:(D=e=>{!e&&!l&&c(null)},t[24]=l,t[25]=D);let O;t[26]!==s||t[27]!==l||t[28]!==m?(O=s&&(0,Z.jsx)(Yi,{itemName:`template "${s.name}"`,isSubmitting:l,onDelete:()=>m(s),customDescription:`This permanently removes ${s.path}. Agents that reference this template by name will fail until it's recreated or shadowed by an ancestor.${s.scope===`inherited`?`
|
|
28
|
+
|
|
29
|
+
This template lives at an ancestor folder — deleting affects every folder under that ancestor that does not shadow it locally.`:s.scope===`user`?`
|
|
30
|
+
|
|
31
|
+
This template lives in your user home (~/.ok/templates/) — deleting affects every OK project you open with this user account.`:``}`}),t[26]=s,t[27]=l,t[28]=m,t[29]=O):O=t[29];let k;t[30]!==E||t[31]!==D||t[32]!==O?(k=(0,Z.jsx)(io,{open:E,onOpenChange:D,children:O}),t[30]=E,t[31]=D,t[32]=O,t[33]=k):k=t[33];let A;t[34]===g?A=t[35]:(A=new Set(g.map(wO)),t[34]=g,t[35]=A);let j;t[36]!==n||t[37]!==d||t[38]!==i||t[39]!==A?(j=(0,Z.jsx)(Zi,{folderPath:n,existingNames:A,open:d,onOpenChange:f,onCreated:i}),t[36]=n,t[37]=d,t[38]=i,t[39]=A,t[40]=j):j=t[40];let N;return t[41]!==T||t[42]!==k||t[43]!==j||t[44]!==S?(N=(0,Z.jsxs)(Z.Fragment,{children:[S,T,k,j]}),t[41]=T,t[42]=k,t[43]=j,t[44]=S,t[45]=N):N=t[45],N}function wO(e){return e.name}function TO(e){let t=(0,$.c)(38),{template:n,onEdit:r,onDelete:i}=e,a=n.title&&n.title!==n.name,o=n.title??n.name,s;t[0]===o?s=t[1]:(s=(0,Z.jsx)(`span`,{className:`font-medium truncate`,children:o}),t[0]=o,t[1]=s);let l;t[2]!==a||t[3]!==n.name?(l=a?(0,Z.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground shrink-0`,children:n.name}):null,t[2]=a,t[3]=n.name,t[4]=l):l=t[4];let u;t[5]===n.scope?u=t[6]:(u=n.scope===`inherited`?(0,Z.jsx)(M,{variant:`gray`,className:`ml-auto shrink-0 text-2xs`,children:`inherited`}):null,t[5]=n.scope,t[6]=u);let d;t[7]===n.scope?d=t[8]:(d=n.scope===`user`?(0,Z.jsx)(M,{variant:`primary`,className:`ml-auto shrink-0 text-2xs`,children:`user`}):null,t[7]=n.scope,t[8]=d);let f;t[9]!==s||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[s,l,u,d]}),t[9]=s,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]===n.description?p=t[15]:(p=n.description?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mt-0.5`,children:n.description}):null,t[14]=n.description,t[15]=p);let m;t[16]!==r||t[17]!==f||t[18]!==p?(m=(0,Z.jsxs)(`button`,{type:`button`,onClick:r,className:`min-w-0 flex-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm`,children:[f,p]}),t[16]=r,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h=`Actions for ${n.title??n.name}`,g;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(ki,{className:`size-4`,"aria-hidden":!0}),t[20]=g):g=t[20];let _;t[21]===h?_=t[22]:(_=(0,Z.jsx)(ii,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":h,children:g})}),t[21]=h,t[22]=_);let v;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(we,{"aria-hidden":!0}),t[23]=v):v=t[23];let y;t[24]===r?y=t[25]:(y=(0,Z.jsxs)(Ei,{onSelect:r,children:[v,`Edit`]}),t[24]=r,t[25]=y);let b;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(c,{"aria-hidden":!0}),t[26]=b):b=t[26];let x;t[27]===i?x=t[28]:(x=(0,Z.jsxs)(Ei,{variant:`destructive`,onSelect:i,children:[b,`Delete`]}),t[27]=i,t[28]=x);let S;t[29]!==y||t[30]!==x?(S=(0,Z.jsxs)(ba,{align:`end`,children:[y,x]}),t[29]=y,t[30]=x,t[31]=S):S=t[31];let C;t[32]!==_||t[33]!==S?(C=(0,Z.jsxs)(Bi,{children:[_,S]}),t[32]=_,t[33]=S,t[34]=C):C=t[34];let w;return t[35]!==C||t[36]!==m?(w=(0,Z.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted/50 text-sm`,children:[m,C]}),t[35]=C,t[36]=m,t[37]=w):w=t[37],w}function EO(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=X(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=X(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function DO(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function OO(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function kO(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=X(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function AO(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=X(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function jO(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function MO(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);return a<30?`${a}d ago`:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function NO(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function PO(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(at,{className:`ml-1 size-3`}):(0,Z.jsx)(R,{className:`ml-1 size-3`}):(0,Z.jsx)(Jo,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(zr,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function FO(e){let t=(0,$.c)(98),{folderPath:n}=e,{addPage:r,folderPaths:i,loading:a,pages:o,pageTitles:s,pageMeta:c}=hr(),{state:l,refresh:u}=aa(n),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(`name`),[y,b]=(0,Q.useState)(`asc`);if(a){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(da,{className:`size-5 rounded`}),(0,Z.jsx)(da,{className:`h-7 w-48`})]}),(0,Z.jsx)(da,{className:`h-9 w-20 rounded-md`})]}),t[0]=e):e=t[0];let n;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(da,{className:`h-4 w-16`}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":`Loading folder contents`,children:(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[e,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[n,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(da,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(zO)]})]})}),t[2]=r):r=t[2],r}let x,S,C,w,T,E,D,O,k,A;if(t[3]!==r||t[4]!==h||t[5]!==p||t[6]!==l||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==s||t[11]!==o||t[12]!==u||t[13]!==y||t[14]!==_){let e=SO(n,{pages:o,pageTitles:s,pageMeta:c,folderPaths:i}),a=NO(e.children,_,y),d;t[25]===_?d=t[26]:(d=function(e){e===_?b(RO):(v(e),b(`asc`))},t[25]=_,t[26]=d);let j=d,M;t[27]!==r||t[28]!==n?(M=async function(){m(!0),g(null);try{let e=`${n}/index.md`,t=await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i=await t.json().catch(LO);if(!t.ok){let e=Wt.safeParse(i);g(e.success?e.data.title:`Server error (HTTP ${t.status})`),m(!1);return}let a=or.safeParse(i),o=a.success?a.data.docName:`${n}/index`;r(o),zn([`files`,`backlinks`,`graph`]),window.location.hash=Gn(o)}catch(e){console.warn(`[FolderOverview] create index note failed:`,e),g(`Network error — please try again`)}m(!1)},t[27]=r,t[28]=n,t[29]=M):M=t[29];let N=M;A=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,E=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let P;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(xe,{className:`size-5 text-muted-foreground`}),t[30]=P):P=t[30];let I=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[P,(0,Z.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e.title})]}),L;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(si,{className:`size-4`}),t[31]=L):L=t[31];let R;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(ii,{asChild:!0,children:(0,Z.jsxs)(zr,{children:[L,`New`,(0,Z.jsx)(F,{className:`size-3`})]})}),t[32]=R):R=t[32];let z;t[33]===N?z=t[34]:(z=()=>void N(),t[33]=N,t[34]=z);let B;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`font-medium`,children:`Index note`}),(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Landing page for this folder`})]}),t[35]=B):B=t[35];let V;t[36]!==p||t[37]!==z?(V=(0,Z.jsx)(Ei,{disabled:p,onSelect:z,children:B}),t[36]=p,t[37]=z,t[38]=V):V=t[38];let H;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(Ei,{onSelect:()=>f(!0),children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`font-medium`,children:`Note`}),(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`New note inside this folder`})]})}),t[39]=H):H=t[39];let U;t[40]===V?U=t[41]:(U=(0,Z.jsxs)(Bi,{children:[R,(0,Z.jsxs)(ba,{align:`end`,children:[V,H]})]}),t[40]=V,t[41]=U);let W;t[42]!==I||t[43]!==U?(W=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[I,U]}),t[42]=I,t[43]=U,t[44]=W):W=t[44];let G;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This folder has no landing note yet. Choose an explicit action to add one or open a note inside the folder.`}),t[45]=G):G=t[45];let K;t[46]===h?K=t[47]:(K=h?(0,Z.jsx)(`span`,{role:`alert`,className:`text-sm text-destructive`,children:h}):null,t[46]=h,t[47]=K),t[48]!==W||t[49]!==K?(D=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[W,G,K]}),t[48]=W,t[49]=K,t[50]=D):D=t[50],t[51]!==l||t[52]!==n||t[53]!==u?(O=(0,Z.jsx)(gO,{folderPath:n,state:l,onChange:u}),k=(0,Z.jsx)(CO,{folderPath:n,state:l,onChange:u}),t[51]=l,t[52]=n,t[53]=u,t[54]=O,t[55]=k):(O=t[54],k=t[55]),T=`rounded-lg border`,S=EO;let q=_===`name`?y===`asc`?`ascending`:`descending`:`none`,ee;t[56]!==j||t[57]!==y||t[58]!==_?(ee=(0,Z.jsx)(PO,{label:`Name`,sortKey:`name`,activeKey:_,activeDir:y,onSort:j}),t[56]=j,t[57]=y,t[58]=_,t[59]=ee):ee=t[59];let te;t[60]!==q||t[61]!==ee?(te=(0,Z.jsx)(AO,{"aria-sort":q,children:ee}),t[60]=q,t[61]=ee,t[62]=te):te=t[62];let ne=_===`modified`?y===`asc`?`ascending`:`descending`:`none`,re;t[63]!==j||t[64]!==y||t[65]!==_?(re=(0,Z.jsx)(PO,{label:`Modified`,sortKey:`modified`,activeKey:_,activeDir:y,onSort:j}),t[63]=j,t[64]=y,t[65]=_,t[66]=re):re=t[66];let ie;t[67]!==ne||t[68]!==re?(ie=(0,Z.jsx)(AO,{className:`w-32`,"aria-sort":ne,children:re}),t[67]=ne,t[68]=re,t[69]=ie):ie=t[69],t[70]!==te||t[71]!==ie?(w=(0,Z.jsx)(DO,{children:(0,Z.jsxs)(kO,{children:[te,ie]})}),t[70]=te,t[71]=ie,t[72]=w):w=t[72],x=OO,C=a.length?a.map(IO):(0,Z.jsx)(kO,{children:(0,Z.jsx)(jO,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:`This folder is empty.`})}),t[3]=r,t[4]=h,t[5]=p,t[6]=l,t[7]=n,t[8]=i,t[9]=c,t[10]=s,t[11]=o,t[12]=u,t[13]=y,t[14]=_,t[15]=x,t[16]=S,t[17]=C,t[18]=w,t[19]=T,t[20]=E,t[21]=D,t[22]=O,t[23]=k,t[24]=A}else x=t[15],S=t[16],C=t[17],w=t[18],T=t[19],E=t[20],D=t[21],O=t[22],k=t[23],A=t[24];let j;t[73]!==x||t[74]!==C?(j=(0,Z.jsx)(x,{children:C}),t[73]=x,t[74]=C,t[75]=j):j=t[75];let M;t[76]!==S||t[77]!==w||t[78]!==j?(M=(0,Z.jsxs)(S,{children:[w,j]}),t[76]=S,t[77]=w,t[78]=j,t[79]=M):M=t[79];let N;t[80]!==M||t[81]!==T?(N=(0,Z.jsx)(`div`,{className:T,children:M}),t[80]=M,t[81]=T,t[82]=N):N=t[82];let P;t[83]!==N||t[84]!==E||t[85]!==D||t[86]!==O||t[87]!==k?(P=(0,Z.jsxs)(`div`,{className:E,children:[D,O,k,N]}),t[83]=N,t[84]=E,t[85]=D,t[86]=O,t[87]=k,t[88]=P):P=t[88];let I;t[89]!==P||t[90]!==A?(I=(0,Z.jsx)(`div`,{className:A,children:P}),t[89]=P,t[90]=A,t[91]=I):I=t[91];let L;t[92]!==d||t[93]!==n?(L=(0,Z.jsx)(Sf,{open:d,onOpenChange:f,kind:`file`,initialDir:n}),t[92]=d,t[93]=n,t[94]=L):L=t[94];let R;return t[95]!==I||t[96]!==L?(R=(0,Z.jsxs)(Z.Fragment,{children:[I,L]}),t[95]=I,t[96]=L,t[97]=R):R=t[97],R}function IO(e){return(0,Z.jsxs)(kO,{children:[(0,Z.jsx)(jO,{children:(0,Z.jsxs)(`a`,{href:Gn(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(Ss,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(ve,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(jO,{className:`text-muted-foreground`,children:e.kind===`file`?MO(e.modified):`—`})]},e.path)}function LO(){return null}function RO(e){return e===`asc`?`desc`:`asc`}function zO(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(da,{className:`size-4 rounded`}),(0,Z.jsx)(da,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(da,{className:`h-4 w-16`})})]},e)}function BO(e){let t=(0,$.c)(7),{docName:n}=e,[r,i]=(0,Q.useState)(VO),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>rt(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let s;t[2]===n?s=t[3]:(s=function(){Se(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=s);let c=s,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{children:`Still loading`}),t[4]=l):l=t[4];let u;return t[5]===c?u=t[6]:(u=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[l,(0,Z.jsx)(zr,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:c,children:`Cancel`})]}),t[5]=c,t[6]=u),u}function VO(){return new Set}var HO=(0,Q.createContext)(null);function UO(e){let t=(0,$.c)(7),{children:n}=e,[r,i]=(0,Q.useState)(WO),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{i(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},t[0]=a):a=t[0];let o=a,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},t[1]=s):s=t[1];let c=s,l;t[2]===r?l=t[3]:(l={addPropertySignal:r,requestAddProperty:o,clearAddProperty:c},t[2]=r,t[3]=l);let u=l,d;return t[4]!==n||t[5]!==u?(d=(0,Z.jsx)(HO,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function WO(){return new Map}function GO(){let e=(0,Q.use)(HO);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}function KO(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Rb,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function qO(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Vb,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function JO(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=X(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(Gb,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}var YO=960,XO=1024;function ZO(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)($O),[r,i]=(0,Q.useState)(QO),a,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.matchMedia(`(max-width: ${YO-1}px)`),t=window.matchMedia(`(max-width: ${XO-1}px)`),r=()=>{let r=e.matches;n(r?`sheet`:`panel`),i(!r&&t.matches)};return e.addEventListener(`change`,r),t.addEventListener(`change`,r),()=>{e.removeEventListener(`change`,r),t.removeEventListener(`change`,r)}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o);let s;return e[2]!==r||e[3]!==t?(s={layout:t,autoCollapse:r},e[2]=r,e[3]=t,e[4]=s):s=e[4],s}function QO(){return window.innerWidth>=YO&&window.innerWidth<XO}function $O(){return window.innerWidth<YO?`sheet`:`panel`}var ek={words:0,chars:0,tokens:0},tk=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,nk=/[\p{L}\p{N}]/u,rk=new Set([`text`,`inlineCode`,`code`,`tag`]),ik=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),ak=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function ok(e,t){if(!e)return;let n=e.type;if(!ik.has(n)){if(rk.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
32
|
+
`));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)ok(n,t);if(ak.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
33
|
+
`)&&t.push(`
|
|
34
|
+
`)}}}}function sk(e){try{let t=d().parseToMdast(e),n=[];return ok(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function ck(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))nk.test(n)&&t++;return t}function lk(e){let t=globalThis.Intl.Segmenter;if(!t)return ck(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function uk(e){let t=tk.test(e)?1.5:4;return Math.ceil(e.length/t)}function dk(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=Cn(e);if(!t.trim())return{words:0,chars:0,tokens:0};let n=sk(t);return n?{words:tk.test(n)?lk(n):ck(n),chars:n.length,tokens:uk(n)}:{words:0,chars:0,tokens:0}}var fk=300;function pk(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(ek),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(ek);return}let n=e.document.getText(`source`),r=!1,a=null,o=function(){r||i(dk(n.toString()))};o();let s=function(){a&&clearTimeout(a),a=setTimeout(o,fk)};return n.observe(s),()=>{r=!0,n.unobserve(s),a&&clearTimeout(a)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Q.useEffect)(a,o),r}function mk(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(`connecting`),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(`connecting`);return}let t=e.configuration.websocketProvider.status;e.isSynced?r(`synced`):r(t===`connected`?`connected`:t===`disconnected`?`disconnected`:`connecting`);let n=e=>{let{status:t}=e;r(t===`connected`?hk:t===`disconnected`?`disconnected`:`connecting`)},i=e=>{let{state:t}=e;r(t?`synced`:`connected`)},a=()=>r(`disconnected`);return e.on(`status`,n),e.on(`synced`,i),e.on(`disconnect`,a),()=>{e.off(`status`,n),e.off(`synced`,i),e.off(`disconnect`,a)}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function hk(e){return e===`synced`?`synced`:`connected`}var gk=Rn;function _k(e,t={}){let n=s(e.componentName);return n.name===`*`?t.unregisteredSuffix?`${e.componentName} (unregistered)`:e.componentName:n.displayName??n.name}var vk=4;function yk(e){let t=(0,$.c)(8),{editor:n}=e,r=_e(n),i=!!(n&&r&&r.ancestorChain.length>0),a=i?void 0:`true`,o=`jsx-component-breadcrumb flex items-center gap-1 min-h-[28px] px-3 py-1.5 text-xs font-mono text-muted-foreground overflow-hidden ${i?`border-t border-border`:``}`,s;t[0]!==r||t[1]!==n||t[2]!==i?(s=i&&r?(0,Z.jsx)(xk,{editor:n,blockSelection:r}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=s):s=t[3];let c;return t[4]!==a||t[5]!==o||t[6]!==s?(c=(0,Z.jsx)(`nav`,{"aria-label":`Block ancestor navigation`,"aria-hidden":a,className:o,children:s}),t[4]=a,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function bk(e,t){let n=j.getState(e.state)?.posToId;if(!n)return t.pos;for(let[e,r]of n)if(r===t.bridgeId)return e;return null}function xk(e){let t=(0,$.c)(9),{editor:n,blockSelection:r}=e,{ancestorChain:i,selectedBlockId:a}=r,o;if(t[0]!==i||t[1]!==n||t[2]!==a){let e=wk(i),r;t[4]===n?r=t[5]:(r=(0,Z.jsx)(`button`,{type:`button`,className:`opacity-60 hover:opacity-100 hover:text-foreground transition-opacity outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm`,onClick:()=>{n.chain().focus().setTextSelection(0).command(Ck).run()},children:Y}),t[4]=n,t[5]=r);let s;t[6]!==n||t[7]!==a?(s=e=>{if(e.kind===`ellipsis`)return(0,Z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(ct,{size:12,className:`opacity-50`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{role:`img`,"aria-label":`${e.hiddenCount} hidden ancestors`,title:`${e.hiddenCount} hidden ancestors`,className:`opacity-60`,children:`…`})]},`ellipsis`);let t=_k(e.entry),r=e.entry.bridgeId===a;return(0,Z.jsxs)(`span`,{className:`flex items-center gap-1 min-w-0`,children:[(0,Z.jsx)(ct,{size:12,className:`opacity-50 shrink-0`,"aria-hidden":`true`}),r?(0,Z.jsx)(`span`,{"aria-current":`location`,className:`text-foreground truncate`,children:t}):(0,Z.jsx)(`button`,{type:`button`,className:`hover:text-foreground transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm truncate`,onClick:()=>{let t=bk(n,e.entry);t!==null&&n.chain().focus().setNodeSelection(t).command(Sk).run()},children:t})]},e.entry.bridgeId)},t[6]=n,t[7]=a,t[8]=s):s=t[8],o=(0,Z.jsxs)(Z.Fragment,{children:[r,e.map(s)]}),t[0]=i,t[1]=n,t[2]=a,t[3]=o}else o=t[3];return o}function Sk(e){let{tr:t}=e;return t.setMeta(te,`programmatic`),!0}function Ck(e){let{tr:t}=e;return t.setMeta(te,`programmatic`),!0}function wk(e){if(e.length<=vk)return e.map(e=>({kind:`entry`,entry:e}));let t=e[0],n=e.slice(-2),r=e.length-1-n.length;return[{kind:`entry`,entry:t},{kind:`ellipsis`,hiddenCount:r},...n.map(e=>({kind:`entry`,entry:e}))]}var Tk=200,Ek=`Outside any block`;function Dk(e){let t=(0,$.c)(5),{editor:n}=e,r=_e(n),i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(!1),s,c;t[0]!==r||t[1]!==n?(s=()=>{if(a.current!==null&&(window.clearTimeout(a.current),a.current=null),!n||!i.current)return;let e=r!==null&&r.ancestorChain.length>0,t;return t=e?Ok(n,r):o.current?Ek:``,a.current=window.setTimeout(()=>{i.current&&(i.current.textContent=``,i.current.textContent=t),o.current=e,a.current=null},Tk),()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)}},c=[n,r],t[0]=r,t[1]=n,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,Q.useEffect)(s,c);let l;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{ref:i,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`}),t[4]=l):l=t[4],l}function Ok(e,t){if(!t||t.ancestorChain.length===0)return``;let n=t.ancestorChain,r=n[n.length-1],i=_k(r,{unregisteredSuffix:!0});if(n.length===1)return`Selected: ${i}`;let a=n[n.length-2],o=_k(a);try{let t=e.state.doc.resolve(r.pos),n=t.index(t.depth),a=t.parent.childCount;return`Selected: ${i}, ${n+1} of ${a} in ${o}`}catch{return`Selected: ${i} in ${o}`}}function kk(){let[e]=(0,Q.useState)(Sr);return e}function Ak({principal:e,identity:t}){return e&&e.source===`git-config`?{type:`human`,name:Vn(e.display_name),color:fr(e.id,Un),coeditor:t.coeditor,tabId:t.tabId,principalId:e.id}:e&&e.source===`synthesized`?{type:`human`,name:t.name,color:fr(e.id,Un),coeditor:t.coeditor,tabId:t.tabId}:{type:`human`,name:t.name,color:t.color,coeditor:t.coeditor,tabId:t.tabId}}function jk(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var Mk=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&tr(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Ut(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(pn(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(dn(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Zt(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Qt(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Xt(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(qn(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(ln(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=Hn(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof gn){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof _r){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():jk(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Yn(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Nk=e=>new Jt({key:typeof e.pluginKey==`string`?new Cr(e.pluginKey):e.pluginKey,view:t=>new Mk({view:t,...e})});pr.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Nk({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Pk=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return yr(e,{textSerializers:In(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Ut(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(pn(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(dn(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Zt(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Qt(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Xt(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(qn(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(ln(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=Hn(this.view,e.from,e.to);Yn({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Fk=e=>new Jt({key:typeof e.pluginKey==`string`?new Cr(e.pluginKey):e.pluginKey,view:t=>new Pk({view:t,...e})});pr.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[Fk({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ik(e,t){return e??new Cr(t)}var Lk=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,Rk=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),zk=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),Bk=new Set([`children`,`className`,`style`]),Vk=new Set([`tabIndex`]),Hk=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),Uk={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function Wk(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function Gk(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function Kk(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||Hk.has(e)}function qk(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Jk(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:Uk[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function Yk(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function Xk(e){return Vk.has(e)}function Zk(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function Qk(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function $k(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||zk.has(e)?String(t):`${t}px`}function eA(e,t){Rk.has(t)||e.style.removeProperty(qk(t))}function tA(e,t,n){Rk.has(t)||e.style.setProperty(qk(t),$k(t,n))}function nA(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(Bk.has(r)||!Kk(r)||Wk(r,t[r])||Wk(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=Gk(r);if(a==null||a===!1){Xk(r)&&Qk(e,r),e.removeAttribute(o);return}if(a===!0){Xk(r)&&Zk(e,r,!0),e.setAttribute(o,``);return}if(Xk(r)){Zk(e,r,a);return}e.setAttribute(o,String(a))})}function rA(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function iA(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){eA(e,t);return}tA(e,t,a)}})}function aA(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!Wk(t,n))return;let{eventName:i,options:a}=Jk(t),o=t=>{n(Yk(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function oA(e,t){let n=(0,Q.useRef)({}),r=(0,Q.useRef)([]);Lk(()=>{let i=n.current;return rA(e,i.className,t.className),iA(e,i.style,t.style),nA(e,i,t),r.current=aA(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var sA=Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,Q.useRef)(document.createElement(`div`)),f=(0,Q.useRef)(Ik(e,`bubbleMenu`)).current;oA(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=We(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,Q.useRef)(h);g.current=h;let[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=Nk({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,Q.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,Zo.createPortal)(c,d.current)});Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,Q.useRef)(document.createElement(`div`)),d=(0,Q.useRef)(Ik(e,`floatingMenu`)).current;oA(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=We(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,Q.useRef)(m);h.current=m;let[g,_]=(0,Q.useState)(!1),v=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=Fk({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,Q.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,Zo.createPortal)(s,u.current)});var cA=[{name:`paragraph`,label:`Text`,icon:Vs,isActive:e=>e.isActive(`paragraph`)&&!e.isActive(`list`),command:e=>e.chain().focus().setParagraph().run()},{name:`heading1`,label:`Heading 1`,icon:Ve,isActive:e=>e.isActive(`heading`,{level:1}),command:e=>e.chain().focus().toggleHeading({level:1}).run()},{name:`heading2`,label:`Heading 2`,icon:he,isActive:e=>e.isActive(`heading`,{level:2}),command:e=>e.chain().focus().toggleHeading({level:2}).run()},{name:`heading3`,label:`Heading 3`,icon:fe,isActive:e=>e.isActive(`heading`,{level:3}),command:e=>e.chain().focus().toggleHeading({level:3}).run()},{name:`bulletList`,label:`Bullet List`,icon:Ye,isActive:e=>e.isActive(`list`,{ordered:!1})&&!e.isActive(`listItem`,{checked:!0})&&!e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleBulletList().run()},{name:`orderedList`,label:`Ordered List`,icon:ke,isActive:e=>e.isActive(`list`,{ordered:!0}),command:e=>e.chain().focus().toggleOrderedList().run()},{name:`taskList`,label:`Task List`,icon:le,isActive:e=>e.isActive(`listItem`,{checked:!0})||e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleTaskList().run()},{name:`blockquote`,label:`Quote`,icon:Ke,isActive:e=>e.isActive(`blockquote`),command:e=>e.chain().focus().toggleBlockquote().run()},{name:`codeBlock`,label:`Code Block`,icon:Qs,isActive:e=>e.isActive(`codeBlock`),command:e=>e.chain().focus().toggleCodeBlock().run()}];function lA(e){let t=(0,$.c)(18),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:uA},t[0]=n,t[1]=r);let{current:i,activeStates:a}=C(r),o=i.icon,s;t[2]===o?s=t[3]:(s=(0,Z.jsx)(o,{className:`size-3.5`}),t[2]=o,t[3]=s);let c;t[4]===i.label?c=t[5]:(c=(0,Z.jsx)(`span`,{children:i.label}),t[4]=i.label,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(F,{className:`size-3 opacity-50`}),t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Z.jsx)(ii,{asChild:!0,children:(0,Z.jsxs)(zr,{variant:`ghost`,size:`sm`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,children:[s,c,l]})}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n?(d=cA.map(e=>{let t=e.icon,r=a[e.name];return(0,Z.jsxs)(Ei,{className:r?`bg-accent text-accent-foreground`:``,onSelect:()=>{e.command(n)},children:[(0,Z.jsx)(t,{className:`size-4`}),(0,Z.jsx)(`span`,{children:e.label})]},e.name)}),t[10]=a,t[11]=n,t[12]=d):d=t[12];let f;t[13]===d?f=t[14]:(f=(0,Z.jsx)(ba,{align:`start`,sideOffset:8,className:`w-44 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto subtle-scrollbar`,children:d}),t[13]=d,t[14]=f);let p;return t[15]!==u||t[16]!==f?(p=(0,Z.jsxs)(Bi,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function uA(e){let t=Object.fromEntries(cA.map(t=>[t.name,t.isActive(e.editor)]));return{current:cA.find(e=>t[e.name])??cA[0],activeStates:t}}function dA(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(n!==`File`&&n!==`WikiEmbedFile`)return null;let r=(t.attrs.props??{}).src;return typeof r!=`string`||r.length===0?null:r}function fA(e){let t=e.state.selection.node;if(!t)return``;let n=t.attrs.props??{},r=typeof n.alias==`string`?n.alias:``;if(r.length>0)return r;let i=typeof n.name==`string`?n.name:``;return i.length>0?i:J(typeof n.src==`string`?n.src:``)}function pA(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,n.rel=`noopener noreferrer`,n.style.display=`none`,document.body.appendChild(n),n.click(),n.remove()}function mA(e){let t=(0,$.c)(10),{editor:n}=e,r;if(t[0]===n?r=t[1]:(r={editor:n,selector:hA},t[0]=n,t[1]=r),C(r)===null)return null;let i;t[2]===n?i=t[3]:(i=e=>{e.preventDefault();let t=dA(n);t&&pA(t,fA(n))},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(di,{className:`size-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-xs`,"aria-label":`Download file`,className:`text-accent-foreground`,onMouseDown:i,children:a})}),t[5]=i,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Ya,{side:`bottom`,sideOffset:8,children:`Download file`}),t[7]=s):s=t[7];let c;return t[8]===o?c=t[9]:(c=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:(0,Z.jsxs)(Za,{children:[o,s]})}),t[8]=o,t[9]=c),c}function hA(e){return dA(e.editor)}function gA(e){return dA(e)!==null}var _A=[{value:`left`,label:`Align left`,icon:pe},{value:`center`,label:`Align center`,icon:Fe},{value:`right`,label:`Align right`,icon:Qe}];function vA(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(n!==`img`&&n!==`CommonMarkImage`)return null;let r=(t.attrs.props??{}).align;return r===`left`||r===`right`||r===`center`?r:`center`}function yA(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:bA},t[0]=n,t[1]=r);let i=C(r);if(i===null)return null;let a;t[2]!==i||t[3]!==n?(a=_A.map(e=>{let{value:t,label:r,icon:a}=e,o=i===t;return(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-xs`,"aria-label":r,"aria-pressed":o,className:o?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:e=>{e.preventDefault();let r=n.state.selection,i=r.node;if(!i||i.type.name!==`jsxComponent`)return;let a=String(i.attrs.componentName??``);if(a!==`img`&&a!==`CommonMarkImage`||i.attrs.kind!==`element`)return;let o=a===`CommonMarkImage`,s=r.from,c={...i.attrs.props??{},align:t},l=o?{...i.attrs,componentName:`img`,props:c,sourceDirty:!0}:{...i.attrs,props:c,sourceDirty:!0},u=n.state.tr.setNodeMarkup(s,null,l);u.setSelection(gn.create(u.doc,s)),n.view.dispatch(u)},children:(0,Z.jsx)(a,{className:`size-3.5`})})}),(0,Z.jsx)(Ya,{side:`bottom`,sideOffset:8,children:r})]},t)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function bA(e){return vA(e.editor)}function xA(e){return vA(e)!==null}var SA=[{name:`bold`,icon:Xo,command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive(`strong`),shortcut:`⌘B`},{name:`italic`,icon:Ds,command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive(`emphasis`),shortcut:`⌘I`},{name:`underline`,icon:oc,command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive(`underline`),shortcut:`⌘U`},{name:`strikethrough`,icon:tc,command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive(`strike`),shortcut:`⌘⇧X`},{name:`code`,icon:ss,command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive(`code`),shortcut:`⌘E`},{name:`highlight`,icon:Es,command:e=>e.chain().focus().toggleHighlight().run(),isActive:e=>e.isActive(`highlight`),shortcut:`⌘⇧H`}];function CA(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:wA},t[0]=n,t[1]=r);let i=C(r),a;t[2]!==i||t[3]!==n?(a=SA.map(e=>{let t=e.icon,r=i[e.name];return(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-xs`,"aria-label":e.name,className:r?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:t=>{t.preventDefault(),e.command(n)},children:(0,Z.jsx)(t,{className:`size-3.5`})})}),(0,Z.jsxs)(Ya,{side:`bottom`,sideOffset:8,children:[(0,Z.jsx)(`span`,{className:`capitalize`,children:e.name}),(0,Z.jsx)(`kbd`,{className:`ml-1.5 text-[10px] opacity-60`,children:e.shortcut})]})]},e.name)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function wA(e){return Object.fromEntries(SA.map(t=>[t.name,t.isActive(e.editor)]))}function TA(e){let t=(0,$.c)(46),{editor:n}=e,[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(``),s=(0,Q.useRef)(null),l;t[0]===n?l=t[1]:(l=n.isActive(`link`),t[0]=n,t[1]=l);let u=l,d;t[2]===n?d=t[3]:(d=n.getAttributes(`link`).href??``,t[2]=n,t[3]=d);let f=d,p,m;t[4]===n?(p=t[5],m=t[6]):(p=()=>{let e=function(){n.state.selection.empty&&i(!1)};return n.on(`selectionUpdate`,e),()=>{n.off(`selectionUpdate`,e)}},m=[n],t[4]=n,t[5]=p,t[6]=m),(0,Q.useEffect)(p,m);let h,g;t[7]!==f||t[8]!==r?(h=()=>{r&&(o(f),requestAnimationFrame(()=>s.current?.focus()))},g=[r,f],t[7]=f,t[8]=r,t[9]=h,t[10]=g):(h=t[9],g=t[10]),(0,Q.useEffect)(h,g);let _;t[11]!==n||t[12]!==u||t[13]!==a?(_=function(){a.trim()?n.chain().focus().setLink({href:a.trim()}).run():u&&n.chain().focus().unsetLink().run(),i(!1)},t[11]=n,t[12]=u,t[13]=a,t[14]=_):_=t[14];let y=_,b;t[15]===n?b=t[16]:(b=function(){n.chain().focus().unsetLink().run(),i(!1)},t[15]=n,t[16]=b);let x=b,S;t[17]!==y||t[18]!==n?(S=function(e){e.key===`Enter`&&(e.preventDefault(),y()),e.key===`Escape`&&(e.preventDefault(),i(!1),n.chain().focus().run())},t[17]=y,t[18]=n,t[19]=S):S=t[19];let C=S;if(r){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>o(e.target.value),t[20]=e):e=t[20];let n;t[21]!==C||t[22]!==a?(n=(0,Z.jsx)(`input`,{ref:s,type:`url`,placeholder:`Paste link`,value:a,onChange:e,onKeyDown:C,"aria-label":`Link URL`,className:`h-5 w-44 bg-transparent text-sm border-none outline-none placeholder:text-muted-foreground`}),t[21]=C,t[22]=a,t[23]=n):n=t[23];let r;t[24]===y?r=t[25]:(r=()=>{y()},t[24]=y,t[25]=r);let i;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(ds,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[26]=i):i=t[26];let l;t[27]===r?l=t[28]:(l=(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-xs`,"aria-label":`Apply link`,onClick:r,children:i}),t[27]=r,t[28]=l);let d;t[29]!==n||t[30]!==l?(d=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border bg-background px-2 py-1`,children:[n,l]}),t[29]=n,t[30]=l,t[31]=d):d=t[31];let p;t[32]!==f||t[33]!==u||t[34]!==x?(p=u&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-xs`,"aria-label":`Open link in new tab`,onMouseDown:e=>{e.preventDefault(),v(f)},children:(0,Z.jsx)(Ea,{className:`size-3.5`})})}),(0,Z.jsx)(Ya,{side:`bottom`,sideOffset:8,children:`Open link in new tab`})]}),(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-xs`,"aria-label":`Remove link`,onMouseDown:e=>{e.preventDefault(),x()},children:(0,Z.jsx)(c,{className:`size-3.5`})})}),(0,Z.jsx)(Ya,{side:`bottom`,sideOffset:8,children:`Remove link`})]})]}),t[32]=f,t[33]=u,t[34]=x,t[35]=p):p=t[35];let m;return t[36]!==d||t[37]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[d,p]}),t[36]=d,t[37]=p,t[38]=m):m=t[38],m}let w=u?`bg-accent text-primary`:`text-accent-foreground`,T,E;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e.preventDefault(),i(!0)},E=(0,Z.jsx)(js,{className:`size-3.5`}),t[39]=T,t[40]=E):(T=t[39],E=t[40]);let D;t[41]===w?D=t[42]:(D=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-xs`,"aria-label":`Insert link`,className:w,onMouseDown:T,children:E})}),t[41]=w,t[42]=D);let O;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsxs)(Ya,{side:`bottom`,sideOffset:8,children:[`Link`,(0,Z.jsx)(`kbd`,{className:`ml-1.5 text-[10px] opacity-60`,children:`⌘K`})]}),t[43]=O):O=t[43];let k;return t[44]===D?k=t[45]:(k=(0,Z.jsxs)(Za,{children:[D,O]}),t[44]=D,t[45]=k),k}function EA({editor:e}){if(e.isActive(`codeBlock`))return!1;if(xA(e)||gA(e))return!0;if(e.state.selection.empty)return!1;let{from:t,to:n}=e.state.selection;return!!e.state.doc.textBetween(t,n,` `).trim()}function DA(e){let t=(0,$.c)(22),{editor:n}=e,r=(0,Q.useRef)(null),[i,a]=(0,Q.useState)(0),o=(0,Q.useRef)(null),s;t[0]===n?s=t[1]:(s={editor:n,selector:MA},t[0]=n,t[1]=s);let c=C(s),l;t[2]===n?l=t[3]:(l={editor:n,selector:jA},t[2]=n,t[3]=l);let u=C(l),d;t[4]!==n.state||t[5]!==n.view?(d=()=>{try{let{from:e,to:t}=n.state.selection;return Hn(n.view,e,t)}catch{return new DOMRect}},t[4]=n.state,t[5]=n.view,t[6]=d):d=t[6];let f;if(t[7]!==n.view.dom||t[8]!==d){let e={getBoundingClientRect:d,contextElement:n.view.dom};f=()=>{let t=r.current;t&&(o.current?.(),o.current=fn(e,t,()=>{Yn(e,t,{placement:`top`,strategy:`fixed`,middleware:[dn(8),Ut(),pn({padding:8})]}).then(e=>{let{x:n,y:r}=e;t.isConnected&&(t.style.position=`fixed`,t.style.left=`${n}px`,t.style.top=`${r}px`)}).catch(AA)}))},t[7]=n.view.dom,t[8]=d,t[9]=f}else f=t[9];let p=f,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{o.current?.(),o.current=null,a(kA)},t[10]=m):m=t[10];let h=m,g;t[11]===p?g=t[12]:(g={onShow:p,onHide:h,strategy:`fixed`},t[11]=p,t[12]=g);let _;t[13]!==n||t[14]!==u||t[15]!==c||t[16]!==i?(_=c?(0,Z.jsx)(yA,{editor:n},`${i}-img-align`):u?(0,Z.jsx)(mA,{editor:n},`${i}-file`):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(lA,{editor:n}),(0,Z.jsx)(la,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(CA,{editor:n},i),(0,Z.jsx)(la,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(TA,{editor:n},`${i}-link`)]}),t[13]=n,t[14]=u,t[15]=c,t[16]=i,t[17]=_):_=t[17];let v;return t[18]!==n||t[19]!==g||t[20]!==_?(v=(0,Z.jsx)(sA,{ref:r,editor:n,appendTo:OA,shouldShow:EA,updateDelay:250,options:g,className:`z-50 flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:_}),t[18]=n,t[19]=g,t[20]=_,t[21]=v):v=t[21],v}function OA(){return document.body}function kA(e){return e+1}function AA(){}function jA(e){return gA(e.editor)}function MA(e){return xA(e.editor)}var NA=[{name:`addRowBefore`,icon:at,label:`Add row above`,command:e=>e.chain().focus().addRowBefore().run()},{name:`addRowAfter`,icon:R,label:`Add row below`,command:e=>e.chain().focus().addRowAfter().run()},{name:`deleteRow`,icon:c,label:`Delete row`,command:e=>e.chain().focus().deleteRow().run()}],PA=[{name:`addColumnBefore`,icon:Yr,label:`Add column left`,command:e=>e.chain().focus().addColumnBefore().run()},{name:`addColumnAfter`,icon:Si,label:`Add column right`,command:e=>e.chain().focus().addColumnAfter().run()},{name:`deleteColumn`,icon:c,label:`Delete column`,command:e=>e.chain().focus().deleteColumn().run()}],FA=[{name:`toggleHeaderRow`,icon:rc,label:`Toggle header row`,command:e=>e.chain().focus().toggleHeaderRow().run()},{name:`toggleHeaderColumn`,icon:ls,label:`Toggle header column`,command:e=>e.chain().focus().toggleHeaderColumn().run()},{name:`deleteTable`,icon:ws,label:`Delete table`,command:e=>e.chain().focus().deleteTable().run()}];function IA({editor:e}){return e.isActive(`table`)}function LA(e){let t=(0,$.c)(14),{action:n,editor:r}=e,i=n.icon,a;t[0]!==n||t[1]!==r?(a=e=>{e.preventDefault(),n.command(r)},t[0]=n,t[1]=r,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Z.jsx)(i,{className:`size-3.5`}),t[3]=i,t[4]=o);let s;t[5]!==n.label||t[6]!==a||t[7]!==o?(s=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-xs`,"aria-label":n.label,className:`text-muted-foreground`,onMouseDown:a,children:o})}),t[5]=n.label,t[6]=a,t[7]=o,t[8]=s):s=t[8];let c;t[9]===n.label?c=t[10]:(c=(0,Z.jsx)(Ya,{side:`bottom`,sideOffset:8,children:n.label}),t[9]=n.label,t[10]=c);let l;return t[11]!==s||t[12]!==c?(l=(0,Z.jsxs)(Za,{children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function RA(e){let t=(0,$.c)(13),{editor:n}=e,r;t[0]===n?r=t[1]:(r=NA.map(e=>(0,Z.jsx)(LA,{action:e,editor:n},e.name)),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(la,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[2]=i):i=t[2];let a;t[3]===n?a=t[4]:(a=PA.map(e=>(0,Z.jsx)(LA,{action:e,editor:n},e.name)),t[3]=n,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(la,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[5]=o):o=t[5];let s;t[6]===n?s=t[7]:(s=FA.map(e=>(0,Z.jsx)(LA,{action:e,editor:n},e.name)),t[6]=n,t[7]=s);let c;return t[8]!==n||t[9]!==r||t[10]!==a||t[11]!==s?(c=(0,Z.jsxs)(sA,{editor:n,shouldShow:IA,updateDelay:100,className:`flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:[r,i,a,o,s]}),t[8]=n,t[9]=r,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}var zA=new WeakMap;function BA(e){let t=document.createElement(`span`);t.classList.add(`collaboration-cursor__caret`),t.style.borderColor=e.color;let n=document.createElement(`div`);return n.classList.add(`collaboration-cursor__label`),n.style.backgroundColor=e.color,n.style.color=vr(e.color),n.textContent=e.name,t.append(n),t}var VA={state:`idle`,count:0,lastFiredAt:null,position:`append`,lastAgentId:null};function HA(){let e=new Yt({extensions:on});return{mdManager:e,text:S({mdManager:e}),html:Ue({mdManager:e}),paste:U({mdManager:e}),drop:G({mdManager:e})}}function UA(e){let{provider:t,placeholder:n,prebuiltMapping:r}=e;return[...Be.map(e=>e.name===`link`||e.name===`wikiLink`?e.configure({docName:t.configuration.name??``}):e),gk.configure({placeholder:n??`Type '/' for commands`,showOnlyCurrent:!0}),q.configure({document:t.document,...r?{ySyncOptions:{mapping:r}}:{}}),pr.create({name:`imageUploadDecoration`,addProseMirrorPlugins(){return[$e]}}),pr.create({name:`collaborationCursor`,addProseMirrorPlugins(){let e=t.awareness;if(!e)throw Error(`[TiptapEditor] HocuspocusProvider has no awareness instance — cursor plugin cannot initialize`);return[Ee(e,{cursorBuilder:BA})]}})]}function WA(e){let{provider:t,clipboard:n,ctorStart:r}=e;return{onBeforeCreate:({editor:e})=>{zA.set(e,r)},onCreate:({editor:e})=>{n.html.setView(e.view);let r=zA.get(e);if(zA.delete(e),r==null)return;let i=performance.now();W(`ok/editor/create-tiptap`,{docName:t.configuration.name??`unknown`,ytextLength:t.document.getText(`source`).length},{startTime:r,duration:Math.max(0,i-r)})},editorProps:{attributes:{class:`pt-4 pb-4 h-full`},clipboardTextParser:(e,t,r,i)=>{let a=n.mdManager.parse(e);return i.state.schema.nodeFromJSON(a).content},clipboardTextSerializer:(e,t)=>n.text(e,t),clipboardSerializer:n.html.serializer,handlePaste:(e,t)=>n.paste(e,t),handleDrop:(e,t)=>n.drop(e,t)},extensions:Zu(UA(e))}}function GA(e){let{provider:t,placeholder:n,clipboard:r,ctorStart:i}=e,a=Qn(UA({provider:t,placeholder:n,clipboard:r,ctorStart:i})),{doc:o,mapping:s}=l(t.document.getXmlFragment(`default`),a);return{...WA({provider:t,placeholder:n,clipboard:r,ctorStart:i,prebuiltMapping:s}),content:o.toJSON(),element:null}}var KA=e=>{let t=(0,$.c)(20),{provider:n,placeholder:r,isSourceMode:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(VA),s=kk(),{principal:c,activeDocName:l}=Pe(),u=n.configuration.name??``,[d]=(0,Q.useState)(HA),f;t[0]!==d||t[1]!==r||t[2]!==n?(f=()=>()=>({editor:new ir(GA({provider:n,placeholder:r,clipboard:d,ctorStart:performance.now()})),ydoc:n.document,ytext:n.document.getText(`source`),provider:n}),t[0]=d,t[1]=r,t[2]=n,t[3]=f):f=t[3];let[p]=(0,Q.useState)(f),m,h;if(t[4]!==p||t[5]!==u||t[6]!==n.document){let e={viewCount:0,bytes:n.document.getText(`source`).length},r=se(u)??crypto.randomUUID();m=Q.use,h=re({docName:u,mountId:r,construct:p,sizeStats:e}),t[4]=p,t[5]=u,t[6]=n.document,t[7]=m,t[8]=h}else m=t[7],h=t[8];let g=m(h),_=g.editor,v,y;t[9]===g?(v=t[10],y=t[11]):(v=()=>()=>{ge(g)},y=[g],t[9]=g,t[10]=v,t[11]=y),(0,Q.useEffect)(v,y);let b;return t[12]!==l||t[13]!==u||t[14]!==_||t[15]!==s||t[16]!==i||t[17]!==c||t[18]!==n?(b=(0,Z.jsx)(qA,{provider:n,isSourceMode:i,docName:u,activeDocName:l,identity:s,principal:c,editor:_,wrapperRef:a,flashStateRef:o}),t[12]=l,t[13]=u,t[14]=_,t[15]=s,t[16]=i,t[17]=c,t[18]=n,t[19]=b):b=t[19],b},qA=e=>{let t=(0,$.c)(64),{provider:n,isSourceMode:r,docName:i,activeDocName:a,identity:o,principal:s,editor:c,wrapperRef:l,flashStateRef:d}=e,f;t[0]!==c||t[1]!==n.configuration.name?(f=()=>(qe(c,n.configuration.name??null),()=>{qe(c,null)}),t[0]=c,t[1]=n.configuration.name,t[2]=f):f=t[2];let p;t[3]!==c||t[4]!==n?(p=[c,n],t[3]=c,t[4]=n,t[5]=p):p=t[5],(0,Q.useEffect)(f,p);let m;t[6]!==c||t[7]!==n.configuration.name?(m=()=>{},t[6]=c,t[7]=n.configuration.name,t[8]=m):m=t[8];let h;t[9]!==c||t[10]!==n?(h=[c,n],t[9]=c,t[10]=n,t[11]=h):h=t[11],(0,Q.useEffect)(m,h);let g;t[12]!==c||t[13]!==n.configuration.name?(g=()=>{},t[12]=c,t[13]=n.configuration.name,t[14]=g):g=t[14];let _;t[15]!==c||t[16]!==n?(_=[c,n],t[15]=c,t[16]=n,t[17]=_):_=t[17],(0,Q.useEffect)(g,_);let v,b;t[18]===c?(v=t[19],b=t[20]):(v=()=>{let e=JA,t=null,n=()=>{if(t||c.isDestroyed)return;let n=it(c);n&&(t=n.dom,t.addEventListener(`keydown`,e),t.addEventListener(`paste`,e),t.addEventListener(`drop`,e),t.addEventListener(`cut`,e))},r=()=>{t&&=(t.removeEventListener(`keydown`,e),t.removeEventListener(`paste`,e),t.removeEventListener(`drop`,e),t.removeEventListener(`cut`,e),null)};return it(c)?n():c.on(`create`,n),()=>{c.off(`create`,n),r()}},b=[c],t[18]=c,t[19]=v,t[20]=b),(0,Q.useEffect)(v,b);let x,S;t[21]!==d||t[22]!==n.document||t[23]!==l?(S=()=>{let e=n.document.getMap(`agent-flash`),t=Date.now(),r=0,i=null,a=null,o=null,s=()=>{let t=null;for(let[,n]of e.entries()){let e=n;e.timestamp&&(!t||e.timestamp>t.timestamp)&&(t={agentId:e.agentId??`unknown`,timestamp:e.timestamp,type:e.type??`insert`,description:e.description})}return t},c=e=>{d.current=e;let t=l.current;t&&(t.setAttribute(`data-agent-flash-state`,e.state),t.setAttribute(`data-agent-flash-count`,String(e.count)),t.setAttribute(`data-agent-flash-position`,e.position),t.setAttribute(`data-agent-flash-agent-id`,e.lastAgentId??``))},u=()=>{let e=s(),t=e?.description?.toLowerCase().includes(`prepend`)?`prepend`:`append`,n={state:`editing`,count:(d.current?.count??0)+1,lastFiredAt:Date.now(),position:t,lastAgentId:e?.agentId??null};c(n),document.dispatchEvent(new CustomEvent(`agent-flash`,{detail:n})),a&&clearTimeout(a),o&&clearTimeout(o),a=window.setTimeout(()=>{let e={...n,state:`settled`};c(e),document.dispatchEvent(new CustomEvent(`agent-flash-end`,{detail:e})),o=window.setTimeout(()=>{c({...e,state:`idle`})},300)},cr)};c(VA);let f=()=>{if(Fn(e),!jn(e,t)||document.visibilityState!==`visible`)return;let n=Date.now();if(t=n,n-r<500){if(!i){let e=500-(n-r);i=window.setTimeout(()=>{i=null,r=Date.now(),u()},e)}return}r=n,u()};e.observe(f);let p=()=>{document.visibilityState===`visible`?jn(e,t)&&(t=Date.now(),r=Date.now(),u()):t=Date.now()};return document.addEventListener(`visibilitychange`,p),()=>{e.unobserve(f),document.removeEventListener(`visibilitychange`,p),i&&clearTimeout(i),a&&clearTimeout(a),o&&clearTimeout(o)}},x=[n.document,d,l],t[21]=d,t[22]=n.document,t[23]=l,t[24]=x,t[25]=S):(x=t[24],S=t[25]),(0,Q.useEffect)(S,x);let C,w;t[26]===n?(C=t[27],w=t[28]):(C=()=>{let e=window.location.hash,t=e.indexOf(`?`),r=t>=0?new URLSearchParams(e.slice(t+1)).get(`anchor`):null;if(!r)return;let i=r,a=0,o,s=!1;function c(){if(s)return;let e=document.getElementById(i);e?(e.scrollIntoView({behavior:`smooth`,block:`start`}),s=!0,n.off(`synced`,c)):a<20&&(a+=1,o=window.setTimeout(c,100))}return c(),n.on(`synced`,c),()=>{o!==void 0&&clearTimeout(o),n.off(`synced`,c)}},w=[n],t[26]=n,t[27]=C,t[28]=w),(0,Q.useEffect)(C,w);let T,E;t[29]===c?(T=t[30],E=t[31]):(T=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`wysiwyg`||c.isDestroyed)return;let n=it(c);if(!n)return;let r=n.dom.querySelectorAll(`h1, h2, h3, h4, h5, h6`)[t.index];r&&r.scrollIntoView({behavior:`smooth`,block:`start`})};return window.addEventListener(Mo,e),()=>window.removeEventListener(Mo,e)},E=[c],t[29]=c,t[30]=T,t[31]=E),(0,Q.useEffect)(T,E);let D;t[32]!==a||t[33]!==i||t[34]!==o||t[35]!==r||t[36]!==s||t[37]!==n.awareness?(D=()=>{let e=n.awareness;if(e){if(i!==a){e.setLocalState(null);return}e.setLocalState({user:Ak({principal:s,identity:o}),mode:r?`source`:`wysiwyg`})}},t[32]=a,t[33]=i,t[34]=o,t[35]=r,t[36]=s,t[37]=n.awareness,t[38]=D):D=t[38];let O;t[39]!==a||t[40]!==i||t[41]!==o||t[42]!==r||t[43]!==s||t[44]!==n?(O=[n,i,a,o,s,r],t[39]=a,t[40]=i,t[41]=o,t[42]=r,t[43]=s,t[44]=n,t[45]=O):O=t[45],(0,Q.useEffect)(D,O);let k,A,j,M,N;t[46]===c?(k=t[47],A=t[48],j=t[49],M=t[50],N=t[51]):(k=(0,Z.jsx)(DA,{editor:c}),A=(0,Z.jsx)(RA,{editor:c}),j=(0,Z.jsx)(y,{editor:c,className:`h-full`}),M=(0,Z.jsx)(yk,{editor:c}),N=(0,Z.jsx)(Dk,{editor:c}),t[46]=c,t[47]=k,t[48]=A,t[49]=j,t[50]=M,t[51]=N);let P;t[52]===c?P=t[53]:(P=u(c),t[52]=c,t[53]=P);let F;t[54]===P.store?F=t[55]:(F=(0,Z.jsx)(V,{store:P.store}),t[54]=P.store,t[55]=F);let I;return t[56]!==k||t[57]!==A||t[58]!==j||t[59]!==M||t[60]!==N||t[61]!==F||t[62]!==l?(I=(0,Z.jsxs)(`div`,{ref:l,className:`tiptap-editor h-full`,"data-agent-flash-state":`idle`,"data-agent-flash-count":`0`,"data-agent-flash-position":`append`,"data-agent-flash-agent-id":``,children:[k,A,j,M,N,F]}),t[56]=k,t[57]=A,t[58]=j,t[59]=M,t[60]=N,t[61]=F,t[62]=l,t[63]=I):I=t[63],I};function JA(){return L()}function YA(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(et(n,r));let a;return t[0]===i?a=t[1]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[0]=i,t[1]=a),a}var XA=`__back-nav__`;function ZA(e){return e instanceof ce||e instanceof Le||e instanceof ie||e instanceof Ce||e instanceof Je||e instanceof Ne?e.docName:null}function QA(e){return e instanceof ce?{title:`Couldn't load document`,summary:`"${e.docName}" took too long. Check your connection.`}:e instanceof Le?{title:`Connection dropped`,summary:`Lost connection to "${e.docName}".`}:e instanceof ie?{title:`Document not found`,summary:`"${e.docName}" doesn't exist.`}:e instanceof Ce?{title:`Couldn't open document`,summary:`Something went wrong opening "${e.docName}".`}:e instanceof Je?{title:`Server can't open documents`,summary:`This project's running server doesn't support live editing. Restart Open Knowledge to fix.`}:e instanceof Ne?{title:`Cancelled`,summary:`You cancelled loading "${e.docName}".`}:{title:`Unknown error`,summary:e instanceof Error&&e.message?e.message:`An unexpected error occurred.`}}function $A(e){let t=(0,$.c)(27),{error:n,resetErrorBoundary:r,activeDocName:i,previousDocName:a,onNavigateBack:o}=e,s;t[0]===n?s=t[1]:(s=QA(n),t[0]=n,t[1]=s);let{title:c,summary:l}=s,u=!!a&&!!o,d=(0,Q.useRef)(null),f,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{d.current?.focus()},p=[],t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,Q.useEffect)(f,p);let m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(vx,{size:80,variant:`sleeping`}),t[4]=m):m=t[4];let h;t[5]===c?h=t[6]:(h=(0,Z.jsx)(`h2`,{id:`document-error-title`,className:`text-lg font-medium`,children:c}),t[5]=c,t[6]=h);let g;t[7]===l?g=t[8]:(g=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:l}),t[7]=l,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;t[12]===r?v=t[13]:(v=(0,Z.jsx)(zr,{ref:d,variant:`default`,onClick:r,children:`Try again`}),t[12]=r,t[13]=v);let y;t[14]!==i||t[15]!==u||t[16]!==n||t[17]!==o||t[18]!==a||t[19]!==r?(y=u?(0,Z.jsx)(zr,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(Oe(ZA(n)??i),o(a),r(XA))},children:`Go back`}):null,t[14]=i,t[15]=u,t[16]=n,t[17]=o,t[18]=a,t[19]=r,t[20]=y):y=t[20];let b;t[21]!==v||t[22]!==y?(b=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[v,y]}),t[21]=v,t[22]=y,t[23]=b):b=t[23];let x;return t[24]!==b||t[25]!==_?(x=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`document-error-title`,"data-slot":`document-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[m,_,b]}),t[24]=b,t[25]=_,t[26]=x):x=t[26],x}function ej(e){let t=(0,$.c)(17),{activeDocName:n,previousDocName:r,onNavigateBack:i,onRecycle:a,children:o}=e,s;t[0]!==n||t[1]!==i||t[2]!==r?(s=e=>(0,Z.jsx)($A,{...e,activeDocName:n,previousDocName:r,onNavigateBack:i}),t[0]=n,t[1]=i,t[2]=r,t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=[n],t[4]=n,t[5]=c);let l;t[6]!==n||t[7]!==a?(l=e=>{if(e.reason===`imperative-api`){if(Array.isArray(e.args)&&e.args[0]===XA){console.warn(`[DocumentErrorBoundary] back-nav reset (no recycle)`);return}a(n),console.warn(`[DocumentErrorBoundary] retry recycled ${n}`)}else console.warn(`[DocumentErrorBoundary] reset by key change (${e.prev?.[0]} → ${e.next?.[0]})`)},t[6]=n,t[7]=a,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=e=>{console.error(`[DocumentErrorBoundary] rendered fallback for ${n}: ${QA(e).title}`,e)},t[9]=n,t[10]=u);let d;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Z.jsx)(ft,{fallbackRender:s,resetKeys:c,onReset:l,onError:u,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}var tj={text:``,number:0,boolean:!1,date:``,list:[]};function nj(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=xn(t);return{map:n,keys:_n(t),parseError:r}}function rj(e){let t=(0,$.c)(169),{provider:n}=e,[r,i]=(0,Q.useState)(null),a;t[0]===n?a=t[1]:(a=()=>nj(n),t[0]=n,t[1]=a);let[o,s]=(0,Q.useState)(a),c,l;t[2]===n?(c=t[3],l=t[4]):(c=()=>{let e=ur(n);i(e),s(e.current());let t=e.subscribe(e=>{s(e)});return()=>{t(),e.dispose(),i(t=>t===e?null:t)}},l=[n],t[2]=n,t[3]=c,t[4]=l),(0,Q.useEffect)(c,l);let u=o.map,d=o.keys,f=o.parseError,[p,m]=(0,Q.useState)(!1),h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h={},t[5]=h):h=t[5];let[g,v]=(0,Q.useState)(h),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(null),C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C={},t[6]=C):C=t[6];let[w,T]=(0,Q.useState)(C),E;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(E={},t[7]=E):E=t[7];let[O,k]=(0,Q.useState)(E),j=n.configuration.name??``,M;t[8]===j?M=t[9]:(M=aj(j),t[8]=j,t[9]=M);let N=aa(M),P;t[10]!==N.state.data||t[11]!==N.state.status?(P=N.state.status===`ready`?N.state.data.folder.frontmatter_defaults??{}:{},t[10]=N.state.data,t[11]=N.state.status,t[12]=P):P=t[12];let F=P,I;t[13]!==N.state.data||t[14]!==N.state.status?(I=N.state.status===`ready`?N.state.data.frontmatterSources:{},t[13]=N.state.data,t[14]=N.state.status,t[15]=I):I=t[15];let L=I,R;t[16]===r?R=t[17]:(R=function(e){if(!r)return{ok:!1,error:`Connecting`};let t=r.patch(e);if(t.ok)return{ok:!0};if(t.error.code===`WRITE_ERROR`)return console.warn(`[PropertyPanel] binding write error:`,t.error.detail),{ok:!1,error:t.error.detail};let n=er(t.error);return{ok:!1,error:t.error.issues[0]?.message??`Invalid patch payload`,fieldErrors:Object.keys(n).length>0?n:void 0}},t[16]=r,t[17]=R);let z=R,B;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(B=function(e){T(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},t[18]=B):B=t[18];let V=B,H;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=function(e,t){if(e.ok)return;let n=e.error??`Failed to update property`,r=e.fieldErrors??{};T(e=>{let i={...e};for(let e of t)i[e]=r[e]??n;return i}),k(e=>{let n={...e};for(let e of t)n[e]=(n[e]??0)+1;return n})},t[19]=H):H=t[19];let U=H,W;t[20]===z?W=t[21]:(W=function(e,t){V(e),U(z({[e]:t}),[e])},t[20]=z,t[21]=W);let G=W,K;t[22]===z?K=t[23]:(K=function(e){V(e),U(z({[e]:null}),[e])},t[22]=z,t[23]=K);let q=K,ee;t[24]===r?ee=t[25]:(ee=function(e,t){if(!r)return{ok:!1,error:`Connecting`};if(e===t)return{ok:!0};let n=r.rename(e,t);if(n.ok)return{ok:!0};if(n.error.code===`WRITE_ERROR`)return{ok:!1,error:n.error.detail};let i=er(n.error);return{ok:!1,error:n.error.issues[0]?.message??`Failed to rename`,fieldErrors:Object.keys(i).length>0?i:void 0}},t[24]=r,t[25]=ee);let te=ee,ne;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ne=function(e,t){return`${e} ${t}`},t[26]=ne):ne=t[26];let re=ne,ie;t[27]!==r||t[28]!==d?(ie=function(e){if(!r)return;let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let i=d.map((e,t)=>re(e,t)),a=i.indexOf(t),o=i.indexOf(n);if(a<0||o<0)return;let s=d.slice(),[c]=s.splice(a,1);if(!c)return;s.splice(o,0,c);let l=r.reorder(s);l.ok||console.warn(`[PropertyPanel] reorder failed:`,l.error)},t[27]=r,t[28]=d,t[29]=ie):ie=t[29];let ae=ie,oe;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(oe={activationConstraint:{distance:4}},t[30]=oe):oe=t[30];let se;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(se={coordinateGetter:yi},t[31]=se):se=t[31];let ce=ai(wa(vi,oe),wa(hi,se)),le;t[32]!==F||t[33]!==G||t[34]!==u?(le=function(e,t){let n=u[e]??oj(F[e]);if(n===void 0)return;v(n=>({...n,[e]:t}));let r=rO(n,t);(!Object.hasOwn(u,e)||!ij(n,r))&&G(e,r)},t[32]=F,t[33]=G,t[34]=u,t[35]=le):le=t[35];let ue=le,de;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(de=function(){b({name:``,type:`text`,value:``,error:null}),m(!1)},t[36]=de):de=t[36];let fe=de,{addPropertySignal:pe,clearAddProperty:J}=GO(),me;t[37]!==pe||t[38]!==j?(me=pe.get(j)??0,t[37]=pe,t[38]=j,t[39]=me):me=t[39];let he=me,ge,_e;t[40]===he?(ge=t[41],_e=t[42]):(ge=()=>{he>0&&(b({name:``,type:`text`,value:``,error:null}),m(!1))},_e=[he],t[40]=he,t[41]=ge,t[42]=_e),(0,Q.useEffect)(ge,_e);let ve,ye;t[43]!==J||t[44]!==j?(ve=()=>()=>J(j),ye=[j,J],t[43]=J,t[44]=j,t[45]=ve,t[46]=ye):(ve=t[45],ye=t[46]),(0,Q.useEffect)(ve,ye);let be;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(be=function(e){b(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):tj[e];return{...t,type:e,value:n,error:null}})},t[47]=be):be=t[47];let xe=be,Se;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Se=function(e){b(t=>t&&{...t,value:e})},t[48]=Se):Se=t[48];let Ce=Se,we;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(we=function(e){b(t=>t&&{...t,name:e,error:null})},t[49]=we):we=t[49];let Te=we,Y;t[50]!==y||t[51]!==z||t[52]!==u?(Y=function(){if(!y)return;let e=y.name.trim();if(!e){b({...y,error:`Name is required`});return}if(e===`frontmatter`){b({...y,error:`"frontmatter" is a reserved property name`});return}if(Object.hasOwn(u,e)){b({...y,error:`Property "${e}" already exists`});return}let t=z({[e]:y.value});if(t.ok){b(null);return}let n=t.fieldErrors?.[e],r=t.error??`Failed to add property`;b({...y,error:n??r})},t[50]=y,t[51]=z,t[52]=u,t[53]=Y):Y=t[53];let Ee=Y,De;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(De=function(){b(null)},t[54]=De):De=t[54];let Oe=De,ke;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ke=function(e){S({key:e,draft:e,error:null})},t[55]=ke):ke=t[55];let Ae=ke,je;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(je=function(e){S(t=>t&&{...t,draft:e,error:null})},t[56]=je):je=t[56];let Me=je,Ne;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=function(){S(null)},t[57]=Ne):Ne=t[57];let Pe=Ne,Fe;t[58]!==u||t[59]!==te||t[60]!==x?(Fe=function(){if(!x)return;let e=x.draft.trim();if(!e){S(null);return}if(e===x.key){S(null);return}if(e===`frontmatter`){S({...x,error:`"frontmatter" is a reserved property name`});return}if(Object.hasOwn(u,e)){S({...x,error:`Property "${e}" already exists`});return}let t=te(x.key,e);if(t.ok){v(t=>{if(!Object.hasOwn(t,x.key))return t;let n={...t};return n[e]=n[x.key],delete n[x.key],n}),V(x.key),S(null);return}let n=t.fieldErrors?.[e]??t.fieldErrors?.[x.key]??t.error??`Failed to rename property`;S({...x,error:n})},t[58]=u,t[59]=te,t[60]=x,t[61]=Fe):Fe=t[61];let Ie=Fe,Le;t[62]!==u||t[63]!==d?(Le=d.length>0?d:Object.keys(u),t[62]=u,t[63]=d,t[64]=Le):Le=t[64];let Re=Le,ze;if(t[65]!==Re){ze=new Map;for(let e of Re)ze.set(e,(ze.get(e)??0)+1);t[65]=Re,t[66]=ze}else ze=t[66];let Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze;if(t[67]!==y||t[68]!==F||t[69]!==L||t[70]!==p||t[71]!==G||t[72]!==Ie||t[73]!==ze||t[74]!==w||t[75]!==ae||t[76]!==u||t[77]!==g||t[78]!==f||t[79]!==q||t[80]!==x||t[81]!==Re||t[82]!==O||t[83]!==ce||t[84]!==ue){Ze=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Object.keys(F).filter(e=>!Object.hasOwn(u,e)).sort();if(Re.length===0&&e.length===0&&!y&&!f){Ze=null;break bb0}Ye=`property-panel editor-content-aligned pt-4 pb-4 text-sm`,Xe=`property-panel`,Ve=D,Ke=!p,t[97]===Symbol.for(`react.memo_cache_sentinel`)?(qe=e=>m(!e),t[97]=qe):qe=t[97];let n=!p,r;t[98]===n?r=t[99]:(r=(0,Z.jsx)(ct,{"data-expanded":n,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 ease-out data-[expanded=true]:rotate-90`}),t[98]=n,t[99]=r);let i;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`span`,{children:`Properties`}),t[100]=i):i=t[100],t[101]===r?Je=t[102]:(Je=(0,Z.jsx)(_,{asChild:!0,children:(0,Z.jsxs)(zr,{type:`button`,variant:`ghost`,className:`mb-1.5 flex h-auto w-fit bg-transparent! items-center gap-1 px-1 py-0.5 text-base font-medium text-foreground hover:bg-transparent hover:text-foreground`,children:[r,i]})}),t[101]=r,t[102]=Je),Be=A,He=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[103]===f?Ue=t[104]:(Ue=f?(0,Z.jsxs)(`div`,{role:`alert`,"data-testid":`property-panel-yaml-error`,className:`mb-1 flex items-start gap-1.5 rounded border border-destructive/30 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive`,children:[(0,Z.jsx)(Er,{className:`size-3.5 shrink-0 mt-0.5`}),(0,Z.jsxs)(`div`,{children:[`Frontmatter YAML is malformed; fix in source mode to recover.`,(0,Z.jsx)(`span`,{className:`block text-[10px] opacity-80`,children:f})]})]}):null,t[103]=f,t[104]=Ue);let a;if(t[105]!==Re){let e;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(e=(e,t)=>re(e,t),t[107]=e):e=t[107],a=Re.map(e),t[105]=Re,t[106]=a}else a=t[106];let o;if(t[108]!==F||t[109]!==L||t[110]!==G||t[111]!==Ie||t[112]!==ze||t[113]!==w||t[114]!==u||t[115]!==g||t[116]!==q||t[117]!==x||t[118]!==Re||t[119]!==O||t[120]!==ue){let e;t[122]!==F||t[123]!==L||t[124]!==G||t[125]!==Ie||t[126]!==ze||t[127]!==w||t[128]!==u||t[129]!==g||t[130]!==q||t[131]!==x||t[132]!==O||t[133]!==ue?(e=(e,t)=>{let n=u[e];if(n===void 0)return null;let r=g[e]??Jn(n),i=x?.key===e?x:null,a=(ze.get(e)??0)>1,o=Object.hasOwn(F,e)?(0,Z.jsx)(sj,{source:L[e]??``}):void 0;return(0,Z.jsx)(aO,{sortableId:re(e,t),keyName:e,value:n,declared:r,error:w[e]??null,resetCounter:O[e]??0,isDuplicate:a,badge:o,rename:{state:i,onBegin:()=>Ae(e),onChangeDraft:Me,onCommit:Ie,onCancel:Pe},onCommit:t=>G(e,t),onChangeType:t=>ue(e,t),onRemove:()=>q(e)},`${e}-${t}`)},t[122]=F,t[123]=L,t[124]=G,t[125]=Ie,t[126]=ze,t[127]=w,t[128]=u,t[129]=g,t[130]=q,t[131]=x,t[132]=O,t[133]=ue,t[134]=e):e=t[134],o=Re.map(e),t[108]=F,t[109]=L,t[110]=G,t[111]=Ie,t[112]=ze,t[113]=w,t[114]=u,t[115]=g,t[116]=q,t[117]=x,t[118]=Re,t[119]=O,t[120]=ue,t[121]=o}else o=t[121];let s;t[135]!==a||t[136]!==o?(s=(0,Z.jsx)(ea,{items:a,strategy:Ci,children:o}),t[135]=a,t[136]=o,t[137]=s):s=t[137],t[138]!==ae||t[139]!==ce||t[140]!==s?(We=(0,Z.jsx)(fi,{sensors:ce,collisionDetection:Ti,onDragEnd:ae,children:s}),t[138]=ae,t[139]=ce,t[140]=s,t[141]=We):We=t[141];let c;t[142]!==F||t[143]!==L||t[144]!==G||t[145]!==w||t[146]!==O||t[147]!==ue?(c=e=>{let t=F[e],n=oj(t),r=Jn(n),i=L[e]??``;return(0,Z.jsx)(aO,{keyName:e,value:n,declared:r,error:w[e]??null,resetCounter:O[e]??0,isInherited:!0,badge:(0,Z.jsx)(fO,{source:i}),onCommit:t=>G(e,t),onChangeType:t=>ue(e,t)},`inherited-${e}`)},t[142]=F,t[143]=L,t[144]=G,t[145]=w,t[146]=O,t[147]=ue,t[148]=c):c=t[148],Ge=e.map(c)}t[67]=y,t[68]=F,t[69]=L,t[70]=p,t[71]=G,t[72]=Ie,t[73]=ze,t[74]=w,t[75]=ae,t[76]=u,t[77]=g,t[78]=f,t[79]=q,t[80]=x,t[81]=Re,t[82]=O,t[83]=ce,t[84]=ue,t[85]=Be,t[86]=Ve,t[87]=He,t[88]=Ue,t[89]=We,t[90]=Ge,t[91]=Ke,t[92]=qe,t[93]=Je,t[94]=Ye,t[95]=Xe,t[96]=Ze}else Be=t[85],Ve=t[86],He=t[87],Ue=t[88],We=t[89],Ge=t[90],Ke=t[91],qe=t[92],Je=t[93],Ye=t[94],Xe=t[95],Ze=t[96];if(Ze!==Symbol.for(`react.early_return_sentinel`))return Ze;let Qe;t[149]!==y||t[150]!==Ee?(Qe=y?(0,Z.jsx)(uO,{draft:y,onChangeName:Te,onChangeType:xe,onChangeValue:Ce,onCommit:Ee,onCancel:Oe}):(0,Z.jsxs)(zr,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:fe,className:`mt-1 flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(si,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:`Add property`})]}),t[149]=y,t[150]=Ee,t[151]=Qe):Qe=t[151];let $e;t[152]!==Be||t[153]!==He||t[154]!==Ue||t[155]!==We||t[156]!==Ge||t[157]!==Qe?($e=(0,Z.jsxs)(Be,{className:He,children:[Ue,We,Ge,Qe]}),t[152]=Be,t[153]=He,t[154]=Ue,t[155]=We,t[156]=Ge,t[157]=Qe,t[158]=$e):$e=t[158];let et;t[159]!==Ve||t[160]!==Ke||t[161]!==qe||t[162]!==Je||t[163]!==$e?(et=(0,Z.jsxs)(Ve,{open:Ke,onOpenChange:qe,children:[Je,$e]}),t[159]=Ve,t[160]=Ke,t[161]=qe,t[162]=Je,t[163]=$e,t[164]=et):et=t[164];let tt;return t[165]!==Ye||t[166]!==Xe||t[167]!==et?(tt=(0,Z.jsx)(`div`,{className:Ye,"data-testid":Xe,children:et}),t[165]=Ye,t[166]=Xe,t[167]=et,t[168]=tt):tt=t[168],tt}function ij(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length?e.every((e,n)=>e===t[n]):!1:e===t}function aj(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function oj(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`?e:Array.isArray(e)?e.map(e=>typeof e==`string`?e:JSON.stringify(e)):e==null?``:JSON.stringify(e)}function sj(e){let t=(0,$.c)(2),{source:n}=e,r=`Overrides default from ${n===``?`.ok/frontmatter.yml`:`${n}/.ok/frontmatter.yml`}. Remove to revert.`,i;return t[0]===r?i=t[1]:(i=(0,Z.jsx)(M,{variant:`primary`,"data-testid":`property-override-badge`,title:r,className:`text-2xs`,children:`overrides`}),t[0]=r,t[1]=i),i}var cj=ee(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function lj(e){let t=e.threshold??cj;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function uj(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var dj=ee(`ACTIVITY_MOUNT_LIMIT`,3);function fj(){return r(()=>import(`./SourceEditor-CzC_EQwX.js`),__vite__mapDeps([44,1,36,2,37,38,22,39,40,41,42,21,3,6,7,16,4,8,15,10,45,25]),import.meta.url)}var pj=(0,Q.lazy)(async()=>({default:(await fj()).SourceEditor}));function mj(e,t,n){if(n<=0)return[];let r=e.filter(e=>!me(e.docName)),i=[...r].sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt).slice(0,n);if(t===null||i.some(e=>e.docName===t))return i;let a=r.find(e=>e.docName===t);return a?[...i.slice(0,n-1),a]:i}function hj(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:`Couldn't reconnect after server restart`,summary:t.reason===`clear-data-timeout`?`Local collaboration data for "${e}" could not be cleared in time. Reload to retry.`:`Local collaboration data for "${e}" could not be cleared. Reload to retry.`,actionLabel:`Reload`}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:`Reconnecting after server restart`,summary:t.phase===`clearing-local-cache`?`Clearing local collaboration data for "${e}" before reconnecting.`:`Reopening "${e}" with a fresh local collaboration cache.`}:null}function gj(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(K,{name:`activity-pool`,children:(0,Z.jsx)(_j,{...e})}),t[0]=e,t[1]=n),n}function _j(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=Pe(),{pages:u,loading:d}=hr(),f=mj(c,n,dj),p=(0,Q.useRef)(``),m=f.map(vj).join(`,`),h=(0,Q.useRef)(c),g,_;t[0]===c?(g=t[1],_=t[2]):(g=()=>{h.current=c},_=[c],t[0]=c,t[1]=g,t[2]=_),(0,Q.useLayoutEffect)(g,_),(0,Q.useLayoutEffect)(()=>{if(p.current===m)return;let e=p.current?p.current.split(`,`):[],t=m?m.split(`,`):[],r=e.filter(e=>!t.includes(e)),i=t.filter(t=>!e.includes(t));for(let e of r)dt(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;lt(e,t&&t.length>0?t:crypto.randomUUID())}W(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,He(t)},[m,n]);let v;t[3]!==n||t[4]!==i||t[5]!==r||t[6]!==d||t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==a||t[11]!==l?(v=e=>(0,Z.jsx)(Cj,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName),previousDocName:a,onNavigateBack:o,onRecycle:s,serverRestartRecovery:l},e.docName),t[3]=n,t[4]=i,t[5]=r,t[6]=d,t[7]=o,t[8]=s,t[9]=u,t[10]=a,t[11]=l,t[12]=v):v=t[12];let y=f.map(v),b;return t[13]===y?b=t[14]:(b=(0,Z.jsx)(Z.Fragment,{children:y}),t[13]=y,t[14]=b),b}function vj(e){return e.docName}function yj(e){let t=(0,$.c)(8),{isActive:n,children:r}=e,i=(0,Q.useRef)(null),a=(0,Q.useRef)(0),o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=i.current;if(!e)return;let t=()=>{e.scrollTop>0&&(a.current=e.scrollTop)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,Q.useEffect)(o,s);let c,l;t[2]===n?(c=t[3],l=t[4]):(c=()=>{if(!n)return;let e=i.current;if(!e)return;let t=a.current;if(t===0||(e.scrollTop=t,e.scrollTop===t))return;let r=!1,o=()=>{r||(r=!0,s.disconnect(),clearTimeout(c))},s=new ResizeObserver(()=>{r||!e||e.scrollHeight>t&&(e.scrollTop=t,e.scrollTop===t&&o())});s.observe(e);let c=setTimeout(o,500);return o},l=[n],t[2]=n,t[3]=c,t[4]=l),(0,Q.useLayoutEffect)(c,l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={overflowAnchor:`auto`},t[5]=u):u=t[5];let d;return t[6]===r?d=t[7]:(d=(0,Z.jsx)(`div`,{ref:i,"data-testid":`editor-scroll-container`,className:`subtle-scrollbar h-full overflow-y-auto pt-14 scroll-pt-14`,style:u,children:r}),t[6]=r,t[7]=d),d}function bj(e){let t=(0,$.c)(12),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a}=e,o=r&&i,[s,c]=(0,Q.useState)(o),l,u;if(t[0]===o?(l=t[1],u=t[2]):(l=()=>{o&&c(!0)},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u),!s&&!o)return null;let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Jb,{}),t[3]=d):d=t[3];let f=n.docName,p;t[4]===n.provider.document?p=t[5]:(p=n.provider.document.getText(`source`),t[4]=n.provider.document,t[5]=p);let m;return t[6]!==a||t[7]!==n.docName||t[8]!==n.provider||t[9]!==o||t[10]!==p?(m=(0,Z.jsx)(Q.Suspense,{fallback:d,children:(0,Z.jsx)(pj,{docName:f,ytext:p,provider:n.provider,placeholder:a,isSourceModeActive:o})}),t[6]=a,t[7]=n.docName,t[8]=n.provider,t[9]=o,t[10]=p,t[11]=m):m=t[11],m}function xj(e){let t=(0,$.c)(18),{view:n}=e,r=n.kind===`failed`,i=r?`alert`:`status`,a=!r,o;t[0]===r?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full border bg-muted text-muted-foreground`,children:r?(0,Z.jsx)(Ws,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(Re,{className:`size-5 animate-spin`,"aria-hidden":`true`})}),t[0]=r,t[1]=o);let s;t[2]===n.title?s=t[3]:(s=(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:n.title}),t[2]=n.title,t[3]=s);let c;t[4]===n.summary?c=t[5]:(c=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:n.summary}),t[4]=n.summary,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==n.actionLabel?(u=r?(0,Z.jsxs)(zr,{type:`button`,onClick:Sj,children:[(0,Z.jsx)(Ws,{className:`size-4`,"aria-hidden":`true`}),n.actionLabel]}):null,t[9]=r,t[10]=n.actionLabel,t[11]=u):u=t[11];let d;return t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==u?(d=(0,Z.jsxs)(`div`,{"data-slot":`server-restart-recovery`,role:i,"aria-busy":a,className:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,children:[o,l,u]}),t[12]=i,t[13]=a,t[14]=o,t[15]=l,t[16]=u,t[17]=d):d=t[17],d}function Sj(){return window.location.reload()}function Cj(e){let t=(0,$.c)(45),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a,isNewDoc:o,previousDocName:s,onNavigateBack:c,onRecycle:l,serverRestartRecovery:u}=e,d;t[0]!==n.docName||t[1]!==u?(d=hj(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,p=n.provider.document.getText(`source`).length,[m,h]=(0,Q.useState)(i),[g,_]=(0,Q.useState)(!i),v,y;t[3]!==i||t[4]!==m||t[5]!==g?(v=()=>{i&&!m?h(!0):!i&&!g&&_(!0)},y=[i,m,g],t[3]=i,t[4]=m,t[5]=g,t[6]=v,t[7]=y):(v=t[6],y=t[7]),(0,Q.useEffect)(v,y);let b=lj({ytextLength:p,isSourceMode:i,visitedSource:m,visitedVisual:g}),x=(0,Q.useRef)(``),S=`${b.isLarge}-${b.renderSource}-${b.renderVisual}`,C,w;t[8]!==n.docName||t[9]!==b.isLarge||t[10]!==b.renderSource||t[11]!==b.renderVisual||t[12]!==S||t[13]!==i||t[14]!==p?(C=()=>{x.current!==S&&(x.current=S,b.isLarge&&W(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:p,isSourceMode:i,renderSource:b.renderSource,renderVisual:b.renderVisual}))},w=[S,b.isLarge,b.renderSource,b.renderVisual,n.docName,p,i],t[8]=n.docName,t[9]=b.isLarge,t[10]=b.renderSource,t[11]=b.renderVisual,t[12]=S,t[13]=i,t[14]=p,t[15]=C,t[16]=w):(C=t[15],w=t[16]),(0,Q.useEffect)(C,w);let[T,E]=(0,Q.useState)(!1),D,O;t[17]!==n.docName||t[18]!==b.isLarge||t[19]!==b.renderSource||t[20]!==b.renderVisual||t[21]!==T||t[22]!==i||t[23]!==p?(D=()=>{uj({isLarge:b.isLarge,renderSource:b.renderSource,renderVisual:b.renderVisual,hasEmittedFirstToggle:T})&&(W(`ok/cold/first-toggle`,{docName:n.docName,mountId:se(n.docName),ytextLength:p,modeEnteredFirst:i?`source`:`visual`}),E(!0))},O=[T,b.isLarge,b.renderSource,b.renderVisual,n.docName,p,i],t[17]=n.docName,t[18]=b.isLarge,t[19]=b.renderSource,t[20]=b.renderVisual,t[21]=T,t[22]=i,t[23]=p,t[24]=D,t[25]=O):(D=t[24],O=t[25]),(0,Q.useEffect)(D,O);let k=r?`visible`:`hidden`,A=`editor:${n.docName}`,j;t[26]!==a||t[27]!==n||t[28]!==b.renderSource||t[29]!==b.renderVisual||t[30]!==r||t[31]!==o||t[32]!==i||t[33]!==c||t[34]!==l||t[35]!==s||t[36]!==f?(j=f?(0,Z.jsx)(xj,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(ej,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(Jb,{}),children:(0,Z.jsx)(YA,{docName:n.docName,provider:n.provider,children:(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(0,Z.jsx)(rj,{provider:n.provider}),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[b.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(bj,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,b.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(KA,{provider:n.provider,placeholder:a,isSourceMode:i},`${n.docName}-${String(o)}`)}):null]})]})})})})}),t[26]=a,t[27]=n,t[28]=b.renderSource,t[29]=b.renderVisual,t[30]=r,t[31]=o,t[32]=i,t[33]=c,t[34]=l,t[35]=s,t[36]=f,t[37]=j):j=t[37];let M;t[38]!==r||t[39]!==j?(M=(0,Z.jsx)(yj,{isActive:r,children:j}),t[38]=r,t[39]=j,t[40]=M):M=t[40];let N;return t[41]!==M||t[42]!==k||t[43]!==A?(N=(0,Z.jsx)(Q.Activity,{mode:k,name:A,children:M}),t[41]=M,t[42]=k,t[43]=A,t[44]=N):N=t[44],N}function wj(e){let t=(0,$.c)(27),{stats:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-full h-2 bg-linear-to-t from-background to-transparent`}),t[0]=r):r=t[0];let i;t[1]===n.words?i=t[2]:(i=n.words.toLocaleString(),t[1]=n.words,t[2]=i);let a;t[3]===i?a=t[4]:(a=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:i}),t[3]=i,t[4]=a);let o=n.words===1?`word`:`words`,s;t[5]!==a||t[6]!==o?(s=(0,Z.jsxs)(`span`,{children:[a,` `,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7];let c;t[8]===n.chars?c=t[9]:(c=n.chars.toLocaleString(),t[8]=n.chars,t[9]=c);let l;t[10]===c?l=t[11]:(l=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:c}),t[10]=c,t[11]=l);let u=n.chars===1?`char`:`chars`,d;t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`span`,{children:[l,` `,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14];let f=n.tokens>0?`~`:``,p;t[15]===n.tokens?p=t[16]:(p=n.tokens.toLocaleString(),t[15]=n.tokens,t[16]=p);let m;t[17]===p?m=t[18]:(m=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:p}),t[17]=p,t[18]=m);let h=n.tokens===1?`token`:`tokens`,g;t[19]!==f||t[20]!==m||t[21]!==h?(g=(0,Z.jsxs)(`span`,{children:[f,m,` `,h]}),t[19]=f,t[20]=m,t[21]=h,t[22]=g):g=t[22];let _;return t[23]!==g||t[24]!==s||t[25]!==d?(_=(0,Z.jsxs)(`section`,{"aria-label":`Document statistics`,className:`relative flex h-6 shrink-0 items-center justify-end gap-3 bg-background px-3 text-2xs text-muted-foreground`,children:[r,s,d,g]}),t[23]=g,t[24]=s,t[25]=d,t[26]=_):_=t[26],_}var Tj={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},Ej=e=>{let t=(0,$.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,...Tj,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},Dj=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Markdown`}),r=(0,Z.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(Ej,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},Oj=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Textbox`}),r=(0,Z.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(Ej,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function kj(e){let t=(0,$.c)(39),{isSourceMode:n,sourceDisabled:r,onModeChange:i,showAddPropertyButton:a,onAddProperty:o,showPanelOpen:s,onTogglePanel:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{}),t[0]=l):l=t[0];let u=n?`source`:`wysiwyg`,d;t[1]===i?d=t[2]:(d=e=>{e&&i(e)},t[1]=i,t[2]=d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Wa,{value:`wysiwyg`,"aria-label":`Visual editor`,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:(0,Z.jsx)(Ja,{children:(0,Z.jsx)(Oj,{className:`size-4`})})}),(0,Z.jsx)(Ya,{side:`bottom`,children:`Visual`})]}),t[3]=f):f=t[3];let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(Dj,{className:`size-4`}),t[4]=p):p=t[4];let m;t[5]===r?m=t[6]:(m=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Wa,{value:`source`,"aria-label":`Markdown source`,disabled:r,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:p})})}),t[5]=r,t[6]=m);let h=r?`Source mode requires a live connection — your edits are saved and will appear when you reconnect.`:`Markdown`,g;t[7]===h?g=t[8]:(g=(0,Z.jsx)(Ya,{side:`bottom`,children:h}),t[7]=h,t[8]=g);let _;t[9]!==m||t[10]!==g?(_=(0,Z.jsxs)(Za,{children:[m,g]}),t[9]=m,t[10]=g,t[11]=_):_=t[11];let v;t[12]!==u||t[13]!==d||t[14]!==_?(v=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex justify-center`,children:(0,Z.jsxs)(Ka,{type:`single`,value:u,onValueChange:d,"aria-label":`Editor mode`,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 data-[size=sm]:rounded-[10px] bg-muted p-0.5`,children:[f,_]})}),t[12]=u,t[13]=d,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==o||t[17]!==a?(y=a&&(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(zr,{variant:`ghost`,size:`icon`,"aria-label":`Add properties`,onClick:o,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(Ja,{children:(0,Z.jsx)(Ns,{})})}),(0,Z.jsx)(Ya,{side:`bottom`,children:`Add properties`})]}),t[16]=o,t[17]=a,t[18]=y):y=t[18];let b=s?`Show document panel`:`Hide document panel`,x;t[19]===s?x=t[20]:(x=(0,Z.jsx)(Ja,{children:s?(0,Z.jsx)(Bs,{}):(0,Z.jsx)(zs,{})}),t[19]=s,t[20]=x);let S;t[21]!==c||t[22]!==b||t[23]!==x?(S=(0,Z.jsx)(zr,{variant:`ghost`,size:`icon`,onClick:c,"aria-label":b,asChild:!0,children:x}),t[21]=c,t[22]=b,t[23]=x,t[24]=S):S=t[24];let C=s?`Show panel`:`Hide panel`,w;t[25]===C?w=t[26]:(w=(0,Z.jsx)(Ya,{side:`bottom`,children:C}),t[25]=C,t[26]=w);let T;t[27]!==S||t[28]!==w?(T=(0,Z.jsxs)(Za,{children:[S,w]}),t[27]=S,t[28]=w,t[29]=T):T=t[29];let E;t[30]!==y||t[31]!==T?(E=(0,Z.jsxs)(`div`,{className:`pointer-events-auto flex items-center justify-end gap-1`,children:[y,T]}),t[30]=y,t[31]=T,t[32]=E):E=t[32];let D;t[33]!==v||t[34]!==E?(D=(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 items-center px-2 py-2 bg-background`,children:[l,v,E]}),t[33]=v,t[34]=E,t[35]=D):D=t[35];let O;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none h-2 bg-linear-to-b from-background to-transparent`}),t[36]=O):O=t[36];let k;return t[37]===D?k=t[38]:(k=(0,Z.jsxs)(`div`,{"data-testid":`editor-toolbar`,className:`pointer-events-none absolute inset-x-0 top-0 z-10`,children:[D,O]}),t[37]=D,t[38]=k),k}function Aj(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}var jj=(0,Q.lazy)(()=>r(()=>import(`./SettingsDialog-B0r_NhKC.js`).then(e=>({default:e.SettingsDialog})),__vite__mapDeps([46,1,36,2,37,38,22,39,40,41,42,21,3,6,7,16,4,8,15,10,47,17,23,9,11,24]),import.meta.url));function Mj(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(Pj,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(Nj,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(K,{name:`editor-area`,children:(0,Z.jsxs)(UO,{children:[n,r]})}),t[3]=n,t[4]=i),i}function Nj(){let e=(0,$.c)(8),t=Fp(),[n,r]=(0,Q.useState)(!1),i,a;if(e[0]===t.open?(i=e[1],a=e[2]):(i=()=>{t.open&&r(!0)},a=[t.open],e[0]=t.open,e[1]=i,e[2]=a),(0,Q.useEffect)(i,a),!n)return null;let o;e[3]===t?o=e[4]:(o=e=>{e||t.close()},e[3]=t,e[4]=o);let s;return e[5]!==t.open||e[6]!==o?(s=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(jj,{open:t.open,onOpenChange:o})}),e[5]=t.open,e[6]=o,e[7]=s):s=e[7],s}function Pj(e){let t=(0,$.c)(95),{editorMode:n,onModeChange:r,activeTab:i,onActiveTabChange:a}=e,{activeDocName:o,activeProvider:s,activeTarget:c,recycleDocument:l,docPanelMode:u,docPanelExpandSignal:d}=Pe(),{openDocumentTransition:f}=Ge(),{requestAddProperty:p}=GO(),m=pk(s,o),h=mk(s),g=h===`connected`||h===`synced`,_=(0,Q.useDeferredValue)(o),v=c?.kind===`missing`,y=!!o&&c?.kind!==`folder`,b=v?`Start writing to create this page`:void 0,x=Ub(),[S,C]=(0,Q.useState)(!1),{layout:w,autoCollapse:T}=ZO(),E=w===`sheet`,[D,O]=(0,Q.useState)(!1),k=(0,Q.useRef)(!1),A,j;t[0]!==T||t[1]!==w||t[2]!==x?(A=()=>{w===`panel`&&(T?(k.current=!1,x.current?.collapse()):k.current||x.current?.expand())},j=[T,w,x],t[0]=T,t[1]=w,t[2]=x,t[3]=A,t[4]=j):(A=t[3],j=t[4]),(0,Q.useEffect)(A,j);let M,N;t[5]!==E||t[6]!==a||t[7]!==x?(M=()=>{let e=e=>{a(e),E?O(!0):(k.current=!1,x.current?.expand())},t=sf();return t&&e(t),lf(t=>{sf(),e(t)})},N=[E,a,x],t[5]=E,t[6]=a,t[7]=x,t[8]=M,t[9]=N):(M=t[8],N=t[9]),(0,Q.useEffect)(M,N);let P,F;t[10]!==d||t[11]!==E||t[12]!==x?(P=()=>{d!==0&&(E?O(!0):(k.current=!1,x.current?.expand()))},F=[d,E,x],t[10]=d,t[11]=E,t[12]=x,t[13]=P,t[14]=F):(P=t[13],F=t[14]),(0,Q.useEffect)(P,F);let I=(0,Q.useRef)(null),[L,R]=(0,Q.useState)(null),z,B;if(t[15]===o?(z=t[16],B=t[17]):(z=()=>{if(o&&o!==I.current){let e=I.current;I.current=o,R(e)}},B=[o],t[15]=o,t[16]=z,t[17]=B),(0,Q.useEffect)(z,B),c?.kind===`folder`){let e;return t[18]===c.folderPath?e=t[19]:(e=(0,Z.jsx)(FO,{folderPath:c.folderPath}),t[18]=c.folderPath,t[19]=e),e}if(c?.kind===`asset`){let e;return t[20]!==c.assetPath||t[21]!==c.mediaKind?(e=(0,Z.jsx)(qb,{assetPath:c.assetPath,mediaKind:c.mediaKind}),t[20]=c.assetPath,t[21]=c.mediaKind,t[22]=e):e=t[22],e}if(!s||!o){if((typeof window<`u`?rr(window.location.hash):null)!==null){let e;return t[23]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Jb,{}),t[23]=e):e=t[23],e}let e;return t[24]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Rx,{}),t[24]=e):e=t[24],e}let V=n===`source`,H=!g,U=E?!D:S,W;t[25]!==o||t[26]!==p?(W=function(){o&&p(o)},t[25]=o,t[26]=p,t[27]=W):W=t[27];let G=W,K;t[28]!==S||t[29]!==E||t[30]!==x?(K=function(){E?O(Fj):S?(k.current=!1,x.current?.expand()):(k.current=!0,x.current?.collapse())},t[28]=S,t[29]=E,t[30]=x,t[31]=K):K=t[31];let q=K,ee=_??o,te=L??void 0,ne;t[32]===f?ne=t[33]:(ne=e=>{let t=Gn(e);window.location.hash===t?f(e):window.location.hash=t},t[32]=f,t[33]=ne);let re;t[34]!==b||t[35]!==V||t[36]!==l||t[37]!==ee||t[38]!==te||t[39]!==ne?(re=(0,Z.jsx)(gj,{activeDocName:ee,isSourceMode:V,editorPlaceholder:b,previousDocName:te,onNavigateBack:ne,onRecycle:l}),t[34]=b,t[35]=V,t[36]=l,t[37]=ee,t[38]=te,t[39]=ne,t[40]=re):re=t[40];let ie;t[41]!==o||t[42]!==_?(ie=Aj({activeDocName:o,deferredActiveDocName:_,mountResolved:o!==null&&ye(o),syncResolved:o!==null&&de(o)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(Jb,{}),o===null?null:(0,Z.jsx)(BO,{docName:o})]}):null,t[41]=o,t[42]=_,t[43]=ie):ie=t[43];let ae;t[44]!==re||t[45]!==ie?(ae=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[re,ie]}),t[44]=re,t[45]=ie,t[46]=ae):ae=t[46];let oe=!V,se;t[47]!==V||t[48]!==r||t[49]!==G||t[50]!==U||t[51]!==H||t[52]!==oe||t[53]!==q?(se=(0,Z.jsx)(kj,{isSourceMode:V,sourceDisabled:H,onModeChange:r,showAddPropertyButton:oe,onAddProperty:G,showPanelOpen:U,onTogglePanel:q}),t[47]=V,t[48]=r,t[49]=G,t[50]=U,t[51]=H,t[52]=oe,t[53]=q,t[54]=se):se=t[54];let ce;t[55]!==ae||t[56]!==se?(ce=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[ae,se]}),t[55]=ae,t[56]=se,t[57]=ce):ce=t[57];let le;t[58]!==y||t[59]!==m?(le=y&&(0,Z.jsx)(wj,{stats:m}),t[58]=y,t[59]=m,t[60]=le):le=t[60];let ue;t[61]!==ce||t[62]!==le?(ue=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[ce,le]}),t[61]=ce,t[62]=le,t[63]=ue):ue=t[63];let fe=ue;if(E){let e;t[64]===fe?e=t[65]:(e=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:fe}),t[64]=fe,t[65]=e);let n;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(y_,{className:`sr-only`,children:(0,Z.jsx)(b_,{children:`Document panel`})}),t[66]=n):n=t[66];let r;t[67]!==o||t[68]!==i||t[69]!==u||t[70]!==V||t[71]!==a?(r=(0,Z.jsxs)(v_,{side:`right`,className:`flex w-80 sm:w-96 flex-col gap-0 p-0`,children:[n,(0,Z.jsx)(Xv,{docName:o,isSourceMode:V,activeTab:i,onActiveTabChange:a,mode:u})]}),t[67]=o,t[68]=i,t[69]=u,t[70]=V,t[71]=a,t[72]=r):r=t[72];let s;t[73]!==D||t[74]!==r?(s=(0,Z.jsx)(h_,{open:D,onOpenChange:O,children:r}),t[73]=D,t[74]=r,t[75]=s):s=t[75];let c;return t[76]!==e||t[77]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[e,s]}),t[76]=e,t[77]=s,t[78]=c):c=t[78],c}let pe;t[79]===fe?pe=t[80]:(pe=(0,Z.jsx)(qO,{minSize:`30%`,defaultSize:`75%`,children:fe}),t[79]=fe,t[80]=pe);let J;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Z.jsx)(JO,{withHandle:!0}),t[81]=J):J=t[81];let me;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>C(e.asPercentage===0),t[82]=me):me=t[82];let he;t[83]!==o||t[84]!==i||t[85]!==u||t[86]!==V||t[87]!==a?(he=(0,Z.jsx)(Xv,{docName:o,isSourceMode:V,activeTab:i,onActiveTabChange:a,mode:u}),t[83]=o,t[84]=i,t[85]=u,t[86]=V,t[87]=a,t[88]=he):he=t[88];let ge;t[89]!==x||t[90]!==he?(ge=(0,Z.jsx)(qO,{panelRef:x,defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,collapsible:!0,collapsedSize:0,onResize:me,className:`flex flex-col bg-muted/20`,children:he}),t[89]=x,t[90]=he,t[91]=ge):ge=t[91];let _e;return t[92]!==pe||t[93]!==ge?(_e=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,Z.jsxs)(KO,{orientation:`horizontal`,children:[pe,J,ge]})}),t[92]=pe,t[93]=ge,t[94]=_e):_e=t[94],_e}function Fj(e){return!e}var Ij=1280;function Lj(){let e=(0,$.c)(2),[t,n]=(0,Q.useState)(Rj),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(max-width: ${Ij-1}px)`),t=()=>{n(window.innerWidth<Ij)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i),t}function Rj(){return window.innerWidth<Ij}function zj(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function Bj(e){let{value:t,unit:n}=zj(e);return n===`rem`?t*16:t}function Vj(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var Hj=3600*24*7;function Uj(e){let t=(0,$.c)(28),{direction:n,currentWidth:r,onResize:i,onToggle:a,isCollapsed:o,minResizeWidth:s,maxResizeWidth:c,enableToggle:l,enableAutoCollapse:u,autoCollapseThreshold:d,expandThreshold:f,enableDrag:p,setIsDraggingRail:m,widthCookieName:h,widthCookieMaxAge:g,isNested:_}=e,v=n===void 0?`right`:n,y=o===void 0?!1:o,b=s===void 0?`14rem`:s,x=c===void 0?`24rem`:c,S=l===void 0?!0:l,C=u===void 0?!0:u,w=d===void 0?1.5:d,T=f===void 0?.2:f,E=p===void 0?!0:p,D=m===void 0?Wj:m,O=g===void 0?Hj:g,k=_===void 0?!1:_,A=(0,Q.useRef)(null),j=(0,Q.useRef)(0),M=(0,Q.useRef)(0),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(0),L=(0,Q.useRef)(!1),R=(0,Q.useRef)(0),z=(0,Q.useRef)(0),B=(0,Q.useRef)(null),V=(0,Q.useRef)(r),H=(0,Q.useRef)(y),U,W;t[0]===r?(U=t[1],W=t[2]):(U=()=>{V.current=r},W=[r],t[0]=r,t[1]=U,t[2]=W),(0,Q.useEffect)(U,W);let G,K;t[3]===y?(G=t[4],K=t[5]):(G=()=>{H.current=y},K=[y],t[3]=y,t[4]=G,t[5]=K),(0,Q.useEffect)(G,K);let q=Bj(b),ee;t[6]===x?ee=t[7]:(ee=Bj(x),t[6]=x,t[7]=ee);let te=ee,ne;t[8]!==E||t[9]!==k?(ne=function(e){P.current=!0,E&&(j.current=H.current?0:Bj(V.current),M.current=e.clientX,I.current=e.clientX,F.current=null,L.current=!1,R.current=0,z.current=0,B.current=k&&A.current?A.current.getBoundingClientRect():null,e.preventDefault())},t[8]=E,t[9]=k,t[10]=ne):ne=t[10];let re=ne,ie,ae;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==te||t[18]!==q||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(ie=()=>{let e=function(e){h&&(document.cookie=`${h}=${e}; path=/; max-age=${O}`)},t=function(e,t){return v===`left`?e<t:e>t},n=function(e,t,n,r){if(k&&r){let r=e.clientX-t;return v===`left`?n-r:n+r}return v===`left`?window.innerWidth-e.clientX:e.clientX},r=function(r){if(!P.current)return;let o=Math.abs(r.clientX-M.current);if(!N.current&&o>5&&(N.current=!0,D(!0)),N.current){let{unit:o}=zj(V.current),s=B.current;k&&A.current&&(s=A.current.getBoundingClientRect());let c=t(r.clientX,I.current)?`expand`:`collapse`;F.current!==c&&(F.current=c),z.current=Math.abs(r.clientX-I.current);let l=Date.now();if(L.current&&l-R.current>200&&(L.current=!1),!L.current){if(C&&a&&!H.current){let e=n(r,M.current,j.current,s),t=!1;if(w<=1)t=e<=q*w;else if(e<=q){let n=q*(w-1);t=q-e>=n}if(c===`collapse`&&t){a(),I.current=r.clientX,L.current=!0,R.current=l;return}}if(a&&H.current&&c===`expand`&&z.current>q*T){a();let t=n(r,M.current,j.current,s),c=Math.max(q,Math.min(te,t)),u=Vj(o===`rem`?c/16:c,o);i(u),e(u),I.current=r.clientX,L.current=!0,R.current=l;return}}if(H.current)return;let u=n(r,M.current,j.current,s),d=Math.max(q,Math.min(te,u)),f=Vj(o===`rem`?d/16:d,o);i(f),e(f)}},o=function(){P.current&&(!N.current&&a&&S&&a(),N.current=!1,P.current=!1,F.current=null,I.current=0,L.current=!1,R.current=0,z.current=0,B.current=null,D(!1))};return document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)}},ae=[i,a,D,q,te,k,C,w,T,S,h,O,v],t[11]=w,t[12]=v,t[13]=C,t[14]=S,t[15]=T,t[16]=k,t[17]=te,t[18]=q,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=ie,t[25]=ae):(ie=t[24],ae=t[25]),(0,Q.useEffect)(ie,ae);let oe;return t[26]===re?oe=t[27]:(oe={dragRef:A,isDragging:N,handleMouseDown:re},t[26]=re,t[27]=oe),oe}function Wj(){}var Gj=`sidebar_state`,Kj=3600*24*7,qj=`18rem`,Jj=`3rem`,Yj=`\\`,Xj=`app-file-sidebar`,Zj=`14.625rem`,Qj=`22rem`,$j=`sidebar_width`,eM=/^\d+(?:\.\d+)?(?:rem|px)$/,tM=Q.createContext(null);function nM(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${$j}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return eM.test(n)?n:e}function rM(){let e=Q.use(tM);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function iM(e){let t=(0,$.c)(53),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,defaultWidth:l,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=c===void 0?!0:c,d=l===void 0?qj:l,f=Lj(),p;t[9]===d?p=t[10]:(p=()=>nM(d),t[9]=d,t[10]=p);let[m,h]=Q.useState(p),[g,_]=Q.useState(!1),v=Q.useRef(g),[y,b]=Q.useState(!1),[x,S]=Q.useState(!1),[C,w]=Q.useState(u),T=i??C,E;t[11]!==T||t[12]!==o?(E=e=>{let t=typeof e==`function`?e(T):e;o?o(t):w(t),document.cookie=`${Gj}=${t}; path=/; max-age=${Kj}`},t[11]=T,t[12]=o,t[13]=E):E=t[13];let D=E,O;t[14]===D?O=t[15]:(O=function(){return window.innerWidth<1280?_(oM):D(aM)},t[14]=D,t[15]=O);let k=O,A;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(){window.innerWidth>=1280||v.current&&(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||S(!0))},t[16]=A):A=t[16];let j=A,M;t[17]===g?M=t[18]:(M=()=>{v.current=g},t[17]=g,t[18]=M),Q.useLayoutEffect(M);let N,P;t[19]===k?(N=t[20],P=t[21]):(N=()=>{let e=e=>{e.key===Yj&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),k())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},P=[k],t[19]=k,t[20]=N,t[21]=P),Q.useEffect(N,P);let F,I;t[22]!==f||t[23]!==g?(F=()=>{if(!f||!g)return;let e=e=>{e.key===`Escape`&&(document.querySelector(`[data-state="open"][role="dialog"], [data-state="open"][role="alertdialog"], [data-state="open"][role="menu"], [data-state="open"][role="listbox"], [data-radix-popper-content-wrapper] [data-state="open"]`)||_(!1))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},I=[f,g],t[22]=f,t[23]=g,t[24]=F,t[25]=I):(F=t[24],I=t[25]),Q.useEffect(F,I);let L=Q.useRef(f),R,z;t[26]!==f||t[27]!==T?(R=()=>{!L.current&&f&&_(T),L.current=f},z=[f,T],t[26]=f,t[27]=T,t[28]=R,t[29]=z):(R=t[28],z=t[29]),Q.useEffect(R,z);let B=f?g?`expanded`:`collapsed`:T?`expanded`:`collapsed`,V;t[30]!==y||t[31]!==f||t[32]!==T||t[33]!==g||t[34]!==D||t[35]!==x||t[36]!==B||t[37]!==k||t[38]!==m?(V={state:B,open:T,setOpen:D,isMobile:f,openMobile:g,setOpenMobile:_,toggleSidebar:k,width:m,setWidth:h,isDraggingRail:y,setIsDraggingRail:b,showPushPulse:x,setShowPushPulse:S,notifySidebarFileSelected:j},t[30]=y,t[31]=f,t[32]=T,t[33]=g,t[34]=D,t[35]=x,t[36]=B,t[37]=k,t[38]=m,t[39]=V):V=t[39];let H;t[40]!==s||t[41]!==m?(H={"--sidebar-width":m,"--sidebar-width-icon":Jj,...s},t[40]=s,t[41]=m,t[42]=H):H=t[42];let U=H,W;t[43]===r?W=t[44]:(W=X(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[43]=r,t[44]=W);let G;t[45]!==n||t[46]!==a||t[47]!==U||t[48]!==W?(G=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:U,className:W,...a,children:n}),t[45]=n,t[46]=a,t[47]=U,t[48]=W,t[49]=G):G=t[49];let K;return t[50]!==V||t[51]!==G?(K=(0,Z.jsx)(tM.Provider,{value:V,children:G}),t[50]=V,t[51]=G,t[52]=K):K=t[52],K}function aM(e){return!e}function oM(e){return!e}function sM(e){let t=(0,$.c)(51),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offcanvas`:s,{isMobile:d,state:f,openMobile:p,isDraggingRail:m}=rM();if(u===`none`){let e;t[7]===r?e=t[8]:(e=X(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e||t[12]!==l?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,"data-variant":l,className:e,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=l,t[13]=a):a=t[13],a}if(d){let e=p?`expanded`:`collapsed`,a=l===`floating`||l===`inset`?`p-2`:``,o;t[14]!==r||t[15]!==a?(o=X(`fixed inset-y-0 z-30 flex h-svh w-(--sidebar-width)`,`transition-transform duration-200 ease-linear motion-reduce:transition-none`,`data-[side=left]:left-0 data-[side=right]:right-0`,`group-data-[state=collapsed]:data-[side=left]:-translate-x-full`,`group-data-[state=collapsed]:data-[side=right]:translate-x-full`,a,r),t[14]=r,t[15]=a,t[16]=o):o=t[16];let s;t[17]===n?s=t[18]:(s=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[17]=n,t[18]=s);let u;t[19]!==i||t[20]!==c||t[21]!==o||t[22]!==s?(u=(0,Z.jsx)(`nav`,{id:Xj,"aria-label":`File sidebar`,"data-slot":`sidebar-container`,"data-side":c,className:o,...i,children:s}),t[19]=i,t[20]=c,t[21]=o,t[22]=s,t[23]=u):u=t[23];let d;return t[24]!==e||t[25]!==c||t[26]!==u||t[27]!==l?(d=(0,Z.jsx)(`div`,{className:`group peer text-sidebar-foreground`,"data-state":e,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-mobile":`true`,children:u}),t[24]=e,t[25]=c,t[26]=u,t[27]=l,t[28]=d):d=t[28],d}let h=f===`collapsed`?u:``,g=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,_;t[29]===g?_=t[30]:(_=X(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,g,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`),t[29]=g,t[30]=_);let v;t[31]===_?v=t[32]:(v=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:_}),t[31]=_,t[32]=v);let y=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,b;t[33]!==r||t[34]!==y?(b=X(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,y,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`,r),t[33]=r,t[34]=y,t[35]=b):b=t[35];let x;t[36]===n?x=t[37]:(x=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[36]=n,t[37]=x);let S;t[38]!==i||t[39]!==c||t[40]!==x||t[41]!==b?(S=(0,Z.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":c,className:b,...i,children:x}),t[38]=i,t[39]=c,t[40]=x,t[41]=b,t[42]=S):S=t[42];let C;return t[43]!==m||t[44]!==c||t[45]!==f||t[46]!==S||t[47]!==h||t[48]!==v||t[49]!==l?(C=(0,Z.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":f,"data-collapsible":h,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-dragging":m,children:[v,S]}),t[43]=m,t[44]=c,t[45]=f,t[46]=S,t[47]=h,t[48]=v,t[49]=l,t[50]=C):C=t[50],C}function cM(e){let t=(0,$.c)(16),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a,state:o}=rM(),s=o===`expanded`,c;t[4]===n?c=t[5]:(c=X(n),t[4]=n,t[5]=c);let l;t[6]!==r||t[7]!==a?(l=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=l):l=t[8];let u,d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(ae,{}),d=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[9]=u,t[10]=d):(u=t[9],d=t[10]);let f;return t[11]!==i||t[12]!==s||t[13]!==c||t[14]!==l?(f=(0,Z.jsxs)(zr,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,"aria-expanded":s,"aria-controls":Xj,className:c,onClick:l,...i,children:[u,d]}),t[11]=i,t[12]=s,t[13]=c,t[14]=l,t[15]=f):f=t[15],f}function lM(e){let t=(0,$.c)(24),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,enableDrag:a,enableToggle:o,onMouseDown:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?!0:a,c=o===void 0?!0:o,{toggleSidebar:l,setWidth:u,state:d,width:f,setIsDraggingRail:p}=rM(),m=d===`collapsed`,h;t[6]!==s||t[7]!==c||t[8]!==p||t[9]!==u||t[10]!==m||t[11]!==l||t[12]!==f?(h={direction:`right`,enableDrag:s,enableToggle:c,onResize:u,onToggle:l,currentWidth:f,isCollapsed:m,minResizeWidth:Zj,maxResizeWidth:Qj,setIsDraggingRail:p,widthCookieName:$j,widthCookieMaxAge:Kj},t[6]=s,t[7]=c,t[8]=p,t[9]=u,t[10]=m,t[11]=l,t[12]=f,t[13]=h):h=t[13];let{dragRef:g,handleMouseDown:_}=Uj(h),v;t[14]!==_||t[15]!==r?(v=e=>{r?.(e),e.defaultPrevented||_(e)},t[14]=_,t[15]=r,t[16]=v):v=t[16];let y;t[17]===n?y=t[18]:(y=X(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,`md:group-data-[variant=inset]:after:inset-y-5`,n),t[17]=n,t[18]=y);let b;return t[19]!==g||t[20]!==i||t[21]!==v||t[22]!==y?(b=(0,Z.jsx)(`button`,{ref:g,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onMouseDown:v,title:`Toggle Sidebar`,className:y,...i}),t[19]=g,t[20]=i,t[21]=v,t[22]=y,t[23]=b):b=t[23],b}function uM(e){let t=(0,$.c)(21),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,onClick:i,onAnimationEnd:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{isMobile:o,openMobile:s,setOpenMobile:c,showPushPulse:l,setShowPushPulse:u}=rM(),d;t[5]!==o||t[6]!==i||t[7]!==s||t[8]!==c?(d=e=>{i?.(e),!e.defaultPrevented&&(!o||!s||e.target?.closest(`[data-sidebar="trigger"]`)||c(!1))},t[5]=o,t[6]=i,t[7]=s,t[8]=c,t[9]=d):d=t[9];let f=d,p;t[10]!==r||t[11]!==u?(p=e=>{r?.(e),e.animationName===`sidebar-push-pulse`&&u(!1)},t[10]=r,t[11]=u,t[12]=p):p=t[12];let m=p,h=l?``:void 0,g;t[13]===n?g=t[14]:(g=X(`relative flex w-full flex-1 flex-col bg-background peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0 peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,`transition-transform duration-200 ease-linear motion-reduce:transition-none`,`peer-data-[mobile=true]:peer-data-[state=expanded]:translate-x-(--sidebar-width)`,n),t[13]=n,t[14]=g);let _;return t[15]!==m||t[16]!==f||t[17]!==a||t[18]!==h||t[19]!==g?(_=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,"data-push-pulse":h,onClick:f,onAnimationEnd:m,className:g,...a}),t[15]=m,t[16]=f,t[17]=a,t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function dM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function fM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function pM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var gM=Or(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-hover data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-hover hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-hover hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function _M(e){let t=(0,$.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?kr:`button`,{isMobile:m,state:h}=rM(),g;t[8]!==n||t[9]!==f||t[10]!==d?(g=X(gM({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==g?(_=(0,Z.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:g,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=g,t[17]=_):_=t[17];let v=_;if(!c)return v;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let y;t[20]===v?y=t[21]:(y=(0,Z.jsx)(Ja,{asChild:!0,children:v}),t[20]=v,t[21]=y);let b=h!==`collapsed`||m,x;t[22]!==b||t[23]!==c?(x=(0,Z.jsx)(Ya,{side:`right`,align:`center`,hidden:b,...c}),t[22]=b,t[23]=c,t[24]=x):x=t[24];let S;return t[25]!==y||t[26]!==x?(S=(0,Z.jsxs)(Za,{children:[y,x]}),t[25]=y,t[26]=x,t[27]=S):S=t[27],S}function vM(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.kind!==i.kind)return!1;if(r.kind===`human`&&i.kind===`human`){if(r.clientId!==i.clientId||r.mode!==i.mode||r.tabCount!==i.tabCount)return!1;let e=r.user,t=i.user;if(e.name!==t.name||e.color!==t.color||e.icon!==t.icon)return!1}else if(r.kind===`agent`&&i.kind===`agent`){if(r.agentId!==i.agentId)return!1;let e=r.presence,t=i.presence;if(e.displayName!==t.displayName||e.icon!==t.icon||e.color!==t.color||e.currentDoc!==t.currentDoc||e.mode!==t.mode)return!1}}return!0}function yM(e){let t=new Map;for(let n of e){let e=n.user.principalId;if(typeof e==`string`&&e.length>0){let r=t.get(e);r?r.push(n):t.set(e,[n])}}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>Math.min(e,t.clientId),1/0);n.set(e,{repClientId:t,count:r.length})}let r=[];for(let t of e){let e=t.user.principalId;if(typeof e==`string`&&e.length>0){let i=n.get(e);i&&i.repClientId===t.clientId&&r.push({...t,tabCount:i.count})}else r.push({...t,tabCount:1})}return r}var bM=1e3,xM=!1;function SM(e,t,n){let r=(0,$.c)(9),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={current:[],crossDoc:[]},r[0]=i):i=r[0];let[a,o]=(0,Q.useState)(i),s;r[1]!==n||r[2]!==e?.awareness||r[3]!==t?.awareness?(s=()=>{let r=e?.awareness,i=t?.awareness,a;i==null?a=void 0:ti(i)?a=i:(a=void 0,xM||(xM=!0,console.warn(`[agent-presence] __system__ provider awareness missing getStates() — presence bar will render without agent peers`)));let s=()=>{let e=[];if(r)for(let[t,n]of r.getStates().entries()){let r=n;if(!r.user||typeof r.user!=`object`)continue;let i=r.user;i.type===`human`&&e.push({kind:`human`,clientId:t,user:i,mode:r.mode??`wysiwyg`,tabCount:1})}let t=yM(e),{current:i,crossDoc:s}=a?Xr(a,n,Date.now()):{current:[],crossDoc:[]},c=CM,l=i.map(c),u=s.map(c),d=[...t,...l],f=u;o(e=>vM(e.current,d)&&vM(e.crossDoc,f)?e:{current:d,crossDoc:f})};s();let c=()=>s(),l=()=>s();r?.on(`change`,c),t?.awareness?.on(`change`,l);let u=setInterval(s,bM);return()=>{r?.off(`change`,c),t?.awareness?.off(`change`,l),clearInterval(u)}},r[1]=n,r[2]=e?.awareness,r[3]=t?.awareness,r[4]=s):s=r[4];let c;return r[5]!==n||r[6]!==e||r[7]!==t?(c=[e,t,n],r[5]=n,r[6]=e,r[7]=t,r[8]=c):c=r[8],(0,Q.useEffect)(s,c),a}function CM(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var wM=`sync-status`;function TM(e,t){let n=(0,$.c)(4),r=(0,Q.useRef)(!1),i=(0,Q.useRef)(!1),a=(0,Q.useRef)(t),o,s;n[0]!==t||n[1]!==e?(o=()=>{a.current!==t&&(a.current=t,r.current=!1,i.current=!1),t&&(e===`synced`&&(r.current=!0),e===`disconnected`&&r.current?(i.current=!0,Fa.warning(`Connection lost — keep this tab open, your edits will sync when reconnected`,{id:wM,duration:1/0})):i.current&&e===`synced`&&(i.current=!1,Fa.success(`Reconnected`,{id:wM,duration:3e3})))},s=[e,t],n[0]=t,n[1]=e,n[2]=o,n[3]=s):(o=n[2],s=n[3]),(0,Q.useEffect)(o,s)}var EM=4,DM=3,OM={Bird:Yo,Cat:ts,Dog:ps,Fish:vs,Mouse:Us,Rabbit:Hs,Shrimp:Ys,Snail:Xs,Squirrel:ec,Turtle:ic};Object.freeze([...Object.keys(OM)]);function kM(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(OM,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var AM={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function jM(e){let t=(0,$.c)(20),{user:n,mode:r,tabCount:i}=e,a=kM(n),o=a.kind===`animal`?OM[a.animal]:void 0,s;t[0]===n.name?s=t[1]:(s=On(n.name),t[0]=n.name,t[1]=s);let c=s,l;t[2]===n.color?l=t[3]:(l=vr(n.color),t[2]=n.color,t[3]=l);let u=l,d=i>1?`${n.name} · ${i} tabs`:n.name,f=i>1?`${n.name}, ${i} concurrent tabs`:n.name,p;t[4]===n.color?p=t[5]:(p={backgroundColor:n.color},t[4]=n.color,t[5]=p);let m;t[6]!==o||t[7]!==u||t[8]!==c?(m=o?(0,Z.jsx)(o,{size:18,color:u,strokeWidth:1.5}):(0,Z.jsx)(`span`,{className:`font-mono text-2xs font-semibold leading-none`,style:{color:u},children:c}),t[6]=o,t[7]=u,t[8]=c,t[9]=m):m=t[9];let h;t[10]!==f||t[11]!==r||t[12]!==p||t[13]!==m?(h=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(`div`,{"data-presence-badge":`human`,"data-presence-mode":r,role:`img`,"aria-label":f,className:`inline-flex size-7 shrink-0 cursor-default items-center justify-center rounded-full ring-2 ring-background`,style:p,children:m})}),t[10]=f,t[11]=r,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===d?g=t[16]:(g=(0,Z.jsx)(Ya,{children:d}),t[15]=d,t[16]=g);let _;return t[17]!==h||t[18]!==g?(_=(0,Z.jsxs)(Za,{children:[h,g]}),t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function MM(e){let t=AM[e.icon];return e.displayName||t||`Agent`}function NM(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(e===`writing`),i=(0,Q.useRef)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`writing`){i.current!==null&&(clearTimeout(i.current),i.current=null),r(!0);return}return i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r(!1)},600),()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)}},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),n}function PM(e){let t=(0,$.c)(36),{participant:n,crossDoc:r,scoped:i,onClickAgent:a}=e,{presence:o,agentId:s}=n,c;t[0]===o?c=t[1]:(c=MM(o),t[0]=o,t[1]=c);let l=c,u=NM(o.mode),d=!r&&u,f=i?`ring-primary ring-offset-2 ring-offset-background`:`ring-background`,p=d&&!i?`ring-primary/40 animate-pulse`:``,m;t[2]!==f||t[3]!==p?(m=[`inline-flex size-7 shrink-0 items-center justify-center rounded-full ring-2 cursor-pointer`,f,p].filter(Boolean),t[2]=f,t[3]=p,t[4]=m):m=t[4];let h=m.join(` `),g=r?`true`:void 0,_=i?`true`:void 0,v;t[5]!==o.mode||t[6]!==g||t[7]!==_?(v={"data-presence-badge":`agent`,"data-presence-mode":o.mode,"data-presence-crossdoc":g,"data-presence-scoped":_},t[5]=o.mode,t[6]=g,t[7]=_,t[8]=v):v=t[8];let y=v,b=r&&o.currentDoc?`Open activity panel for ${l}, editing ${o.currentDoc}`:`Open activity panel for ${l}`,x;t[9]===o.color?x=t[10]:(x={backgroundColor:o.color},t[9]=o.color,t[10]=x);let S;t[11]!==s||t[12]!==a?(S=()=>a(s),t[11]=s,t[12]=a,t[13]=S):S=t[13];let C;t[14]===o.icon?C=t[15]:(C=(0,Z.jsx)($r,{icon:o.icon,width:16,height:16,className:`text-white`}),t[14]=o.icon,t[15]=C);let w;t[16]!==b||t[17]!==y||t[18]!==h||t[19]!==C||t[20]!==x||t[21]!==S?(w=(0,Z.jsx)(`button`,{type:`button`,...y,"aria-label":b,className:h,style:x,onClick:S,children:C}),t[16]=b,t[17]=y,t[18]=h,t[19]=C,t[20]=x,t[21]=S,t[22]=w):w=t[22];let T=w,E;t[23]===T?E=t[24]:(E=(0,Z.jsx)(Ja,{asChild:!0,children:T}),t[23]=T,t[24]=E);let D;t[25]===l?D=t[26]:(D=(0,Z.jsx)(`span`,{className:`font-medium`,children:l}),t[25]=l,t[26]=D);let O;t[27]!==r||t[28]!==o.currentDoc?(O=r&&o.currentDoc?(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`editing [[`,o.currentDoc,`]]`]}):null,t[27]=r,t[28]=o.currentDoc,t[29]=O):O=t[29];let k;t[30]!==D||t[31]!==O?(k=(0,Z.jsxs)(Ya,{className:`flex flex-col gap-0.5`,children:[D,O]}),t[30]=D,t[31]=O,t[32]=k):k=t[32];let A;return t[33]!==E||t[34]!==k?(A=(0,Z.jsxs)(Za,{children:[E,k]}),t[33]=E,t[34]=k,t[35]=A):A=t[35],A}function FM(e){let t=(0,$.c)(18),{count:n,remainder:r,crossDoc:i,scopedAgentId:a,onClickAgent:o}=e,s=i?`true`:void 0,c=`${n} more ${i?`cross-doc `:``}${n===1?`participant`:`participants`}`,l;t[0]!==n||t[1]!==s||t[2]!==c?(l=(0,Z.jsx)(N,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`presence-overflow`,"data-presence-crossdoc":s,className:`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs ring-2 ring-background hover:bg-muted/80`,"aria-label":c,children:[`+`,n]})}),t[0]=n,t[1]=s,t[2]=c,t[3]=l):l=t[3];let u;if(t[4]!==i||t[5]!==o||t[6]!==r||t[7]!==a){let e;t[9]!==i||t[10]!==o||t[11]!==a?(e=e=>e.kind===`human`?(0,Z.jsx)(jM,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(PM,{participant:e,crossDoc:i,scoped:a===e.agentId,onClickAgent:o},e.agentId),t[9]=i,t[10]=o,t[11]=a,t[12]=e):e=t[12],u=r.map(e),t[4]=i,t[5]=o,t[6]=r,t[7]=a,t[8]=u}else u=t[8];let d;t[13]===u?d=t[14]:(d=(0,Z.jsx)(T,{align:`end`,className:`w-auto max-w-xs p-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:u})}),t[13]=u,t[14]=d);let f;return t[15]!==l||t[16]!==d?(f=(0,Z.jsxs)(x,{children:[l,d]}),t[15]=l,t[16]=d,t[17]=f):f=t[17],f}function IM(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(jM,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(PM,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function LM(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=Pe(),{current:s,crossDoc:c}=SM(t,r,n);TM(mk(t),n);let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,EM),n;e[6]===s?n=e[7]:(n=s.slice(EM),e[6]=s,e[7]=n);let r=n,u=c.slice(0,DM),d;e[8]===c?d=e[9]:(d=c.slice(DM),e[8]=c,e[9]=d);let f=d,p=i,m=a===`agent`?o:null,h;e[10]!==p||e[11]!==m?(h=e=>IM(e,p,!1,m),e[10]=p,e[11]=m,e[12]=h):h=e[12];let g=t.map(h),_;e[13]!==r||e[14]!==p||e[15]!==m?(_=r.length>0?(0,Z.jsx)(FM,{count:r.length,remainder:r,crossDoc:!1,scopedAgentId:m,onClickAgent:p}):null,e[13]=r,e[14]=p,e[15]=m,e[16]=_):_=e[16];let v;e[17]!==g||e[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-presence-section":`current`,children:[g,_]}),e[17]=g,e[18]=_,e[19]=v):v=e[19],l=(0,Z.jsxs)(`div`,{"data-slot":`presence-bar`,className:`flex items-center px-1 py-1.5`,children:[v,c.length>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`mx-2 h-4 w-px bg-border`,"aria-hidden":!0,"data-slot":`presence-divider`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 opacity-60 grayscale`,"data-presence-section":`crossdoc`,children:[u.map(e=>IM(e,p,!0,m)),f.length>0?(0,Z.jsx)(FM,{count:f.length,remainder:f,crossDoc:!0,scopedAgentId:m,onClickAgent:p}):null]})]}):null]}),e[0]=c,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l}else l=e[5];return l}function RM(e,t){return t.trim()}function zM(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function BM(e,t){let n=RM(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function VM(e,t,n=[]){if(t.length===0&&n.length===0)return e;let r=new Map(t.map(e=>[e.fromDocName,e.toDocName]));return e.map(e=>xr(e)?{...e,docName:r.get(e.docName)??e.docName}:wr(e)||En(e)?{...e,path:WM(e.path,n)}:e)}function HM(e,t,n){if(t.length===0&&!n)return e;let r=new Set(t);return e.filter(e=>xr(e)?!r.has(e.docName)&&!GM(e.docName,n):wr(e)||En(e)?!GM(e.path,n):!0)}function UM(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function WM(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function GM(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function KM(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(ul,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function qM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(dl,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function JM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(fl,{children:(0,Z.jsx)(pl,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function YM(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=X(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Z.jsx)(ml,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function XM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var ZM=Or(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function QM(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=X(ZM({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:$M,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function $M(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}Or(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function eN(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tN(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ao,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var nN=[`.md`,`.mdx`];function rN(e,t){let n=e.lastIndexOf(`/`),r=n<0?e:e.slice(n+1),i=`${r}${t}`;return n<0?{baseName:r,extension:t,label:i,prefix:``}:{baseName:r,extension:t,label:i,prefix:`${e.slice(0,n)}/`}}function iN(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function aN(e){let t=Gn(e);window.location.hash!==t&&(window.location.hash=t)}function oN(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function sN(e,t){let n=[t,...nN].filter((e,t,n)=>e&&n.indexOf(e)===t),r=e.toLowerCase(),i=n.find(t=>e.length>t.length&&r.endsWith(t.toLowerCase()));return i?e.slice(0,-i.length):e}function cN(e){let t=(0,$.c)(26),{children:n,closeTab:r,closeTabs:i,disabled:a,openTabs:o,tabId:s}=e;if(a!==void 0&&a)return n;let c;if(t[0]!==o||t[1]!==s){let e;t[3]===s?e=t[4]:(e=e=>e!==s,t[3]=s,t[4]=e),c=o.filter(e),t[0]=o,t[1]=s,t[2]=c}else c=t[2];let l=c,u;t[5]===n?u=t[6]:(u=(0,Z.jsx)(qM,{asChild:!0,children:n}),t[5]=n,t[6]=u);let d;t[7]!==r||t[8]!==s?(d=(0,Z.jsx)(YM,{onSelect:()=>r(s),children:`Close`}),t[7]=r,t[8]=s,t[9]=d):d=t[9];let f=l.length===0,p;t[10]!==i||t[11]!==l?(p=()=>{i(l)},t[10]=i,t[11]=l,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,Z.jsx)(YM,{disabled:f,onSelect:p,children:`Close others`}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]!==i||t[17]!==o?(h=(0,Z.jsx)(YM,{onSelect:()=>{i(o)},children:`Close all`}),t[16]=i,t[17]=o,t[18]=h):h=t[18];let g;t[19]!==d||t[20]!==m||t[21]!==h?(g=(0,Z.jsxs)(JM,{className:`min-w-40`,children:[d,m,h]}),t[19]=d,t[20]=m,t[21]=h,t[22]=g):g=t[22];let _;return t[23]!==u||t[24]!==g?(_=(0,Z.jsxs)(KM,{children:[u,g]}),t[23]=u,t[24]=g,t[25]=_):_=t[25],_}function lN(){let e=(0,$.c)(65),{activeDocName:t,activeTabId:n,activeNewTabId:r,activeTarget:i,activateTab:a,activateNewTab:o,closeAndClearForRename:s,closeNewTab:c,closeTab:l,closeTabs:u,isNewTabActive:d,newTabIds:f,openNewTab:p,openTabs:m,remapTabsForRename:h}=Pe(),{pageMeta:_}=hr(),v=(0,Q.useRef)(null),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(``),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(!1),D=(0,Q.useRef)(null),O=(0,Q.useRef)(!1),k=(0,Q.useRef)(!1),A=(0,Q.useRef)(null),j=(0,Q.useRef)(t),M;e[0]!==n||e[1]!==t||e[2]!==i?(M=n??(i?Ae(i):t?oe(t):null),e[0]=n,e[1]=t,e[2]=i,e[3]=M):M=e[3];let N=M,P;e[4]!==r||e[5]!==N||e[6]!==d||e[7]!==f||e[8]!==m?(P=d?`${r??`__new-tab__`}\u0000${m.join(`\0`)}\u0000${f.join(`\0`)}`:N?`${N}\u0000${m.join(`\0`)}`:``,e[4]=r,e[5]=N,e[6]=d,e[7]=f,e[8]=m,e[9]=P):P=e[9];let F=P,I,L;e[10]===t?(I=e[11],L=e[12]):(I=()=>{j.current=t},L=[t],e[10]=t,e[11]=I,e[12]=L),(0,Q.useEffect)(I,L);let R,B;e[13]===F?(R=e[14],B=e[15]):(R=()=>{F&&(v.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},B=[F],e[13]=F,e[14]=R,e[15]=B),(0,Q.useEffect)(R,B);let V,H;e[16]===y?(V=e[17],H=e[18]):(V=()=>{y&&(D.current?.focus(),D.current?.select())},H=[y],e[16]=y,e[17]=V,e[18]=H),(0,Q.useEffect)(V,H);let U,W;e[19]!==m||e[20]!==y?(U=()=>{!y||m.includes(oe(y))||(k.current=!0,A.current=null,b(null),S(``),w(null),E(!1))},W=[m,y],e[19]=m,e[20]=y,e[21]=U,e[22]=W):(U=e[21],W=e[22]),(0,Q.useEffect)(U,W);let G,K,q,ee,te;if(e[23]!==a||e[24]!==N||e[25]!==s||e[26]!==l||e[27]!==u||e[28]!==T||e[29]!==m||e[30]!==_||e[31]!==h||e[32]!==C||e[33]!==x||e[34]!==y){let t=function(e){let t=e.split(`/`);k.current=!1,A.current=null,b(e),S(t[t.length-1]),w(null)},n=function(){k.current=!0,A.current=null,b(null),S(``),w(null),E(!1)},r=async function(){if(k.current){k.current=!1;return}if(O.current)return;let e=y;if(!e){n();return}let t=RM(`file`,sN(x,_.get(e)?.docExt??`.md`)),r=e.split(`/`),i=r[r.length-1];if(t===i){n();return}if(t===A.current){D.current?.focus();return}if(!zM(t)){w(`Name can’t be empty, ".", "..", or contain / or \\`),D.current?.focus();return}let a=BM({kind:`file`,path:e,name:i},t);O.current=!0,E(!0),w(null);try{let n=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:`file`,fromPath:e,toPath:a})});if(k.current){E(!1),O.current=!1;return}let r=await z(n,`Server error (HTTP ${n.status})`);if(!r.ok){w(r.title),E(!1),O.current=!1,A.current=t,D.current?.focus();return}let i=g(un,r.body,`rename-path:tab`,{renamed:[]}).renamed,o=j.current,c=UM(o,i);await Promise.all(i.flatMap(e=>[s(e.fromDocName),s(e.toDocName)])),h(i),zn([`files`,`backlinks`,`graph`]),k.current=!0,b(null),S(``),w(null),E(!1),O.current=!1,A.current=null,c&&c!==o&&aN(c)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:a,normalized:t}),w(`Network error — please try again`),E(!1),O.current=!1,A.current=t,D.current?.focus()}};G=typeof window<`u`&&window.okDesktop!=null,K=v,e[40]===Symbol.for(`react.memo_cache_sentinel`)?(q=X(`pl-2 flex h-12 min-w-0 touch-manipulation flex-1 items-center gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain scroll-fade-mask-x [scrollbar-width:none]`,G&&`[-webkit-app-region:drag]`),e[40]=q):q=e[40],ee=oN,te=m.map(e=>{let i=Xe(e),o=e===N;if(i.kind===`folder`){let{baseName:t,label:n,prefix:r}=rN(i.folderPath,`/`),s=`${r}${n}`;return(0,Z.jsx)(cN,{tabId:e,openTabs:m,closeTab:l,closeTabs:u,children:(0,Z.jsxs)(`div`,{role:`presentation`,"data-active-tab":o?`true`:void 0,className:X(`group flex min-w-28 max-w-64 shrink-0 items-center overflow-hidden rounded-lg border border-b-transparent py-1.5 relative`,o?`tab-bottom-flares -mb-px self-end pb-3.5 border-border border-b-background bg-background text-foreground rounded-b-none overflow-visible`:`border-transparent text-muted-foreground hover:bg-muted/70 hover:text-foreground`,G&&`[-webkit-app-region:no-drag]`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),l(e))},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":s,title:s,className:`flex h-full min-w-0 flex-1 items-center gap-1.5 overflow-hidden px-2 text-left text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>{a(e)},children:[(0,Z.jsx)(xe,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),r?(0,Z.jsx)(`span`,{className:X(`min-w-0 flex-1 truncate`,o&&`text-muted-foreground`),children:r}):null,(0,Z.jsxs)(`span`,{className:X(`flex min-w-0 items-center font-medium`,r?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`/`})]})]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close ${s}`,className:X(`mr-1 flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,o?`opacity-100`:`opacity-0 hover:opacity-100 focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100`),onClick:t=>{t.stopPropagation(),l(e)},children:(0,Z.jsx)(Ma,{"aria-hidden":`true`,className:`size-3.5`})}),o?(0,Z.jsx)(`div`,{className:`z-0 h-2 w-[calc(100%+16px)] absolute -left-[8px] -bottom-[2px] bg-background pointer-events-none`}):null]})},e)}let s=i.docName,c=_.get(s)?.docExt??`.md`,{baseName:d,extension:f,label:p,prefix:h}=rN(s,c),g=`${h}${p}`,v=y===s,b=`editor-tab-rename-error-${iN(s)}`;return(0,Z.jsx)(cN,{disabled:v,tabId:e,openTabs:m,closeTab:l,closeTabs:u,children:(0,Z.jsxs)(`div`,{role:`presentation`,"data-active-tab":o?`true`:void 0,className:X(`group flex min-w-28 max-w-64 shrink-0 items-center overflow-hidden rounded-lg border border-b-transparent py-1.5 relative`,o?`tab-bottom-flares -mb-px self-end pb-3.5 border-border border-b-background bg-background text-foreground rounded-b-none overflow-visible`:`border-transparent text-muted-foreground hover:bg-muted/70 hover:text-foreground`,v&&C&&`border-destructive`,G&&`[-webkit-app-region:no-drag]`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),l(e))},children:[v?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(XM,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent`,children:[(0,Z.jsx)(tN,{ref:D,value:x,disabled:T,"aria-label":`Rename ${p}`,"aria-invalid":C?!0:void 0,"aria-describedby":C?b:void 0,"aria-busy":T||void 0,title:C??s,className:`h-full min-w-0 px-2 py-0 text-xs`,onChange:e=>{S(sN(e.target.value,c)),w(null),A.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),r()):e.key===`Escape`&&(e.preventDefault(),n())},onBlur:r}),(0,Z.jsx)(QM,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(eN,{className:`text-xs text-muted-foreground/60`,children:c})})]}),C?(0,Z.jsx)(`span`,{id:b,role:`alert`,className:`sr-only`,children:C}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":g,title:g,className:`flex h-full min-w-0 flex-1 items-center gap-1.5 overflow-hidden px-2 text-left text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>{a(e)},onDoubleClick:e=>{e.preventDefault(),e.stopPropagation(),t(s)},children:[h?(0,Z.jsx)(`span`,{className:X(`min-w-0 flex-1 truncate text-muted-foreground/60`,o&&`text-muted-foreground`),children:h}):null,(0,Z.jsxs)(`span`,{className:X(`flex min-w-0 items-center font-medium`,h?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:d}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:f})]})]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close ${g}`,className:X(`mr-1 flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,o?`opacity-100`:`opacity-0 hover:opacity-100 focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100`),onClick:t=>{t.stopPropagation(),l(e)},children:(0,Z.jsx)(Ma,{"aria-hidden":`true`,className:`size-3.5`})})]}),o?(0,Z.jsx)(`div`,{className:`z-0 h-2 w-[calc(100%+16px)] absolute -left-[8px] -bottom-[2px] bg-background pointer-events-none`}):null]})},e)}),e[23]=a,e[24]=N,e[25]=s,e[26]=l,e[27]=u,e[28]=T,e[29]=m,e[30]=_,e[31]=h,e[32]=C,e[33]=x,e[34]=y,e[35]=G,e[36]=K,e[37]=q,e[38]=ee,e[39]=te}else G=e[35],K=e[36],q=e[37],ee=e[38],te=e[39];let ne;if(e[41]!==o||e[42]!==r||e[43]!==c||e[44]!==G||e[45]!==f){let t;e[47]!==o||e[48]!==r||e[49]!==c||e[50]!==G?(t=e=>{let t=e===r;return(0,Z.jsxs)(`div`,{role:`presentation`,"data-active-tab":t?`true`:void 0,className:X(`group flex min-w-28 max-w-64 shrink-0 items-center overflow-hidden rounded-lg border border-b-transparent py-1.5 relative`,t?`tab-bottom-flares -mb-px self-end pb-3.5 border-border border-b-background bg-background text-foreground rounded-b-none overflow-visible`:`border-transparent text-muted-foreground hover:bg-muted/70 hover:text-foreground`,G&&`[-webkit-app-region:no-drag]`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),c(e))},children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Activate new tab`,title:`New tab`,className:`flex h-full min-w-0 flex-1 items-center overflow-hidden px-2 text-left font-medium text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>o(e),children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:`New tab`})}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close new tab`,className:X(`mr-1 flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,t?`opacity-100`:`opacity-0 hover:opacity-100 focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100`),onClick:t=>{t.stopPropagation(),c(e)},children:(0,Z.jsx)(Ma,{"aria-hidden":`true`,className:`size-3.5`})}),t?(0,Z.jsx)(`div`,{className:`z-0 h-2 w-[calc(100%+16px)] absolute -left-[8px] -bottom-[2px] bg-background pointer-events-none`}):null]},e)},e[47]=o,e[48]=r,e[49]=c,e[50]=G,e[51]=t):t=e[51],ne=f.map(t),e[41]=o,e[42]=r,e[43]=c,e[44]=G,e[45]=f,e[46]=ne}else ne=e[46];let re;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(si,{"aria-hidden":`true`,className:`size-3.5`}),e[52]=re):re=e[52];let ie;e[53]===p?ie=e[54]:(ie=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`New tab`,className:`flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition hover:bg-muted/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:p,children:re})}),e[53]=p,e[54]=ie);let ae;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(Ya,{children:`New tab`}),e[55]=ae):ae=e[55];let se;e[56]===ie?se=e[57]:(se=(0,Z.jsxs)(Za,{children:[ie,ae]}),e[56]=ie,e[57]=se);let ce;return e[58]!==K||e[59]!==q||e[60]!==ee||e[61]!==te||e[62]!==ne||e[63]!==se?(ce=(0,Z.jsxs)(`div`,{ref:K,className:q,onWheel:ee,children:[te,ne,se]}),e[58]=K,e[59]=q,e[60]=ee,e[61]=te,e[62]=ne,e[63]=se,e[64]=ce):ce=e[64],ce}function uN(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`LinkedIn`}),r=(0,Z.jsx)(`path`,{d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function dN(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`X (Twitter)`}),r=(0,Z.jsx)(`path`,{d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var fN=[{label:`Documentation`,href:`https://openknowledge.ai/docs`,icon:f},{label:`Homepage`,href:`https://openknowledge.ai/`,icon:Ta},{label:`Twitter / X`,href:`https://x.com/inkeep`,icon:dN},{label:`LinkedIn`,href:`https://www.linkedin.com/company/inkeep/`,icon:uN}],pN=()=>{let e=(0,$.c)(13),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(!1),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(N,{asChild:!0,children:(0,Z.jsxs)(zr,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[(0,Z.jsx)(ut,{className:`size-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Help & resources`})]})})}),(0,Z.jsx)(Ya,{children:`Help & resources`})]}),e[0]=a):a=e[0];let o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:`Setup`}),e[1]=o):o=e[1];let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{i(!1),n(!0)},e[2]=s):s=e[2];let c,l;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`ul`,{className:`mb-3 space-y-0.5`,children:(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:s,className:`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`,children:[(0,Z.jsx)(di,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Z.jsx)(`span`,{children:`Install for Claude Chat & Cowork`})]})})}),l=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:`Resources`}),e[3]=c,e[4]=l):(c=e[3],l=e[4]);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsxs)(T,{align:`end`,className:`w-64 p-3`,children:[o,c,l,(0,Z.jsx)(`nav`,{"aria-label":`Help and resources`,children:(0,Z.jsx)(`ul`,{className:`space-y-0.5`,children:fN.map(mN)})})]}),e[5]=u):u=e[5];let d;e[6]===r?d=e[7]:(d=(0,Z.jsxs)(x,{open:r,onOpenChange:i,children:[a,u]}),e[6]=r,e[7]=d);let f;e[8]===t?f=e[9]:(f=(0,Z.jsx)(sa,{open:t,onOpenChange:n}),e[8]=t,e[9]=f);let p;return e[10]!==d||e[11]!==f?(p=(0,Z.jsxs)(Z.Fragment,{children:[d,f]}),e[10]=d,e[11]=f,e[12]=p):p=e[12],p};function mN(e){let{label:t,href:n,icon:r}=e;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>xa(e,n),onAuxClick:e=>xa(e,n),className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`,children:[(0,Z.jsx)(r,{"aria-hidden":`true`,className:`size-4 shrink-0`}),t]})},n)}var hN={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function gN(e){let t=(0,$.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=nn(),s=hN[r],c=s?(o===`dark`?yn[s]:void 0)??Gt[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u=l,d=c&&`[&_*]:![color:var(--ok-brand-color)]`,f;t[8]!==n||t[9]!==d?(f=X(d,n),t[8]=n,t[9]=d,t[10]=f):f=t[10];let p=f;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==p||t[12]!==u||t[13]!==i?(e=(0,Z.jsx)(Gr,{style:u,className:p,...i}),t[11]=p,t[12]=u,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==p||t[16]!==u||t[17]!==i?(e=(0,Z.jsx)(Wr,{style:u,className:p,...i}),t[15]=p,t[16]=u,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==p||t[20]!==u||t[21]!==i?(e=(0,Z.jsx)(Zr,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}function _N(e){let{installState:t}=e;return t.installed===null?`Detecting`:t.installed===!1?`Not installed`:null}function vN(e){let{target:t,installState:n}=e;if(n.installed===null)return{enabled:!1,tooltip:null};if(n.installed===!1){let e=t.appBrandName??t.displayName;return{enabled:!1,tooltip:{message:`Requires ${e}.`,installAction:{label:`Install ${e} →`,url:t.installUrl},...t.hasWebFallback?{webFallback:{label:`Open in claude.ai →`,url:``}}:{}}}}return{enabled:!0,tooltip:null}}function yN(e){return wn(e)}function bN(e){return`Opened ${e} in your browser.`}var xN=`claude.ai`;async function SN(e,t=om){(await t(wn(e))).ok?Fa.success(bN(xN)):Fa.error(`Couldn't open ${xN} in your browser.`)}function CN(e){let t=(0,$.c)(73),{target:n,installState:r,isElectronHost:i,prompt:a,onSelect:o}=e,s=e.openExternal??om,c=e.onWebFallbackSuccess??TN,l=e.onWebFallbackError??wN,u;t[0]!==r||t[1]!==i||t[2]!==n?(u=vN({target:n,installState:r,isElectronHost:i}),t[0]=r,t[1]=i,t[2]=n,t[3]=u):u=t[3];let d=u,f;t[4]!==r||t[5]!==i||t[6]!==n?(f=_N({target:n,installState:r,isElectronHost:i}),t[4]=r,t[5]=i,t[6]=n,t[7]=f):f=t[7];let p=f,m;t[8]!==s||t[9]!==d.tooltip?(m=()=>{d.tooltip&&s(d.tooltip.installAction.url)},t[8]=s,t[9]=d.tooltip,t[10]=m):m=t[10];let h=m,g;t[11]!==l||t[12]!==c||t[13]!==s||t[14]!==a||t[15]!==n?(g=()=>{(async()=>{let e=await s(yN(a));e.ok?c(n):l(n,e.detail??e.reason)})()},t[11]=l,t[12]=c,t[13]=s,t[14]=a,t[15]=n,t[16]=g):g=t[16];let _=g;if(d.enabled){let e=`open-in-agent-item-${n.id}`,r=`Open in ${n.displayName}`,i;t[17]===n.id?i=t[18]:(i=(0,Z.jsx)(gN,{id:n.id,"aria-hidden":`true`}),t[17]=n.id,t[18]=i);let a;t[19]===n.displayName?a=t[20]:(a=(0,Z.jsx)(`span`,{children:n.displayName}),t[19]=n.displayName,t[20]=a);let s;return t[21]!==o||t[22]!==e||t[23]!==r||t[24]!==i||t[25]!==a?(s=(0,Z.jsxs)(Ei,{onSelect:o,"data-testid":e,"aria-label":r,children:[i,a]}),t[21]=o,t[22]=e,t[23]=r,t[24]=i,t[25]=a,t[26]=s):s=t[26],s}if(!d.tooltip){let e=p?`Open in ${n.displayName}, ${p}`:`Open in ${n.displayName}`,r=`open-in-agent-item-${n.id}`,i;t[27]===n.id?i=t[28]:(i=(0,Z.jsx)(gN,{id:n.id,"aria-hidden":`true`}),t[27]=n.id,t[28]=i);let a;t[29]===n.displayName?a=t[30]:(a=(0,Z.jsx)(`span`,{className:`flex-1`,children:n.displayName}),t[29]=n.displayName,t[30]=a);let o;t[31]===p?o=t[32]:(o=p?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:p}):null,t[31]=p,t[32]=o);let s;return t[33]!==e||t[34]!==r||t[35]!==i||t[36]!==a||t[37]!==o?(s=(0,Z.jsxs)(Ei,{disabled:!0,"data-testid":r,"aria-label":e,children:[i,a,o]}),t[33]=e,t[34]=r,t[35]=i,t[36]=a,t[37]=o,t[38]=s):s=t[38],s}let v=p?`Open in ${n.displayName}, ${p}`:`Open in ${n.displayName}`,y=`open-in-agent-item-${n.id}`,b;t[39]===n.id?b=t[40]:(b=(0,Z.jsx)(gN,{id:n.id,"aria-hidden":`true`,className:`mr-2`}),t[39]=n.id,t[40]=b);let x;t[41]===n.displayName?x=t[42]:(x=(0,Z.jsx)(`span`,{className:`flex-1`,children:n.displayName}),t[41]=n.displayName,t[42]=x);let S;t[43]===p?S=t[44]:(S=p?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:p}):null,t[43]=p,t[44]=S);let C;t[45]!==v||t[46]!==y||t[47]!==b||t[48]!==x||t[49]!==S?(C=(0,Z.jsxs)(ta,{"data-testid":y,"data-row-disabled":``,"aria-label":v,children:[b,x,S]}),t[45]=v,t[46]=y,t[47]=b,t[48]=x,t[49]=S,t[50]=C):C=t[50];let w=`open-in-agent-submenu-${n.id}`,T=`open-in-agent-message-${n.id}`,E;t[51]!==d.tooltip.message||t[52]!==T?(E=(0,Z.jsx)(oi,{className:`font-normal text-muted-foreground text-xs`,"data-testid":T,children:d.tooltip.message}),t[51]=d.tooltip.message,t[52]=T,t[53]=E):E=t[53];let D;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(ui,{}),t[54]=D):D=t[54];let O=`open-in-agent-install-${n.id}`,k;t[55]===d.tooltip.installAction.label?k=t[56]:(k=(0,Z.jsx)(`span`,{children:d.tooltip.installAction.label}),t[55]=d.tooltip.installAction.label,t[56]=k);let A;t[57]!==h||t[58]!==O||t[59]!==k?(A=(0,Z.jsx)(Ei,{onSelect:h,"data-testid":O,children:k}),t[57]=h,t[58]=O,t[59]=k,t[60]=A):A=t[60];let j;t[61]!==_||t[62]!==d.tooltip.webFallback||t[63]!==n.id?(j=d.tooltip.webFallback?(0,Z.jsxs)(Ei,{onSelect:_,"data-testid":`open-in-agent-web-fallback-${n.id}`,"aria-label":`${d.tooltip.webFallback.label}, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:d.tooltip.webFallback.label}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser with prompt pre-filled`})]}):null,t[61]=_,t[62]=d.tooltip.webFallback,t[63]=n.id,t[64]=j):j=t[64];let M;t[65]!==E||t[66]!==A||t[67]!==j||t[68]!==w?(M=(0,Z.jsxs)(xi,{className:`min-w-[260px]`,"data-testid":w,children:[E,D,A,j]}),t[65]=E,t[66]=A,t[67]=j,t[68]=w,t[69]=M):M=t[69];let N;return t[70]!==M||t[71]!==C?(N=(0,Z.jsxs)(ci,{children:[C,M]}),t[70]=M,t[71]=C,t[72]=N):N=t[72],N}function wN(){}function TN(){}function EN(e){let t=(0,$.c)(60),{input:n}=e,{states:r,refresh:i}=Gm(),{dispatch:a}=Pm(),[o,s]=(0,Q.useState)(!1),c=typeof window<`u`&&window.okDesktop!=null,l;t[0]===i?l=t[1]:(l=e=>{s(e),e&&i()},t[0]=i,t[1]=l);let u=l,d=n===null,f;t[2]===n?f=t[3]:(f=n===null?``:Kn(n.docContext),t[2]=n,t[3]=f);let p=f,m;t[4]!==a||t[5]!==n?(m=e=>{n!==null&&a(e.id,n)},t[4]=a,t[5]=n,t[6]=m):m=t[6];let h=m,g,_,v,y,b,x,S,C,w,T,E,D;if(t[7]!==u||t[8]!==h||t[9]!==n||t[10]!==o||t[11]!==p||t[12]!==r||t[13]!==d){let e;t[26]===r?e=t[27]:(e=e=>r[e.id]?.installed===!0,t[26]=r,t[27]=e);let i=Ap.filter(e);v=r[`claude-cowork`]?.installed===!0;let a;t[28]!==n||t[29]!==p?(a=()=>{n!==null&&SN(p)},t[28]=n,t[29]=p,t[30]=a):a=t[30],y=a,_=Bi,D=o,b=u;let s;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Qr,{className:`size-4`}),t[31]=s):s=t[31];let l;t[32]===d?l=t[33]:(l=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(ii,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-sm`,"aria-label":`Edit with AI`,disabled:d,className:`text-muted-foreground`,"data-testid":`open-in-agent-trigger`,children:s})})}),t[32]=d,t[33]=l);let f;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(Ya,{children:`Edit with AI`}),t[34]=f):f=t[34],t[35]===l?x=t[36]:(x=(0,Z.jsxs)(Za,{children:[l,f]}),t[35]=l,t[36]=x),g=ba,S=`end`,C=`min-w-[220px]`,w=`open-in-agent-menu`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(oi,{className:`font-mono font-normal tracking-wide uppercase text-muted-foreground text-xs`,children:`Open in`}),t[37]=T):T=t[37];let m;t[38]!==h||t[39]!==p||t[40]!==r?(m=e=>{let t=r[e.id];return(0,Z.jsx)(CN,{target:e,installState:t,isElectronHost:c,prompt:p,onSelect:()=>h(e)},e.id)},t[38]=h,t[39]=p,t[40]=r,t[41]=m):m=t[41],E=i.map(m),t[7]=u,t[8]=h,t[9]=n,t[10]=o,t[11]=p,t[12]=r,t[13]=d,t[14]=g,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D}else g=t[14],_=t[15],v=t[16],y=t[17],b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25];let O;t[42]!==v||t[43]!==y||t[44]!==n?(O=v?null:(0,Z.jsxs)(Ei,{onSelect:y,disabled:n===null,"data-testid":`open-in-agent-claude-web-fallback`,"aria-label":`Open in claude.ai, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(nt,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in claude.ai →`}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser`})]}),t[42]=v,t[43]=y,t[44]=n,t[45]=O):O=t[45];let k;t[46]!==g||t[47]!==O||t[48]!==S||t[49]!==C||t[50]!==w||t[51]!==T||t[52]!==E?(k=(0,Z.jsxs)(g,{align:S,className:C,"data-testid":w,children:[T,E,O]}),t[46]=g,t[47]=O,t[48]=S,t[49]=C,t[50]=w,t[51]=T,t[52]=E,t[53]=k):k=t[53];let A;return t[54]!==_||t[55]!==b||t[56]!==x||t[57]!==k||t[58]!==D?(A=(0,Z.jsxs)(_,{open:D,onOpenChange:b,children:[x,k]}),t[54]=_,t[55]=b,t[56]=x,t[57]=k,t[58]=D,t[59]=A):A=t[59],A}var DN=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsxs)(zr,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,"data-testid":`header-settings-button`,onClick:ON,children:[(0,Z.jsx)(Js,{className:`size-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Settings`})]})}),(0,Z.jsx)(Ya,{children:`Settings`})]}),e[0]=t):t=e[0],t};function ON(){window.location.hash!==`#settings`&&(window.location.hash=jp)}function kN(e){if(!e)return`never`;let t=Date.now()-new Date(e).getTime();return t<6e4?`just now`:t<36e5?`${Math.floor(t/6e4)} min ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:new Date(e).toLocaleDateString()}async function AN(e){await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})})}function jN(e){let t=(0,$.c)(9),{status:n}=e;switch(n.state){case`dormant`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(os,{className:`size-3.5 text-muted-foreground`}),t[0]=e):e=t[0],e}case`idle`:{if(n.ahead>0||n.behind>0){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ws,{className:`size-3.5 text-muted-foreground`}),t[1]=e):e=t[1],e}let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(os,{className:`size-3.5 text-emerald-500`}),t[2]=e):e=t[2],e}case`fetching`:case`pulling`:case`pushing`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ws,{className:`size-3.5 text-muted-foreground animate-spin`}),t[3]=e):e=t[3],e}case`conflict`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Er,{className:`size-3.5 text-amber-500`}),t[4]=e):e=t[4],e}case`offline`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(as,{className:`size-3.5 text-muted-foreground`}),t[5]=e):e=t[5],e}case`auth-error`:{let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Fs,{className:`size-3.5 text-destructive`}),t[6]=e):e=t[6],e}case`disabled`:{let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Er,{className:`size-3.5 text-amber-500`}),t[7]=e):e=t[7],e}default:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(os,{className:`size-3.5 text-muted-foreground`}),t[8]=e):e=t[8],e}}}function MN(e){switch(e.state){case`idle`:return e.ahead>0?`↑${e.ahead}`:e.behind>0?`↓${e.behind}`:``;case`fetching`:case`pulling`:case`pushing`:return``;case`conflict`:return e.conflictCount>0?`${e.conflictCount}`:``;case`offline`:return``;case`auth-error`:return``;default:return``}}function NN(e){switch(e){case`dormant`:return`No git remote`;case`idle`:return`Synced`;case`fetching`:return`Fetching`;case`pulling`:return`Pulling`;case`pushing`:return`Pushing`;case`conflict`:return`Conflict`;case`offline`:return`Offline`;case`auth-error`:return`Sign in required`;case`disabled`:return`Sync disabled`;default:return e}}function PN(e){switch(e){case`external-changes-pending`:return`External changes pending`;case`dirty-tree`:return`Working tree has uncommitted changes`;case`detached-head`:return`Detached HEAD — checkout a branch to resume`;case`auth-error`:return`Sign in required`;case`protected-branch`:return`Protected branch — cannot push`;default:return e}}function FN(e){return e.syncEnabled?e.state===`idle`?e.ahead>0&&e.behind>0?`${e.ahead} ahead, ${e.behind} behind`:e.ahead>0?`${e.ahead} ahead`:e.behind>0?`${e.behind} behind`:`Synced`:e.state===`conflict`&&e.conflictCount>0?`${e.conflictCount} conflict${e.conflictCount===1?``:`s`}`:NN(e.state):`Sync off`}function IN(e){let t=(0,$.c)(76),{status:n,onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a}=e,{projectLocalConfig:o,projectLocalSynced:s}=ri(),c=o?.autoSync?.enabled??!1,{confirmOpen:l,setConfirmOpen:u,onToggleRequest:d,onConfirm:f}=gi(Pi()),p;t[0]===n?p=t[1]:(p=(0,Z.jsx)(jN,{status:n}),t[0]=n,t[1]=p);let m;t[2]===n.state?m=t[3]:(m=NN(n.state),t[2]=n.state,t[3]=m);let h;t[4]===m?h=t[5]:(h=(0,Z.jsx)(`span`,{className:`text-sm font-medium truncate`,children:m}),t[4]=m,t[5]=h);let g;t[6]!==p||t[7]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[p,h]}),t[6]=p,t[7]=h,t[8]=g):g=t[8];let _=!s,v=c?`Disable sync`:`Enable sync`,y;t[9]!==c||t[10]!==d||t[11]!==_||t[12]!==v?(y=(0,Z.jsx)(E,{checked:c,disabled:_,onCheckedChange:d,"aria-label":v}),t[9]=c,t[10]=d,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==g||t[15]!==y?(b=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[g,y]}),t[14]=g,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==f||t[19]!==u?(x=(0,Z.jsx)(qi,{open:l,onOpenChange:u,onConfirm:f}),t[17]=l,t[18]=f,t[19]=u,t[20]=x):x=t[20];let S;t[21]===n.error?S=t[22]:(S=n.error&&(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:n.error}),t[21]=n.error,t[22]=S);let C;t[23]===n.pausedReason?C=t[24]:(C=n.pausedReason&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:PN(n.pausedReason)}),t[23]=n.pausedReason,t[24]=C);let w;t[25]===n.state?w=t[26]:(w=n.state===`conflict`&&(0,Z.jsx)(`p`,{className:`text-xs text-amber-700 dark:text-amber-400`,children:`Sync paused — resolve conflicts to resume.`}),t[25]=n.state,t[26]=w);let T;t[27]!==c||t[28]!==n.lastSyncUtc||t[29]!==n.state?(T=c&&n.state!==`dormant`&&(0,Z.jsxs)(`div`,{children:[`Last synced: `,kN(n.lastSyncUtc)]}),t[27]=c,t[28]=n.lastSyncUtc,t[29]=n.state,t[30]=T):T=t[30];let D;t[31]===n.ahead?D=t[32]:(D=n.ahead>0&&(0,Z.jsxs)(`div`,{children:[n.ahead,` commit`,n.ahead===1?``:`s`,` ahead`]}),t[31]=n.ahead,t[32]=D);let O;t[33]===n.behind?O=t[34]:(O=n.behind>0&&(0,Z.jsxs)(`div`,{children:[n.behind,` commit`,n.behind===1?``:`s`,` behind`]}),t[33]=n.behind,t[34]=O);let k;t[35]===n.conflictCount?k=t[36]:(k=n.conflictCount>0&&(0,Z.jsxs)(`div`,{children:[n.conflictCount,` file`,n.conflictCount===1?``:`s`,` conflicted`]}),t[35]=n.conflictCount,t[36]=k);let A;t[37]===c?A=t[38]:(A=!c&&(0,Z.jsx)(`div`,{children:`Sync is off — your edits will not sync to the remote repository.`}),t[37]=c,t[38]=A);let j;t[39]!==T||t[40]!==D||t[41]!==O||t[42]!==k||t[43]!==A?(j=(0,Z.jsxs)(`div`,{className:`text-xs text-muted-foreground space-y-0.5`,children:[T,D,O,k,A]}),t[39]=T,t[40]=D,t[41]=O,t[42]=k,t[43]=A,t[44]=j):j=t[44];let M;t[45]!==a||t[46]!==n.identityUnresolved?(M=n.identityUnresolved&&a&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,Z.jsx)(cc,{className:`size-3.5 mt-0.5 text-muted-foreground shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 min-w-0`,children:[(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground leading-snug`,children:`Git identity isn't set — commits use a default author. Set yours so teammates see your name.`}),(0,Z.jsx)(zr,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:`Set identity`})]})]}),t[45]=a,t[46]=n.identityUnresolved,t[47]=M):M=t[47];let N;t[48]!==c||t[49]!==n.state?(N=c&&n.state!==`dormant`&&n.state!==`disabled`&&n.state!==`auth-error`&&n.state!==`conflict`&&(0,Z.jsx)(zr,{variant:`outline`,size:`xs`,onClick:RN,children:`Sync now`}),t[48]=c,t[49]=n.state,t[50]=N):N=t[50];let P;t[51]!==c||t[52]!==r||t[53]!==n.state?(P=c&&n.state===`auth-error`&&(0,Z.jsx)(zr,{variant:`outline`,size:`xs`,onClick:r,children:`Sign in`}),t[51]=c,t[52]=r,t[53]=n.state,t[54]=P):P=t[54];let F;t[55]!==c||t[56]!==n.state?(F=c&&n.state===`offline`&&(0,Z.jsx)(zr,{variant:`outline`,size:`xs`,onClick:LN,children:`Retry`}),t[55]=c,t[56]=n.state,t[57]=F):F=t[57];let I;t[58]!==c||t[59]!==i||t[60]!==n.state?(I=c&&n.state===`conflict`&&i&&(0,Z.jsx)(zr,{variant:`outline`,size:`xs`,onClick:i,children:`Review conflicts`}),t[58]=c,t[59]=i,t[60]=n.state,t[61]=I):I=t[61];let L;t[62]!==N||t[63]!==P||t[64]!==F||t[65]!==I?(L=(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1 pt-1`,children:[N,P,F,I]}),t[62]=N,t[63]=P,t[64]=F,t[65]=I,t[66]=L):L=t[66];let R;return t[67]!==S||t[68]!==C||t[69]!==w||t[70]!==j||t[71]!==M||t[72]!==L||t[73]!==b||t[74]!==x?(R=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[b,x,S,C,w,j,M,L]}),t[67]=S,t[68]=C,t[69]=w,t[70]=j,t[71]=M,t[72]=L,t[73]=b,t[74]=x,t[75]=R):R=t[75],R}function LN(){AN(`sync`)}function RN(){AN(`sync`)}function zN(e){let t=(0,$.c)(36),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a}=n,{status:o,fetchError:s}=ma();if(!o){if(s){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":`Sync status unavailable`,disabled:!0,children:(0,Z.jsx)(as,{className:`size-3.5`})})}),t[2]=e):e=t[2];let n=s===`network`?`Sync status unavailable — server unreachable.`:`Sync status unavailable — server error.`,r;return t[3]===n?r=t[4]:(r=(0,Z.jsxs)(Za,{children:[e,(0,Z.jsx)(Ya,{children:n})]}),t[3]=n,t[4]=r),r}return null}if(o.state===`dormant`&&!o.hasRemote||o.state===`disabled`&&!o.pausedReason)return null;let c;t[5]===o?c=t[6]:(c=MN(o),t[5]=o,t[6]=c);let l=c,u=!!o.identityUnresolved,d;t[7]===o.state?d=t[8]:(d=NN(o.state),t[7]=o.state,t[8]=d);let f=`Sync status: ${d}${u?` — git identity unset`:``}`,p;t[9]===o?p=t[10]:(p=(0,Z.jsx)(jN,{status:o}),t[9]=o,t[10]=p);let m;t[11]===l?m=t[12]:(m=l&&(0,Z.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[9px] leading-none font-medium bg-background border rounded-full px-0.5`,children:l}),t[11]=l,t[12]=m);let h;t[13]!==l||t[14]!==u?(h=!l&&u&&(0,Z.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-amber-500 ring-2 ring-background`,"aria-hidden":!0}),t[13]=l,t[14]=u,t[15]=h):h=t[15];let g;t[16]!==f||t[17]!==p||t[18]!==m||t[19]!==h?(g=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(N,{asChild:!0,children:(0,Z.jsxs)(zr,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground relative`,"aria-label":f,children:[p,m,h]})})}),t[16]=f,t[17]=p,t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;t[21]===o?_=t[22]:(_=FN(o),t[21]=o,t[22]=_);let v;t[23]===_?v=t[24]:(v=(0,Z.jsx)(Ya,{children:_}),t[23]=_,t[24]=v);let y;t[25]!==v||t[26]!==g?(y=(0,Z.jsxs)(Za,{children:[g,v]}),t[25]=v,t[26]=g,t[27]=y):y=t[27];let b;t[28]!==i||t[29]!==a||t[30]!==r||t[31]!==o?(b=(0,Z.jsx)(T,{align:`end`,className:`w-64 p-3`,children:(0,Z.jsx)(IN,{status:o,onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a})}),t[28]=i,t[29]=a,t[30]=r,t[31]=o,t[32]=b):b=t[32];let S;return t[33]!==y||t[34]!==b?(S=(0,Z.jsxs)(x,{children:[y,b]}),t[33]=y,t[34]=b,t[35]=S):S=t[35],S}var BN=[{value:`light`,label:`Light`,icon:nc},{value:`dark`,label:`Dark`,icon:Is},{value:`system`,label:`System`,icon:us}],VN=()=>{let e=(0,$.c)(16),{theme:t}=nn(),{merged:n,userBinding:r}=ri(),i=n?.appearance?.theme??t??`system`,a;e[0]===r?a=e[1]:(a=e=>{if(e!==`light`&&e!==`dark`&&e!==`system`||!r)return;let t=r.patch({appearance:{theme:e}});t.ok||Fa.error(hn(t.error))},e[0]=r,e[1]=a);let o=a,s=i===`system`?us:i===`dark`?Is:nc,c;e[2]===s?c=e[3]:(c=(0,Z.jsx)(s,{}),e[2]=s,e[3]=c);let l;e[4]===i?l=e[5]:(l=(0,Z.jsxs)(`span`,{className:`sr-only`,children:[`Toggle theme (current: `,i,`)`]}),e[4]=i,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,Z.jsx)(ii,{asChild:!0,children:(0,Z.jsxs)(zr,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[c,l]})}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=BN.map(HN),e[9]=d):d=e[9];let f;e[10]!==i||e[11]!==o?(f=(0,Z.jsx)(ba,{align:`end`,children:(0,Z.jsx)(va,{value:i,onValueChange:o,children:d})}),e[10]=i,e[11]=o,e[12]=f):f=e[12];let p;return e[13]!==u||e[14]!==f?(p=(0,Z.jsxs)(Bi,{children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15],p};function HN(e){let{value:t,label:n,icon:r}=e;return(0,Z.jsxs)(Oi,{value:t,className:`capitalize`,children:[(0,Z.jsx)(r,{className:`text-muted-foreground`}),n]},t)}function UN(e){let t=(0,$.c)(49),{onSaveVersion:n,saving:r,onSignIn:i,onSetIdentity:a,onOpenConflictResolver:o}=e,{activeDocName:s,activeTarget:c}=Pe(),{state:l}=rM(),u=Rp(),d;t[0]!==s||t[1]!==u?(d=Tm({docName:s,workspace:u}),t[0]=s,t[1]=u,t[2]=d):d=t[2];let f=d,p=c?.kind===`asset`,m=p?c.assetPath:``,h,g;t[3]===m?(h=t[4],g=t[5]):(h=m.lastIndexOf(`/`),g=h===-1?``:m.slice(0,h),t[3]=m,t[4]=h,t[5]=g);let _=g,v;t[6]!==m||t[7]!==h?(v=h===-1?m:m.slice(h+1),t[6]=m,t[7]=h,t[8]=v):v=t[8];let y=v,b=typeof window<`u`&&window.okDesktop!=null,x=b&&l===`collapsed`&&`pl-[78px]`,S;t[9]===x?S=t[10]:(S=X(`flex h-12 shrink-0 items-center bg-muted/20 shadow-[inset_0_-1px_0_var(--border)]`,b&&`[-webkit-app-region:drag]`,x,b&&`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-linear`),t[9]=x,t[10]=S);let C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(cM,{className:X(`-ml-1 shrink-0 text-muted-foreground`,b&&`[-webkit-app-region:no-drag]`)})}),t[11]=C):C=t[11];let w=l===`expanded`?`Hide Files`:`Show Files`,T;t[12]===w?T=t[13]:(T=(0,Z.jsxs)(Za,{children:[C,(0,Z.jsx)(Ya,{children:w})]}),t[12]=w,t[13]=T);let E;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(la,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),t[14]=E):E=t[14];let D;t[15]!==y||t[16]!==_||t[17]!==p?(D=p?(0,Z.jsx)(`div`,{className:`flex min-w-0 items-center gap-2 overflow-hidden text-sm`,children:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center overflow-hidden`,children:[_&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground/60`,children:_}),(0,Z.jsx)(`span`,{className:`shrink-0 px-2 text-muted-foreground/60`,children:`/`})]}),(0,Z.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:y})]})}):null,t[15]=y,t[16]=_,t[17]=p,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(lN,{}),t[19]=O):O=t[19];let k;t[20]!==D||t[21]!==T?(k=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 px-3`,children:[T,E,D,O]}),t[20]=D,t[21]=T,t[22]=k):k=t[22];let A;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=X(`flex shrink-0 items-center justify-end gap-2 px-3`,b&&`[&>*]:[-webkit-app-region:no-drag]`),t[23]=A):A=t[23];let j;t[24]!==s||t[25]!==n||t[26]!==r?(j=s&&(0,Z.jsxs)(Za,{children:[(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-sm`,"aria-label":`Checkpoint version`,onClick:n,disabled:r,className:`text-muted-foreground`,children:(0,Z.jsx)(Ks,{className:`size-3.5`})})}),(0,Z.jsx)(Ya,{children:r?`Saving`:`Checkpoint version`})]}),t[24]=s,t[25]=n,t[26]=r,t[27]=j):j=t[27];let M;t[28]!==s||t[29]!==f?(M=s&&(0,Z.jsx)(EN,{input:f}),t[28]=s,t[29]=f,t[30]=M):M=t[30];let N;t[31]!==o||t[32]!==a||t[33]!==i?(N=(0,Z.jsx)(zN,{onSignIn:i,onSetIdentity:a,onOpenConflictResolver:o}),t[31]=o,t[32]=a,t[33]=i,t[34]=N):N=t[34];let P,F,I,L,R,z;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(LM,{}),F=(0,Z.jsx)(la,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),I=(0,Z.jsx)(Zl,{}),L=(0,Z.jsx)(DN,{}),R=(0,Z.jsx)(pN,{}),z=(0,Z.jsx)(VN,{}),t[35]=P,t[36]=F,t[37]=I,t[38]=L,t[39]=R,t[40]=z):(P=t[35],F=t[36],I=t[37],L=t[38],R=t[39],z=t[40]);let B;t[41]!==j||t[42]!==M||t[43]!==N?(B=(0,Z.jsxs)(`div`,{className:A,children:[j,M,N,P,F,I,L,R,z]}),t[41]=j,t[42]=M,t[43]=N,t[44]=B):B=t[44];let V;return t[45]!==k||t[46]!==B||t[47]!==S?(V=(0,Z.jsxs)(`header`,{className:S,children:[k,B]}),t[45]=k,t[46]=B,t[47]=S,t[48]=V):V=t[48],V}function WN(){let e=(0,$.c)(32),[t,n]=xh(),[r,i]=(0,Q.useState)(t),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(`auth`),[d,f]=(0,Q.useState)(Kv[0].id),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_=Ki(),{projectLocalConfig:v,projectLocalSynced:y}=ri(),{activeDocName:b}=Pe(),x=!h&&_?.hasRemote===!0&&y===!0&&v!==null&&v.autoSync?.enabled===null,S,C;e[0]===b?(S=e[1],C=e[2]):(S=()=>{let e=function(e){let t=e.detail;t&&b&&Ao(b,{kind:`raw-mdx`,detail:t}),i(`source`)};return window.addEventListener(ph,e),()=>window.removeEventListener(ph,e)},C=[b],e[0]=b,e[1]=S,e[2]=C),(0,Q.useEffect)(S,C);let w;e[3]===n?w=e[4]:(w=function(e){i(e),n(e)},e[3]=n,e[4]=w);let T=w,E;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=async function(){m(!0);try{let e=await fetch(`/api/save-version`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});e.ok?Fa.success(`Checkpoint saved`):(console.error(`[save-version] failed:`,await e.text()),Fa.error(`Checkpoint failed — try again`))}catch(e){console.error(`[save-version] failed:`,e),Fa.error(`Checkpoint failed — try again`)}m(!1)},e[5]=E):E=e[5];let D=E,O;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(wh,{onOpenResolver:()=>o(!0)}),e[6]=O):O=e[6];let k,A,j;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{u(`auth`),c(!0)},A=()=>{u(`identity`),c(!0)},j=()=>o(!0),e[7]=k,e[8]=A,e[9]=j):(k=e[7],A=e[8],j=e[9]);let M;e[10]===p?M=e[11]:(M=(0,Z.jsx)(UN,{onSaveVersion:D,saving:p,onSignIn:k,onSetIdentity:A,onOpenConflictResolver:j}),e[10]=p,e[11]=M);let N;e[12]!==d||e[13]!==r||e[14]!==T?(N=(0,Z.jsx)(Mj,{editorMode:r,onModeChange:T,activeTab:d,onActiveTabChange:f}),e[12]=d,e[13]=r,e[14]=T,e[15]=N):N=e[15];let P;e[16]===a?P=e[17]:(P=(0,Z.jsx)(E_,{open:a,onOpenChange:o}),e[16]=a,e[17]=P);let F=l===`identity`,I;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{c(!1)},e[18]=I):I=e[18];let L;e[19]!==s||e[20]!==F?(L=(0,Z.jsx)(Yl,{open:s,onOpenChange:c,identityPrompt:F,onSuccess:I}),e[19]=s,e[20]=F,e[21]=L):L=e[21];let R;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>g(!0),e[22]=R):R=e[22];let z;e[23]===x?z=e[24]:(z=(0,Z.jsx)(Sh,{open:x,onResolved:R}),e[23]=x,e[24]=z);let B;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(uh,{}),e[25]=B):B=e[25];let V;return e[26]!==P||e[27]!==L||e[28]!==z||e[29]!==M||e[30]!==N?(V=(0,Z.jsxs)(Z.Fragment,{children:[O,M,N,P,L,z,B]}),e[26]=P,e[27]=L,e[28]=z,e[29]=M,e[30]=N,e[31]=V):V=e[31],V}var GN=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
35
|
+
<symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
|
|
36
|
+
<path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06" fill="currentcolor"/>
|
|
37
|
+
</symbol>
|
|
38
|
+
<symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
|
|
39
|
+
<circle cx="3" cy="3" r="3" />
|
|
40
|
+
</symbol>
|
|
41
|
+
<symbol id="file-tree-icon-file" viewBox="0 0 16 16">
|
|
42
|
+
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".5"/>
|
|
43
|
+
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
44
|
+
</symbol>
|
|
45
|
+
<symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
|
|
46
|
+
<path fill="currentcolor" d="M4 5.336V4a4 4 0 1 1 8 0v1.336c1.586.54 2 1.843 2 4.664v1c0 4.118-.883 5-5 5H7c-4.117 0-5-.883-5-5v-1c0-2.821.414-4.124 2-4.664M5.5 4v1.054Q6.166 4.998 7 5h2q.834-.002 1.5.054V4a2.5 2.5 0 0 0-5 0m-2 6v1c0 .995.055 1.692.167 2.193.107.483.246.686.35.79s.307.243.79.35c.5.112 1.198.167 2.193.167h2c.995 0 1.692-.055 2.193-.166.483-.108.686-.247.79-.35.104-.105.243-.308.35-.791.112-.5.167-1.198.167-2.193v-1c0-.995-.055-1.692-.166-2.193-.108-.483-.247-.686-.35-.79-.105-.104-.308-.243-.791-.35C10.693 6.555 9.995 6.5 9 6.5H7c-.995 0-1.692.055-2.193.167-.483.107-.686.246-.79.35s-.243.307-.35.79C3.555 8.307 3.5 9.005 3.5 10" />
|
|
47
|
+
</symbol>
|
|
48
|
+
<symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
|
|
49
|
+
<path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
|
|
50
|
+
</symbol>
|
|
51
|
+
</svg>`,KN=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
|
|
52
|
+
<path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
|
|
53
|
+
<path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
|
|
54
|
+
</symbol>`,qN=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
|
|
55
|
+
<path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
|
|
56
|
+
</symbol>`,JN=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
|
|
57
|
+
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
58
|
+
<path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
|
|
59
|
+
</symbol>`,YN=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
|
|
60
|
+
<path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
|
|
61
|
+
</symbol>`,XN=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
|
|
62
|
+
<path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
|
|
63
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
|
|
64
|
+
</symbol>`,ZN=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
|
|
65
|
+
<path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
|
|
66
|
+
<path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
|
|
67
|
+
<path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
|
|
68
|
+
</symbol>`,QN=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
|
|
69
|
+
<path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
|
|
70
|
+
</symbol>`,$N=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
|
|
71
|
+
<path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
|
|
72
|
+
</symbol>`,eP=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
|
|
73
|
+
<path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
|
|
74
|
+
<path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
|
|
75
|
+
</symbol>`,tP=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
|
|
76
|
+
<path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
|
|
77
|
+
<path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
|
|
78
|
+
<path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
|
|
79
|
+
</symbol>`,nP=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
|
|
80
|
+
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
|
|
81
|
+
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
82
|
+
</symbol>`,rP=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
|
|
83
|
+
<path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
|
|
84
|
+
<path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
|
|
85
|
+
</symbol>`,iP=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
|
|
86
|
+
<path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
|
|
87
|
+
<path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
|
|
88
|
+
</symbol>`,aP=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
|
|
89
|
+
<path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
|
|
90
|
+
</symbol>`,oP=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
|
|
91
|
+
<path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
|
|
92
|
+
</symbol>`,sP=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
|
|
93
|
+
<path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
|
|
94
|
+
</symbol>`,cP=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
|
|
95
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
|
|
96
|
+
</symbol>`,lP=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
|
|
97
|
+
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
98
|
+
<path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
|
|
99
|
+
</symbol>`,uP=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
|
|
100
|
+
<path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
|
|
101
|
+
<path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
|
|
102
|
+
</symbol>`,dP=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
|
|
103
|
+
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
104
|
+
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
|
|
105
|
+
</symbol>`,fP=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
|
|
106
|
+
<path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
|
|
107
|
+
</symbol>`,pP=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
|
|
108
|
+
<path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
|
|
109
|
+
</symbol>`,mP=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
|
|
110
|
+
<path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
|
|
111
|
+
<path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
|
|
112
|
+
</symbol>`,hP=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
|
|
113
|
+
<defs>
|
|
114
|
+
<linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
|
|
115
|
+
<stop stop-color="currentColor"/>
|
|
116
|
+
<stop offset="1" stop-color="currentColor" stop-opacity="0"/>
|
|
117
|
+
</linearGradient>
|
|
118
|
+
</defs>
|
|
119
|
+
<path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
|
|
120
|
+
<path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
|
|
121
|
+
<path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
|
|
122
|
+
</symbol>`,gP=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
|
|
123
|
+
<path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
|
|
124
|
+
<path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
|
|
125
|
+
</symbol>`,_P=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
|
|
126
|
+
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
|
|
127
|
+
</symbol>`,vP=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
|
|
128
|
+
<path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
|
|
129
|
+
</symbol>`,yP=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
|
|
130
|
+
<path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
|
|
131
|
+
<path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
|
|
132
|
+
<path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
|
|
133
|
+
<path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
|
|
134
|
+
</symbol>`,bP=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
|
|
135
|
+
<path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
|
|
136
|
+
<path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
|
|
137
|
+
</symbol>`,xP=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
|
|
138
|
+
<path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
|
|
139
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
|
|
140
|
+
</symbol>`,SP=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
|
|
141
|
+
<path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
|
|
142
|
+
</symbol>`,CP=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
|
|
143
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
|
|
144
|
+
</symbol>`,wP=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
|
|
145
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
|
|
146
|
+
</symbol>`,TP=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
|
|
147
|
+
<path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
|
|
148
|
+
<path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
|
|
149
|
+
</symbol>`,EP=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
|
|
150
|
+
<path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
|
|
151
|
+
</symbol>`,DP=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
|
|
152
|
+
<path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
|
|
153
|
+
<path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
|
|
154
|
+
</symbol>`,OP=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
|
|
155
|
+
<path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
|
|
156
|
+
<path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
|
|
157
|
+
</symbol>`,kP=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
|
|
158
|
+
<path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
|
|
159
|
+
</symbol>`,AP=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
|
|
160
|
+
<path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
|
|
161
|
+
<path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
162
|
+
</symbol>`,jP=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
|
|
163
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
|
|
164
|
+
</symbol>`,MP=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
|
|
165
|
+
<path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
|
|
166
|
+
</symbol>`,NP=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
|
|
167
|
+
<path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
|
|
168
|
+
<path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
|
|
169
|
+
</symbol>`,PP=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
|
|
170
|
+
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
171
|
+
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
|
|
172
|
+
</symbol>`,FP=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
|
|
173
|
+
<path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
|
|
174
|
+
</symbol>`,IP=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
|
|
175
|
+
<path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
|
|
176
|
+
<path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
|
|
177
|
+
<path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
|
|
178
|
+
</symbol>`,LP=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
|
|
179
|
+
<path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
|
|
180
|
+
<path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
|
|
181
|
+
</symbol>`,RP=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
|
|
182
|
+
<path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
|
|
183
|
+
<path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
|
|
184
|
+
<path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
|
|
185
|
+
</symbol>`,zP=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
|
|
186
|
+
<path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
|
|
187
|
+
<path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
|
|
188
|
+
</symbol>`,BP=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
|
|
189
|
+
<path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
|
|
190
|
+
</symbol>`,VP=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
|
|
191
|
+
<path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
|
|
192
|
+
<path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
|
|
193
|
+
</symbol>`,HP=[JN,eP,tP,nP,aP,oP,sP,lP,uP,dP,fP,pP,mP,bP,SP,CP,kP,AP,NP,PP,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
|
|
194
|
+
<path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
|
|
195
|
+
<path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
|
|
196
|
+
</symbol>`],UP=[KN,qN,YN,XN,ZN,QN,$N,rP,iP,cP,hP,gP,_P,vP,yP,xP,wP,TP,EP,DP,OP,jP,MP,FP,IP,LP,RP,zP,BP,VP];function WP(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
|
|
197
|
+
`)}\n</svg>`)}var GP=WP(GN,HP),KP={minimal:GN,standard:GP,complete:WP(GP,UP)},qP={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},JP={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,htm:`html`,html:`html`,icns:`image`,ico:`image`,ini:`text`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},YP={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},XP=new Set([`bash`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),ZP=new Set([`complete`]);function QP(e){return KP[e===`none`?`minimal`:e]}function $P(e){return`file-tree-builtin-${e}`}function eF(e){return e!==`none`&&ZP.has(e)}function tF(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=qP[t.toLowerCase()];if(i!=null&&(r||XP.has(i)))return i;for(let e of n){if(r){let t=YP[e];if(t!=null)return t}let t=JP[e];if(t!=null&&(r||XP.has(t)))return t}return`default`}var nF=`file-tree-container`,rF=`data-file-tree-style`,iF=`data-file-tree-unsafe-css`,aF=`data-file-tree-scrollbar-measure`,oF=`data-file-tree-scrollbar-gutter-measured`,sF=`--trees-scrollbar-gutter-measured`,cF=`header`,lF=`context-menu`,uF=`context-menu-trigger`;function dF(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function fF(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(dF(e)?`none`:`complete`),colored:e.colored??!0}}var pF=e=>e.trim().toLowerCase(),mF=e=>e.split(`/`).at(-1)??e,hF=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function gF(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function _F(e){let t=fF(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(pF(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=mF(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return gF(c,e);for(let[t,n]of a)if(s.includes(t))return gF(n,e);let l=hF(n);for(let t of l){let n=i.get(t);if(n!=null)return gF(n,e)}let u=tF(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:$P(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:gF(s,e)}}}var vF=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,yF=/^0(?:\.0+)?%?$/;function bF(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function xF(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||vF.test(t))return!0;let n=bF(t);return n!=null&&yF.test(n)}function SF(e){return xF(e)?void 0:e}function CF(e){let t=e.colors??{},n=t[`sideBar.background`]??t[`editor.background`]??e.bg,r=t[`sideBar.foreground`]??t[`editor.foreground`]??e.fg,i=t[`sideBar.border`],a=t[`list.activeSelectionForeground`]??t[`sideBar.foreground`],o=n?.toLowerCase(),s=t[`list.hoverBackground`],c=s?.toLowerCase()===o?void 0:s,l=t[`list.activeSelectionBackground`],u=l?.toLowerCase()===o?t[`list.focusBackground`]??t[`editor.selectionBackground`]:l??t[`editor.selectionBackground`],d=SF(t[`list.focusOutline`])??SF(t.focusBorder),f=t[`input.background`]??n,p=t[`input.border`],m=t[`scrollbarSlider.background`],h=t[`sideBarSectionHeader.foreground`]??r,g=t[`gitDecoration.addedResourceForeground`]??t[`terminal.ansiGreen`]??t[`editorGutter.addedBackground`],_=t[`gitDecoration.modifiedResourceForeground`]??t[`terminal.ansiBlue`]??t[`editorGutter.modifiedBackground`],v=t[`gitDecoration.deletedResourceForeground`]??t[`terminal.ansiRed`]??t[`editorGutter.deletedBackground`],y=e.type===`dark`,b={colorScheme:y?`dark`:`light`,backgroundColor:n??``,color:r??``,borderColor:`var(--trees-theme-sidebar-border, light-dark(oklch(0% 0 0 / 0.15), oklch(100% 0 0 / 0.15)))`,"--trees-theme-sidebar-bg":n??``,"--trees-theme-sidebar-fg":r??``,"--trees-theme-sidebar-header-fg":h??``,"--trees-theme-list-active-selection-fg":a??r??``,"--trees-theme-list-hover-bg":c??(y?`rgba(255,255,255,0.08)`:`rgba(0,0,0,0.06)`),"--trees-theme-list-active-selection-bg":u??`transparent`,"--trees-theme-focus-ring":d??r??``,"--trees-theme-input-bg":f??``};return i!=null&&i!==``&&(b[`--trees-theme-sidebar-border`]=i),p!=null&&p!==``&&(b[`--trees-theme-input-border`]=p),m!=null&&m!==``&&(b[`--trees-theme-scrollbar-thumb`]=m),g!=null&&g!==``&&(b[`--trees-theme-git-added-fg`]=g),_!=null&&_!==``&&(b[`--trees-theme-git-modified-fg`]=_),v!=null&&v!==``&&(b[`--trees-theme-git-deleted-fg`]=v),b}var wF=5,TF=1<<wF,EF=TF*4;function DF(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function OF(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function kF(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function AF(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function jF(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function MF(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function NF(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,LF(e,t)}function PF(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=AF(e).get(t);if(i===void 0)return;let a=i>>wF;e.childVisibleChunkSums[a]+=r}function FF(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=RF(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=TF}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function IF(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>wF;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<wF}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function LF(e,t){if(t.childIds.length<EF){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/TF),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>wF]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function RF(e,t,n,r){let i=Math.min(t.childIds.length,n+TF),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var zF=7,BF=3,VF=1<<BF,HF=4;function UF(e,t,n=0){return e<<HF|n<<BF|t}function WF(e){return e.depthAndFlags>>>HF}function GF(e){return(e.depthAndFlags&VF)>>BF}function KF(e){return(e.depthAndFlags&VF)!==0}function qF(e){return e.depthAndFlags&zF}function JF(e,t){return(qF(e)&t)!==0}function YF(e,t){e.depthAndFlags|=t}function XF(e,t){e.depthAndFlags=UF(t,qF(e),GF(e))}var ZF=Symbol(`benchmarkInstrumentation`);function QF(e,t){return t==null||Object.defineProperty(e,ZF,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function $F(e){return e==null?null:e[ZF]??null}function eI(e,t,n){return e==null?n():e.measurePhase(t,n)}function tI(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function nI(e){return e>=48&&e<=57}function rI(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!nI(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&nI(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function iI(e){let t=e.toLowerCase();return{lowerValue:t,tokens:rI(t)}}function aI(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function oI(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=aI(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function sI(e,t,n){let r=oI(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function cI(e,t){return sI(e,t,iI)}function lI(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function uI(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=lI(e,r);return a===lI(t,r)?cI(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function dI(e,t){return uI(e,t)}function fI(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=iI(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=lI(e,n);return o===lI(t,n)?sI(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function pI(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=iI(r);return e.sortKeyById[t]=i,i}function mI(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function hI(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function gI(e){let{hasTrailingSlash:t,segments:n}=hI(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function _I(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=hI(e);return{requiresDirectory:t,segments:n}}var vI=``;function yI(){let e=new Map;return e.set(vI,0),{idByValue:e,valueById:[vI],sortKeyById:[iI(vI)]}}function bI(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function xI(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var SI=Symbol(`pathStorePreparedInputKind`);function CI(e,t){return e[SI]=t,e}function wI(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function TI(e,t,n){return n===`default`?dI(e,t):n(wI(e),wI(t))}function EI(){return{depthAndFlags:UF(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function DI(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function OI(e){return e.isDirectory?e.segments.length:e.segments.length-1}function kI(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function AI(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function jI(e,t={}){return LI(e,t).map(e=>e.path)}function MI(e,t={}){let n=LI(e,t);return CI({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function NI(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return CI({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function PI(e){let t=e,n=t.preparedPaths;if(t[SI]===`prepared`&&n!=null)return n;if(!kI(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function FI(e){let t=e;return t[SI]===`presorted`&&t.presortedPaths!=null||AI(t.presortedPaths)?t.presortedPaths:null}function II(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function LI(e,t={}){let n=mI(t),r=$F(t);tI(r,`workload.inputFiles`,e.length);let i=eI(r,`store.preparePathEntries.parse`,()=>e.map(e=>gI(e)));return eI(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>TI(e,t,n.sort))),i}var RI=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[EI()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=yI();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=$F(e),this.options=mI(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,DF())}appendPaths(e){return eI(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>gI(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,eI(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return eI(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:UF(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:UF(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:UF(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=gI(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:UF(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:UF(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=gI(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(eI(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||eI(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?fI(this.lastPreparedPath,e,this.segmentSortKeyCache):TI(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=OI(e),i=n==null?0:OI(n),a=n==null?0:DI(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=bI(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:UF(WF(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),jF(i,s),s}createFileChildUnchecked(e,t){let n=bI(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:UF(WF(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),jF(r,a),a}getOrCreateDirectoryChild(e,t){let n=bI(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!KF(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:UF(WF(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),jF(r,a),this.directories.set(a,DF()),a}createDirectoryChild(e,t){let n=bI(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:UF(WF(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),jF(r,a),this.directories.set(a,DF()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!KF(n))throw Error(`Path is not a directory: "${t}"`);if(JF(n,1))throw Error(`Duplicate path: "${t}"`);YF(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,OF());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(KF(a)){let t=OF();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;KF(n)&&this.directories.set(t,DF());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),jF(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!KF(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return NF(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function zI(e,t=`closed`,n=null){let r=VI(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function BI(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function VI(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function HI(e,t){return JF(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:WF(t)<=e.defaultExpansion}function UI(e,t,n=e.snapshot.nodes[t]){return n==null||!KF(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:HI(e,n)}function WI(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!KF(r))return;let i=HI(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function GI(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function KI(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function qI(e,t){let n=GI(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function JI(e,t){let n=GI(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function YI(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function XI(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function ZI(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function QI(e,t){e.directoryLoadInfoById.delete(t)}function $I(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function eL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function tL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function nL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function rL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function iL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function aL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function oL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function sL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function cL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function lL(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function uL(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function dL(e,t,n){return{...n,visibleCountDelta:SL(e)-t}}function fL(e,t){let n=SL(e),r=BI();e.transactionStack.push(r);try{t()}catch(t){throw hL(e,r,!1),t}hL(e,r,!0,SL(e)-n)}function pL(e,t){let n=e.instrumentation;if(n==null){mL(e,t);return}eI(n,`store.events.record`,()=>mL(e,t))}function mL(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){bL(e,t);return}n.events.push(t),yL(n,t)}function hL(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?vL(i,t):eI(n,`store.events.batch.merge`,()=>vL(i,t));return}let a=gL(t,r),o=e.instrumentation;if(o==null){bL(e,a);return}eI(o,`store.events.batch.commit`,()=>bL(e,a))}function gL(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function _L(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function vL(e,t){for(let n of t.events)e.events.push(n);_L(e,t)}function yL(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function bL(e,t){let n=e.instrumentation;if(n==null){xL(e,t);return}eI(n,`store.events.emit`,()=>xL(e,t))}function xL(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function SL(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function CL(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!KF(n)||JF(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!KF(a)?null:i}function wL(e,t){let n=t;for(;;){let t=CL(e,n);if(t==null)return n;n=t}}function TL(e,t){let n=[t],r=t;for(;;){let t=CL(e,r);if(t==null)return n;n.push(t),r=t}}function EL(e,t){let n=t==null?e.snapshot.rootId:IL(e,t);return n==null?[]:BL(e,n)}function DL(e,t){let n=gI(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=tR(e,eR(e,r)),{createdNodeIds:a,directoryId:o}=VL(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=zL(e,o);if(JF(n,1))throw Error(`Path already exists: "${t}"`);YF(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=UL(e,o,n.basename),s.add(c);NL(e,o);let l=tR(e,o);return eL({affectedAncestorIds:FL(e,c),affectedNodeIds:[...s],path:t,projectionChanged:nR(i,l)})}function OL(e,t,n){let r=IL(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=zL(e,r);if(JF(i,2))throw Error(`The root node cannot be removed`);if(KF(i)&&RL(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=tR(e,a),s=QL(e,r);KL(e,a,r,i.nameId),$L(e,a),NL(e,a);let c=tR(e,a);return tL({affectedAncestorIds:FL(e,a),affectedNodeIds:s,path:t,projectionChanged:nR(o,c),recursive:n.recursive===!0})}function kL(e,t,n,r){let i=IL(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=zL(e,i);if(JF(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=XL(e,i,n),c=tR(e,a.parentId),l=tR(e,s.parentId),u=xI(e.snapshot.segmentTable,a.nameId),d=bI(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(KF(a)&&oR(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=kF(e.snapshot.nodes,RL(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&ZL(e,p,o,GF(a))===`skip`)return null;let m=a.parentId;KL(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),aR(e,i),GL(e,s.parentId,i),$L(e,m),e.pathCacheVersion++,NL(e,m),s.parentId!==m&&NL(e,s.parentId);let h=tR(e,m),g=tR(e,s.parentId);return nL({affectedAncestorIds:[...new Set([...FL(e,m),...FL(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:rR([c,l],[h,g]),to:ML(e,i)})}function AL(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function jL(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function ML(e,t){let n=zL(e,t),r=AL(e,t);if(r!=null)return r;if(JF(n,2))return jL(e,t,``);let i=ML(e,n.parentId),a=xI(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return jL(e,t,KF(n)?`${o}/`:o)}function NL(e,t){let n=e.instrumentation;if(n==null){cR(e,t);return}eI(n,`store.recomputeCountsUpwardFrom`,()=>cR(e,t))}function PL(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!KF(o)){sR(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){sR(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function FL(e,t){let n=[],r=t;for(;r!=null;){let t=zL(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function IL(e,t){if(t.length===0)return e.snapshot.rootId;let n=_I(t);return LL(e,n.segments,n.requiresDirectory)}function LL(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=RL(e,r),a=kF(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=zL(e,r);return n&&!KF(i)?null:r}function RL(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function zL(e,t){let n=e.snapshot.nodes[t];if(n===void 0||JF(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function BL(e,t){let n=e.snapshot.nodes[t];if(n===void 0||JF(n,4))return[];if(!KF(n))return[ML(e,t)];if(RL(e,t).childIds.length===0)return JF(n,1)&&!JF(n,2)?[ML(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||JF(n,4)){i.pop();continue}if(!KF(n)){r.push(ML(e,t.nodeId)),i.pop();continue}let a=RL(e,t.nodeId);if(a.childIds.length===0){JF(n,1)&&!JF(n,2)&&r.push(ML(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function VL(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=bI(e.snapshot.segmentTable,i),a=RL(e,r),o=kF(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!KF(zL(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=HL(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function HL(e,t,n){let r=zL(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:UF(WF(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,DF()),GL(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function UL(e,t,n){let r=bI(e.snapshot.segmentTable,n),i=RL(e,t);if(kF(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${uR(e,t,n)}"`);let a=zL(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:UF(WF(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),GL(e,t,o),e.activeNodeCount++,o}function WL(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}qL(e,n,o)<0?i=a:r=a+1}return r}function GL(e,t,n){let r=RL(e,t),i=zL(e,n);kF(e.snapshot.nodes,r).set(i.nameId,n),PF(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=WL(e,r,n);r.childIds.splice(a,0,n),MF(r,a),LF(e.snapshot.nodes,r)}function KL(e,t,n,r){let i=RL(e,t),a=AF(i),o=a.get(n)??-1;kF(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&PF(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),MF(i,o),LF(e.snapshot.nodes,i))}function qL(e,t,n){let r=e.snapshot.options.sort;return r===`default`?JL(e,t,n):r(YL(e,t),YL(e,n))}function JL(e,t,n){let r=zL(e,t),i=zL(e,n),a=KF(r);if(a!==KF(i))return a?-1:1;let o=oI(pI(e.snapshot.segmentTable,r.nameId),pI(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=xI(e.snapshot.segmentTable,r.nameId),c=xI(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function YL(e,t){let n=zL(e,t),r=ML(e,t),i=KF(n),a=i?r.slice(0,-1):r;return{basename:xI(e.snapshot.segmentTable,n.nameId),depth:WF(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function XL(e,t,n){let r=zL(e,t),i=IL(e,n);if(i!=null){let t=zL(e,i);if(KF(t))return{basename:xI(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=_I(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=_I(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:LL(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function ZL(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${ML(e,t)}"`);let i=zL(e,t);if(GF(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(KF(i)&&RL(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return QL(e,t),KL(e,a,t,o),$L(e,a),NL(e,a),`handled`}function QL(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=zL(e,t.nodeId);if(t.visitedChildren||!KF(i)){KF(i)&&e.snapshot.directories.delete(t.nodeId),YF(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),QI(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=RL(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function $L(e,t){let n=t;for(;n!=null;){let t=zL(e,n);if(!KF(t)||JF(t,2)||RL(e,n).childIds.length>0)return;YF(t,1),n=t.parentId===n?null:t.parentId}}function eR(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=kF(e.snapshot.nodes,RL(e,n)).get(t);if(i==null||!KF(zL(e,i)))break;n=i}return n}function tR(e,t){let n=iR(e,t);if(n==null)return null;let r=wL(e,n),i=zL(e,r),a=n===r?null:TL(e,n).map(t=>ML(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:RL(e,r).childIds.length>0,path:ML(e,r),terminalKind:GF(i)})}function nR(e,t){return rR([e],[t])}function rR(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function iR(e,t){let n=t;for(;n!=null;){let t=zL(e,n);if(!KF(t)||JF(t,2))return null;if(!UI(e,n,t))return n;n=t.parentId}return null}function aR(e,t){let n=zL(e,t);if(XF(n,(t===e.snapshot.rootId?-1:WF(zL(e,n.parentId)))+1),!KF(n))return;let r=RL(e,t);for(let t of r.childIds)aR(e,t)}function oR(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=zL(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function sR(e,t,n=zL(e,t),r=!1){let i=e.instrumentation;if(i==null){lR(e,t,n,r);return}eI(i,`store.recomputeNodeCounts`,()=>lR(e,t,n,r))}function cR(e,t){let n=t;for(;n!=null;){let t=zL(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(sR(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&PF(RL(e,s),n,a,o),n=s}}function lR(e,t,n,r){if(!KF(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=RL(e,t);if(r){let t=e.instrumentation;t==null?NF(e.snapshot.nodes,i):eI(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>NF(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,JF(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=CL(e,t)==null?UI(e,t,n)?1+o:1:o}function uR(e,t,n){let r=ML(e,t);return r.length===0?n:`${r}${n}`}function dR(e){return e!=null&&!JF(e,4)}function fR(e,t){let n=e.snapshot.nodes[t];return!dR(n)||!KF(n)||JF(n,2)?null:n}function pR(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&dR(e.snapshot.nodes[n])&&(t+=1);return t}function mR(e){return Math.max(0,e.valueById.length-1)}function hR(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:pR(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:mR(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function gR(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function _R(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)fR(e,n)!=null&&t.push(ML(e,n));for(let t of e.expandedDirectoryIds)fR(e,t)!=null&&n.push(ML(e,t));return{collapsedPaths:t,expandedPaths:n}}function vR(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)fR(e,n)==null||KI(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:ML(e,n)});return t}function yR(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=IL(e,n);t!=null&&WI(e,t,!0,zL(e,t))}for(let n of t.collapsedPaths){let t=IL(e,n);t!=null&&WI(e,t,!1,zL(e,t))}}function bR(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=IL(e,n.path);t!=null&&fR(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function xR(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function SR(e){let t=e.snapshot.segmentTable,n=yI();for(let r of e.snapshot.nodes)if(dR(r)){if(JF(r,2)){r.nameId=0;continue}r.nameId=bI(n,xI(t,r.nameId))}e.snapshot.segmentTable=n}function CR(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!dR(r)||!KF(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return dR(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[zL(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),NF(e.snapshot.nodes,n)}}function wR(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(dR(n))break;--t}e.snapshot.nodes.length=t+1}function TR(e){let t=_R(e),n=vR(e);eI(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>xR(e)),eI(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>SR(e)),eI(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>CR(e)),eI(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>wR(e)),eI(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>yR(e,t)),eI(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>bR(e,n)),eI(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>PL(e,e.snapshot.rootId))}function ER(e){let t=_R(e),n=vR(e),r=eI(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>EL(e)),i=QF({...e.snapshot.options},e.instrumentation),a=eI(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new RI(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,eI(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>yR(e,t)),eI(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>bR(e,n)),eI(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>PL(e,e.snapshot.rootId))}function DR(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function OR(e,t){let n=hR(e);t===`stable`?eI(e.instrumentation,`store.cleanup.stable`,()=>TR(e)):eI(e.instrumentation,`store.cleanup.aggressive`,()=>ER(e));let r=hR(e);return gR(t,t===`stable`,n,r)}var kR=64;function AR(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function jR(e){return zL(e,e.snapshot.rootId).visibleSubtreeCount}function MR(e,t,n,r){let i=zL(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function NR(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:QR(e,t.cursor),setSize:t.setSize,subtreeEndIndex:MR(e,t.cursor,t.index,n)}}function PR(e,t,n,r,i,a){let o=RL(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=FF(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return FR(e,u,l,r+c,i+1,s,o.childIds.length,a)}function FR(e,t,n,r,i,a,o,s){if(!KF(zL(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=KR(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=zL(e,c.terminalNodeId);if(!KF(l)||!UI(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return PR(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function IR(e,t){let n=jR(e);if(t<0||t>=n)return null;let r=PR(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>ML(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=NR(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:QR(e,r.cursor),setSize:r.setSize,subtreeEndIndex:MR(e,r.cursor,r.index,n)}}function LR(e,t,n){let r=e.instrumentation,i=jR(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return ZR(e,o+1);let t=[],n=UR(e,a);for(let r=a;r<=o&&n!=null;r++){let r=QR(e,n);t.push(r),n=JR(e,n)}return t}let s=[],c=0,l=0,u=eI(r,`store.getVisibleSlice.selectFirstRow`,()=>UR(e,a));for(let t=a;t<=o&&u!=null;t++){let t=eI(r,`store.getVisibleSlice.materializeRow`,()=>QR(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=eI(r,`store.getVisibleSlice.advanceCursor`,()=>JR(e,u))}return tI(r,`workload.visibleRowsRead`,s.length),tI(r,`workload.flattenedRowsRead`,c),tI(r,`workload.flattenedSegmentsRead`,l),s}function RR(e,t=jR(e)){let n=e.instrumentation;return n==null?XR(e,t):eI(n,`store.getVisibleTreeProjection`,()=>XR(e,t))}function zR(e){return YR(RR(e))}function BR(e,t){let n=IL(e,t);if(n==null||n===e.snapshot.rootId||KF(zL(e,n))&&wL(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=zL(e,i).parentId,n=RL(e,t),s=AF(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=IF(a,n,s),t!==o){let n=zL(e,t),a=CL(e,t);if(!UI(e,t,n)&&a!==i)return null;wL(e,t)===t&&(r+=1)}i=t}return r}function VR(e,t){let n=IL(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=zL(e,n);if(!KF(r))throw Error(`Path is not a directory: "${t}"`);return UI(e,n,r)?null:(WI(e,n,!0,r),NL(e,n),rL({affectedAncestorIds:FL(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function HR(e,t){let n=IL(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=zL(e,n);if(!KF(r))throw Error(`Path is not a directory: "${t}"`);return UI(e,n,r)?(WI(e,n,!1,r),NL(e,n),iL({affectedAncestorIds:FL(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function UR(e,t){return t<0||t>=jR(e)?null:WR(e,e.snapshot.rootId,t,-1)}function WR(e,t,n,r){let i=RL(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?FF(e.snapshot.nodes,i,n):eI(a,`store.getVisibleSlice.selectChildIndex`,()=>FF(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return GR(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function GR(e,t,n,r){if(!KF(zL(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=KR(e,t,r);if(n===0)return i;let a=zL(e,i.terminalNodeId);if(!KF(a)||!UI(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return WR(e,i.terminalNodeId,n-1,i.visibleDepth)}function KR(e,t,n){return KF(zL(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:wL(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:eI(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>wL(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function qR(e,t){let n=zL(e,t);if(!KF(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:CL(e,r)!==t}function JR(e,t){let n=zL(e,t.terminalNodeId);if(KF(n)){let r=RL(e,t.terminalNodeId);if(UI(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:GR(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=zL(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=RL(e,n),o=AF(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return GR(e,s,0,i);qR(e,r)&&i--,r=n}}function YR(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function XR(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(kR);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=AR(o,y);let x,S=_;if(KF(v))S=f?wL(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:ML(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&KF(C)&&UI(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function ZR(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!KF(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:ML(e,f)};continue}let h=l?wL(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=QR(e,g);let _=i[h];_!=null&&KF(_)&&UI(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function QR(e,t){let n=zL(e,t.terminalNodeId),r=KF(n)?$R(e,t):null,i=ML(e,t.terminalNodeId),a=xI(e.snapshot.segmentTable,n.nameId),o=KF(n)&&RL(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?TL(e,t.headNodeId).map(n=>{let r=zL(e,n);return{isTerminal:n===t.terminalNodeId,name:xI(e.snapshot.segmentTable,r.nameId),nodeId:n,path:ML(e,n)}}):eI(c,`store.getVisibleSlice.flatten.collectSegments`,()=>TL(e,t.headNodeId).map(n=>{let r=zL(e,n);return{isTerminal:n===t.terminalNodeId,name:xI(e.snapshot.segmentTable,r.nameId),nodeId:n,path:ML(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:KF(n)&&UI(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:KF(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function $R(e,t){if(t.headNodeId===t.terminalNodeId)return KI(e,t.terminalNodeId);let n=TL(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=KI(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function ez(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!KF(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&LF(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&KF(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,LF(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function tz(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var nz=class e{#e;constructor(e={}){let t=$F(e),n=eI(t,`store.builder.create`,()=>new RI(e));if(e.preparedInput!=null){let t=FI(e.preparedInput);t==null?n.appendPreparedPaths(PI(e.preparedInput),!1):n.appendPresortedPaths(t,II(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(eI(t,`store.preparePathEntries`,()=>LI(r,e)))}let r=eI(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=eI(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=eI(t,`store.state.create`,()=>zI(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:eI(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||tz(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&eI(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?eI(t,`store.state.initializeOpenVisibleCounts`,()=>ez(this.#e)):eI(t,`store.state.recomputeCounts`,()=>PL(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return jI(e,t)}static prepareInput(e,t={}){return MI(e,t)}static preparePresortedInput(e){return NI(e)}list(e){return eI(this.#e.instrumentation,`store.list`,()=>EL(this.#e,e))}add(e){eI(this.#e.instrumentation,`store.add`,()=>{let t=jR(this.#e);pL(this.#e,dL(this.#e,t,DL(this.#e,e)))})}remove(e,t={}){eI(this.#e.instrumentation,`store.remove`,()=>{let n=jR(this.#e);pL(this.#e,dL(this.#e,n,OL(this.#e,e,t)))})}move(e,t,n={}){eI(this.#e.instrumentation,`store.move`,()=>{let r=jR(this.#e),i=kL(this.#e,e,t,n);i!=null&&pL(this.#e,dL(this.#e,r,i))})}batch(e){fL(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return eI(this.#e.instrumentation,`store.getVisibleCount`,()=>jR(this.#e))}getVisibleSlice(e,t){return eI(this.#e.instrumentation,`store.getVisibleSlice`,()=>LR(this.#e,e,t))}getVisibleRowContext(e){return eI(this.#e.instrumentation,`store.getVisibleRowContext`,()=>IR(this.#e,e))}getVisibleTreeProjection(){return zR(this.#e)}getVisibleTreeProjectionData(e){return RR(this.#e,e)}getVisibleIndex(e){return eI(this.#e.instrumentation,`store.getVisibleIndex`,()=>BR(this.#e,e))}getPathInfo(e){return eI(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=IL(this.#e,e);if(t==null)return null;let n=zL(this.#e,t);return{depth:WF(n),kind:KF(n)?`directory`:`file`,path:ML(this.#e,t)}})}isExpanded(e){return eI(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=zL(this.#e,t);return UI(this.#e,t,n)})}expand(e){eI(this.#e.instrumentation,`store.expand`,()=>{let t=jR(this.#e),n=VR(this.#e,e);n!=null&&pL(this.#e,dL(this.#e,t,n))})}collapse(e){eI(this.#e.instrumentation,`store.collapse`,()=>{let t=jR(this.#e),n=HR(this.#e,e);n!=null&&pL(this.#e,dL(this.#e,t,n))})}on(e,t){return $I(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return KI(this.#e,t)}markDirectoryUnloaded(e){eI(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(RL(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=jR(this.#e);JI(this.#e,t),pL(this.#e,dL(this.#e,n,aL({affectedAncestorIds:FL(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return eI(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=jR(this.#e),r=qI(this.#e,t);return pL(this.#e,dL(this.#e,n,oL({affectedAncestorIds:FL(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return eI(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||KI(this.#e,n)!==`loading`||!XI(this.#e,n,e.attemptId))return!1;let r=ML(this.#e,n);this.validateChildPatch(r,t);let i=jR(this.#e),a=[];for(let e of t.operations){rz(r,e);let t=jR(this.#e);switch(e.type){case`add`:a.push(dL(this.#e,t,DL(this.#e,e.path)));break;case`remove`:a.push(dL(this.#e,t,OL(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=kL(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(dL(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return pL(this.#e,dL(this.#e,i,sL({affectedAncestorIds:FL(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:ML(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return eI(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=jR(this.#e),r=YI(this.#e,t,e.attemptId);return pL(this.#e,dL(this.#e,n,cL({affectedAncestorIds:FL(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:ML(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return eI(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=jR(this.#e),i=ZI(this.#e,n,e.attemptId,t);return pL(this.#e,dL(this.#e,r,lL({affectedAncestorIds:FL(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:ML(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return eI(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(DR(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=jR(this.#e),n=OR(this.#e,e.mode??`stable`);return pL(this.#e,dL(this.#e,t,uL({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=RL(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??iI(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=oI(pI(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!KF(zL(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=zL(this.#e,n);UI(this.#e,n,i)||(WI(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=zL(this.#e,e);if(!UI(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=IL(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!KF(zL(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!KF(zL(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=zL(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=zL(this.#e,e),r=CL(this.#e,e);if(!UI(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function rz(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var iz={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function az(e,t){if(typeof e==`number`)return{itemHeight:t??iz.default.itemHeight,factor:e};let n=iz[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var oz=iz.default.itemHeight,sz=`@layer base, theme, unsafe;
|
|
198
|
+
|
|
199
|
+
@layer base {
|
|
200
|
+
:host {
|
|
201
|
+
/*
|
|
202
|
+
CSS variables use a fallback stack to ensure user and theme colors slot
|
|
203
|
+
in with ease. User colors take precedence over theme colors, which take
|
|
204
|
+
precedence over defaults.
|
|
205
|
+
|
|
206
|
+
Fallback order:
|
|
207
|
+
|
|
208
|
+
1. --trees-*-override (explicit)
|
|
209
|
+
2. --trees-theme-* (e.g. Shiki/VS Code tokens)
|
|
210
|
+
3. defaults
|
|
211
|
+
|
|
212
|
+
Theme variable names mirror Shiki/VS Code theme file JSON tokens.
|
|
213
|
+
|
|
214
|
+
// Available CSS Color Overrides
|
|
215
|
+
--trees-fg-override
|
|
216
|
+
--trees-fg-muted-override
|
|
217
|
+
--trees-bg-override
|
|
218
|
+
--trees-bg-muted-override
|
|
219
|
+
--trees-accent-override
|
|
220
|
+
--trees-border-color-override
|
|
221
|
+
|
|
222
|
+
--trees-focus-ring-color-override
|
|
223
|
+
--trees-focus-ring-width-override
|
|
224
|
+
--trees-focus-ring-offset-override
|
|
225
|
+
|
|
226
|
+
--trees-search-fg-override
|
|
227
|
+
--trees-search-font-weight-override
|
|
228
|
+
--trees-search-bg-override
|
|
229
|
+
|
|
230
|
+
--trees-selected-fg-override
|
|
231
|
+
--trees-selected-bg-override
|
|
232
|
+
--trees-selected-focused-border-color-override
|
|
233
|
+
|
|
234
|
+
// Git Status Color Overrides
|
|
235
|
+
--trees-status-added-override
|
|
236
|
+
--trees-status-ignored-override
|
|
237
|
+
--trees-status-modified-override
|
|
238
|
+
--trees-status-renamed-override
|
|
239
|
+
--trees-status-untracked-override
|
|
240
|
+
--trees-status-deleted-override
|
|
241
|
+
--trees-git-added-color-override
|
|
242
|
+
--trees-git-ignored-color-override
|
|
243
|
+
--trees-git-modified-color-override
|
|
244
|
+
--trees-git-renamed-color-override
|
|
245
|
+
--trees-git-untracked-color-override
|
|
246
|
+
--trees-git-deleted-color-override
|
|
247
|
+
|
|
248
|
+
// Built-in File Icon Color Overrides
|
|
249
|
+
--trees-file-icon-color
|
|
250
|
+
--trees-file-icon-color-astro
|
|
251
|
+
--trees-file-icon-color-babel
|
|
252
|
+
--trees-file-icon-color-bash
|
|
253
|
+
--trees-file-icon-color-biome
|
|
254
|
+
--trees-file-icon-color-bootstrap
|
|
255
|
+
--trees-file-icon-color-browserslist
|
|
256
|
+
--trees-file-icon-color-bun
|
|
257
|
+
--trees-file-icon-color-claude
|
|
258
|
+
--trees-file-icon-color-css
|
|
259
|
+
--trees-file-icon-color-database
|
|
260
|
+
--trees-file-icon-color-default
|
|
261
|
+
--trees-file-icon-color-docker
|
|
262
|
+
--trees-file-icon-color-eslint
|
|
263
|
+
--trees-file-icon-color-git
|
|
264
|
+
--trees-file-icon-color-go
|
|
265
|
+
--trees-file-icon-color-graphql
|
|
266
|
+
--trees-file-icon-color-html
|
|
267
|
+
--trees-file-icon-color-image
|
|
268
|
+
--trees-file-icon-color-javascript
|
|
269
|
+
--trees-file-icon-color-json
|
|
270
|
+
--trees-file-icon-color-markdown
|
|
271
|
+
--trees-file-icon-color-mcp
|
|
272
|
+
--trees-file-icon-color-npm
|
|
273
|
+
--trees-file-icon-color-oxc
|
|
274
|
+
--trees-file-icon-color-postcss
|
|
275
|
+
--trees-file-icon-color-prettier
|
|
276
|
+
--trees-file-icon-color-python
|
|
277
|
+
--trees-file-icon-color-react
|
|
278
|
+
--trees-file-icon-color-ruby
|
|
279
|
+
--trees-file-icon-color-rust
|
|
280
|
+
--trees-file-icon-color-sass
|
|
281
|
+
--trees-file-icon-color-svg
|
|
282
|
+
--trees-file-icon-color-svelte
|
|
283
|
+
--trees-file-icon-color-svgo
|
|
284
|
+
--trees-file-icon-color-swift
|
|
285
|
+
--trees-file-icon-color-table
|
|
286
|
+
--trees-file-icon-color-text
|
|
287
|
+
--trees-file-icon-color-tailwind
|
|
288
|
+
--trees-file-icon-color-terraform
|
|
289
|
+
--trees-file-icon-color-typescript
|
|
290
|
+
--trees-file-icon-color-vite
|
|
291
|
+
--trees-file-icon-color-vscode
|
|
292
|
+
--trees-file-icon-color-vue
|
|
293
|
+
--trees-file-icon-color-wasm
|
|
294
|
+
--trees-file-icon-color-webpack
|
|
295
|
+
--trees-file-icon-color-yml
|
|
296
|
+
--trees-file-icon-color-zig
|
|
297
|
+
--trees-file-icon-color-zip
|
|
298
|
+
|
|
299
|
+
// Density
|
|
300
|
+
//
|
|
301
|
+
// A unitless scale factor for padding, gaps, and indentation. Usually
|
|
302
|
+
// set via \`density\` on useFileTree. Individual overrides take precedence.
|
|
303
|
+
//
|
|
304
|
+
// Compact: 0.8
|
|
305
|
+
// Default: 1
|
|
306
|
+
// Relaxed: 1.2
|
|
307
|
+
//
|
|
308
|
+
--trees-density-override
|
|
309
|
+
|
|
310
|
+
// Available CSS Layout Overrides
|
|
311
|
+
--trees-gap-override
|
|
312
|
+
--trees-border-radius-override
|
|
313
|
+
--trees-font-family-override
|
|
314
|
+
--trees-font-size-override
|
|
315
|
+
--trees-font-weight-regular-override
|
|
316
|
+
--trees-font-weight-semibold-override
|
|
317
|
+
--trees-level-gap-override
|
|
318
|
+
--trees-item-padding-x-override
|
|
319
|
+
--trees-item-margin-x-override
|
|
320
|
+
--trees-item-row-gap-override
|
|
321
|
+
--trees-icon-width-override
|
|
322
|
+
--trees-icon-nudge-override
|
|
323
|
+
--trees-scrollbar-gutter-override
|
|
324
|
+
--trees-padding-inline-override
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
--trees-accent: var(--trees-accent-override, #009fff);
|
|
328
|
+
--trees-fg: var(
|
|
329
|
+
--trees-fg-override,
|
|
330
|
+
var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
|
|
331
|
+
);
|
|
332
|
+
--trees-fg-muted: var(
|
|
333
|
+
--trees-fg-muted-override,
|
|
334
|
+
var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
|
|
335
|
+
);
|
|
336
|
+
--trees-bg: var(
|
|
337
|
+
--trees-bg-override,
|
|
338
|
+
var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
|
|
339
|
+
);
|
|
340
|
+
/* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
|
|
341
|
+
--trees-bg-muted: var(
|
|
342
|
+
--trees-bg-muted-override,
|
|
343
|
+
var(
|
|
344
|
+
--trees-theme-list-hover-bg,
|
|
345
|
+
light-dark(
|
|
346
|
+
color-mix(
|
|
347
|
+
in lab,
|
|
348
|
+
var(--trees-accent) var(--trees-bg-alpha-light, 8%),
|
|
349
|
+
var(--trees-bg)
|
|
350
|
+
),
|
|
351
|
+
color-mix(
|
|
352
|
+
in lab,
|
|
353
|
+
var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
|
|
354
|
+
var(--trees-bg)
|
|
355
|
+
)
|
|
356
|
+
)
|
|
357
|
+
)
|
|
358
|
+
);
|
|
359
|
+
--trees-input-bg: var(
|
|
360
|
+
--trees-input-bg-override,
|
|
361
|
+
light-dark(#f8f8f8, #070707)
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
--trees-added-light: #16a994;
|
|
365
|
+
--trees-added-dark: #00cab1;
|
|
366
|
+
--trees-ignored-light: #adadb1;
|
|
367
|
+
--trees-ignored-dark: #4a4a4e;
|
|
368
|
+
--trees-modified-light: #1ca1c7;
|
|
369
|
+
--trees-modified-dark: #08c0ef;
|
|
370
|
+
--trees-renamed-light: #d5a910;
|
|
371
|
+
--trees-renamed-dark: #ffd452;
|
|
372
|
+
--trees-untracked-light: #16a994;
|
|
373
|
+
--trees-untracked-dark: #00cab1;
|
|
374
|
+
--trees-deleted-light: #ff2e3f;
|
|
375
|
+
--trees-deleted-dark: #ff6762;
|
|
376
|
+
|
|
377
|
+
--trees-border-color: var(
|
|
378
|
+
--trees-border-color-override,
|
|
379
|
+
var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
|
|
380
|
+
);
|
|
381
|
+
--trees-indent-guide-bg: var(
|
|
382
|
+
--trees-indent-guide-bg-override,
|
|
383
|
+
color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
|
|
384
|
+
);
|
|
385
|
+
--trees-density: var(--trees-density-override, 1);
|
|
386
|
+
--trees-border-radius: var(
|
|
387
|
+
--trees-border-radius-override,
|
|
388
|
+
calc(6px * var(--trees-density))
|
|
389
|
+
);
|
|
390
|
+
|
|
391
|
+
--trees-font-family: var(--trees-font-family-override, system-ui);
|
|
392
|
+
--trees-font-size: var(--trees-font-size-override, 13px);
|
|
393
|
+
--trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
|
|
394
|
+
--trees-font-weight-semibold: var(
|
|
395
|
+
--trees-font-weight-semibold-override,
|
|
396
|
+
600
|
|
397
|
+
);
|
|
398
|
+
|
|
399
|
+
--trees-focus-ring-color: var(
|
|
400
|
+
--trees-focus-ring-color-override,
|
|
401
|
+
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
402
|
+
);
|
|
403
|
+
--trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
|
|
404
|
+
--trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
|
|
405
|
+
|
|
406
|
+
--trees-search-fg: var(
|
|
407
|
+
--trees-search-fg-override,
|
|
408
|
+
var(--trees-theme-input-fg, var(--trees-fg))
|
|
409
|
+
);
|
|
410
|
+
--trees-search-font-weight: var(--trees-search-font-weight-override, 600);
|
|
411
|
+
--trees-search-bg: var(
|
|
412
|
+
--trees-search-bg-override,
|
|
413
|
+
var(--trees-theme-input-bg, var(--trees-input-bg))
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
--trees-scrollbar-thumb: var(
|
|
417
|
+
--trees-scrollbar-thumb-override,
|
|
418
|
+
var(
|
|
419
|
+
--trees-theme-scrollbar-thumb,
|
|
420
|
+
color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
|
|
421
|
+
)
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
--trees-selected-fg: var(
|
|
425
|
+
--trees-selected-fg-override,
|
|
426
|
+
var(--trees-theme-list-active-selection-fg, var(--trees-fg))
|
|
427
|
+
);
|
|
428
|
+
--trees-selected-bg: var(
|
|
429
|
+
--trees-selected-bg-override,
|
|
430
|
+
var(
|
|
431
|
+
--trees-theme-list-active-selection-bg,
|
|
432
|
+
light-dark(
|
|
433
|
+
color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
|
|
434
|
+
color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
|
|
435
|
+
)
|
|
436
|
+
)
|
|
437
|
+
);
|
|
438
|
+
--trees-selected-focused-border-color: var(
|
|
439
|
+
--trees-selected-focused-border-color-override,
|
|
440
|
+
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
441
|
+
);
|
|
442
|
+
|
|
443
|
+
/* Git status (e.g. from Shiki theme gitDecoration.*) */
|
|
444
|
+
--trees-status-added: var(
|
|
445
|
+
--trees-status-added-override,
|
|
446
|
+
var(
|
|
447
|
+
--trees-theme-git-added-fg,
|
|
448
|
+
light-dark(var(--trees-added-light), var(--trees-added-dark))
|
|
449
|
+
)
|
|
450
|
+
);
|
|
451
|
+
--trees-status-ignored: var(
|
|
452
|
+
--trees-status-ignored-override,
|
|
453
|
+
var(
|
|
454
|
+
--trees-theme-git-ignored-fg,
|
|
455
|
+
light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
|
|
456
|
+
)
|
|
457
|
+
);
|
|
458
|
+
--trees-status-modified: var(
|
|
459
|
+
--trees-status-modified-override,
|
|
460
|
+
var(
|
|
461
|
+
--trees-theme-git-modified-fg,
|
|
462
|
+
light-dark(var(--trees-modified-light), var(--trees-modified-dark))
|
|
463
|
+
)
|
|
464
|
+
);
|
|
465
|
+
--trees-status-renamed: var(
|
|
466
|
+
--trees-status-renamed-override,
|
|
467
|
+
var(
|
|
468
|
+
--trees-theme-git-renamed-fg,
|
|
469
|
+
light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
|
|
470
|
+
)
|
|
471
|
+
);
|
|
472
|
+
--trees-status-untracked: var(
|
|
473
|
+
--trees-status-untracked-override,
|
|
474
|
+
var(
|
|
475
|
+
--trees-theme-git-untracked-fg,
|
|
476
|
+
light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
|
|
477
|
+
)
|
|
478
|
+
);
|
|
479
|
+
--trees-status-deleted: var(
|
|
480
|
+
--trees-status-deleted-override,
|
|
481
|
+
var(
|
|
482
|
+
--trees-theme-git-deleted-fg,
|
|
483
|
+
light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
|
|
484
|
+
)
|
|
485
|
+
);
|
|
486
|
+
--trees-git-modified-color: var(
|
|
487
|
+
--trees-git-modified-color-override,
|
|
488
|
+
var(--trees-status-modified)
|
|
489
|
+
);
|
|
490
|
+
--trees-git-added-color: var(
|
|
491
|
+
--trees-git-added-color-override,
|
|
492
|
+
var(--trees-status-added)
|
|
493
|
+
);
|
|
494
|
+
--trees-git-ignored-color: var(
|
|
495
|
+
--trees-git-ignored-color-override,
|
|
496
|
+
var(--trees-status-ignored)
|
|
497
|
+
);
|
|
498
|
+
--trees-git-deleted-color: var(
|
|
499
|
+
--trees-git-deleted-color-override,
|
|
500
|
+
var(--trees-status-deleted)
|
|
501
|
+
);
|
|
502
|
+
--trees-git-renamed-color: var(
|
|
503
|
+
--trees-git-renamed-color-override,
|
|
504
|
+
var(--trees-status-renamed)
|
|
505
|
+
);
|
|
506
|
+
--trees-git-untracked-color: var(
|
|
507
|
+
--trees-git-untracked-color-override,
|
|
508
|
+
var(--trees-status-untracked)
|
|
509
|
+
);
|
|
510
|
+
|
|
511
|
+
--trees-icon-gray: light-dark(#84848a, #adadb1);
|
|
512
|
+
--trees-icon-red: light-dark(#d52c36, #ff6762);
|
|
513
|
+
--trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
|
|
514
|
+
--trees-icon-orange: light-dark(#d47628, #ffa359);
|
|
515
|
+
--trees-icon-yellow: light-dark(#d5a910, #ffd452);
|
|
516
|
+
--trees-icon-green: light-dark(#199f43, #5ecc71);
|
|
517
|
+
--trees-icon-teal: light-dark(#17a5af, #64d1db);
|
|
518
|
+
--trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
|
|
519
|
+
--trees-icon-blue: light-dark(#1a85d4, #69b1ff);
|
|
520
|
+
--trees-icon-indigo: light-dark(#693acf, #9d6afb);
|
|
521
|
+
--trees-icon-purple: light-dark(#a631be, #d568ea);
|
|
522
|
+
--trees-icon-pink: light-dark(#d32a61, #ff678d);
|
|
523
|
+
--trees-icon-mauve: light-dark(#594c5b, #79697b);
|
|
524
|
+
|
|
525
|
+
--trees-file-icon-color-default: var(
|
|
526
|
+
--trees-file-icon-color,
|
|
527
|
+
var(--trees-icon-gray)
|
|
528
|
+
);
|
|
529
|
+
--trees-file-icon-color-astro: var(
|
|
530
|
+
--trees-file-icon-color,
|
|
531
|
+
var(--trees-icon-purple)
|
|
532
|
+
);
|
|
533
|
+
--trees-file-icon-color-babel: var(
|
|
534
|
+
--trees-file-icon-color,
|
|
535
|
+
var(--trees-icon-yellow)
|
|
536
|
+
);
|
|
537
|
+
--trees-file-icon-color-bash: var(
|
|
538
|
+
--trees-file-icon-color,
|
|
539
|
+
var(--trees-icon-green)
|
|
540
|
+
);
|
|
541
|
+
--trees-file-icon-color-biome: var(
|
|
542
|
+
--trees-file-icon-color,
|
|
543
|
+
var(--trees-icon-blue)
|
|
544
|
+
);
|
|
545
|
+
--trees-file-icon-color-bootstrap: var(
|
|
546
|
+
--trees-file-icon-color,
|
|
547
|
+
var(--trees-icon-indigo)
|
|
548
|
+
);
|
|
549
|
+
--trees-file-icon-color-browserslist: var(
|
|
550
|
+
--trees-file-icon-color,
|
|
551
|
+
var(--trees-icon-yellow)
|
|
552
|
+
);
|
|
553
|
+
--trees-file-icon-color-bun: var(
|
|
554
|
+
--trees-file-icon-color,
|
|
555
|
+
var(--trees-icon-mauve)
|
|
556
|
+
);
|
|
557
|
+
--trees-file-icon-color-claude: var(
|
|
558
|
+
--trees-file-icon-color,
|
|
559
|
+
var(--trees-icon-orange)
|
|
560
|
+
);
|
|
561
|
+
--trees-file-icon-color-css: var(
|
|
562
|
+
--trees-file-icon-color,
|
|
563
|
+
var(--trees-icon-indigo)
|
|
564
|
+
);
|
|
565
|
+
--trees-file-icon-color-database: var(
|
|
566
|
+
--trees-file-icon-color,
|
|
567
|
+
var(--trees-icon-purple)
|
|
568
|
+
);
|
|
569
|
+
--trees-file-icon-color-docker: var(
|
|
570
|
+
--trees-file-icon-color,
|
|
571
|
+
var(--trees-icon-blue)
|
|
572
|
+
);
|
|
573
|
+
--trees-file-icon-color-eslint: var(
|
|
574
|
+
--trees-file-icon-color,
|
|
575
|
+
var(--trees-icon-indigo)
|
|
576
|
+
);
|
|
577
|
+
--trees-file-icon-color-git: var(
|
|
578
|
+
--trees-file-icon-vermilion,
|
|
579
|
+
var(--trees-icon-vermilion)
|
|
580
|
+
);
|
|
581
|
+
--trees-file-icon-color-go: var(
|
|
582
|
+
--trees-file-icon-color,
|
|
583
|
+
var(--trees-icon-cyan)
|
|
584
|
+
);
|
|
585
|
+
--trees-file-icon-color-graphql: var(
|
|
586
|
+
--trees-file-icon-color,
|
|
587
|
+
var(--trees-icon-pink)
|
|
588
|
+
);
|
|
589
|
+
--trees-file-icon-color-html: var(
|
|
590
|
+
--trees-file-icon-color,
|
|
591
|
+
var(--trees-icon-orange)
|
|
592
|
+
);
|
|
593
|
+
--trees-file-icon-color-image: var(
|
|
594
|
+
--trees-file-icon-color,
|
|
595
|
+
var(--trees-icon-pink)
|
|
596
|
+
);
|
|
597
|
+
--trees-file-icon-color-javascript: var(
|
|
598
|
+
--trees-file-icon-color,
|
|
599
|
+
var(--trees-icon-yellow)
|
|
600
|
+
);
|
|
601
|
+
--trees-file-icon-color-json: var(
|
|
602
|
+
--trees-file-icon-color,
|
|
603
|
+
var(--trees-icon-orange)
|
|
604
|
+
);
|
|
605
|
+
--trees-file-icon-color-markdown: var(
|
|
606
|
+
--trees-file-icon-color,
|
|
607
|
+
var(--trees-icon-green)
|
|
608
|
+
);
|
|
609
|
+
--trees-file-icon-color-mcp: var(
|
|
610
|
+
--trees-file-icon-color,
|
|
611
|
+
var(--trees-icon-teal)
|
|
612
|
+
);
|
|
613
|
+
--trees-file-icon-color-npm: var(
|
|
614
|
+
--trees-file-icon-color,
|
|
615
|
+
var(--trees-icon-red)
|
|
616
|
+
);
|
|
617
|
+
--trees-file-icon-color-oxc: var(
|
|
618
|
+
--trees-file-icon-cyan,
|
|
619
|
+
var(--trees-icon-cyan)
|
|
620
|
+
);
|
|
621
|
+
--trees-file-icon-color-postcss: var(
|
|
622
|
+
--trees-file-icon-color,
|
|
623
|
+
var(--trees-icon-red)
|
|
624
|
+
);
|
|
625
|
+
--trees-file-icon-color-prettier: var(
|
|
626
|
+
--trees-file-icon-color,
|
|
627
|
+
var(--trees-icon-teal)
|
|
628
|
+
);
|
|
629
|
+
--trees-file-icon-color-python: var(
|
|
630
|
+
--trees-file-icon-color,
|
|
631
|
+
var(--trees-icon-blue)
|
|
632
|
+
);
|
|
633
|
+
--trees-file-icon-color-react: var(
|
|
634
|
+
--trees-file-icon-color,
|
|
635
|
+
var(--trees-icon-cyan)
|
|
636
|
+
);
|
|
637
|
+
--trees-file-icon-color-ruby: var(
|
|
638
|
+
--trees-file-icon-color,
|
|
639
|
+
var(--trees-icon-red)
|
|
640
|
+
);
|
|
641
|
+
--trees-file-icon-color-rust: var(
|
|
642
|
+
--trees-file-icon-color,
|
|
643
|
+
var(--trees-icon-orange)
|
|
644
|
+
);
|
|
645
|
+
--trees-file-icon-color-sass: var(
|
|
646
|
+
--trees-file-icon-color,
|
|
647
|
+
var(--trees-icon-pink)
|
|
648
|
+
);
|
|
649
|
+
--trees-file-icon-color-svg: var(
|
|
650
|
+
--trees-file-icon-color,
|
|
651
|
+
var(--trees-icon-orange)
|
|
652
|
+
);
|
|
653
|
+
--trees-file-icon-color-svelte: var(
|
|
654
|
+
--trees-file-icon-color,
|
|
655
|
+
var(--trees-icon-red)
|
|
656
|
+
);
|
|
657
|
+
--trees-file-icon-color-svgo: var(
|
|
658
|
+
--trees-file-icon-color,
|
|
659
|
+
var(--trees-icon-green)
|
|
660
|
+
);
|
|
661
|
+
--trees-file-icon-color-swift: var(
|
|
662
|
+
--trees-file-icon-color,
|
|
663
|
+
var(--trees-icon-orange)
|
|
664
|
+
);
|
|
665
|
+
--trees-file-icon-color-table: var(
|
|
666
|
+
--trees-file-icon-color,
|
|
667
|
+
var(--trees-icon-teal)
|
|
668
|
+
);
|
|
669
|
+
--trees-file-icon-color-text: var(
|
|
670
|
+
--trees-file-icon-color,
|
|
671
|
+
var(--trees-icon-gray)
|
|
672
|
+
);
|
|
673
|
+
--trees-file-icon-color-tailwind: var(
|
|
674
|
+
--trees-file-icon-color,
|
|
675
|
+
var(--trees-icon-cyan)
|
|
676
|
+
);
|
|
677
|
+
--trees-file-icon-color-terraform: var(
|
|
678
|
+
--trees-file-icon-color,
|
|
679
|
+
var(--trees-icon-indigo)
|
|
680
|
+
);
|
|
681
|
+
--trees-file-icon-color-typescript: var(
|
|
682
|
+
--trees-file-icon-color,
|
|
683
|
+
var(--trees-icon-blue)
|
|
684
|
+
);
|
|
685
|
+
--trees-file-icon-color-vite: var(
|
|
686
|
+
--trees-file-icon-color,
|
|
687
|
+
var(--trees-icon-purple)
|
|
688
|
+
);
|
|
689
|
+
--trees-file-icon-color-vscode: var(
|
|
690
|
+
--trees-file-icon-color,
|
|
691
|
+
var(--trees-icon-blue)
|
|
692
|
+
);
|
|
693
|
+
--trees-file-icon-color-vue: var(
|
|
694
|
+
--trees-file-icon-color,
|
|
695
|
+
var(--trees-icon-green)
|
|
696
|
+
);
|
|
697
|
+
--trees-file-icon-color-wasm: var(
|
|
698
|
+
--trees-file-icon-color,
|
|
699
|
+
var(--trees-icon-indigo)
|
|
700
|
+
);
|
|
701
|
+
--trees-file-icon-color-webpack: var(
|
|
702
|
+
--trees-file-icon-color,
|
|
703
|
+
var(--trees-icon-blue)
|
|
704
|
+
);
|
|
705
|
+
--trees-file-icon-color-yml: var(
|
|
706
|
+
--trees-file-icon-color,
|
|
707
|
+
var(--trees-icon-red)
|
|
708
|
+
);
|
|
709
|
+
--trees-file-icon-color-zig: var(
|
|
710
|
+
--trees-file-icon-color,
|
|
711
|
+
var(--trees-icon-orange)
|
|
712
|
+
);
|
|
713
|
+
--trees-file-icon-color-zip: var(
|
|
714
|
+
--trees-file-icon-color,
|
|
715
|
+
var(--trees-icon-orange)
|
|
716
|
+
);
|
|
717
|
+
|
|
718
|
+
--trees-level-gap: var(
|
|
719
|
+
--trees-level-gap-override,
|
|
720
|
+
calc(8px * var(--trees-density))
|
|
721
|
+
);
|
|
722
|
+
--trees-item-padding-x: var(
|
|
723
|
+
--trees-item-padding-x-override,
|
|
724
|
+
calc(8px * var(--trees-density))
|
|
725
|
+
);
|
|
726
|
+
--trees-item-margin-x: var(
|
|
727
|
+
--trees-item-margin-x-override,
|
|
728
|
+
calc(2px * var(--trees-density))
|
|
729
|
+
);
|
|
730
|
+
--trees-item-row-gap: var(
|
|
731
|
+
--trees-item-row-gap-override,
|
|
732
|
+
calc(6px * var(--trees-density))
|
|
733
|
+
);
|
|
734
|
+
--trees-icon-width: var(--trees-icon-width-override, 16px);
|
|
735
|
+
--trees-icon-nudge: var(
|
|
736
|
+
--trees-icon-nudge-override,
|
|
737
|
+
calc(1px * var(--trees-density))
|
|
738
|
+
);
|
|
739
|
+
--trees-row-height: var(--trees-item-height, 30px);
|
|
740
|
+
--trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
|
|
741
|
+
--trees-action-lane-width: var(
|
|
742
|
+
--trees-action-lane-width-override,
|
|
743
|
+
calc(var(--trees-icon-width) + 2px)
|
|
744
|
+
);
|
|
745
|
+
/* Keep the floating trigger aligned with the row's action lane. Going in
|
|
746
|
+
from the root's right edge: the scroll container reserves
|
|
747
|
+
\`--trees-padding-inline\` of effective inset on each side (its asymmetric
|
|
748
|
+
padding formula cancels the scrollbar gutter on the right), the row
|
|
749
|
+
sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
|
|
750
|
+
action lane itself. The trigger's own focus-ring margin then trims one
|
|
751
|
+
pixel back so the button's visible right edge lines up with the lane. */
|
|
752
|
+
--trees-context-menu-trigger-inline-offset: calc(
|
|
753
|
+
var(--trees-padding-inline) + var(--trees-item-padding-x) -
|
|
754
|
+
var(--trees-focus-ring-width)
|
|
755
|
+
);
|
|
756
|
+
|
|
757
|
+
--trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
|
|
758
|
+
--trees-padding-inline: var(--trees-padding-inline-override, 16px);
|
|
759
|
+
|
|
760
|
+
color-scheme: light dark;
|
|
761
|
+
display: flex;
|
|
762
|
+
flex-direction: column;
|
|
763
|
+
font-size: var(--trees-font-size);
|
|
764
|
+
color: var(--trees-fg);
|
|
765
|
+
background-color: var(--trees-bg);
|
|
766
|
+
--truncate-marker-background-color: var(--trees-bg);
|
|
767
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
768
|
+
font-family: var(--trees-font-family);
|
|
769
|
+
font-weight: var(--trees-font-weight-regular);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
:host([data-file-tree-virtualized='true']) {
|
|
773
|
+
height: 100%;
|
|
774
|
+
overflow: hidden;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
[data-file-tree-virtualized-wrapper='true'] {
|
|
778
|
+
height: 100%;
|
|
779
|
+
overflow: hidden;
|
|
780
|
+
display: flex;
|
|
781
|
+
flex-direction: column;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
[data-file-tree-virtualized-root='true'] {
|
|
785
|
+
height: 100%;
|
|
786
|
+
display: flex;
|
|
787
|
+
flex-direction: column;
|
|
788
|
+
overflow: hidden;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
[data-file-tree-virtualized-scroll='true'],
|
|
792
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
793
|
+
overflow-y: auto;
|
|
794
|
+
scrollbar-gutter: stable;
|
|
795
|
+
|
|
796
|
+
&::-webkit-scrollbar {
|
|
797
|
+
width: var(--trees-scrollbar-gutter);
|
|
798
|
+
height: var(--trees-scrollbar-gutter);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
&::-webkit-scrollbar-track {
|
|
802
|
+
background: transparent;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
&::-webkit-scrollbar-thumb {
|
|
806
|
+
background-color: var(--trees-scrollbar-thumb);
|
|
807
|
+
border: 1px solid transparent;
|
|
808
|
+
background-clip: content-box;
|
|
809
|
+
border-radius: calc(var(--trees-scrollbar-gutter) / 2);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
&::-webkit-scrollbar-corner {
|
|
813
|
+
background-color: transparent;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/* These are styles for a temporarily generated element to measure the size
|
|
818
|
+
* of the scrollbar. It's intended to be somewhat similar in scrollbar style
|
|
819
|
+
* scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
|
|
820
|
+
* accurate reflection of the size the scrollbar gutter takes up. */
|
|
821
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
822
|
+
position: absolute;
|
|
823
|
+
top: 0;
|
|
824
|
+
left: 0;
|
|
825
|
+
visibility: hidden;
|
|
826
|
+
pointer-events: none;
|
|
827
|
+
width: 100px;
|
|
828
|
+
height: 100px;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
@supports (-moz-appearance: none) {
|
|
832
|
+
[data-file-tree-virtualized-scroll='true'],
|
|
833
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
834
|
+
scrollbar-width: thin;
|
|
835
|
+
scrollbar-color: var(--trees-scrollbar-thumb) transparent;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
[data-file-tree-virtualized-scroll='true'] {
|
|
840
|
+
position: relative;
|
|
841
|
+
overflow-y: auto;
|
|
842
|
+
flex: 1 1 0;
|
|
843
|
+
min-height: 0;
|
|
844
|
+
padding-inline: max(
|
|
845
|
+
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
846
|
+
0px
|
|
847
|
+
)
|
|
848
|
+
/* NOTE(amadeus): We can assume that all Webkit based browser gutters
|
|
849
|
+
* will align to the value of '--trees-scrollbar-gutter', however if not, then
|
|
850
|
+
* \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
|
|
851
|
+
* hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
|
|
852
|
+
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
853
|
+
*/
|
|
854
|
+
max(
|
|
855
|
+
calc(
|
|
856
|
+
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
857
|
+
var(
|
|
858
|
+
--trees-scrollbar-gutter-measured,
|
|
859
|
+
var(--trees-scrollbar-gutter)
|
|
860
|
+
)
|
|
861
|
+
),
|
|
862
|
+
0px
|
|
863
|
+
);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
@supports (-moz-appearance: none) {
|
|
867
|
+
[data-file-tree-virtualized-scroll='true'] {
|
|
868
|
+
padding-inline: max(
|
|
869
|
+
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
870
|
+
0px
|
|
871
|
+
)
|
|
872
|
+
/* NOTE(amadeus): However on Firefox it can vary a little bit, but most
|
|
873
|
+
* likely the majority of cases will default to a 0px width scrollbar lets
|
|
874
|
+
* inherit that first to avoid SSR jumps. In non-SSR'd environments
|
|
875
|
+
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
876
|
+
*/
|
|
877
|
+
max(
|
|
878
|
+
calc(
|
|
879
|
+
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
880
|
+
var(--trees-scrollbar-gutter-measured, 0px)
|
|
881
|
+
),
|
|
882
|
+
0px
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
[data-file-tree-sticky-overlay='true'] {
|
|
888
|
+
position: sticky;
|
|
889
|
+
top: 0;
|
|
890
|
+
height: 0;
|
|
891
|
+
z-index: 4;
|
|
892
|
+
overflow: visible;
|
|
893
|
+
pointer-events: none;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/* The overlay DOM is kept populated even at scrollTop=0 so the browser has
|
|
897
|
+
* the rendered rows on hand the moment scrolling begins — otherwise the
|
|
898
|
+
* compositor paints a scrolled frame before React can mount the overlay,
|
|
899
|
+
* and the topmost sticky folder jumps up by a couple of pixels before it
|
|
900
|
+
* "snaps" into its pinned position. We hide it via CSS whenever the scroll
|
|
901
|
+
* is at the top and no scroll is in progress, so the preview doesn't leak
|
|
902
|
+
* through at rest. \`data-overlay-reveal\` is stamped on the root only when
|
|
903
|
+
* the user initiates a scroll while already at the top — exactly the case
|
|
904
|
+
* where we need the pre-mounted overlay to be visible through the first
|
|
905
|
+
* compositor frame. It is deliberately distinct from the general
|
|
906
|
+
* \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
|
|
907
|
+
* navigation) re-hides the overlay the instant the scroll lands, rather
|
|
908
|
+
* than waiting for the hover-suppression timer to elapse. */
|
|
909
|
+
[data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
|
|
910
|
+
[data-overlay-reveal]
|
|
911
|
+
)
|
|
912
|
+
[data-file-tree-sticky-overlay='true'] {
|
|
913
|
+
visibility: hidden;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
[data-file-tree-sticky-overlay-content='true'] {
|
|
917
|
+
background-color: var(--trees-bg);
|
|
918
|
+
position: relative;
|
|
919
|
+
pointer-events: none;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
[data-file-tree-virtualized-list='true'] {
|
|
923
|
+
background-color: var(--trees-bg);
|
|
924
|
+
position: relative;
|
|
925
|
+
min-height: 100%;
|
|
926
|
+
width: 100%;
|
|
927
|
+
overflow-anchor: none;
|
|
928
|
+
|
|
929
|
+
&[data-is-scrolling] {
|
|
930
|
+
pointer-events: none;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
[data-file-tree-virtualized-sticky-offset='true'] {
|
|
935
|
+
contain: layout size;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
[data-file-tree-virtualized-sticky='true'] {
|
|
939
|
+
position: sticky;
|
|
940
|
+
top: 0;
|
|
941
|
+
width: 100%;
|
|
942
|
+
display: flex;
|
|
943
|
+
flex-direction: column;
|
|
944
|
+
isolation: isolate;
|
|
945
|
+
/* Promote to its own compositor layer so text inside the window is
|
|
946
|
+
* rasterized once and GPU-translated during scroll. Without this, the
|
|
947
|
+
* browser re-paints the window (and its text) at every scroll frame,
|
|
948
|
+
* which produces visible 1px shake / character tearing. */
|
|
949
|
+
will-change: transform;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
[data-file-tree-search-container] {
|
|
953
|
+
display: flex;
|
|
954
|
+
padding: 0;
|
|
955
|
+
padding-inline: var(--trees-padding-inline);
|
|
956
|
+
margin-bottom: var(--trees-item-row-gap);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
[data-file-tree-search-input] {
|
|
960
|
+
--trees-focus-ring-width: 2px;
|
|
961
|
+
font-family: var(--trees-font-family);
|
|
962
|
+
font-size: var(--trees-font-size);
|
|
963
|
+
flex: 1;
|
|
964
|
+
height: var(--trees-row-height);
|
|
965
|
+
/* 1px breathing room so the focus-visible outline isn't clipped when the
|
|
966
|
+
* input sits flush against the top of the scroll container. */
|
|
967
|
+
margin-block: 1px;
|
|
968
|
+
padding-inline: var(--trees-item-padding-x);
|
|
969
|
+
line-height: var(--trees-row-height);
|
|
970
|
+
color: var(--trees-search-fg);
|
|
971
|
+
background-color: var(--trees-search-bg);
|
|
972
|
+
border: 1px solid var(--trees-border-color);
|
|
973
|
+
border-radius: var(--trees-border-radius);
|
|
974
|
+
outline: none;
|
|
975
|
+
|
|
976
|
+
&::placeholder {
|
|
977
|
+
color: color-mix(
|
|
978
|
+
in lab,
|
|
979
|
+
var(--trees-search-fg) 65%,
|
|
980
|
+
var(--trees-search-bg)
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
&:focus-visible,
|
|
985
|
+
&[data-file-tree-search-input-fake-focus='true'] {
|
|
986
|
+
outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
|
|
987
|
+
outline-offset: var(--trees-focus-ring-offset);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/* The wrapper for the tree items */
|
|
992
|
+
[role='tree'] {
|
|
993
|
+
position: relative;
|
|
994
|
+
display: flex;
|
|
995
|
+
flex-direction: column;
|
|
996
|
+
gap: var(--trees-gap-override, 0);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
/* LIST ITEM */
|
|
1000
|
+
[data-type='item'] {
|
|
1001
|
+
color: inherit;
|
|
1002
|
+
font-family: var(--trees-font-family);
|
|
1003
|
+
font-size: var(--trees-font-size);
|
|
1004
|
+
text-align: start;
|
|
1005
|
+
outline: none;
|
|
1006
|
+
background-color: var(--trees-bg);
|
|
1007
|
+
border: none;
|
|
1008
|
+
position: relative;
|
|
1009
|
+
|
|
1010
|
+
padding: 0 var(--trees-item-padding-x);
|
|
1011
|
+
margin: 0 var(--trees-item-margin-x);
|
|
1012
|
+
cursor: pointer;
|
|
1013
|
+
-webkit-user-select: none;
|
|
1014
|
+
user-select: none;
|
|
1015
|
+
-webkit-touch-callout: none;
|
|
1016
|
+
touch-action: manipulation;
|
|
1017
|
+
display: flex;
|
|
1018
|
+
flex: 0 0 var(--trees-row-height);
|
|
1019
|
+
align-items: center;
|
|
1020
|
+
height: var(--trees-row-height);
|
|
1021
|
+
line-height: var(--trees-row-height);
|
|
1022
|
+
gap: var(--trees-item-row-gap);
|
|
1023
|
+
border-radius: var(--trees-border-radius);
|
|
1024
|
+
/* Row states may be translucent, so markers paint the tree background first
|
|
1025
|
+
* and then the state color on top to avoid compositing the same alpha twice. */
|
|
1026
|
+
--truncate-marker-background-color: var(--trees-bg);
|
|
1027
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
1028
|
+
--truncate-marker-block-inset: 0px;
|
|
1029
|
+
|
|
1030
|
+
&:hover,
|
|
1031
|
+
&[data-item-context-hover='true'] {
|
|
1032
|
+
background-color: var(--trees-bg-muted);
|
|
1033
|
+
--truncate-marker-background-overlay-color: var(--trees-bg-muted);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
&[data-item-focused='true'],
|
|
1037
|
+
&:focus-visible {
|
|
1038
|
+
z-index: 2;
|
|
1039
|
+
|
|
1040
|
+
/* Flattened segment markers sit high enough to cover the row outline unless
|
|
1041
|
+
* their painted background is inset by the focus ring width. */
|
|
1042
|
+
[data-item-flattened-subitems] {
|
|
1043
|
+
--truncate-marker-block-inset: var(--trees-focus-ring-width);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
&::before {
|
|
1047
|
+
position: absolute;
|
|
1048
|
+
inset: 0;
|
|
1049
|
+
content: '';
|
|
1050
|
+
display: block;
|
|
1051
|
+
border-radius: var(--trees-border-radius);
|
|
1052
|
+
outline: var(--trees-focus-ring-width) solid
|
|
1053
|
+
var(--trees-focus-ring-color);
|
|
1054
|
+
outline-offset: var(--trees-focus-ring-offset);
|
|
1055
|
+
pointer-events: none;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
&[data-item-selected='true']::before {
|
|
1059
|
+
outline-color: var(--trees-selected-focused-border-color);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
&[data-item-selected='true'] {
|
|
1064
|
+
color: var(--trees-selected-fg);
|
|
1065
|
+
background-color: var(--trees-selected-bg);
|
|
1066
|
+
--truncate-marker-background-overlay-color: var(--trees-selected-bg);
|
|
1067
|
+
z-index: 3;
|
|
1068
|
+
|
|
1069
|
+
[data-item-section='icon'] {
|
|
1070
|
+
color: var(--trees-selected-fg);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
&[data-item-search-match='true'] {
|
|
1075
|
+
font-weight: var(--trees-search-font-weight);
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
1080
|
+
pointer-events: auto;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/* Sticky rows opt back into pointer events because the overlay wrapper is
|
|
1084
|
+
* inert. During scroll, put them back under the same hover suppression as
|
|
1085
|
+
* the virtualized list so translucent hover states and menu triggers do not
|
|
1086
|
+
* paint over rows moving beneath the sticky stack. */
|
|
1087
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1088
|
+
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
1089
|
+
pointer-events: none;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1093
|
+
[data-type='item'][data-file-tree-sticky-row='true']:hover:not(
|
|
1094
|
+
[data-item-selected='true']
|
|
1095
|
+
),
|
|
1096
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1097
|
+
[data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
|
|
1098
|
+
[data-item-selected='true']
|
|
1099
|
+
) {
|
|
1100
|
+
background-color: var(--trees-bg);
|
|
1101
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
[data-item-selected='true']:has(+ [data-item-selected='true']) {
|
|
1105
|
+
border-bottom-left-radius: 0;
|
|
1106
|
+
border-bottom-right-radius: 0;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
[data-item-selected='true'] + [data-item-selected='true'] {
|
|
1110
|
+
border-top-left-radius: 0;
|
|
1111
|
+
border-top-right-radius: 0;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/* Flattened Directory Parts */
|
|
1115
|
+
[data-item-flattened-subitems] {
|
|
1116
|
+
display: inline-flex;
|
|
1117
|
+
align-items: center;
|
|
1118
|
+
gap: 2px;
|
|
1119
|
+
}
|
|
1120
|
+
[data-item-flattened-subitem]:hover,
|
|
1121
|
+
[data-item-flattened-subitem-drag-target='true'] {
|
|
1122
|
+
text-decoration: underline;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
/* Icon for each item */
|
|
1126
|
+
[data-item-section='icon'] {
|
|
1127
|
+
flex-shrink: 0;
|
|
1128
|
+
display: flex;
|
|
1129
|
+
align-items: center;
|
|
1130
|
+
justify-content: center;
|
|
1131
|
+
color: var(--trees-fg-muted);
|
|
1132
|
+
fill: currentColor;
|
|
1133
|
+
width: var(--trees-icon-width);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
:where([data-item-section='icon'] > [data-icon-token]) {
|
|
1137
|
+
color: var(--trees-fg-muted);
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
[data-file-tree-colored-icons='true'] {
|
|
1141
|
+
[data-icon-token='astro'] {
|
|
1142
|
+
color: var(--trees-file-icon-color-astro);
|
|
1143
|
+
}
|
|
1144
|
+
[data-icon-token='babel'] {
|
|
1145
|
+
color: var(--trees-file-icon-color-babel);
|
|
1146
|
+
}
|
|
1147
|
+
[data-icon-token='bash'] {
|
|
1148
|
+
color: var(--trees-file-icon-color-bash);
|
|
1149
|
+
}
|
|
1150
|
+
[data-icon-token='biome'] {
|
|
1151
|
+
color: var(--trees-file-icon-color-biome);
|
|
1152
|
+
}
|
|
1153
|
+
[data-icon-token='bootstrap'] {
|
|
1154
|
+
color: var(--trees-file-icon-color-bootstrap);
|
|
1155
|
+
}
|
|
1156
|
+
[data-icon-token='browserslist'] {
|
|
1157
|
+
color: var(--trees-file-icon-color-browserslist);
|
|
1158
|
+
}
|
|
1159
|
+
[data-icon-token='bun'] {
|
|
1160
|
+
color: var(--trees-file-icon-color-bun);
|
|
1161
|
+
}
|
|
1162
|
+
[data-icon-token='claude'] {
|
|
1163
|
+
color: var(--trees-file-icon-color-claude);
|
|
1164
|
+
}
|
|
1165
|
+
[data-icon-token='css'] {
|
|
1166
|
+
color: var(--trees-file-icon-color-css);
|
|
1167
|
+
}
|
|
1168
|
+
[data-icon-token='database'] {
|
|
1169
|
+
color: var(--trees-file-icon-color-database);
|
|
1170
|
+
}
|
|
1171
|
+
[data-icon-token='default'] {
|
|
1172
|
+
color: var(--trees-file-icon-color-default);
|
|
1173
|
+
}
|
|
1174
|
+
[data-icon-token='docker'] {
|
|
1175
|
+
color: var(--trees-file-icon-color-docker);
|
|
1176
|
+
}
|
|
1177
|
+
[data-icon-token='eslint'] {
|
|
1178
|
+
color: var(--trees-file-icon-color-eslint);
|
|
1179
|
+
}
|
|
1180
|
+
[data-icon-token='git'] {
|
|
1181
|
+
color: var(--trees-file-icon-color-git);
|
|
1182
|
+
}
|
|
1183
|
+
[data-icon-token='go'] {
|
|
1184
|
+
color: var(--trees-file-icon-color-go);
|
|
1185
|
+
}
|
|
1186
|
+
[data-icon-token='graphql'] {
|
|
1187
|
+
color: var(--trees-file-icon-color-graphql);
|
|
1188
|
+
}
|
|
1189
|
+
[data-icon-token='html'] {
|
|
1190
|
+
color: var(--trees-file-icon-color-html);
|
|
1191
|
+
}
|
|
1192
|
+
[data-icon-token='image'] {
|
|
1193
|
+
color: var(--trees-file-icon-color-image);
|
|
1194
|
+
}
|
|
1195
|
+
[data-icon-token='javascript'] {
|
|
1196
|
+
color: var(--trees-file-icon-color-javascript);
|
|
1197
|
+
}
|
|
1198
|
+
[data-icon-token='json'] {
|
|
1199
|
+
color: var(--trees-file-icon-color-json);
|
|
1200
|
+
}
|
|
1201
|
+
[data-icon-token='markdown'] {
|
|
1202
|
+
color: var(--trees-file-icon-color-markdown);
|
|
1203
|
+
}
|
|
1204
|
+
[data-icon-token='mcp'] {
|
|
1205
|
+
color: var(--trees-file-icon-color-mcp);
|
|
1206
|
+
}
|
|
1207
|
+
[data-icon-token='npm'] {
|
|
1208
|
+
color: var(--trees-file-icon-color-npm);
|
|
1209
|
+
}
|
|
1210
|
+
[data-icon-token='oxc'] {
|
|
1211
|
+
color: var(--trees-file-icon-color-oxc);
|
|
1212
|
+
}
|
|
1213
|
+
[data-icon-token='postcss'] {
|
|
1214
|
+
color: var(--trees-file-icon-color-postcss);
|
|
1215
|
+
}
|
|
1216
|
+
[data-icon-token='prettier'] {
|
|
1217
|
+
color: var(--trees-file-icon-color-prettier);
|
|
1218
|
+
}
|
|
1219
|
+
[data-icon-token='python'] {
|
|
1220
|
+
color: var(--trees-file-icon-color-python);
|
|
1221
|
+
}
|
|
1222
|
+
[data-icon-token='react'] {
|
|
1223
|
+
color: var(--trees-file-icon-color-react);
|
|
1224
|
+
}
|
|
1225
|
+
[data-icon-token='ruby'] {
|
|
1226
|
+
color: var(--trees-file-icon-color-ruby);
|
|
1227
|
+
}
|
|
1228
|
+
[data-icon-token='rust'] {
|
|
1229
|
+
color: var(--trees-file-icon-color-rust);
|
|
1230
|
+
}
|
|
1231
|
+
[data-icon-token='sass'] {
|
|
1232
|
+
color: var(--trees-file-icon-color-sass);
|
|
1233
|
+
}
|
|
1234
|
+
[data-icon-token='svg'] {
|
|
1235
|
+
color: var(--trees-file-icon-color-svg);
|
|
1236
|
+
}
|
|
1237
|
+
[data-icon-token='svelte'] {
|
|
1238
|
+
color: var(--trees-file-icon-color-svelte);
|
|
1239
|
+
}
|
|
1240
|
+
[data-icon-token='svgo'] {
|
|
1241
|
+
color: var(--trees-file-icon-color-svgo);
|
|
1242
|
+
}
|
|
1243
|
+
[data-icon-token='swift'] {
|
|
1244
|
+
color: var(--trees-file-icon-color-swift);
|
|
1245
|
+
}
|
|
1246
|
+
[data-icon-token='table'] {
|
|
1247
|
+
color: var(--trees-file-icon-color-table);
|
|
1248
|
+
}
|
|
1249
|
+
[data-icon-token='text'] {
|
|
1250
|
+
color: var(--trees-file-icon-color-text);
|
|
1251
|
+
}
|
|
1252
|
+
[data-icon-token='tailwind'] {
|
|
1253
|
+
color: var(--trees-file-icon-color-tailwind);
|
|
1254
|
+
}
|
|
1255
|
+
[data-icon-token='terraform'] {
|
|
1256
|
+
color: var(--trees-file-icon-color-terraform);
|
|
1257
|
+
}
|
|
1258
|
+
[data-icon-token='typescript'] {
|
|
1259
|
+
color: var(--trees-file-icon-color-typescript);
|
|
1260
|
+
}
|
|
1261
|
+
[data-icon-token='vite'] {
|
|
1262
|
+
color: var(--trees-file-icon-color-vite);
|
|
1263
|
+
}
|
|
1264
|
+
[data-icon-token='vscode'] {
|
|
1265
|
+
color: var(--trees-file-icon-color-vscode);
|
|
1266
|
+
}
|
|
1267
|
+
[data-icon-token='vue'] {
|
|
1268
|
+
color: var(--trees-file-icon-color-vue);
|
|
1269
|
+
}
|
|
1270
|
+
[data-icon-token='wasm'] {
|
|
1271
|
+
color: var(--trees-file-icon-color-wasm);
|
|
1272
|
+
}
|
|
1273
|
+
[data-icon-token='webpack'] {
|
|
1274
|
+
color: var(--trees-file-icon-color-webpack);
|
|
1275
|
+
}
|
|
1276
|
+
[data-icon-token='yml'] {
|
|
1277
|
+
color: var(--trees-file-icon-color-yml);
|
|
1278
|
+
}
|
|
1279
|
+
[data-icon-token='zig'] {
|
|
1280
|
+
color: var(--trees-file-icon-color-zig);
|
|
1281
|
+
}
|
|
1282
|
+
[data-icon-token='zip'] {
|
|
1283
|
+
color: var(--trees-file-icon-color-zip);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
/* Chevron rotation and visual alignment */
|
|
1288
|
+
/* Chevron pointing down */
|
|
1289
|
+
[data-icon-name='file-tree-icon-chevron'] {
|
|
1290
|
+
&[data-align-capitals='false'] {
|
|
1291
|
+
transform: translate(0, var(--trees-icon-nudge));
|
|
1292
|
+
}
|
|
1293
|
+
&[data-align-capitals='true'] {
|
|
1294
|
+
transform: translate(0, 0);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
[data-item-section='content'] {
|
|
1299
|
+
flex: 0 1 auto;
|
|
1300
|
+
text-align: start;
|
|
1301
|
+
min-width: 0;
|
|
1302
|
+
max-width: 100%;
|
|
1303
|
+
overflow: hidden;
|
|
1304
|
+
text-overflow: ellipsis;
|
|
1305
|
+
/* Breaks middle truncate component to also set this */
|
|
1306
|
+
/* white-space: nowrap; */
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
[data-item-section='decoration'] {
|
|
1310
|
+
flex: 1 1 0;
|
|
1311
|
+
min-width: 0;
|
|
1312
|
+
display: flex;
|
|
1313
|
+
justify-content: flex-end;
|
|
1314
|
+
text-align: end;
|
|
1315
|
+
overflow: hidden;
|
|
1316
|
+
color: var(--trees-fg-muted);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
[data-item-section='decoration'] > span {
|
|
1320
|
+
min-width: 0;
|
|
1321
|
+
max-width: 100%;
|
|
1322
|
+
display: inline-flex;
|
|
1323
|
+
align-items: center;
|
|
1324
|
+
justify-content: flex-end;
|
|
1325
|
+
overflow: hidden;
|
|
1326
|
+
text-overflow: ellipsis;
|
|
1327
|
+
white-space: nowrap;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
[data-item-section='git'],
|
|
1331
|
+
[data-item-section='action'] {
|
|
1332
|
+
flex: 0 0 auto;
|
|
1333
|
+
display: flex;
|
|
1334
|
+
align-items: center;
|
|
1335
|
+
justify-content: center;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
[data-item-section='git'] {
|
|
1339
|
+
width: var(--trees-git-lane-width);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
[data-item-section='action'] {
|
|
1343
|
+
width: var(--trees-action-lane-width);
|
|
1344
|
+
color: var(--trees-fg-muted);
|
|
1345
|
+
fill: currentColor;
|
|
1346
|
+
pointer-events: none;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
[data-item-section='git'] > span,
|
|
1350
|
+
[data-item-section='action'] > span {
|
|
1351
|
+
width: 100%;
|
|
1352
|
+
display: inline-flex;
|
|
1353
|
+
align-items: center;
|
|
1354
|
+
justify-content: center;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
[data-item-action-affordance='decorative'] {
|
|
1358
|
+
opacity: 0.85;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
[data-item-rename-input] {
|
|
1362
|
+
appearance: none;
|
|
1363
|
+
width: 100%;
|
|
1364
|
+
min-width: 0;
|
|
1365
|
+
height: calc(var(--trees-row-height) - 4px);
|
|
1366
|
+
font-family: inherit;
|
|
1367
|
+
font-size: inherit;
|
|
1368
|
+
/* line-height: calc(var(--trees-row-height) - 8px); */
|
|
1369
|
+
color: inherit;
|
|
1370
|
+
background-color: transparent;
|
|
1371
|
+
border: 0;
|
|
1372
|
+
padding-inline: 6px;
|
|
1373
|
+
outline: none;
|
|
1374
|
+
box-sizing: border-box;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
[data-item-section='content']:has([data-item-rename-input])
|
|
1378
|
+
~ [data-item-section='action'],
|
|
1379
|
+
[data-item-section='content']:has([data-item-rename-input])
|
|
1380
|
+
~ [data-item-section='decoration'] {
|
|
1381
|
+
display: none;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
/* Chevron pointing right */
|
|
1385
|
+
[aria-expanded='false'][data-item-type='folder']
|
|
1386
|
+
> [data-item-section='icon']
|
|
1387
|
+
> [data-icon-name='file-tree-icon-chevron'] {
|
|
1388
|
+
&[data-align-capitals='true'] {
|
|
1389
|
+
transform: rotate(-90deg)
|
|
1390
|
+
translate(
|
|
1391
|
+
calc(var(--trees-icon-nudge) / 2),
|
|
1392
|
+
calc(var(--trees-icon-nudge) / 2)
|
|
1393
|
+
);
|
|
1394
|
+
}
|
|
1395
|
+
&[data-align-capitals='false'] {
|
|
1396
|
+
transform: rotate(-90deg)
|
|
1397
|
+
translate(
|
|
1398
|
+
calc(var(--trees-icon-nudge) / 2 * -1),
|
|
1399
|
+
calc(var(--trees-icon-nudge) / 2)
|
|
1400
|
+
);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/* LIST IDENTATION */
|
|
1405
|
+
/* Spacing container */
|
|
1406
|
+
[data-item-section='spacing'] {
|
|
1407
|
+
display: flex;
|
|
1408
|
+
flex-direction: row;
|
|
1409
|
+
align-items: center;
|
|
1410
|
+
justify-content: center;
|
|
1411
|
+
height: var(--trees-row-height);
|
|
1412
|
+
padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
|
|
1413
|
+
|
|
1414
|
+
&:empty {
|
|
1415
|
+
padding-left: 0;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
/* Spacing per level */
|
|
1420
|
+
[data-item-section='spacing-item'] {
|
|
1421
|
+
transform: translateX(-0.25px);
|
|
1422
|
+
display: inline-block;
|
|
1423
|
+
border-left: 1px solid var(--trees-indent-guide-bg);
|
|
1424
|
+
height: 100%;
|
|
1425
|
+
margin-right: calc(var(--trees-level-gap) - 1px);
|
|
1426
|
+
opacity: 0;
|
|
1427
|
+
transition: opacity 150ms ease;
|
|
1428
|
+
|
|
1429
|
+
& + & {
|
|
1430
|
+
margin-left: calc(
|
|
1431
|
+
var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
|
|
1432
|
+
);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
:host(:hover) [data-item-section='spacing-item'] {
|
|
1437
|
+
opacity: 0.75;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
/* Git status indicator */
|
|
1441
|
+
|
|
1442
|
+
/* This is a folder that contains a git change */
|
|
1443
|
+
[data-item-contains-git-change='true'] > [data-item-section='git'] {
|
|
1444
|
+
color: var(--trees-git-modified-color);
|
|
1445
|
+
opacity: 0.5;
|
|
1446
|
+
fill: currentColor;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
/* These are files that have a git change */
|
|
1450
|
+
[data-item-git-status] {
|
|
1451
|
+
&
|
|
1452
|
+
> :where([data-item-section='icon'])
|
|
1453
|
+
> :where(:not([data-icon-name='file-tree-icon-chevron'])) {
|
|
1454
|
+
color: var(--trees-item-git-status-color);
|
|
1455
|
+
}
|
|
1456
|
+
& > [data-item-section='content'] {
|
|
1457
|
+
color: var(--trees-item-git-status-color);
|
|
1458
|
+
}
|
|
1459
|
+
& > [data-item-section='git'] {
|
|
1460
|
+
color: var(--trees-item-git-status-color);
|
|
1461
|
+
font-weight: var(--trees-font-weight-semibold);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
[data-item-git-status='added'] {
|
|
1466
|
+
--trees-item-git-status-color: var(--trees-git-added-color);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
[data-item-git-status='deleted'] {
|
|
1470
|
+
--trees-item-git-status-color: var(--trees-git-deleted-color);
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
[data-item-git-status='ignored'] {
|
|
1474
|
+
--trees-item-git-status-color: var(--trees-git-ignored-color);
|
|
1475
|
+
|
|
1476
|
+
& > [data-item-section='icon'] {
|
|
1477
|
+
opacity: 0.5;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
[data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
|
|
1482
|
+
/* this is a nudge to align the dot with the likely lowercase text. it's slightly
|
|
1483
|
+
generalizable, but other fonts are gonna need other nudges i assume */
|
|
1484
|
+
transform: translateY(calc(0.65ex - 50%));
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
[data-item-git-status='modified'] {
|
|
1488
|
+
--trees-item-git-status-color: var(--trees-git-modified-color);
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
[data-item-git-status='renamed'] {
|
|
1492
|
+
--trees-item-git-status-color: var(--trees-git-renamed-color);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
[data-item-git-status='untracked'] {
|
|
1496
|
+
--trees-item-git-status-color: var(--trees-git-untracked-color);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
/* Drag and drop */
|
|
1500
|
+
[data-item-drag-target='true'] {
|
|
1501
|
+
background-color: var(--trees-selected-bg);
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
[data-item-dragging='true'] {
|
|
1505
|
+
opacity: 0.5;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/* Lock icon for locked paths (sibling of content) */
|
|
1509
|
+
[data-item-section='lock'] {
|
|
1510
|
+
flex: 0 0 auto;
|
|
1511
|
+
margin-left: auto;
|
|
1512
|
+
display: flex;
|
|
1513
|
+
align-items: center;
|
|
1514
|
+
color: var(--trees-fg-muted);
|
|
1515
|
+
}
|
|
1516
|
+
[data-item-section='lock'] svg {
|
|
1517
|
+
display: block;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
[data-type='header-slot'] {
|
|
1521
|
+
display: block;
|
|
1522
|
+
flex: 0 0 auto;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
[data-type='context-menu-wash'] {
|
|
1526
|
+
position: absolute;
|
|
1527
|
+
inset: 0;
|
|
1528
|
+
z-index: 3;
|
|
1529
|
+
background-color: transparent;
|
|
1530
|
+
touch-action: none;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
[data-type='context-menu-anchor'] {
|
|
1534
|
+
position: absolute;
|
|
1535
|
+
top: 0;
|
|
1536
|
+
right: var(--trees-context-menu-trigger-inline-offset);
|
|
1537
|
+
z-index: 4;
|
|
1538
|
+
display: none;
|
|
1539
|
+
align-items: center;
|
|
1540
|
+
|
|
1541
|
+
&[data-visible='true'] {
|
|
1542
|
+
display: flex;
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/* Hide the floating trigger while the scroll container is actively moving.
|
|
1547
|
+
* The anchor is positioned against the root, not the scroll content, so its
|
|
1548
|
+
* \`top\` follows the row via a React state update — one frame behind the
|
|
1549
|
+
* compositor. That delay is visible as the trigger hovering over the wrong
|
|
1550
|
+
* row during the first frame of a scroll. The \`data-is-scrolling\` flag on
|
|
1551
|
+
* the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
|
|
1552
|
+
* the compositor commits the next paint, so this selector hides the anchor
|
|
1553
|
+
* in the same frame the scroll begins. */
|
|
1554
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1555
|
+
[data-type='context-menu-anchor'] {
|
|
1556
|
+
display: none;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
[data-type='context-menu-anchor'] > slot[name='context-menu'] {
|
|
1560
|
+
display: block;
|
|
1561
|
+
width: 0;
|
|
1562
|
+
min-width: 0;
|
|
1563
|
+
flex: 0 0 0;
|
|
1564
|
+
overflow: visible;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
/* Single floating context menu trigger */
|
|
1568
|
+
[data-type='context-menu-trigger'] {
|
|
1569
|
+
all: unset;
|
|
1570
|
+
align-items: center;
|
|
1571
|
+
justify-content: center;
|
|
1572
|
+
width: var(--trees-action-lane-width);
|
|
1573
|
+
color: var(--trees-fg-muted);
|
|
1574
|
+
fill: currentColor;
|
|
1575
|
+
cursor: pointer;
|
|
1576
|
+
font-family: var(--trees-font-family);
|
|
1577
|
+
font-size: var(--trees-font-size);
|
|
1578
|
+
border-top-right-radius: var(--trees-border-radius);
|
|
1579
|
+
border-bottom-right-radius: var(--trees-border-radius);
|
|
1580
|
+
margin: var(--trees-focus-ring-width);
|
|
1581
|
+
height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
|
|
1582
|
+
border-width: 0;
|
|
1583
|
+
transition: color 120ms ease;
|
|
1584
|
+
|
|
1585
|
+
display: flex;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
[data-type='context-menu-trigger']:hover,
|
|
1589
|
+
[data-type='context-menu-trigger'][aria-expanded='true'] {
|
|
1590
|
+
color: var(--trees-fg);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
/** @pierre/truncate css here, manually copy pasted for now */
|
|
1594
|
+
[data-truncate-container] {
|
|
1595
|
+
/* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
|
|
1596
|
+
margin-top: -1px;
|
|
1597
|
+
margin-bottom: -1px;
|
|
1598
|
+
|
|
1599
|
+
/* Width of the fade from default marker to text */
|
|
1600
|
+
--truncate-internal-marker-fade-width: var(
|
|
1601
|
+
--truncate-marker-fade-width,
|
|
1602
|
+
2px
|
|
1603
|
+
);
|
|
1604
|
+
/* Width of the solid color between the fade from the default marker to the text */
|
|
1605
|
+
--truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
|
|
1606
|
+
/* Opacity of the marker 'color' property, not of the element itself */
|
|
1607
|
+
--truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
|
|
1608
|
+
/* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
|
|
1609
|
+
--truncate-internal-middle-marker-opacity: var(
|
|
1610
|
+
--truncate-middle-marker-opacity,
|
|
1611
|
+
80%
|
|
1612
|
+
);
|
|
1613
|
+
/* Background color of the default marker */
|
|
1614
|
+
--truncate-internal-marker-background-color: var(
|
|
1615
|
+
--truncate-marker-background-color,
|
|
1616
|
+
light-dark(white, black)
|
|
1617
|
+
);
|
|
1618
|
+
--truncate-internal-marker-background-overlay-color: var(
|
|
1619
|
+
--truncate-marker-background-overlay-color,
|
|
1620
|
+
transparent
|
|
1621
|
+
);
|
|
1622
|
+
--truncate-internal-marker-block-inset: var(
|
|
1623
|
+
--truncate-marker-block-inset,
|
|
1624
|
+
0px
|
|
1625
|
+
);
|
|
1626
|
+
/* Duration of the fade out animation for the marker */
|
|
1627
|
+
--truncate-internal-marker-fade-out-duration: var(
|
|
1628
|
+
--truncate-marker-fade-out-duration,
|
|
1629
|
+
0ms
|
|
1630
|
+
);
|
|
1631
|
+
/* Duration of the fade in animation for the marker */
|
|
1632
|
+
--truncate-internal-marker-fade-in-duration: var(
|
|
1633
|
+
--truncate-marker-fade-in-duration,
|
|
1634
|
+
100ms
|
|
1635
|
+
);
|
|
1636
|
+
|
|
1637
|
+
/* FADE Variant specifics */
|
|
1638
|
+
--truncate-internal-fade-marker-color: var(
|
|
1639
|
+
--truncate-fade-marker-color,
|
|
1640
|
+
#000
|
|
1641
|
+
);
|
|
1642
|
+
--truncate-internal-fade-marker-width: var(
|
|
1643
|
+
--truncate-fade-marker-width,
|
|
1644
|
+
0.2lh
|
|
1645
|
+
);
|
|
1646
|
+
|
|
1647
|
+
/*
|
|
1648
|
+
In some special cases people might be adding spacing in other ways
|
|
1649
|
+
that would benefit from being able to override this, however the container
|
|
1650
|
+
query below can't use this and would need to be redeclared with the overridden
|
|
1651
|
+
value. It's a bad time, but better than nothing.
|
|
1652
|
+
*/
|
|
1653
|
+
--truncate-internal-single-line-height: 1lh;
|
|
1654
|
+
|
|
1655
|
+
height: var(--truncate-internal-single-line-height);
|
|
1656
|
+
min-width: 0;
|
|
1657
|
+
overflow: hidden;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
[data-truncate-marker] {
|
|
1661
|
+
display: flex;
|
|
1662
|
+
position: absolute;
|
|
1663
|
+
height: var(--truncate-internal-single-line-height);
|
|
1664
|
+
padding-block: var(--truncate-internal-marker-block-inset);
|
|
1665
|
+
box-sizing: border-box;
|
|
1666
|
+
align-items: center;
|
|
1667
|
+
background-clip: content-box;
|
|
1668
|
+
z-index: 2;
|
|
1669
|
+
color: color-mix(
|
|
1670
|
+
in srgb,
|
|
1671
|
+
currentColor var(--truncate-internal-marker-opacity),
|
|
1672
|
+
transparent
|
|
1673
|
+
);
|
|
1674
|
+
|
|
1675
|
+
/* Core trick for hiding the marker until overflow occurs */
|
|
1676
|
+
opacity: 0;
|
|
1677
|
+
transition: opacity var(--truncate-internal-marker-fade-out-duration)
|
|
1678
|
+
ease-in-out;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
@container measure (height > 1lh) {
|
|
1682
|
+
[data-truncate-marker] {
|
|
1683
|
+
opacity: 1;
|
|
1684
|
+
transition: opacity var(--truncate-internal-marker-fade-in-duration)
|
|
1685
|
+
ease-in-out;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
[data-truncate-grid] {
|
|
1690
|
+
display: grid;
|
|
1691
|
+
position: relative;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
[data-truncate-content='visible'] {
|
|
1695
|
+
white-space: nowrap;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
[data-truncate-content='overflow'] {
|
|
1699
|
+
opacity: 0;
|
|
1700
|
+
pointer-events: none;
|
|
1701
|
+
-webkit-user-select: none;
|
|
1702
|
+
user-select: none;
|
|
1703
|
+
word-break: break-all;
|
|
1704
|
+
margin-top: calc(-1 * var(--truncate-internal-single-line-height));
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
[data-truncate-marker-cell] {
|
|
1708
|
+
container: measure / size;
|
|
1709
|
+
overflow: visible;
|
|
1710
|
+
-webkit-user-select: none;
|
|
1711
|
+
user-select: none;
|
|
1712
|
+
pointer-events: none;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
[data-truncate-container='truncate'] {
|
|
1716
|
+
& [data-truncate-grid] {
|
|
1717
|
+
grid-template-columns: minmax(0, max-content) 0;
|
|
1718
|
+
}
|
|
1719
|
+
& [data-truncate-marker] {
|
|
1720
|
+
right: 0;
|
|
1721
|
+
}
|
|
1722
|
+
& [data-truncate-fade] {
|
|
1723
|
+
margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
[data-truncate-container='fruncate'] {
|
|
1728
|
+
& [data-truncate-grid] {
|
|
1729
|
+
grid-template-columns: 0 minmax(0, max-content) auto;
|
|
1730
|
+
}
|
|
1731
|
+
& [data-truncate-content] {
|
|
1732
|
+
direction: rtl;
|
|
1733
|
+
}
|
|
1734
|
+
& [data-truncate-content] > span {
|
|
1735
|
+
unicode-bidi: plaintext;
|
|
1736
|
+
}
|
|
1737
|
+
& [data-truncate-fade] {
|
|
1738
|
+
margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
[data-truncate-variant='default'] {
|
|
1743
|
+
& [data-truncate-marker] {
|
|
1744
|
+
background-color: var(--truncate-internal-marker-background-color);
|
|
1745
|
+
background-image: linear-gradient(
|
|
1746
|
+
var(--truncate-internal-marker-background-overlay-color),
|
|
1747
|
+
var(--truncate-internal-marker-background-overlay-color)
|
|
1748
|
+
);
|
|
1749
|
+
}
|
|
1750
|
+
& [data-truncate-marker]::after,
|
|
1751
|
+
& [data-truncate-marker]::before {
|
|
1752
|
+
content: '';
|
|
1753
|
+
position: absolute;
|
|
1754
|
+
width: calc(
|
|
1755
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1756
|
+
var(--truncate-internal-marker-gap)
|
|
1757
|
+
);
|
|
1758
|
+
inset-block-start: var(--truncate-internal-marker-block-inset);
|
|
1759
|
+
height: max(
|
|
1760
|
+
0px,
|
|
1761
|
+
calc(
|
|
1762
|
+
var(--truncate-internal-single-line-height) -
|
|
1763
|
+
var(--truncate-internal-marker-block-inset) * 2
|
|
1764
|
+
)
|
|
1765
|
+
);
|
|
1766
|
+
background-color: var(--truncate-internal-marker-background-color);
|
|
1767
|
+
background-image: linear-gradient(
|
|
1768
|
+
var(--truncate-internal-marker-background-overlay-color),
|
|
1769
|
+
var(--truncate-internal-marker-background-overlay-color)
|
|
1770
|
+
);
|
|
1771
|
+
mask-image: linear-gradient(
|
|
1772
|
+
var(--truncate-internal-fade-dir),
|
|
1773
|
+
#000 0%,
|
|
1774
|
+
#000 var(--truncate-internal-marker-gap),
|
|
1775
|
+
transparent 100%
|
|
1776
|
+
);
|
|
1777
|
+
}
|
|
1778
|
+
& [data-truncate-marker]::after {
|
|
1779
|
+
--truncate-internal-fade-dir: to right;
|
|
1780
|
+
right: calc(
|
|
1781
|
+
-1 *
|
|
1782
|
+
(
|
|
1783
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1784
|
+
var(--truncate-internal-marker-gap)
|
|
1785
|
+
)
|
|
1786
|
+
);
|
|
1787
|
+
}
|
|
1788
|
+
& [data-truncate-marker]::before {
|
|
1789
|
+
--truncate-internal-fade-dir: to left;
|
|
1790
|
+
left: calc(
|
|
1791
|
+
-1 *
|
|
1792
|
+
(
|
|
1793
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1794
|
+
var(--truncate-internal-marker-gap)
|
|
1795
|
+
)
|
|
1796
|
+
);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
[data-truncate-variant='fade'] {
|
|
1801
|
+
& [data-truncate-marker] {
|
|
1802
|
+
background: transparent;
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
[data-truncate-fade] {
|
|
1807
|
+
box-shadow:
|
|
1808
|
+
0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
|
|
1809
|
+
var(--truncate-internal-fade-marker-color),
|
|
1810
|
+
0 0 var(--truncate-internal-fade-marker-width)
|
|
1811
|
+
var(--truncate-internal-fade-marker-color);
|
|
1812
|
+
width: calc(var(--truncate-internal-fade-marker-width) * 2);
|
|
1813
|
+
height: calc(
|
|
1814
|
+
var(--truncate-internal-single-line-height) -
|
|
1815
|
+
(var(--truncate-internal-fade-marker-width) * 2)
|
|
1816
|
+
);
|
|
1817
|
+
margin: var(--truncate-internal-fade-marker-width) 0;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
[data-truncate-group-container='middle'] {
|
|
1821
|
+
& [data-truncate-container] {
|
|
1822
|
+
--truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
display: flex;
|
|
1826
|
+
min-width: 0;
|
|
1827
|
+
|
|
1828
|
+
& > div {
|
|
1829
|
+
min-width: 0;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
& > div[data-truncate-segment-priority='1'] {
|
|
1833
|
+
flex: 0 1 max-content;
|
|
1834
|
+
}
|
|
1835
|
+
& > div[data-truncate-segment-priority='2'] {
|
|
1836
|
+
flex: 0 999999 max-content;
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
`,cz=`@layer base, unsafe;`;function lz(e){return`${cz}
|
|
1841
|
+
@layer base {
|
|
1842
|
+
${e}
|
|
1843
|
+
}`}function uz(e){return`${cz}
|
|
1844
|
+
@layer unsafe {
|
|
1845
|
+
${e}
|
|
1846
|
+
}`}var dz=new WeakMap;function fz(e){let t=dz.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(aF,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),dz.set(e,i),i}function pz(e,t){if(!e.isConnected)return;let n=fz(t);if(n==null)return;let r=t.querySelector(`style[${oF}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(oF,``),t.appendChild(i)),i.textContent=`:host { ${sF}: ${n}px; }`}var mz;function hz(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){mz??(mz=new CSSStyleSheet,mz.replaceSync(lz(sz)));let t=!1;try{e.adoptedStyleSheets=[mz],t=!0}catch{}if(t){e.querySelector(`style[${rF}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(rF,``),t.textContent=lz(sz),e.prepend(t)}}function gz(e,t){_z(e,t),hz(t),pz(e,t)}function _z(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});gz(this,e)}}if(customElements.define(nF,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(nF)))e instanceof HTMLElement&&gz(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var vz=e=>e.startsWith(`f::`)?e.slice(3):e;function yz(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function bz(e,t){return e===``?t:`${e}/${t}`}function xz({files:e,path:t,isFolder:n,nextBasename:r}){let i=vz(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=yz(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=bz(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function Sz(e){return e.endsWith(`/`)}function Cz(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function wz(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function Tz(e,t){return t.includes(e)?wz(t):[e]}function Ez(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function Dz(e,t){return{draggedPaths:e,target:t}}function Oz(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Sz(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function kz(e,t){return t.kind===`root`||t.directoryPath==null?Cz(e):t.directoryPath}function Az(e,t){let n=e.map(e=>{let n=kz(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}var jz=Symbol(`FILE_TREE_RENAME_VIEW`);function Mz(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}var Nz=512,Pz=512;function Fz(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Iz(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function Lz(e){return Iz(e).at(-1)??null}function Rz(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}var zz=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},Bz=e=>e.toLowerCase();function Vz(e){return e.endsWith(`/`)}function Hz(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function Uz(e){return e.endsWith(`/`)?e.slice(0,-1):e}function Wz(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}function Gz(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function Kz(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function qz(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return Kz(e,t.path)?n?e:null:e;case`move`:return Gz(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=qz(r,e,n),r==null)return null;return r}}}function Jz(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function Yz(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Xz(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!Yz(nz.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function Zz(e){switch(e.operation){case`add`:return{...Jz(e),operation:`add`,path:e.path};case`remove`:return{...Jz(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...Jz(e),from:e.from,operation:`move`,to:e.to}}}function Qz(e){return{...Jz(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>Zz(e)),operation:`batch`}}function $z(e){switch(e.operation){case`add`:case`remove`:case`move`:return Zz(e);case`batch`:return Qz(e);default:return null}}function eB(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=Iz(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function tB(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:eB(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var nB=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=new Set;#z=0;#B;#V=0;#H=!1;#U=0;#W;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=Xz({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#B=this.#se(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ae(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#R=new Set(d),this.#L=f,this.#z=1),this.#Oe(f,!1),r!=null&&this.#Se(r,!1),this.#W=this.#Fe()}destroy(){this.#W?.(),this.#W=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#pe()}focusFirstItem(){this.#ve().length>0&&this.#Me(0)}focusLastItem(){this.#U<=0||(this.#Ne(),this.#Me(this.#U-1))}focusNextItem(){this.#De(1)}focusParentItem(){if(this.#c==null)return;let e=Lz(this.#c);if(e==null)return;let t=this.#Y(e);t>=0&&this.#Me(t)}focusPath(e){let t=this.#B.getPathInfo(e)?.path??null;if(t==null)return;this.#Ne();let n=this.#Y(t);n>=0&&this.#Me(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Y(t);return n>=0?(this.#Me(n),this.#ve()[n]??t):null}focusPreviousItem(){this.#De(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#X(this.#c)}getFocusedPath(){return this.#c}resolveNearestVisiblePath(e){let t=this.#ve();if(this.#U===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#B.getPathInfo(e)?.path??e,r=this.#Y(n);return r>=0?t[r]??n:this.#J(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#R]}getSelectionVersion(){return this.#z}getVisibleCount(){return this.#U}getVisibleRows(e,t){if(t<e||this.#U===0)return[];let n=Math.max(0,e),r=Math.min(this.#U-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Pz){let e=[];for(let t=n;t<=r;t+=1){let n=this.#B.getVisibleRowContext(t);if(n==null)break;e.push(this.#Q(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ne(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#ye(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#B.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#ye(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#Z(o,i,a,{ancestorPaths:this.#te(a),path:s})})}return this.#B.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#Z(e,r,r,{ancestorPaths:this.#te(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#U===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#U;r+=1){let i=e+r*t,a=Math.min(this.#U-1,Math.floor(i/t)),o=this.#$(a,r)??(a>0?this.#$(a-1,r):void 0);if(o==null)break;n.push({row:this.#Q(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#B.getPathInfo(e);return t==null?null:this.#X(t.path,t)}selectAllVisiblePaths(){this.#Ne();let e=[...this.#ve()];this.#re(e,this.#c??this.#L)}selectOnlyPath(e){let t=this.#Ae(e);t!=null&&this.#re([t],t)}selectPath(e){let t=this.#Ae(e);t==null||this.#R.has(t)||this.#re([...this.#R,t])}deselectPath(e){let t=this.#Ae(e);t==null||!this.#R.has(t)||this.#re([...this.#R].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ae(e);if(t!=null){if(this.#R.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ae(e);if(t!=null){if(this.#R.has(t)){this.#re([...this.#R].filter(e=>e!==t),t);return}this.#re([...this.#R,t],t)}}selectPathRange(e,t){let n=this.#Ae(e);if(n==null)return;this.#Ne();let r=this.#L,i=r==null?-1:this.#be(r),a=this.#be(n);if(i===-1||a===-1){let e=t?[...this.#R,n]:[n];this.#re(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#ve().slice(o,s+1),l=t?[...this.#R,...c]:c;this.#re(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#U-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ne();let r=this.#ve(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#R);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#re([...o],this.#L??i,!1),this.#Me(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ae(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=Tz(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#re([t],t,!1),this.#je(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#we(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Dz(t.draggedPaths,n);(Oz(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}Ez(t.target,n)||(this.#i={...t,target:n},this.#we())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#we())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#we(),!1;let n=Dz(e.draggedPaths,t);if(Oz(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#we(),!1;let r=Az(e.draggedPaths,t);if(r==null)return this.#we(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#B.move(e.from,e.to,{collision:e.collision})}else this.#oe(r.operations),this.#B.batch(r.operations)}catch(e){return this.#we(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#B.add(e)}remove(e,t={}){this.#B.remove(e,t)}move(e,t,n={}){this.#B.move(e,t,n)}batch(e){this.#B.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Se(e,!0)}openSearch(e=``){this.#Se(e,!0)}closeSearch(){this.#Se(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#xe(1)}focusPreviousSearchMatch(){this.#xe(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#B.getPathInfo(e);if(n==null)return!1;let r=n.path,i=Vz(r),a=Uz(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of Iz(r))this.#B.isExpanded(e)||this.#B.expand(e);return this.#re([r],r,!1),this.#M!=null&&(this.#Se(null,!1),this.#y?.(this.#M)),this.#je(r),this.#T=r,this.#E=Hz(r),this.#D=t.removeIfCanceled??!1,this.#we(),!0}[jz](){return{cancel:()=>{this.#G()},commit:()=>{this.#K()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#q(e)}}}#G(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,Vz(e)?{recursive:!0}:void 0);return}this.#je(e),this.#we()}#K(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,Vz(e)?{recursive:!0}:void 0);return}let t=Vz(e),n=xz({files:this.#B.list(),isFolder:t,nextBasename:this.#E,path:Uz(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#je(e),this.#v?.(n.error),this.#we();return}if(n.sourcePath===n.destinationPath){this.#je(e),this.#we();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(Wz(n.sourcePath,t),Wz(n.destinationPath,t))}#q(e){this.#T==null||this.#E===e||(this.#E=e,this.#we())}resetPaths(e,t={}){let n=this.#B.list().length,r=this.#U,i=Xz({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#se(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#L;this.#W?.(),this.#B=a,this.#d.clear(),this.#pe();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!Fz(this.#R,u);this.#R=new Set(u),d&&(this.#z+=1),this.#L=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#Oe(o,o!=null||u.length>0||this.#L!=null),this.#W=this.#Fe(),this.#we(),this.#Te({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#U-r})}#J(e){this.#Ne();let t=Lz(e),n=Rz(e,t),r=null,i=null;for(let e of this.#ve()){if(Lz(e)!==t)continue;let a=Rz(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Y(e){let t=this.#be(e);if(t!==-1)return t;let n=Iz(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#be(t);if(r!==-1)return r}return this.#ve().length>0?0:-1}#X(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#B.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#ie(r.path):this.#ae(r.path);return this.#d.set(r.path,i),i}#Z(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#R.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#Q(e){return this.#Z(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#$(e,t){let n=this.#B.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ee(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ee(n),n];return this.#a.set(e,r),r}#te(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ee(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ne(e){this.#B.collapse(e)}#re(e,t=this.#L,n=!0){let r=[...new Set(e)],i=!Fz(this.#R,r),a=this.#L!==t;!i&&!a||(this.#R=new Set(r),this.#L=t,i&&(this.#z+=1),n&&this.#we())}#ie(e){return{collapse:()=>{this.#ne(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#Ee(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#B.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#R.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#Ie(e)}}}#ae(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#R.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#oe(e){let t=this.#B.list();this.#se(t).batch(e)}#se(e,t,n){return new nz({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ce(){return this.#h??=this.#B.list(),this.#h}#le(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ce()){e.add(t);for(let n of Iz(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#ue(){return this.#g??=this.#ce().map(Bz),this.#g}#de(){return this.#f??=this.#le().filter(e=>e.endsWith(`/`)),this.#f}#fe(){return this.#p??=this.#de().map(Bz),this.#p}#pe(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#me(){return this.#de().filter(e=>this.#B.isExpanded(e))}#he(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#R)for(let n of Iz(e))t.add(n);this.#ge(t)}#ge(e){this.#H=!0;try{for(let t of this.#de()){let n=e.has(t),r=this.#B.isExpanded(t);n&&!r?this.#B.expand(t):!n&&r&&this.#B.collapse(t)}}finally{this.#H=!1}}#_e(){let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#M==null||this.#M.length===0||this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#U=this.#V;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#U=n.length}#ve(){return this.#I??this.#b}#ye(e){return this.#F?.[e]??e}#be(e){return this.#P?.get(e)??this.#B.getVisibleIndex(e)??-1}#xe(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Se(e,t){let n=e==null?null:zz(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#me()),this.#M=n,n==null)this.#he(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#Oe(this.#c,!0);else if(n.length===0)this.#he(!1),this.#O.clear(),this.#N=null,this.#Oe(this.#c,!0);else{let e=this.#Ce();this.#Oe(e,!0)}t&&(this.#y?.(this.#M),this.#we())}}#Ce(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ce(),n=this.#ue(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#de(),s=this.#fe();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of Iz(e))l.add(t),c?.add(t)}return this.#ge(l),a??this.#c}#we(){for(let e of this.#t)e()}#Te(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#Ee(e){for(let t of Iz(e))this.#B.isExpanded(t)||this.#B.expand(t);this.#B.isExpanded(e)||this.#B.expand(e)}#De(e){let t=this.#U;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ne(),this.#Me(r))}#Oe(e,t=!0){let n=this.#B.getVisibleCount();this.#V=n;let r=tB(this.#B.getVisibleTreeProjectionData(t?void 0:Math.min(n,Nz)),e,t?e=>this.#B.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#_e(),this.#s=e==null?this.#ve().length>0?0:-1:this.#Y(e),this.#c=this.#s<0?null:this.#ke(this.#s)}#ke(e){return this.#ve()[e]??(this.#F==null?this.#B.getVisibleRowContext(e)?.row.path??null:null)}#Ae(e){return this.#B.getPathInfo(e)?.path??null}#je(e){if(e==null)return;let t=this.#Y(e);t>=0&&this.#Me(t,!1)}#Me(e,t=!0){let n=this.#ke(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#we()))}#Ne(){this.#l||this.#Oe(this.#c,!0)}#Pe(e){let t=qz(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=qz(this.#c,e,!0),r=[...this.#R].map(t=>qz(t,e)).filter(e=>e!=null).map(e=>this.#B.getPathInfo(e)?.path??null).filter(e=>e!=null),i=qz(this.#L,e),a=i==null?null:this.#B.getPathInfo(i)?.path??null,o=[...new Set(r)];return Fz(this.#R,o)||(this.#R=new Set(o),this.#z+=1),this.#L=a,n}#Fe(){return this.#B.on(`*`,e=>{if(this.#H)return;e.canonicalChanged&&(this.#d.clear(),this.#pe()),this.#i!=null&&Mz(e)&&(this.#i=null);let t=Mz(e)?this.#Pe(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ce():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#Oe(n,r),this.#we();let i=$z(e);i!=null&&this.#Te(i)})}#Ie(e){if(this.#B.isExpanded(e)){this.#ne(e);return}this.#Ee(e)}},rB=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function iB(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function aB(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function oB(e,t){return t?`${e}/`:e}function sB(e,t=null){let n=rB(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=iB(t.path);if(e==null)continue;let n=oB(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of aB(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB={},yB=[],bB=Array.isArray,xB=yB.slice,SB=Object.assign;function CB(e){e&&e.parentNode&&e.remove()}function wB(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?xB.call(arguments,2):n),TB(e,o,r,i,null)}function TB(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++lB,__i:-1,__u:0};return i==null&&cB.vnode!=null&&cB.vnode(a),a}function EB(e){return e.children}function DB(e,t){this.props=e,this.context=t,this.__g=0}function OB(e,t){if(t==null)return e.__?OB(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?OB(e):null}function kB(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return kB(e)}}function AB(e){(8&e.__g||!(e.__g|=8)||!uB.push(e)||fB++)&&dB==cB.debounceRendering||((dB=cB.debounceRendering)||queueMicrotask)(jB)}function jB(){for(var e,t,n,r,i,a,o,s,c=1;uB.length;)uB.length>c&&uB.sort(pB),e=uB.shift(),c=uB.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=SB({},r)).__v=r.__v+1,cB.vnode&&cB.vnode(n),zB(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??OB(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,VB(a,n,o),n.__e!=i&&kB(n)));fB=0}function MB(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||yB,b=t.length;for(c=NB(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?vB:y[m.__i]||vB,m.__i=f,_=zB(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&WB(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=PB(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function NB(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?TB(null,o,null,null,null):bB(o)?TB(EB,{children:o},null,null,null):o.constructor==null&&o.__b>0?TB(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=FB(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=OB(s)),GB(s,s));return r}function PB(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=PB(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=OB(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function FB(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function IB(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function LB(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||IB(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||IB(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(mB,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=hB,e.addEventListener(t,a?_B:gB,a)):e.removeEventListener(t,a?_B:gB,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function RB(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=hB++;else if(t.u<n.l)return;return n(cB.event?cB.event(t):t)}}}function zB(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=cB.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new DB(v,x),f.constructor=M,f.render=KB),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=SB({},f.__s)),SB(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=cB.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=SB({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===EB&&d.key==null&&(E=HB(d.props.children)),s=MB(e,bB(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)CB(a[j]);BB(t)}else t.__e=n.__e,t.__k=n.__k,e.then||BB(t);cB.__e(e,t,n)}else s=t.__e=UB(n.__e,t,n,r,i,a,o,c,l,u);return(d=cB.diffed)&&d(t),128&t.__u?void 0:s}function BB(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(BB)}function VB(e,t,n){for(var r=0;r<n.length;r++)WB(n[r],n[++r],n[++r]);cB.__c&&cB.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){cB.__e(e,t.__v)}})}function HB(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:bB(e)?e.map(HB):SB({},e)}function UB(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(cB.__m&&cB.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=xB.call(e.childNodes),v=n.props||vB,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;LB(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||LB(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),MB(b==`template`?e.content:e,bB(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&OB(n,0),s,c,l),a!=null)for(u=a.length;u--;)CB(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||LB(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&LB(e,u,g,v[u],i))}return e}function WB(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){cB.__e(e,n)}}function GB(e,t,n){var r,i;if(cB.unmount&&cB.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||WB(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){cB.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&GB(r[i],t,n||typeof e.type!=`function`);n||CB(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function KB(e,t,n){return this.constructor(e,n)}function qB(e,t){var n,r,i,a;t==document&&(t=document.documentElement),cB.__&&cB.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=wB(EB,null,[e]),i=[],a=[],zB(t,e,r||vB,vB,t.namespaceURI,r?null:t.firstChild?xB.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),VB(i,e,a)}function JB(e,t){e.__u|=32,qB(e,t)}cB={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw fB=0,e}},lB=0,DB.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=SB({},this.state);typeof e==`function`&&(e=e(SB({},n),this.props)),e&&SB(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),AB(this))},DB.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),AB(this))},DB.prototype.render=EB,uB=[],fB=0,pB=function(e,t){return e.__v.__b-t.__v.__b},mB=/(PointerCapture)$|Capture$/i,hB=0,gB=RB(!1),_B=RB(!0);var YB=0;Array.isArray;function XB(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--YB,__i:-1,__u:0,__source:i,__self:a};return cB.vnode&&cB.vnode(l),l}var ZB=16,QB=16,$B={};function eV({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=$B[e]??{width:ZB,height:QB},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return XB(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:XB(`use`,{href:c})})}var tV=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},nV=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},rV=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},iV=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},aV=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},oV=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function sV({children:e,marker:t,variant:n=`default`}){"use no memo";return XB(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:XB(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?XB(`span`,{"data-truncate-fade":!0}):t})})}function cV(e){"use no memo";let{mode:t,children:n}=e;return XB(`div`,{children:[XB(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?XB(`span`,{children:n}):n}),XB(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?XB(`span`,{children:n}):n})]})}function lV({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=XB(cV,{mode:t,children:e},`content`),o=XB(sV,{marker:n,mode:t,variant:r},`marker`),s=XB(`div`,{"data-truncate-fill":!0},`fill`);return XB(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:XB(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function uV({children:e,...t}){"use no memo";return XB(lV,{mode:`truncate`,...t,children:e})}function dV({children:e,...t}){"use no memo";return XB(lV,{mode:`fruncate`,...t,children:e})}function fV({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=XB(uV,{...s,children:t[0]}),l=XB(dV,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return XB(`div`,{className:a,style:o});if(e.length<i)return XB(n===`end`?dV:uV,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=tV:r===`extension`?t=nV:r===`leaf-path`&&(t=rV);else if(typeof r==`number`)t=iV,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=aV:e===`first`&&(t=oV)}else typeof r==`function`&&(t=r);t??=tV;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=XB(uV,{...s,..._,children:f}),l=XB(dV,{...s,...v,children:p})}return XB(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[XB(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),XB(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var pV={endIndex:-1,startIndex:-1};function mV(e,t,n){return Math.min(Math.max(e,t),n)}function hV(e,t){return e<0||t<e?pV:{endIndex:t,startIndex:e}}function gV(e){return e.startIndex<0||e.endIndex<e.startIndex}function _V(e,t){return gV(e)?0:(e.endIndex-e.startIndex+1)*t}function vV(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function yV(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function bV(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function xV(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function SV(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function CV(e,t,n){if(e.length===0||t<=0)return[];let r=SV(e),i=bV(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=xV(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function wV(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=mV(t.scrollTop,0,o),c=t.stickyRows??CV(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=vV(s,n,t.itemHeight),m=vV(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?pV:hV(m,yV(u+d,n,t.itemHeight)),y=g+1,b=gV(v)?pV:hV(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=_V(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:gV(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var TV={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},EV={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},DV=`Contains git status items`;function OV(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function kV(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function AV(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}function jV(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function MV(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}var NV,PV,FV,IV,LV=Object.is,RV=0,zV=[],BV=cB,VV=BV.__b,HV=BV.__r,UV=BV.diffed,WV=BV.__c,GV=BV.unmount,KV=BV.__;function qV(e,t){BV.__h&&BV.__h(PV,e,RV||t),RV=0;var n=PV.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function JV(e){return RV=1,YV(sH,e)}function YV(e,t,n){var r=qV(NV++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):sH(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);LV(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=PV,!PV.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,LV(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};PV.__f=!0;var a=PV.shouldComponentUpdate,o=PV.componentWillUpdate;PV.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},PV.shouldComponentUpdate=i}return r.__N||r.__}function XV(e,t){var n=qV(NV++,3);!BV.__s&&oH(n.__H,t)&&(n.__=e,n.u=t,PV.__H.__h.push(n))}function ZV(e,t){var n=qV(NV++,4);!BV.__s&&oH(n.__H,t)&&(n.__=e,n.u=t,PV.__h.push(n))}function QV(e){return RV=5,$V(function(){return{current:e}},[])}function $V(e,t){var n=qV(NV++,7);return oH(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function eH(e,t){return RV=8,$V(function(){return e},t)}function tH(){for(var e;e=zV.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(iH),e.__H.__h.forEach(aH),e.__H.__h=[]}catch(t){e.__H.__h=[],BV.__e(t,e.__v)}}BV.__b=function(e){PV=null,VV&&VV(e)},BV.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),KV&&KV(e,t)},BV.__r=function(e){HV&&HV(e),NV=0;var t=(PV=e.__c).__H;t&&(FV===PV?(t.__h=[],PV.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(iH),t.__h.forEach(aH),t.__h=[],NV=0)),FV=PV},BV.diffed=function(e){UV&&UV(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zV.push(t)!==1&&IV===BV.requestAnimationFrame||((IV=BV.requestAnimationFrame)||rH)(tH)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),FV=PV=null},BV.__c=function(e,t){t.some(function(e){try{e.__h.forEach(iH),e.__h=e.__h.filter(function(e){return!e.__||aH(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],BV.__e(n,e.__v)}}),WV&&WV(e,t)},BV.unmount=function(e){GV&&GV(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{iH(e)}catch(e){t=e}}),n.__H=void 0,t&&BV.__e(t,n.__v))};var nH=typeof requestAnimationFrame==`function`;function rH(e){var t,n=function(){clearTimeout(r),nH&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);nH&&(t=requestAnimationFrame(n))}function iH(e){var t=PV,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),PV=t}function aH(e){var t=PV;e.__c=e.__(),PV=t}function oH(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!LV(t,e[n])})}function sH(e,t){return typeof t==`function`?t(e):t}function cH(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function lH(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function uH({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return XB(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function dH(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:XB(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return XB(EB,{children:[XB(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:XB(uV,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function fH(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function pH(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function mH(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function hH({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=wV(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:mH(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?mH(u,1,t,o):i&&r<=0&&c.length>0?CV(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var gH=400,_H=10,vH=40,yH=18;function bH(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?xH(e,t,n):a instanceof HTMLElement?a:null}function xH(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function SH(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function CH(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function wH(){return navigator.vendor!==`Apple Computer, Inc.`}function TH(e,t){let n=e-t.top;if(n<vH)return-Math.ceil((vH-Math.max(0,n))/vH*yH);let r=t.bottom-e;return r<vH?Math.ceil((vH-Math.max(0,r))/vH*yH):0}function EH(e,t){if(e!=null){let t=TV[e];return t==null?null:{text:t,title:EV[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:DV}:null}function DH(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function OH(e){return e!=null&&`toggle`in e}function kH(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function AH(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function jH(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function MH(e,t){return e!=null&&e>0?e:t}function NH(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function PH(e,t,n,r,i=0){let a=jV({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function FH(e,t,n,r,i,a){let o=MV({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function IH(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function LH(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function RH(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function zH(e,t){return t&&RH(e)||(e.ctrlKey||e.metaKey)&&kH(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var BH=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function VH(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function HH(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function UH(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function WH(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function GH(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function KH(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function qH(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function JH(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function YH(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=JH(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function XH(e,t){return{kind:e.kind,name:pH(e),path:t}}function ZH(e){return e==null?void 0:`${e}__tree`}function QH(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function $H(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function eU(e,t){if(e==null)return null;if(`text`in e)return XB(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?$H(e.icon)?t(e.icon):{name:e.icon}:$H(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return XB(`span`,{title:e.title,children:XB(eV,{...n})})}function tU(e){e!=null&&cH(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function nU(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=fH(e);return XB(EB,{children:[e.depth>0?XB(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>XB(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,XB(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?XB(eV,{...t(`file-tree-icon-chevron`)}):XB(eV,{...t(`file-tree-icon-file`,u)})}),XB(`div`,{"data-item-section":`content`,children:e.isFlattened?dH(e,c,a):c??XB(fV,{minimumLength:5,split:`extension`,children:e.name})}),i?XB(`div`,{"data-item-section":`decoration`,children:r==null?null:eU(r,t)}):null,s?XB(`div`,{"data-item-section":`git`,children:eU(o,t)}):null,n?XB(`div`,{"data-item-section":`action`,children:l?XB(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:XB(eV,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function rU(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=fH(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??DH(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=EH(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,q=K?a.getValue():``,ee=R||!K?null:XB(uH,{ref:D,ariaLabel:`Rename ${pH(t)}`,isFlattened:t.isFlattened,value:q,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),te=nU(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:ee,showDecorativeActionAffordance:G}),ne={...kV({ariaLabel:pH(t),domId:t.isFocused?QH(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusPath(P),j(t,P,{anchorRect:UH(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusPath(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&K?XB(`div`,{...ne,children:te}):XB(`button`,{...ne,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:te})}function iU(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(fH(e))).map((n,r)=>rU(e,n,t.start+r))}function aU({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=oz,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=QV(null),v=QV(null),y=QV(!1),b=QV(null),x=QV(null),S=QV(null),C=QV(null),w=QV(null),T=QV(new Map),E=QV(new Map),D=QV(()=>{}),O=QV(null),k=QV(!1),A=QV(null),j=QV(null),M=QV(!1),N=QV(null),P=QV(null),F=QV(null),I=QV(null),L=QV(null),R=QV(null),z=QV(null),B=QV(null),V=QV(!1),H=QV(null),U=QV(null),W=QV(null),G=QV(null),K=$V(()=>new Map,[]),[,q]=JV(0),[ee,te]=JV(null),[ne,re]=JV(null),[ie,ae]=JV(null),[oe,se]=JV(null),[ce,le]=JV(0),[ue,de]=JV(null),fe=QV(ue);fe.current=ue;let pe=QV(null),J=QV(null),me=QV(null),he=QV(null),ge=QV(null),_e=QV(!1),ve=()=>{J.current=null,me.current=null,he.current=null},ye=(e,t)=>{J.current=e,me.current=null,he.current=t==null?null:{path:e,scrollTop:t}},be=(e,t)=>{J.current=null,me.current={path:e,viewportOffset:t},he.current=null},xe=QV(d===`retain`&&t.isSearchOpen()),[Se,Ce]=JV(p);XV(()=>{p||Ce(!1)},[p]);let we=QV(!1),Te=eH(()=>{we.current=!0,Ce(e=>e&&!1)},[]),[Y,Ee]=JV(()=>hH({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[De,Oe]=JV(!1);XV(()=>{Oe(!0)},[]);let ke=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ae=e?.contextMenu?.triggerMode??(ke?`right-click`:`both`),je=Ae===`both`||Ae===`button`,Me=e?.contextMenu?.buttonVisibility??`when-needed`,Ne=Ae===`both`||Ae===`right-click`;ZV(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;ge.current=t,re(t),se(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(_e.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Pe=eH((e,t)=>{GH(T.current,e,t)},[]),Fe=eH((e,t)=>{GH(E.current,e,t)},[]),Ie=eH(e=>{x.current=e},[]),Le=eH(e=>KH(e,E.current,T.current),[]),Re=n!=null||r!=null||i!=null,{resolveIcon:ze}=$V(()=>_F(a),[a]),Be=t[jz](),Ve=Be.getPath(),He=Ve!=null,Ue=t.isSearchOpen(),We=t.getSearchValue(),Ge=t.getFocusedPath(),Ke=t.getFocusedIndex(),qe=t.isDragAndDropEnabled(),Je=t.getDragSession(),Ye=$V(()=>Je==null?null:new Set(Je.draggedPaths),[Je]),Xe=Je?.target??null,Ze=Je?.primaryPath??null,Qe=ZH(o),{overlayHeight:$e,overlayRows:et,snapshot:tt,visibleRows:nt}=Y,rt=tt.physical.viewportHeight,it=$V(()=>({end:tt.window.endIndex,start:tt.window.startIndex}),[tt.window.endIndex,tt.window.startIndex]),at=et,ot=tt.sticky.rows,st=tt.physical.totalHeight,ct=tt.sticky.height,lt=$V(()=>new Set(ot.map(e=>fH(e.row))),[ot]),ut=Ke>=0&&Ke>=it.start&&Ke<=it.end,dt=eH((e,t)=>u?.({item:XH(e,t),row:e})??null,[u]),ft=eH(e=>cH(e==null?null:T.current.get(e)??null)?!0:cH(S.current),[]),pt=eH(e=>{ft(t.focusNearestPath(e))},[t,ft]),mt=QV(pt);mt.current=pt;let ht=QV(!0),gt=QV(()=>{}),_t=eH((t=!0)=>{let n=fe.current;n!=null&&(ht.current=ht.current&&t,de(null),e?.contextMenu?.onClose?.(),ht.current&&pt(n.path))},[e?.contextMenu,pt]);gt.current=_t;let vt=eH(e=>{let t=e==null?null:WH(S.current,e);ae(e=>e===t?e:t)},[]),yt=eH((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=Le(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;ye(n,e?.scrollTop??null),k.current=!0,te(e=>e===n?e:n)}i.focus(),vt(a),ht.current=!0,de({anchorRect:r?.anchorRect??null,item:XH(e,n),path:n,source:r?.source??`keyboard`})},[t,Le,vt]),bt=eH(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=jH(e,rt);N.current=Ke<0||e==null?null:Math.max(0,Math.min(Ke*s-e.scrollTop,Math.max(0,t-s))),M.current=!0}t.startRenaming(e)!==!1&&(se(`focus`),q(e=>e+1))}},[t,Ke,s,l,rt]),xt=eH((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=jH(i,rt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:hH({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return k.current=!0,FH(i,a,s,l,u,d),D.current(),pe.current=n?e:null,!0},[t,s,c,rt,h]),St=()=>y.current===!0||G.current!=null||V.current===!0,Ct=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),wt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Tt=()=>{I.current!=null&&(clearTimeout(I.current),I.current=null),F.current=null},Et=()=>{R.current?.remove(),R.current=null},Dt=()=>{wt(P.current),P.current=null,L.current=null},Ot=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},kt=()=>{B.current?.(),B.current=null,G.current!=null&&(clearTimeout(G.current),G.current=null),V.current=!1,H.current=null,W.current=null,U.current!=null&&(U.current.setAttribute(`draggable`,`true`),U.current.style.removeProperty(`touch-action`),U.current=null),Et(),Tt(),Dt(),z.current=null},At=(e,n)=>{let r=S.current?.getRootNode(),i=SH(bH(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},jt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Tt();return}let r=t.getItem(e.directoryPath),i=OH(r)?r:null;if(i==null||i.isExpanded()){Tt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;F.current!==a&&(Tt(),F.current=a,I.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Mt=()=>{P.current=null;let e=L.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=TH(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),jt(At(e.clientX,e.clientY)),P.current=Ct(Mt)},Nt=(e,t)=>{L.current={clientX:e,clientY:t},P.current??=Ct(Mt)},Pt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(kt(),Et(),Tt(),Dt(),t.startDrag(r)===!1){e.preventDefault();return}if(z.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),wH())){let t=CH(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ot(t),R.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ft=()=>{Et(),Tt(),Dt(),z.current=null,t.cancelDrag()},It=(e,n,r)=>{if(G.current!=null||V.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;W.current={clientX:i.clientX,clientY:i.clientY},U.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!V.current;G.current!=null&&(clearTimeout(G.current),G.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),B.current===o&&(B.current=null),t&&(a.setAttribute(`draggable`,`true`),U.current===a&&(U.current=null),W.current=null)},s=e=>{let t=e.touches[0],n=W.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=_H*_H||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),B.current=o,G.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),U.current===a&&(U.current=null),W.current=null;return}V.current=!0,U.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),z.current=n;let e=a.getBoundingClientRect(),s=CH(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Ot(s),R.current=s,H.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=H.current;n!=null&&R.current!=null&&(R.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),jt(At(t.clientX,t.clientY)),Nt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&At(n.clientX,n.clientY),t.completeDrag(),kt()},u=()=>{t.cancelDrag(),kt()};B.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},gH)},Lt=e=>{if(ue!=null){if(e.key===`Escape`){_t(),e.preventDefault(),e.stopPropagation();return}BH.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Be.isActive()){if(e.key===`Escape`)Be.cancel();else if(e.key===`Enter`)Be.commit();else return;se(`focus`),q(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){bt(Ge??void 0),e.preventDefault(),e.stopPropagation();return}if(Ue){if(e.key===`Escape`)M.current=!1,N.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=jH(n,rt);N.current=Ke<0||n==null?null:Math.max(0,Math.min(Ke*s-n.scrollTop,Math.max(0,r-s))),M.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;se(`focus`),q(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&AH(e)){t.openSearch(e.key),q(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=ke&&RH(e),r=zH(e,ke),i=r&&S.current!=null?lH(S.current):null,a=r?new Set(qH(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Ge&&a.has(o)){let e=C.current;ye(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=OH(p)?p:null,h=u!=null&&(lt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=KH(u,E.current,T.current);e==null||n==null?y=!1:yt(e,u)}else if((e.ctrlKey||e.metaKey)&&kH(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;se(`focus`);let b=t.getFocusedPath(),x=b!=null&&(lt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))ye(b,v?.scrollTop??null),k.current=!0,te(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(be(b,YH(S.current,v,i,u,s,ct,rt)),k.current=!0,te(e=>e===b?e:b)):ve()}q(e=>e+1),e.preventDefault(),e.stopPropagation()};ZV(()=>{if(!(!f||!Ue)){if(xe.current){xe.current=!1;return}cH(w.current)}},[Ue,f]),ZV(()=>{let e=x.current;switch(OV({hasRenderedInput:e!=null,previousRenamingPath:j.current,renamingPath:Ve})){case`reset`:j.current=null;return;case`reveal-canonical`:Ve!=null&&xt(Ve,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(pe.current=null,j.current=Ve,cH(e),e.select());return}},[it.end,it.start,Ve,xt,lt]),ZV(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=lH(e)?.dataset.itemPath??null;te(e=>e===t?e:t)},i=()=>{n(),k.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,lH(e)!=null){r();return}k.current=!1,te(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),k.current=!1,te(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;te(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),ZV(()=>{let e=S.current;e!=null&&(tt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[tt.physical.scrollTop]),ZV(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=jH(n,g);let a=()=>{let e=t.getVisibleCount(),r=MH(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ee(hH({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};D.current=a;let o=!1,l=t.subscribe(()=>{o?q(e=>e+1):o=!0,a()}),u=()=>{_e.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,le(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||_e.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),fe.current!=null&&y.current&>.current(),_e.current===!0){y.current=!1;return}re(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:NH(e[0]))??jH(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),ZV(()=>{ke||ue==null||_t(!1)},[_t,ke,ue]);let Rt=$V(()=>ue==null?null:`${ue.path}::${ue.source}`,[ue]);ZV(()=>{if(Rt==null){m?.clearSlotContent(lF);return}let t=fe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??HH(n.getBoundingClientRect()),close:e=>{gt.current(e?.restoreFocus??!0)},restoreFocus:()=>{ht.current&&mt.current(fe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(lF,i),e?.contextMenu?.onOpen?.(t.item,r),tU(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&tU(i)}),()=>{m?.clearSlotContent(lF)}},[Rt,e?.contextMenu,m]),ZV(()=>{ue!=null&&t.getItem(ue.path)==null&&_t()},[_t,ue,t]),ZV(()=>{if(ue==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(VH(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&_t())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_t())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[_t,ue]),ZV(()=>{let e=C.current,t=S.current;if(e==null||t==null){A.current=Ge;return}let n=Ge==null?null:T.current.get(Ge)??null,r=lH(t),i=r?.dataset.itemPath??null,a=He&&x.current===r,o=f&&w.current===r,c=M.current&&!Ue,l=N.current??0,u=pe.current,d=J.current,p=me.current,m=he.current,h=r!=null,g=k.current||h,_=A.current!==Ge,v=d!=null&&d===Ge&&Ge!=null,y=c&&FH(e,Ke,s,rt,st,l),b=u!=null&&u===Ge&&FH(e,Ke,s,rt,st,ct),E=p!=null&&p.path===Ge&&FH(e,Ke,s,rt,st,p.viewportOffset),O=m!=null&&m.path===Ge&&e.scrollTop!==m.scrollTop;if(O&&(e.scrollTop=m.scrollTop),(O||b||E||y||g&&_&&u!==Ge&&!v&&PH(e,Ke,s,rt,ct))&&D.current(),!g){A.current=Ge;return}if(a){A.current=Ge;return}if(o&&!c){A.current=Ge;return}if(n==null){c&&Ke>=0&&(FH(e,Ke,s,rt,st,l),D.current()),A.current=Ge;return}(_||c||u===Ge||d===Ge||p?.path===Ge||m?.path===Ge||i==null||i!==Ge)&&(cH(n),u===Ge&&(pe.current=null),d===Ge&&(J.current=null),p?.path===Ge&&(me.current=null),m?.path===Ge&&(he.current=null),M.current=!1,N.current=null),A.current=Ge},[t,Ke,Ge,ut,s,He,Ue,it,rt,f,ct,st,nt]);let zt=Ke>=0&&Ke>=tt.visible.startIndex&&Ke<=tt.visible.endIndex,Bt=Ge!=null&&at.some(e=>fH(e.row)===Ge),Vt=zt||Bt,Ht=je&&k.current===!0&&Vt?Ge:null,Ut=oe===`pointer`?ne:null,Wt=ue?.path??ge.current??Ut??Ht??ne,Gt=ue?.source===`right-click`;ZV(()=>{y.current&&ue==null||vt(Le(Wt))},[ue,Le,it,rt,ce,at,Wt,vt,nt]);let Kt=eH(e=>{if(y.current||VH(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&se(e=>e===`pointer`?e:`pointer`),re(e=>e===i?e:i)},[]),qt=eH(()=>{re(null)},[]);ZV(()=>{if(!qe)return;let e=()=>{kt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),kt(),t.cancelDrag()}},[t,qe]);let Jt=e=>{if(!qe||t.getDragSession()==null||V.current)return;let n=SH(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),jt(t.getDragSession()?.target??null),Nt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},Yt=e=>{if(!qe||t.getDragSession()==null||V.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Tt(),Dt(),t.setDragTarget(null))},Xt=e=>{!qe||t.getDragSession()==null||V.current||(e.preventDefault(),At(e.clientX,e.clientY),t.completeDrag(),Et(),Tt(),Dt(),z.current=null)},Zt=tt.window.height,Qt=tt.window.offsetTop,$t=Math.min(0,rt-Zt-ct),en=ee===Ge||M.current,tn=Ge!=null&&en&&!ut&&Ke>=0?nt[Ke]??t.getVisibleRows(Ke,Ke)[0]??null:null,nn=tn==null?null:IH(Ke,s,it,Zt),rn=z.current,an=Ze!=null&&rn!=null&&rn.path===Ze&&rn.index>=it.start&&rn.index<=it.end,on=Ze!=null&&rn!=null&&rn.path===Ze&&!an&&rn.path!==tn?.path?rn:null,sn=on==null?null:IH(on.index,s,it,Zt),cn=LH((Ke>=0?nt[Ke]??t.getVisibleRows(Ke,Ke)[0]??null:null)?.ancestorPaths.at(-1)??null),ln=Ue&&Ge!=null?QH(o,Ge,!ut):void 0,un=ue?.path??(Ue?Ge:ee),dn=ue?.path??ne,fn=Le(Wt),pn=ke&&je&&!Gt&&!He&&fn!=null&&ie!=null&&Wt!=null,mn=ke&&(pn||ue!=null),hn=ue?.anchorRect,gn=hn==null&&fn!=null&&ie!=null&&(ue!=null||pn)?ie:null,_n=hn==null?gn==null?void 0:{top:`${gn}px`}:{left:`${hn.left}px`,position:`fixed`,right:`auto`,top:`${hn.top}px`},vn=Gt?{opacity:`0`}:void 0,yn=eH((e,n,r,i)=>{let a=t.getItem(r),o=AV({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:t.isSearchOpen(),mode:i});switch(o.selection.kind){case`range`:t.selectPathRange(r,o.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(r);break;case`single`:t.selectOnlyPath(r);break}let s=e.currentTarget instanceof HTMLElement?e.currentTarget:null,c=n.index>=tt.visible.startIndex&&n.index<=tt.visible.endIndex,l=i===`flow`&&c&&s!=null&&s.dataset.itemParked!==`true`;a?.focus(),l&&(k.current=!0,te(e=>e===r?e:r),se(`focus`)),o.toggleDirectory&&OH(a)&&a.toggle(),o.closeSearch&&t.closeSearch(),o.revealCanonical&&xt(r,{targetOffset:`sticky-parents`})},[t,tt.visible.endIndex,tt.visible.startIndex,xt]),bn=()=>{if(y.current||!je||Wt==null||fn==null)return;let e=t.getItem(Wt);e!=null&&(vt(fn),ht.current=!0,de({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:fn.getAttribute(`aria-label`)??Wt,path:e.getPath()},path:e.getPath(),source:`button`}))},xn={contextHoverPath:dn,contextMenuButtonTriggerEnabled:je,contextMenuButtonVisibility:Me,contextMenuEnabled:ke,contextMenuRightClickEnabled:Ne,contextMenuTriggerMode:Ae,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:qe,draggedPathSet:Ye,dragTarget:Xe,gitLaneActive:Re,gitStatusByPath:n,handleRowDragEnd:Ft,handleRowDragStart:Pt,handleRowTouchStart:It,ignoredGitDirectories:r,ignoredInheritanceCache:K,instanceId:o,itemHeight:s,onKeyDown:Lt,onRowClick:yn,openContextMenuForRow:yt,registerButton:Pe,registerRenameInput:Ie,renameView:Be,renderDecorationForRow:dt,resolveIcon:ze,shouldSuppressContextMenu:St,visualFocusPath:un},Sn={...xn,registerButton:Fe};return XB(`div`,{ref:S,id:Qe,"data-file-tree-context-menu-button-visibility":ke&&je?Me:void 0,"data-file-tree-context-menu-trigger-mode":ke?Ae:void 0,"data-file-tree-has-context-menu-action-lane":ke&&je?`true`:void 0,"data-file-tree-has-git-lane":Re?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:qe?Yt:void 0,onDragOver:qe?Jt:void 0,onDrop:qe?Xt:void 0,onKeyDown:Lt,onPointerLeave:ke?qt:void 0,onPointerOver:ke?Kt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[XB(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:cn}}),XB(`slot`,{name:cF,"data-type":`header-slot`}),f?XB(`div`,{"data-file-tree-search-container":!0,"data-open":Ue?`true`:`false`,children:XB(`input`,{ref:w,"aria-activedescendant":ln,"aria-controls":Qe,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Se?`true`:void 0,value:We,onBlur:()=>{d===`retain`&&!we.current||t.closeSearch()},onFocus:Te,onPointerDown:Te,onInput:e=>{Te();let n=e.currentTarget;t.setSearch(n.value)}})}):null,XB(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&De&&at.length>0?XB(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:XB(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${$e}px`},children:at.map((e,t)=>rU(Sn,e.row,`sticky:${fH(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${at.length-t}`}}))})}):null,XB(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${st}px`},children:[XB(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${Qt}px`}}),XB(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${Zt}px`,top:`${$t}px`,bottom:`${$t}px`},children:[iU(xn,it,lt),tn!=null&&nn!=null?rU(xn,tn,`parked:${tn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:Ze===tn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${nn}px`}}):null,on!=null&&sn!=null?rU(xn,on,`parked-drag:${on.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${sn}px`}}):null]})]})]}),ke?XB(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":mn?`true`:`false`,style:_n,children:[XB(`button`,{ref:v,type:`button`,"data-type":uF,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":ue==null?`false`:`true`,"data-visible":pn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),ue!=null){_t();return}bn()},tabIndex:-1,style:vn,children:XB(eV,{...ze(`file-tree-icon-ellipsis`)})}),ue==null?null:XB(`slot`,{name:lF})]}):null,ue==null?null:XB(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),_t()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),_t()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var oU={hydrateRoot:(e,t)=>{JB(wB(aU,t),e)},renderRoot:(e,t)=>{qB(wB(aU,t),e)},unmountRoot:e=>{qB(null,e)}};function sU(e,t){oU.renderRoot(e,t)}function cU(e,t){oU.hydrateRoot(e,t)}function lU(e){oU.unmountRoot(e)}var uU=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},dU=`__c`,fU=`__k`,pU=`__d`,mU=`__s`,hU=/[\s\n\\/='"\0<>]/,gU=/^(xlink|xmlns|xml)([A-Z])/,_U=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,vU=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,yU=new Set([`draggable`,`spellcheck`]);function bU(e){e.__g===void 0?e[pU]=!0:e.__g|=8}function xU(e){e.__g===void 0?e[pU]=!1:e.__g&=-9}function SU(e){return e.__g===void 0?!0===e[pU]:!!(8&e.__g)}var CU=/["&<]/;function wU(e){if(e.length===0||!1===CU.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var TU={},EU=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),DU=/[A-Z]/g;function OU(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:TU[n]||(TU[n]=n.replace(DU,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||EU.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function kU(){this.__d=!0}function AU(e,t){return{__v:e,context:t,props:e.props,setState:kU,forceUpdate:kU,__d:!0,__h:[]}}function jU(e,t,n){if(!e.s){if(n instanceof MU){if(!n.s)return void(n.o=jU.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(jU.bind(null,e,t),jU.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var MU=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{jU(r,1,a(this.v))}catch(e){jU(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?jU(r,1,t?t(i):i):n?jU(r,1,n(i)):jU(r,2,i)}catch(e){jU(r,2,e)}},r},e}(),NU,PU,FU,IU,LU={},RU=Array.isArray,zU=Object.assign,BU=``,VU=`<!--$s-->`,HU=`<!--/$s-->`;function UU(e,t){var n,r=e.type,i=!0;return e[dU]?(i=!1,(n=e[dU]).state=n[mU]):n=new r(e.props,t),e[dU]=n,n.__v=e,n.props=e.props,n.context=t,bU(n),n.state??=LU,n[mU]??(n[mU]=n.state),r.getDerivedStateFromProps?n.state=zU({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[mU]===n.state?n.state:n[mU]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),FU&&FU(e),n.render(n.props,n.state,t)}function WU(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===BU)return BU;var s=typeof e;if(s!=`object`)return s==`function`?BU:s==`string`?wU(e):e+BU;if(RU(e)){var c,l=BU;i[fU]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=WU(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=BU,RU(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return BU;e.__=i,NU&&NU(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===EB){if(`tpl`in g){for(var x=BU,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!RU(C)?x+=C:x+=WU(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+wU(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=UU(e,b),y=e[dU];else{e[dU]=y=AU(e,b);for(var E=0;SU(y)&&E++<25;){xU(y),FU&&FU(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}bU(y)}if(y.getChildContext!=null&&(t=zU({},t,y.getChildContext())),T&&cB.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===EB&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return WU(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[mU]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,LU),SU(y)?(v=UU(e,t),(y=e[dU]).getChildContext!=null&&(t=zU({},t,y.getChildContext())),WU(v=v!=null&&v.type===EB&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):BU}finally{PU&&PU(e),IU&&IU(e)}}}v=v!=null&&v.type===EB&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=WU(v,t,n,r,e,a,o);return PU&&PU(e),cB.unmount&&cB.unmount(e),e._suspended?typeof D==`string`?VU+D+HU:RU(D)?(D.unshift(VU),D.push(HU),D):D.then(function(e){return VU+e+HU}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return WU(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=cB.__e;return k&&k(i,e),BU}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=WU(v,t,n,r,e,a,o);return e._suspended?VU+s+HU:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=BU;for(var N in g){var P=g[N];if(typeof(P=KU(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=OU(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(gU.test(N))N=N.replace(gU,`$1:$2`).toLowerCase();else{if(hU.test(N))continue;N[4]!==`-`&&!yU.has(N)||P==null?n?vU.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):_U.test(N)&&(N=N.toLowerCase()):P+=BU}}P!=null&&!1!==P&&(j=!0===P||P===BU?j+` `+N:j+` `+N+`="`+(typeof P==`string`?wU(P):P+BU)+`"`)}}if(hU.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=wU(A):A!=null&&!1!==A&&!0!==A&&(M=WU(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),PU&&PU(e),IU&&IU(e),!M&&GU.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return RU(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var GU=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function KU(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var qU=0;function JU(e){return e!=null&&e.length>0?e:(qU+=1,`pst_ft_${qU}`)}function YU({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??oz)}function XU(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function ZU(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function QU(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var $U=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new uU;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=JU(a),this.#p=sB(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=az(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new nB({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(lU(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),sU(t.wrapper,this.#w()))}setGitStatus(e){this.#p=sB(e,this.#p);let t=this.#T();t!=null&&sU(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),sU(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),cU(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),sU(r,this.#w())}#C(){return{initialViewportHeight:YU({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(cF,e());return}this.#l.setSlotHtml(cF,this.#e?.header?.html??null)}#k(e){let t=QU(e).find(e=>ZU(e)),n=XU(QP(fF(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=QU(e),n=t.find(e=>ZU(e)),r=t.filter(e=>e!==n),i=fF(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=XU(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=fF(this.#m);t.colored&&eF(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${iF}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(iF,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=uz(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return gz(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},eW=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function tW(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:cF,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:lF,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function nW(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function rW(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function iW(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function aW({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(n.getComposition()),d=(0,Q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,Q.useCallback)(()=>{s(null)},[]),m=(0,Q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,Q.useMemo)(()=>iW(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),eW(()=>{n.setComposition(g)},[g,n]),eW(()=>{if(c!=null)return r!=null&&rW(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=nW(tW(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Z.jsx)(nF,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function oW(e){let t=(0,Q.useRef)(null);return t.current??=new $U(e),(0,Q.useEffect)(()=>{let e=t.current;return()=>{e?.cleanUp(),t.current=null}},[]),{model:t.current}}var sW=`.md`,cW=/\.(md|mdx)$/i;function lW(e,t=sW){return`${e}${t}`}function uW(e){return OW(e).replace(cW,``)}function dW(e){return wr(e)?mW(e.path):En(e)?e.path:lW(e.docName,e.docExt)}function fW(e){let t=OW(e).match(cW);return t?`.${t[1].toLowerCase()}`:void 0}function pW(e){return OW(e)}function mW(e){let t=OW(e.trim());return t?`${t}/`:``}function hW(e){return e.endsWith(`/`)?pW(e):uW(e)}function gW(e){return e.map(dW)}function _W(e){return[...e].sort().join(`\0`)}function vW(e){return _W(gW(e))}function yW(e){let t=new Set;for(let n of e){if(wr(n)){let e=mW(n.path);e&&t.add(e)}let e=(wr(n)||En(n)?n.path:n.docName).split(`/`).filter(Boolean),r=wr(n)?e.length:e.length-1;for(let n=1;n<=r;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function bW(e){if(!e)return[];let t=OW(e.replace(cW,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function xW(e){let t=e.kind===`directory`,n=t?pW(e.path):uW(e.path),r=t?void 0:fW(e.path);return{kind:t?`folder`:`file`,name:OW(DW(e.path)).replace(cW,``),path:n,treePath:CW(e.path,t),docExt:r}}function SW(e){return e.kind===`directory`?pW(e.path):e.path}function CW(e,t){return t?mW(e):cW.test(e)?e:`${e}${sW}`}function wW(e,t,n){let r=mW(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${sW}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function TW(e,t){return e===`file`?CW(t,!1):`${pW(t)}/index${sW}`}function EW(e,t){return t.kind===`root`||t.directoryPath==null?DW(e):`${t.directoryPath}${DW(e)}`}function DW(e){let t=OW(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function OW(e){return e.endsWith(`/`)?e.slice(0,-1):e}function kW(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`).replace(/\*/g,`\\*`)}function AW(e){let t=kW(e.path);return e.kind===`folder`?`/${t}/`:`/${t}${e.docExt??`.md`}`}function jW(e){return{selectedFilePath:e,selectedFolderPath:null,navigationPath:e}}function MW(e,t,n={}){if(!e)return jW(t);let r=Nn(e);if(t&&r!==t)return jW(t);switch(e.kind){case`doc`:return jW(t??e.docName);case`folder`:case`folder-index`:return{selectedFilePath:null,selectedFolderPath:e.folderPath,navigationPath:e.folderPath};case`missing`:return t&&n.isKnownDocument?.(t)?jW(t):{selectedFilePath:null,selectedFolderPath:null,navigationPath:null};case`asset`:return{selectedFilePath:null,selectedFolderPath:null,navigationPath:null}}}function NW(e,t){if(!e)return{kind:`none`};let n=t.find(t=>dW(t)===e);if(n&&En(n))return{kind:`asset`,hash:dr(n.path)};let r=hW(e);return e.endsWith(`/`)?t.some(e=>wr(e)?e.path===r||e.path.startsWith(`${r}/`):(En(e)?e.path:e.docName).startsWith(`${r}/`))?{kind:`folder`,path:r}:{kind:`none`}:t.some(e=>xr(e)&&e.docName===r)?{kind:`document`,path:r}:{kind:`none`}}function PW(e){let t=!1,n=!1,r=!1;async function i(){if(!r){t=!0;try{await e()}finally{t=!1,r?n=!1:n&&(n=!1,i())}}}return{request(){if(!r){if(t){n=!0;return}i()}},dispose(){r=!0,n=!1}}}function FW(e){return e?`No workspace`:null}function IW(e){let t=(0,$.c)(38),{input:n,installStates:r,dispatch:i}=e,a=n===null,o;t[0]===a?o=t[1]:(o=FW(a),t[0]=a,t[1]=o);let s=o,c,l,u,d,f,p;if(t[2]!==i||t[3]!==s||t[4]!==n||t[5]!==a||t[6]!==r){let e;t[13]===r?e=t[14]:(e=e=>r[e.id]?.installed===!0,t[13]=r,t[14]=e);let o=Ap.filter(e);u=r[`claude-cowork`]?.installed===!0;let m;t[15]===n?m=t[16]:(m=n===null?``:Kn(n.docContext),t[15]=n,t[16]=m);let h=m,g;t[17]!==n||t[18]!==h?(g=()=>{n!==null&&SN(h)},t[17]=n,t[18]=h,t[19]=g):g=t[19],d=g,l=ci,t[20]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(ta,{children:[(0,Z.jsx)(Qr,{"aria-hidden":`true`}),`Open in`]}),t[20]=p):p=t[20],c=xi;let _;t[21]!==i||t[22]!==s||t[23]!==n||t[24]!==a?(_=e=>{let t=!a,r=s?`Open in ${e.displayName}, ${s}`:`Open in ${e.displayName}`;return(0,Z.jsxs)(Ei,{disabled:!t,onSelect:()=>{!t||!n||i(e.id,n)},"data-testid":`file-tree-open-in-${e.id}`,"aria-label":r,children:[(0,Z.jsx)(gN,{id:e.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),s?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:s}):null]},e.id)},t[21]=i,t[22]=s,t[23]=n,t[24]=a,t[25]=_):_=t[25],f=o.map(_),t[2]=i,t[3]=s,t[4]=n,t[5]=a,t[6]=r,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p}else c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12];let m;t[26]!==u||t[27]!==d||t[28]!==a?(m=u?null:(0,Z.jsxs)(Ei,{onSelect:d,disabled:a,"data-testid":`file-tree-open-in-claude-web-fallback`,"aria-label":`Open in claude.ai, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(nt,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in claude.ai →`}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser`})]}),t[26]=u,t[27]=d,t[28]=a,t[29]=m):m=t[29];let h;t[30]!==c||t[31]!==f||t[32]!==m?(h=(0,Z.jsxs)(c,{children:[f,m]}),t[30]=c,t[31]=f,t[32]=m,t[33]=h):h=t[33];let g;return t[34]!==l||t[35]!==p||t[36]!==h?(g=(0,Z.jsxs)(l,{children:[p,h]}),t[34]=l,t[35]=p,t[36]=h,t[37]=g):g=t[37],g}var LW=ee(`HOVER_INTENT_MS`,80),RW=3,zW=20,BW=new Map,VW=new Set,HW=[],UW=new Map;function WW(e){for(UW.delete(e),UW.set(e,!0);UW.size>zW;){let e=UW.keys().next().value;if(e===void 0)break;UW.delete(e)}}function GW(e){VW.delete(e),qW()}function KW(e,t){let n=Date.now();W(`ok/sidebar/prewarm-success`,{docName:e,t:n,poolEventId:t}),ot(e,t,n)}function qW(){for(;VW.size<RW&&HW.length>0;){let e=HW.shift();if(!e)break;if(!UW.has(e.docName)){VW.add(e.docName),WW(e.docName);try{let t=e.prewarm(e.docName);t&&KW(e.docName,t)}catch(t){W(`ok/sidebar/prewarm-failed`,{docName:e.docName,message:t instanceof Error?t.message:String(t)})}finally{GW(e.docName)}}}}function JW(e,t){if(me(e)||UW.has(e))return;let n=BW.get(e);n&&clearTimeout(n.timer);let r=setTimeout(()=>{if(BW.delete(e),VW.size>=RW){HW.push({docName:e,prewarm:t});return}WW(e),VW.add(e);try{let n=t(e);n&&KW(e,n)}catch(t){W(`ok/sidebar/prewarm-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}finally{GW(e)}},LW);BW.set(e,{timer:r,prewarm:t})}function YW(e){let t=BW.get(e);t&&(clearTimeout(t.timer),BW.delete(e))}var XW=/\.(md|mdx)$/i;function ZW(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function QW(e){let t=e.match(/^"(.+)" already exists\.$/);return t?t[1]:null}function $W(e){let t=e.match(XW);return t?t[0]:null}async function eG(e,t){try{await navigator.clipboard.writeText(e),Fa.success(`Copied ${t}`,{description:e})}catch(e){console.warn(`[FileTree] clipboard write failed:`,e),Fa.error(`Could not copy ${t}`)}}var tG=new Set([`agents`,`agent`,`claude`,`skill`]),nG=`ok-file-tree-link-decoration`,rG=`ok-file-tree-agent-decoration`;function iG(e){return e.map(([e,{key:t,...n}])=>`<${e} ${Object.entries(n).map(([e,t])=>`${e}="${t}"`).join(` `)} />`).join(``)}function aG(e,t){return`<symbol id="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${iG(t)}</symbol>`}var oG=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
1847
|
+
${aG(nG,ks)}
|
|
1848
|
+
${aG(rG,$o)}
|
|
1849
|
+
</svg>`,sG=`
|
|
1850
|
+
[data-item-selected='true'] [data-icon-token='markdown'] {
|
|
1851
|
+
color: var(--trees-selected-fg);
|
|
1852
|
+
}
|
|
1853
|
+
`;function cG(e){return{...CF({type:e===`dark`?`dark`:`light`,colors:{"sideBar.background":`var(--sidebar)`,"sideBar.foreground":`var(--sidebar-foreground)`,"sideBar.border":`var(--sidebar-border)`,"list.activeSelectionBackground":`var(--sidebar-accent)`,"list.activeSelectionForeground":`var(--sidebar-accent-foreground)`,"list.hoverBackground":`var(--sidebar-hover)`,focusBorder:`var(--color-primary)`,"input.background":`var(--input)`,"input.border":`var(--border)`}}),"--trees-font-family-override":`var(--font-sans)`,"--trees-font-size-override":`0.875rem`,"--trees-item-padding-x-override":`0.5rem`,"--trees-padding-inline-override":`0.5rem`,"--trees-border-radius-override":`0.375rem`,"--trees-selected-fg":`var(--color-primary)`,"--truncate-marker-fade-in-duration":`0s`,"--trees-file-icon-color-markdown":`light-dark(var(--color-gray-400), var(--color-gray-500))`,"--trees-fg-muted":`light-dark(var(--color-gray-400), var(--color-gray-500))`}}function lG(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&tG.has(t)}function uG(e){return e===`darwin`?`Reveal in Finder`:e===`win32`?`Reveal in File Explorer`:`Open Containing Folder`}function dG(e){let t=(0,$.c)(14),{item:n,workspace:r,onClose:i}=e,a=typeof window<`u`?window.okDesktop:void 0;if(!a)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=uG(a.platform),t[0]=o):o=t[0];let s=o,c=r?null:`No workspace`,l=!r,u;t[1]!==n||t[2]!==i||t[3]!==r?(u=()=>{if(!r)return;i();let e=Cm(r.contentDir,SW(n),r.pathSeparator);a.shell.showItemInFolder(e)},t[1]=n,t[2]=i,t[3]=r,t[4]=u):u=t[4];let d=c?`${s}, ${c}`:s,f,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(xe,{"aria-hidden":`true`}),p=(0,Z.jsx)(`span`,{className:`flex-1`,children:s}),t[5]=f,t[6]=p):(f=t[5],p=t[6]);let m;t[7]===c?m=t[8]:(m=c?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:c}):null,t[7]=c,t[8]=m);let h;return t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==m?(h=(0,Z.jsxs)(Ei,{disabled:l,onSelect:u,"aria-label":d,children:[f,p,m]}),t[9]=l,t[10]=u,t[11]=d,t[12]=m,t[13]=h):h=t[13],h}function fG(e){return e?.isDirectory()?e:null}function pG(e,t){let n=t.getPath();for(let t of e.getSelectedPaths())t!==n&&e.getItem(t)?.deselect();t.isSelected()||t.select()}function mG(e){return xW({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e})}function hG(e,t){return e!==t&&e.startsWith(t)}function gG(e,t){let n=[...new Set(e)].filter(e=>!t(e)),r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>hG(e,t))).map(mG)}function _G(e,t){return e===t||e.startsWith(`${t}/`)}function vG(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable||e.closest(`[contenteditable="true"]`)!==null}function yG(e,t,n){let r=new Set,i=new Set;for(let a of e){if(a.kind===`file`){r.add(a.path);continue}i.add(a.path);for(let e of t)xr(e)&&e.docName.startsWith(`${a.path}/`)&&r.add(e.docName);for(let e of n){let t=pW(e);_G(t,a.path)&&i.add(t)}}return{docNames:r,folderPaths:i}}function bG(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:_G(t.createdPath,e.path)}function xG(e){let t=(0,$.c)(85),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,okignoreBinding:l,onStartCreating:u,onStartCreatingFromTemplate:d,onDelete:f,onExpandSubtree:p,onCollapseSubtree:m,isAsset:h,isAssetTreePath:g}=e,_,v,y,b,x;if(t[0]!==h||t[1]!==g||t[2]!==n||t[3]!==s||t[4]!==l){x=xW(n),y=n.kind===`directory`,_=!h&&l!==null,v=y?`Hide files in this folder`:`Hide this file`;let e=s.getSelectedPaths();b=e.includes(x.treePath)?gG(e,g):[],t[0]=h,t[1]=g,t[2]=n,t[3]=s,t[4]=l,t[5]=_,t[6]=v,t[7]=y,t[8]=b,t[9]=x}else _=t[5],v=t[6],y=t[7],b=t[8],x=t[9];let S=b,C;t[10]!==S||t[11]!==x?(C=S.length>1?S:[x],t[10]=S,t[11]=x,t[12]=C):C=t[12];let w=C,T=w.length>1?`Delete ${w.length} Items`:`Delete`,E;t[13]!==y||t[14]!==n.path||t[15]!==a?(E=y?null:Tm({docName:uW(n.path),workspace:a}),t[13]=y,t[14]=n.path,t[15]=a,t[16]=E):E=t[16];let D=E,O;t[17]===r?O=t[18]:(O=()=>r.close({restoreFocus:!1}),t[17]=r,t[18]=O);let k=O,A;t[19]===r?A=t[20]:(A=()=>r.close(),t[19]=r,t[20]=A);let j=A,M;t[21]===j?M=t[22]:(M=e=>{e||j()},t[21]=j,t[22]=M);let N;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(ii,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[23]=N):N=t[23];let P;t[24]!==i||t[25]!==j||t[26]!==k||t[27]!==y||t[28]!==n.path||t[29]!==m||t[30]!==p||t[31]!==u||t[32]!==d?(P=y?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Ei,{disabled:i,onSelect:()=>{k(),u(`file`,pW(n.path))},children:[(0,Z.jsx)($s,{"aria-hidden":`true`}),`New File`]}),(0,Z.jsxs)(Ei,{disabled:i,onSelect:()=>{k(),d(pW(n.path))},children:[(0,Z.jsx)(gs,{"aria-hidden":`true`}),`New from template`]}),(0,Z.jsxs)(Ei,{disabled:i,onSelect:()=>{k(),u(`folder`,pW(n.path))},children:[(0,Z.jsx)(xs,{"aria-hidden":`true`}),`New Folder`]}),(0,Z.jsx)(ui,{}),(0,Z.jsxs)(Ei,{onSelect:()=>{j(),p(n.path)},children:[(0,Z.jsx)(sc,{"aria-hidden":`true`}),`Expand All`]}),(0,Z.jsxs)(Ei,{onSelect:()=>{j(),m(n.path)},children:[(0,Z.jsx)(ys,{"aria-hidden":`true`}),`Collapse All`]}),(0,Z.jsx)(ui,{})]}):null,t[24]=i,t[25]=j,t[26]=k,t[27]=y,t[28]=n.path,t[29]=m,t[30]=p,t[31]=u,t[32]=d,t[33]=P):P=t[33];let F;t[34]!==i||t[35]!==k||t[36]!==h||t[37]!==n.path||t[38]!==s?(F=h?null:(0,Z.jsxs)(Ei,{disabled:i,onSelect:()=>{k(),s.startRenaming(n.path)},children:[(0,Z.jsx)(we,{"aria-hidden":`true`}),`Rename`]}),t[34]=i,t[35]=k,t[36]=h,t[37]=n.path,t[38]=s,t[39]=F):F=t[39];let I;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsxs)(ta,{children:[(0,Z.jsx)(li,{"aria-hidden":`true`}),`Copy Path`]}),t[40]=I):I=t[40];let L=!a,R;t[41]!==j||t[42]!==n||t[43]!==a?(R=()=>{a&&(j(),eG(Cm(a.contentDir,SW(n),a.pathSeparator),`full path`))},t[41]=j,t[42]=n,t[43]=a,t[44]=R):R=t[44];let z;t[45]!==L||t[46]!==R?(z=(0,Z.jsx)(Ei,{disabled:L,onSelect:R,children:`Full Path`}),t[45]=L,t[46]=R,t[47]=z):z=t[47];let B;t[48]!==j||t[49]!==n?(B=(0,Z.jsx)(Ei,{onSelect:()=>{j(),eG(SW(n),`relative path`)},children:`Relative Path`}),t[48]=j,t[49]=n,t[50]=B):B=t[50];let V;t[51]!==z||t[52]!==B?(V=(0,Z.jsxs)(ci,{children:[I,(0,Z.jsxs)(xi,{children:[z,B]})]}),t[51]=z,t[52]=B,t[53]=V):V=t[53];let H;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(ui,{}),t[54]=H):H=t[54];let U;t[55]!==j||t[56]!==n||t[57]!==a?(U=(0,Z.jsx)(dG,{item:n,workspace:a,onClose:j}),t[55]=j,t[56]=n,t[57]=a,t[58]=U):U=t[58];let W;t[59]!==o||t[60]!==D||t[61]!==h||t[62]!==y?(W=!y&&!h&&(0,Z.jsx)(IW,{input:D,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),t[59]=o,t[60]=D,t[61]=h,t[62]=y,t[63]=W):W=t[63];let G;t[64]!==i||t[65]!==_||t[66]!==j||t[67]!==T||t[68]!==w||t[69]!==v||t[70]!==h||t[71]!==l||t[72]!==f||t[73]!==x?(G=h?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ui,{}),(0,Z.jsxs)(Ei,{"data-testid":`file-tree-menu-hide`,disabled:!_,onSelect:()=>{if(!l)return;j();let e=AW(x),t=Wi(Ri(Hi(l.current()),e));l.patch(t)},children:[(0,Z.jsx)(ms,{"aria-hidden":`true`}),v]}),(0,Z.jsx)(ui,{}),(0,Z.jsxs)(Ei,{variant:`destructive`,disabled:i,onSelect:()=>{j(),f(w)},children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),T]})]}),t[64]=i,t[65]=_,t[66]=j,t[67]=T,t[68]=w,t[69]=v,t[70]=h,t[71]=l,t[72]=f,t[73]=x,t[74]=G):G=t[74];let K;t[75]!==V||t[76]!==U||t[77]!==W||t[78]!==G||t[79]!==P||t[80]!==F?(K=(0,Z.jsxs)(ba,{sideOffset:0,align:`start`,"data-file-tree-context-menu-root":`true`,className:`min-w-52`,children:[P,F,V,H,U,W,G]}),t[75]=V,t[76]=U,t[77]=W,t[78]=G,t[79]=P,t[80]=F,t[81]=K):K=t[81];let q;return t[82]!==K||t[83]!==M?(q=(0,Z.jsxs)(Bi,{open:!0,modal:!1,onOpenChange:M,children:[N,K]}),t[82]=K,t[83]=M,t[84]=q):q=t[84],q}function SG(e){let t=(0,$.c)(176),{ref:n}=e,{activeDocName:r,activeTarget:i,closeTabs:a,closeTab:o,closeDocument:s,closeAndClearForRename:c,isNewTabActive:l,openTarget:u,prewarm:d,remapTabsForRename:f}=Pe(),{notifySidebarFileSelected:p}=rM(),{resolvedTheme:m}=nn(),{addPage:h}=hr(),_;t[0]!==p||t[1]!==u?(_=function(e){u({kind:`doc`,target:e,docName:e},{tabBehavior:`replace-active`}),ZW(Gn(e)),p()},t[0]=p,t[1]=u,t[2]=_):_=t[2];let v=_,y;t[3]!==p||t[4]!==u?(y=function(e){let t=Dn(e);u({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),ZW(t),p()},t[3]=p,t[4]=u,t[5]=y):y=t[5];let b=y,x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[6]=x):x=t[6];let[S,C]=(0,Q.useState)(x),[w,T]=(0,Q.useState)(!0),[E,D]=(0,Q.useState)(null),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(null),[M,N]=(0,Q.useState)(null),[P,F]=(0,Q.useState)(null),I=(0,Q.useRef)(S),L;t[7]!==S||t[8]!==b||t[9]!==v||t[10]!==p?(L=function(e,t){let n=NW(e,t===void 0?S:t);if(n.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,hW(e));return}if(n.kind===`asset`){window.location.hash=n.hash,p();return}if(n.kind===`folder`){b(n.path);return}v(n.path)},t[7]=S,t[8]=b,t[9]=v,t[10]=p,t[11]=L):L=t[11];let R=L,B=(0,Q.useRef)(r),V;t[12]===S?V=t[13]:(V=new Set(S.filter(En).map(LG)),t[12]=S,t[13]=V);let H=V,U=(0,Q.useRef)(H),W;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(W=[],t[14]=W):W=t[14];let G=(0,Q.useRef)(W),K=(0,Q.useRef)(null),q=(0,Q.useRef)(IG),ee=(0,Q.useRef)(null),te=(0,Q.useRef)(null),ne=(0,Q.useRef)(!1),re=(0,Q.useRef)(null),ie=(0,Q.useRef)(null),ae=(0,Q.useRef)(FG),oe=(0,Q.useRef)(PG),se=(0,Q.useRef)(NG),ce=(0,Q.useRef)(MG),le=(0,Q.useRef)(i),{selectedFilePath:de,selectedFolderPath:fe,navigationPath:pe}=MW(i,l?null:r),J=de?lW(de,S.find(e=>xr(e)&&e.docName===de)?.docExt):fe?mW(fe):i?.kind===`asset`?i.assetPath:null,me=Gm().states,{dispatch:he}=Pm(),ge;t[15]!==he||t[16]!==me?(ge={installStates:me,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:he},t[15]=he,t[16]=me,t[17]=ge):ge=t[17];let _e=ge,{okignoreBinding:ve}=ri(),ye;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>re.current===null,t[18]=ye):ye=t[18];let be=ye,xe;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(xe=[],t[19]=xe):xe=t[19];let Se;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Se={set:`complete`,spriteSheet:oG},t[20]=Se):Se=t[20];let Ce;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(Ce={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[21]=Ce):Ce=t[21];let we;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(we={canDrag:be,canDrop:be,onDropComplete:e=>ce.current(e),onDropError:jG},t[22]=we):we=t[22];let Te;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Te={paths:xe,flattenEmptyDirectories:!1,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,icons:Se,unsafeCSS:sG,composition:Ce,dragAndDrop:we,renaming:{canRename:be,onRename:e=>oe.current(e),onError:e=>se.current(e)},onSelectionChange:e=>ae.current(e),renderRowDecoration:e=>{let{item:t}=e;if(t.kind!==`file`)return null;let n=I.current.find(e=>xr(e)&&lW(e.docName,e.docExt)===t.path);return n?.isSymlink?{icon:nG,title:n.targetPath?`Symlink to ${n.targetPath}`:`Symlink`}:lG(t.path)?{icon:rG,title:`Agent configuration file`}:null}},t[23]=Te):Te=t[23];let{model:Y}=oW(Te),Ee;t[24]===Y?Ee=t[25]:(Ee=function(e){let t=Y.getItem(e)??Y.getItem(mW(e));return t?.isDirectory()?mW(pW(t.getPath())):e},t[24]=Y,t[25]=Ee);let De=Ee,Oe,ke;t[26]===S?(Oe=t[27],ke=t[28]):(ke=gW(S),Oe=_W(ke),t[26]=S,t[27]=Oe,t[28]=ke);let Ae=Oe,je=(0,Q.useRef)(ke),Me;t[29]===S?Me=t[30]:(Me=yW(S),t[29]=S,t[30]=Me);let Ne=Me,Fe=(0,Q.useRef)(Ne),Ie=fe?bW(mW(fe)).slice(0,-1):bW(J??pe),Le=Ie.join(`\0`),Re;if(t[31]!==Y){let e=()=>{let e=new Set;for(let t of Fe.current)fG(Y.getItem(t))?.isExpanded()&&e.add(t);return e};Re=t=>{let n=new Set(yW(t??I.current)),r=e();for(let e of G.current)r.add(e);return[...r].filter(e=>n.has(e))},t[31]=Y,t[32]=Re}else Re=t[32];let Be=Re,Ve;t[33]!==Be||t[34]!==Y?(Ve=e=>{let t=gW(e??I.current);Y.resetPaths(t,{initialExpandedPaths:Be(e)})},t[33]=Be,t[34]=Y,t[35]=Ve):Ve=t[35];let He=Ve,Ue;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=e=>{ee.current=vW(e)},t[36]=Ue):Ue=t[36];let We=Ue,Ge;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=e=>U.current.has(e),t[37]=Ge):Ge=t[37];let Ke=Ge,qe=function(e){let t=QW(e);if(!t||$W(t))return!1;let n=Y.getFocusedPath()??Y.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||Ke(n))return!1;let r=$W(n);if(!r)return!1;let i=mW(t);if(!Fe.current.includes(i))return!1;let a=`${t}${r}`;return je.current.includes(a)?!1:(mt({sourcePath:n,destinationPath:a,isFolder:!1}),Y.move(n,a),!0)},Je;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Je=e=>{let t=e??K.current;!t||K.current!==t||(t.disposeCommitListener(),K.current=null)},t[38]=Je):Je=t[38];let Ye=Je,Xe;t[39]!==Ye||t[40]!==s||t[41]!==o||t[42]!==He?(Xe=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,i=n.restoreLocation??r;Ye(e),r&&k(e.renamePath);try{let t=await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.createdPath})});if(!t.ok&&t.status!==404){let n=await z(t,`Failed to clean up pending ${e.kind}`);if(n.ok)return;let i=`${n.title} - ${e.kind} "${e.createdPath}" still exists on disk`;r?Fa.error(i):console.warn(`[FileTree] cleanup pending create failed: ${i}`),r&&(k(null),He());return}}catch(t){console.warn(`[FileTree] cleanup pending create failed:`,t),r&&Fa.error(`Network error - ${e.kind} "${e.createdPath}" still exists on disk`),r&&(k(null),He());return}r&&(e.kind===`file`?s(e.createdPath):o(ze(e.createdPath))),r&&C(t=>{let n=HM(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return We(n),n}),zn([`files`,`backlinks`,`graph`]),i&&(window.location.hash=e.previousHash),r&&k(null)},t[39]=Ye,t[40]=s,t[41]=o,t[42]=He,t[43]=Xe):Xe=t[43];let Ze=Xe,Qe,$e;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=()=>()=>{let e=K.current;e&&q.current(e,{restoreLocation:!1,updateUi:!1}).catch(AG)},$e=[],t[44]=Qe,t[45]=$e):(Qe=t[44],$e=t[45]),(0,Q.useEffect)(Qe,$e);let et,tt;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(et=()=>{let e=!0,t=PW(async function(){try{let t=await z(await fetch(`/api/documents`),`Failed to load documents`);if(!e)return;if(!t.ok)D(t.title);else{let e=br.safeParse(t.body);e.success?(C(e.data.documents),D(null)):D(`Documents response did not match expected shape.`)}}catch(t){let n=t;e&&D(`Could not reach server`),console.warn(`[FileTree] fetch failed:`,n)}e&&T(!1)});t.request();let n=()=>{document.visibilityState===`visible`&&t.request()};window.addEventListener(`focus`,n),window.addEventListener(`visibilitychange`,n);let r=sr(e=>{e.includes(`files`)&&t.request()});return()=>{e=!1,t.dispose(),window.removeEventListener(`focus`,n),window.removeEventListener(`visibilitychange`,n),r()}},tt=[],t[46]=et,t[47]=tt):(et=t[46],tt=t[47]),(0,Q.useEffect)(et,tt);let nt,rt;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(nt=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=g(vn,n,`workspace`,null);r&&F({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(kG),()=>{e=!1}},rt=[],t[48]=nt,t[49]=rt):(nt=t[48],rt=t[49]),(0,Q.useEffect)(nt,rt);let it;t[50]!==Be||t[51]!==Y||t[52]!==Ae?(it=()=>{if(ee.current===Ae){ee.current=null;return}Y.resetPaths(je.current,{initialExpandedPaths:Be()})},t[50]=Be,t[51]=Y,t[52]=Ae,t[53]=it):it=t[53];let at;t[54]!==Y||t[55]!==Ae?(at=[Y,Ae],t[54]=Y,t[55]=Ae,t[56]=at):at=t[56],(0,Q.useEffect)(it,at);let ot,st;t[57]!==Le||t[58]!==J||t[59]!==Y?(ot=()=>{let e=()=>{queueMicrotask(()=>{ne.current=!1})};if(ne.current=!0,!J){for(let e of Y.getSelectedPaths())Y.getItem(e)?.deselect();e();return}let t=Le?Le.split(`\0`):[];for(let e of t){let t=fG(Y.getItem(e));t&&!t.isExpanded()&&t.expand()}let n=Y.getItem(J);if(!n){e();return}pG(Y,n),n.focus(),e()},st=[Le,J,Y],t[57]=Le,t[58]=J,t[59]=Y,t[60]=ot,t[61]=st):(ot=t[60],st=t[61]),(0,Q.useEffect)(ot,st);let ct,lt;t[62]===Y?(ct=t[63],lt=t[64]):(ct=()=>Y.subscribe(()=>{if(!Y.isSearchOpen())for(let e of G.current){let t=fG(Y.getItem(e));t&&!t.isExpanded()&&t.expand()}}),lt=[Y],t[62]=Y,t[63]=ct,t[64]=lt),(0,Q.useEffect)(ct,lt);let ut,dt;t[65]===Y?(ut=t[66],dt=t[67]):(ut=()=>Y.onMutation(`remove`,e=>{let t=K.current;!t||e.path!==t.renamePath||q.current(t)}),dt=[Y],t[65]=Y,t[66]=ut,t[67]=dt),(0,Q.useEffect)(ut,dt);let ft;t[68]!==h||t[69]!==c||t[70]!==b||t[71]!==f?(ft=async(e,t,n)=>{let r=t===void 0?[]:t,i=n?.docName??B.current,a=UM(i,e),o=n?.folderPath??(le.current?.kind===`folder`?le.current.folderPath:null),s=o?ue(o,r):null;await Promise.all(e.flatMap(e=>[c(e.fromDocName),c(e.toDocName)]));for(let t of e)h(t.toDocName);f(e,r),C(t=>{let n=VM(t,e,r);return We(n),n}),o&&s&&s!==o?b(s):a&&a!==i&&(window.location.hash=Gn(a)),zn([`files`,`backlinks`,`graph`])},t[68]=h,t[69]=c,t[70]=b,t[71]=f,t[72]=ft):ft=t[72];let pt=ft;async function mt(e){let t=CW(e.sourcePath,e.isFolder),n=CW(e.destinationPath,e.isFolder);k(t),D(null);try{if(!e.isFolder&&Ke(t)){Fa.error(`Assets cannot be renamed from the sidebar`),He(),Ye(),k(null);return}let r=e.isFolder?{kind:`folder`,fromPath:pW(t),toPath:pW(n)}:{kind:`file`,fromPath:uW(t),toPath:uW(n)},i={docName:B.current,folderPath:le.current?.kind===`folder`?le.current.folderPath:null},a=await z(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}),`Failed to rename path`);if(!a.ok){Fa.error(a.title),D(a.title),He();let e=K.current;e&&e.renamePath===t?await Ze(e):Ye(),k(null);return}await pt(g(un,a.body,`rename-path`,{renamed:[]}).renamed,e.isFolder?[{fromPath:pW(t),toPath:pW(n)}]:[],i),Ye(),k(null)}catch(e){console.warn(`[FileTree] rename failed:`,e),Fa.error(`Network error — please try again`),D(`Network error — please try again`),He();let n=K.current;n&&n.renamePath===t?await Ze(n):Ye(),k(null)}}let ht;t[73]!==pt||t[74]!==He?(ht=async function(e){let t=e.draggedPaths.map(t=>{let n=EW(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(OG);if(t.length!==0){if(t.some(e=>Ke(e.sourcePath))){Fa.error(`Assets cannot be moved from the sidebar`),He();return}k(t[0]?.sourcePath??null),D(null);try{let e=[],n=[],r={docName:B.current,folderPath:le.current?.kind===`folder`?le.current.folderPath:null};for(let r of t){let t=r.sourcePath.endsWith(`/`),i=t?{kind:`folder`,fromPath:pW(r.sourcePath),toPath:pW(r.destinationTreePath)}:{kind:`file`,fromPath:uW(r.sourcePath),toPath:uW(r.destinationTreePath)},a=await z(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)}),`Failed to move`);if(!a.ok){Fa.error(a.title),D(a.title),He(),k(null);return}let o=g(un,a.body,`rename-path:drop`,{renamed:[]});e=e.concat(o.renamed),t&&n.push({fromPath:pW(r.sourcePath),toPath:pW(r.destinationTreePath)})}await pt(e,n,r),k(null)}catch(e){console.warn(`[FileTree] move failed:`,e),Fa.error(`Network error — please try again`),He(),k(null)}}},t[73]=pt,t[74]=He,t[75]=ht):ht=t[75];let gt=ht,_t;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(_t=function(e){N({parentDir:e})},t[76]=_t):_t=t[76];let vt=_t,yt;t[77]!==Ze||t[78]!==Ye||t[79]!==Y||t[80]!==b||t[81]!==v||t[82]!==He||t[83]!==ke?(yt=async function(e,t){if(re.current)return;let n=K.current;n&&Ye(n);try{let n=wW(e,t,[...ke,...Fe.current]);k(n.renamePath),re.current=n.renamePath;let r=window.location.hash,i;if(e===`file`){let e=TW(`file`,n.addPath),t=await z(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),`Failed to create file`);if(!t.ok){Fa.error(t.title),D(t.title),k(null),re.current=null;return}let r=uW(e),a=g(or,t.body,`create-page`,{docName:r}).docName;i=a;let o=e.toLowerCase().endsWith(`.mdx`)?`.mdx`:`.md`;C(e=>{if(e.some(e=>xr(e)&&e.docName===a))return e;let t=[...e,{kind:`document`,docName:a,docExt:o,modified:new Date().toISOString(),size:0}];return We(t),t}),zn([`files`,`backlinks`,`graph`]),v(a)}else{let e=pW(n.addPath),t=await z(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),`Failed to create folder`);if(!t.ok){Fa.error(t.title),D(t.title),k(null),re.current=null;return}i=g(kn,t.body,`create-folder`,{path:e}).path,C(e=>{if(e.some(e=>wr(e)&&e.path===i))return e;let t=[...e,{kind:`folder`,path:i,modified:new Date().toISOString(),size:0}];return We(t),t}),zn([`files`]),b(i)}let a=!1,o=e=>{if(e.key!==`Enter`)return;let t=K.current;!t||t.renamePath!==n.renamePath||queueMicrotask(()=>Ye(t))};document.addEventListener(`keydown`,o,!0),K.current={kind:e,renamePath:n.renamePath,createdPath:i,previousHash:r,disposeCommitListener:()=>{a||(a=!0,document.removeEventListener(`keydown`,o,!0))}},k(null),re.current=null,Y.add(n.addPath),Y.startRenaming(n.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),Fa.error(`Could not start creating a new item`);let t=K.current;t?await Ze(t):Ye(),k(null),re.current=null,He()}},t[77]=Ze,t[78]=Ye,t[79]=Y,t[80]=b,t[81]=v,t[82]=He,t[83]=ke,t[84]=yt):yt=t[84];let bt=yt,xt;t[85]===Y?xt=t[86]:(xt=function(e){let t=mW(e);(0,Q.startTransition)(()=>{for(let e of Fe.current)if(e===t||e.startsWith(t)){let t=fG(Y.getItem(e));t&&t.expand()}})},t[85]=Y,t[86]=xt);let St=xt,Ct;t[87]===Y?Ct=t[88]:(Ct=function(e){let t=mW(e),n=new Set(G.current);(0,Q.startTransition)(()=>{for(let e of[...Fe.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=fG(Y.getItem(e));t&&t.collapse()}})},t[87]=Y,t[88]=Ct);let wt=Ct,Tt;t[89]!==R||t[90]!==Ie||t[91]!==r||t[92]!==i||t[93]!==H||t[94]!==O||t[95]!==Ze||t[96]!==S||t[97]!==Ne||t[98]!==gt||t[99]!==mt||t[100]!==De||t[101]!==qe||t[102]!==ke?(Tt=()=>{I.current=S,B.current=r,le.current=i,U.current=H,re.current=O,je.current=ke,Fe.current=Ne,G.current=Ie,q.current=Ze,ae.current=e=>{if(ne.current||e.length!==1)return;let t=e[0];t&&R(De(t),S)},se.current=e=>{qe(e)||Fa.error(e)},oe.current=mt,ce.current=gt},t[89]=R,t[90]=Ie,t[91]=r,t[92]=i,t[93]=H,t[94]=O,t[95]=Ze,t[96]=S,t[97]=Ne,t[98]=gt,t[99]=mt,t[100]=De,t[101]=qe,t[102]=ke,t[103]=Tt):Tt=t[103],(0,Q.useLayoutEffect)(Tt);let Et,Dt;t[104]===Y?(Et=t[105],Dt=t[106]):(Et=()=>{let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.altKey||e.key.toLowerCase()!==`a`||vG(e.target))return;let t=ie.current,n=e.target,r=document.activeElement,i=n instanceof Node&&t?.contains(n),a=r instanceof Node&&t?.contains(r);if(!i&&!a)return;let o=new Set([...Fe.current,...je.current]);ne.current=!0;for(let e of o)!e||U.current.has(e)||Y.getItem(e)?.select();queueMicrotask(()=>{ne.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},Dt=[Y],t[104]=Y,t[105]=Et,t[106]=Dt),(0,Q.useEffect)(Et,Dt);let Ot,kt;t[107]!==S.length||t[108]!==w?(Ot=()=>{if(w||S.length===0)return;let e=ie.current?.querySelector(nF)?.shadowRoot;if(!e)return;let t=DG,n=()=>{for(let n of e.querySelectorAll(`[data-item-path]`)){let e=n.dataset.itemPath;if(!e)continue;let r=t(e);n.title!==r&&(n.title=r)}let n=e.querySelector(`[data-type="context-menu-anchor"]`);if(n){let r=e.querySelector(`[data-item-context-hover="true"][data-item-path]`)?.dataset.itemPath,i=r?t(r):``;n.title!==i&&(n.title=i)}};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`,`data-item-context-hover`]}),()=>r.disconnect()},kt=[w,S.length],t[107]=S.length,t[108]=w,t[109]=Ot,t[110]=kt):(Ot=t[109],kt=t[110]),(0,Q.useEffect)(Ot,kt);let At;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(At={folderCount:0,expandedCount:0},t[111]=At):At=t[111];let jt=(0,Q.useRef)(At),Mt=(0,Q.useRef)(bt),Nt=(0,Q.useRef)(vt),Pt;t[112]===bt?Pt=t[113]:(Pt=()=>{Mt.current=bt,Nt.current=vt},t[112]=bt,t[113]=Pt),(0,Q.useEffect)(Pt);let Ft,It;t[114]===Y?(Ft=t[115],It=t[116]):(Ft=()=>({startCreating(e,t){Mt.current(e,t)},startCreatingFromTemplate(e){Nt.current(e)},expandAll(){(0,Q.startTransition)(()=>{for(let e of Fe.current){let t=fG(Y.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(G.current);(0,Q.startTransition)(()=>{for(let t of[...Fe.current].reverse()){if(e.has(t))continue;let n=fG(Y.getItem(t));n&&n.collapse()}})},getFolderState(){let e=Fe.current,t=0;for(let n of e)fG(Y.getItem(n))?.isExpanded()&&t++;let n=e.length,r=jt.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return jt.current=i,i},subscribe(e){return Y.subscribe(e)}}),It=[Y],t[114]=Y,t[115]=Ft,t[116]=It),(0,Q.useImperativeHandle)(n,Ft,It);let Lt;t[117]!==Ye||t[118]!==c||t[119]!==a||t[120]!==Y||t[121]!==He?(Lt=async function(e){let t=e[0];if(t){k(t.path),j(null);try{let t=yG(e,I.current,Fe.current),n=[],r=[],i=[];for(let t of e){k(t.path);let e=await z(await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:t.kind,path:t.path})}),`Failed to delete path`);if(!e.ok){let t=yG(i,I.current,Fe.current),o=new Set([...t.docNames,...n]),s=new Set([...t.folderPaths,...r]);a([...[...o].map(EG),...[...s].map(TG)]),await Promise.all([...o].map(e=>c(e))),Fa.error(e.title),k(null),He(),zn([`files`,`backlinks`,`graph`]);return}let o=g($n,e.body,`delete-path`,{deletedDocNames:[]});n.push(...o.deletedDocNames),t.kind===`folder`&&r.push(t.path),i.push(t)}let o=K.current;o&&e.some(e=>bG(e,o))&&(o.kind===`file`?t.docNames.add(o.createdPath):t.folderPaths.add(o.createdPath),Ye(o));let s=new Set([...t.docNames,...n]),l=new Set([...t.folderPaths,...r]);a([...[...s].map(wG),...[...l].map(CG)]),await Promise.all([...s].map(e=>c(e)));for(let t of e){let e=t.kind===`folder`?mW(t.path):lW(t.path,t.docExt);Y.getItem(e)&&Y.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}C(e=>{let t=HM(e,[...s]);for(let e of l)t=HM(t,[],e);return We(t),t}),zn([`files`,`backlinks`,`graph`]),k(null)}catch(e){console.warn(`[FileTree] delete failed:`,e),Fa.error(`Network error — please try again`),k(null),He()}}},t[117]=Ye,t[118]=c,t[119]=a,t[120]=Y,t[121]=He,t[122]=Lt):Lt=t[122];let Rt=Lt,zt;t[123]===Symbol.for(`react.memo_cache_sentinel`)?(zt=function(){let e=te.current;e&&YW(e),te.current=null},t[123]=zt):zt=t[123];let Bt=zt,Vt;t[124]===d?Vt=t[125]:(Vt=function(e){let t=RG(e.nativeEvent);if(!t||t.endsWith(`/`)){Bt();return}let n=uW(t),r=I.current.find(e=>dW(e)===t);if(r&&En(r)){Bt();return}te.current!==n&&(Bt(),te.current=n,JW(n,e=>d(e)))},t[124]=d,t[125]=Vt);let Ht=Vt,Ut;t[126]!==R||t[127]!==Y||t[128]!==b?(Ut=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=zG(e.nativeEvent);if(!t||t.getAttribute(`aria-selected`)!==`true`)return;let n=t.dataset.itemPath;if(!n)return;let r=t.dataset.itemType===`folder`?mW(n):n;if(Y.getSelectedPaths().length!==1)return;if(t.dataset.itemType===`folder`){let e=pW(r);if(window.location.hash===Dn(e))return;queueMicrotask(()=>b(e));return}let i=uW(r);window.location.hash!==Gn(i)&&queueMicrotask(()=>R(r))},t[126]=R,t[127]=Y,t[128]=b,t[129]=Ut):Ut=t[129];let Wt=Ut;if(w){let e;return t[130]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(VG,{}),t[130]=e):e=t[130],e}if(S.length===0){if(E){let e;return t[131]===E?e=t[132]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/50 text-sm`,children:E})}),t[131]=E,t[132]=e),e}let e;t[133]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:`No files yet.`}),t[133]=e):e=t[133];let n;return t[134]===bt?n=t[135]:(n=(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-8`,children:[e,(0,Z.jsx)(zr,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:()=>bt(`file`,``),children:`Create your first file`})]}),t[134]=bt,t[135]=n),n}let Gt=O!==null,Kt=A?.targets[0]??null,qt;t[136]===E?qt=t[137]:(qt=E&&(0,Z.jsx)(`span`,{role:`alert`,className:`px-3 pb-1 text-destructive text-xs`,children:E}),t[136]=E,t[137]=qt);let Jt;t[138]===m?Jt=t[139]:(Jt=cG(m),t[138]=m,t[139]=Jt);let Yt;t[140]!==Gt||t[141]!==H||t[142]!==wt||t[143]!==St||t[144]!==_e||t[145]!==Y||t[146]!==ve||t[147]!==bt||t[148]!==P?(Yt=(e,t)=>(0,Z.jsx)(xG,{item:e,context:t,anyActionBusy:Gt,workspace:P,handoff:_e,model:Y,okignoreBinding:ve,onStartCreating:bt,onStartCreatingFromTemplate:vt,onDelete:e=>j({targets:e}),onExpandSubtree:St,onCollapseSubtree:wt,isAsset:H.has(e.path),isAssetTreePath:Ke}),t[140]=Gt,t[141]=H,t[142]=wt,t[143]=St,t[144]=_e,t[145]=Y,t[146]=ve,t[147]=bt,t[148]=P,t[149]=Yt):Yt=t[149];let Xt;t[150]!==Wt||t[151]!==Ht||t[152]!==Y||t[153]!==qt||t[154]!==Jt||t[155]!==Yt?(Xt=(0,Z.jsx)(`div`,{ref:ie,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(aW,{header:qt,model:Y,style:Jt,onClickCapture:Wt,onMouseMove:Ht,onMouseLeave:Bt,renderContextMenu:Yt})}),t[150]=Wt,t[151]=Ht,t[152]=Y,t[153]=qt,t[154]=Jt,t[155]=Yt,t[156]=Xt):Xt=t[156];let Zt=!!A,Qt;t[157]===O?Qt=t[158]:(Qt=e=>{!e&&!O&&j(null)},t[157]=O,t[158]=Qt);let $t;t[159]!==O||t[160]!==A||t[161]!==Rt||t[162]!==Kt?($t=A&&Kt&&(0,Z.jsx)(Yi,{itemName:A.targets.length===1?`${Kt.name}${Kt.kind===`file`?Kt.docExt??`.md`:`/`}`:void 0,isSubmitting:O!==null,onDelete:()=>Rt(A.targets),customTitle:A.targets.length>1?`Delete selected items`:void 0,customDescription:A.targets.length>1?`Are you sure you want to delete ${A.targets.length} selected items? Folders and all files inside them will be deleted. This action cannot be undone.`:Kt.kind===`folder`?`Are you sure you want to delete ${Kt.name}/ and all files inside? This action cannot be undone.`:void 0}),t[159]=O,t[160]=A,t[161]=Rt,t[162]=Kt,t[163]=$t):$t=t[163];let en;t[164]!==Zt||t[165]!==Qt||t[166]!==$t?(en=(0,Z.jsx)(io,{open:Zt,onOpenChange:Qt,children:$t}),t[164]=Zt,t[165]=Qt,t[166]=$t,t[167]=en):en=t[167];let tn=M!==null,rn;t[168]===Symbol.for(`react.memo_cache_sentinel`)?(rn=e=>{e||N(null)},t[168]=rn):rn=t[168];let an=M?.parentDir??``,on;t[169]!==tn||t[170]!==an?(on=(0,Z.jsx)(Sf,{open:tn,onOpenChange:rn,kind:`file`,initialDir:an}),t[169]=tn,t[170]=an,t[171]=on):on=t[171];let sn;return t[172]!==Xt||t[173]!==en||t[174]!==on?(sn=(0,Z.jsxs)(Z.Fragment,{children:[Xt,en,on]}),t[172]=Xt,t[173]=en,t[174]=on,t[175]=sn):sn=t[175],sn}function CG(e){return ze(e)}function wG(e){return oe(e)}function TG(e){return ze(e)}function EG(e){return oe(e)}function DG(e){return e.endsWith(`/`)?e.slice(0,-1):e}function OG(e){return!!e}function kG(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function AG(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function jG(e){Fa.error(e)}function MG(){}function NG(e){return Fa.error(e)}function PG(){}function FG(){}async function IG(){}function LG(e){return dW(e)}function RG(e){return zG(e)?.dataset.itemPath??null}function zG(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}var BG=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function VG(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-1 px-2 py-2`,role:`status`,"aria-busy":`true`,"aria-label":`Loading files`,children:BG.map(HG)}),e[0]=t):t=e[0],t}function HG(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(da,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(da,{className:`h-3 ${e}`})]},t)}var UG=(e,t,n)=>mc(e,t,n,`ProjectSwitcher`);function WG(e){let t=(0,$.c)(59),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(!1),c;t[1]!==n.project||t[2]!==o?(c=()=>{if(!o)return;let e=!1;return UG(async()=>{let t=await n.project.listRecent();e||a(t)},`Failed to load recent projects.`),()=>{e=!0}},t[1]=n.project,t[2]=o,t[3]=c):c=t[3];let l;t[4]!==n||t[5]!==o?(l=[o,n],t[4]=n,t[5]=o,t[6]=l):l=t[6],(0,Q.useEffect)(c,l);let u;t[7]===n.project?u=t[8]:(u=e=>{s(!1),UG(()=>n.project.open({path:e,target:`new-window`,entryPoint:`recents`}),`Failed to open project.`)},t[7]=n.project,t[8]=u);let d=u,f;t[9]!==n.dialog||t[10]!==n.project?(f=()=>{s(!1),UG(async()=>{let e=await n.dialog.openFolder();e&&await n.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})},`Failed to open folder.`)},t[9]=n.dialog,t[10]=n.project,t[11]=f):f=t[11];let p=f,m;t[12]===n.navigator?m=t[13]:(m=()=>{s(!1),UG(()=>n.navigator.open(),`Failed to open Project Navigator.`)},t[12]=n.navigator,t[13]=m);let h=m,g=n.config.projectPath,_,v,y,b,x,S,C,w,T,E,D;if(t[14]!==n.config.projectName||t[15]!==g||t[16]!==o||t[17]!==d||t[18]!==i){let e;t[30]===g?e=t[31]:(e=e=>e.path!==g,t[30]=g,t[31]=e);let r=i.filter(e);v=Bi,S=o,C=s;let a;t[32]===n.config.projectName?a=t[33]:(a=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[32]=n.config.projectName,t[33]=a);let c;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(rs,{"aria-hidden":`true`,className:`opacity-60`}),t[34]=c):c=t[34],t[35]===a?w=t[36]:(w=(0,Z.jsx)(ii,{asChild:!0,children:(0,Z.jsxs)(_M,{className:`justify-between text-sidebar-foreground/70`,"data-testid":`project-switcher-trigger`,title:`Open project menu`,children:[a,c]})}),t[35]=a,t[36]=w),_=ba,T=`start`,E=`top`,D=`min-w-[260px]`,y=`project-switcher-menu`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(oi,{className:`font-mono font-normal tracking-wide uppercase text-muted-foreground text-xs`,children:`Recent projects`}),t[37]=b):b=t[37],x=r.length===0?(0,Z.jsx)(oi,{className:`font-normal text-muted-foreground text-xs`,children:`No other recent projects.`}):r.slice(0,10).map(e=>(0,Z.jsxs)(Ei,{disabled:e.missing,onSelect:()=>d(e.path),className:`flex flex-col items-start gap-0.5`,"data-testid":`project-switcher-recent-${e.path}`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-sm`,children:e.name}),(0,Z.jsxs)(`span`,{className:`max-w-[240px] truncate text-muted-foreground text-xs`,children:[e.path,e.missing?` (missing)`:``]})]},e.path)),t[14]=n.config.projectName,t[15]=g,t[16]=o,t[17]=d,t[18]=i,t[19]=_,t[20]=v,t[21]=y,t[22]=b,t[23]=x,t[24]=S,t[25]=C,t[26]=w,t[27]=T,t[28]=E,t[29]=D}else _=t[19],v=t[20],y=t[21],b=t[22],x=t[23],S=t[24],C=t[25],w=t[26],T=t[27],E=t[28],D=t[29];let O;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(ui,{}),t[38]=O):O=t[38];let k;t[39]===p?k=t[40]:(k=(0,Z.jsx)(Ei,{onSelect:p,"data-testid":`project-switcher-open-folder`,children:`Open folder`}),t[39]=p,t[40]=k);let A;t[41]===h?A=t[42]:(A=(0,Z.jsx)(Ei,{onSelect:h,"data-testid":`project-switcher-switch-project`,children:`Switch Project`}),t[41]=h,t[42]=A);let j;t[43]!==_||t[44]!==y||t[45]!==b||t[46]!==x||t[47]!==k||t[48]!==A||t[49]!==T||t[50]!==E||t[51]!==D?(j=(0,Z.jsxs)(_,{align:T,side:E,className:D,"data-testid":y,children:[b,x,O,k,A]}),t[43]=_,t[44]=y,t[45]=b,t[46]=x,t[47]=k,t[48]=A,t[49]=T,t[50]=E,t[51]=D,t[52]=j):j=t[52];let M;return t[53]!==v||t[54]!==S||t[55]!==C||t[56]!==w||t[57]!==j?(M=(0,Z.jsxs)(v,{open:S,onOpenChange:C,children:[w,j]}),t[53]=v,t[54]=S,t[55]=C,t[56]=w,t[57]=j,t[58]=M):M=t[58],M}function GG(e){let t=(0,$.c)(33),{notice:n,onDismiss:r}=e,i=n.variant===`error`?`border-destructive/60`:`border-sidebar-border`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ma,{"aria-hidden":`true`,className:`size-3`}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=(0,Z.jsx)(zr,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-sidebar-foreground`,"aria-label":`Dismiss notice`,onClick:r,children:a}),t[1]=r,t[2]=o);let s=o;if(n.secondaryAction){let e=`update-notice-${n.id}`,r=`flex flex-col gap-2 rounded-md border bg-sidebar-accent/30 px-2 py-2 text-xs text-muted-foreground ${i}`,a;t[3]===n.body?a=t[4]:(a=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[3]=n.body,t[4]=a);let o;t[5]!==s||t[6]!==a?(o=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[a,s]}),t[5]=s,t[6]=a,t[7]=o):o=t[7];let c;t[8]===n.action?c=t[9]:(c=n.action?(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[8]=n.action,t[9]=c);let l;t[10]===n.secondaryAction?l=t[11]:(l=()=>{n.secondaryAction?.onClick()},t[10]=n.secondaryAction,t[11]=l);let u;t[12]!==n.secondaryAction.label||t[13]!==l?(u=(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:l,children:n.secondaryAction.label}),t[12]=n.secondaryAction.label,t[13]=l,t[14]=u):u=t[14];let d;t[15]!==c||t[16]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex gap-3 pl-1`,children:[c,u]}),t[15]=c,t[16]=u,t[17]=d):d=t[17];let f;return t[18]!==d||t[19]!==e||t[20]!==r||t[21]!==o?(f=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":e,className:r,children:[o,d]}),t[18]=d,t[19]=e,t[20]=r,t[21]=o,t[22]=f):f=t[22],f}let c=`update-notice-${n.id}`,l=`flex items-center gap-2 rounded-md border bg-sidebar-accent/30 px-2 py-1.5 text-xs text-muted-foreground ${i}`,u;t[23]===n.body?u=t[24]:(u=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[23]=n.body,t[24]=u);let d;t[25]===n.action?d=t[26]:(d=n.action?(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[25]=n.action,t[26]=d);let f;return t[27]!==s||t[28]!==c||t[29]!==l||t[30]!==u||t[31]!==d?(f=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":c,className:l,children:[u,d,s]}),t[27]=s,t[28]=c,t[29]=l,t[30]=u,t[31]=d,t[32]=f):f=t[32],f}function KG(e){if(e.length===0)return null;let t=e[0];if(!t)return null;for(let n=1;n<e.length;n++){let r=e[n];r&&r.priority<t.priority&&(t=r)}return t}function qG(){let e=(0,$.c)(7),t=(0,Q.useSyncExternalStore)(wd,Cd,Cd),n;e[0]===t?n=e[1]:(n=KG(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;let i;e[2]===r.id?i=e[3]:(i=()=>{Sd(r.id)},e[2]=r.id,e[3]=i);let a;return e[4]!==r||e[5]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(GG,{notice:r,onDismiss:i})}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a}var JG={folderCount:0,expandedCount:0};function YG(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(K,{name:`file-sidebar`,children:(0,Z.jsx)(ZG,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var XG=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(Ja,{asChild:!0,children:(0,Z.jsx)(zr,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(Ya,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Za,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function ZG(e){let t=(0,$.c)(36),{onOpenSearch:n}=e,[r,i]=(0,Q.useState)(null),a=typeof window<`u`&&window.okDesktop!=null,{state:o}=rM(),s=o===`expanded`,c=o===`collapsed`,[l,u]=(0,Q.useState)(JG),d,f;t[0]===r?(d=t[1],f=t[2]):(d=()=>{if(r!==null)return u(r.getFolderState()),r.subscribe(()=>{u(r.getFolderState())})},f=[r],t[0]=r,t[1]=d,t[2]=f),(0,Q.useEffect)(d,f);let p=l.folderCount>0,m=p&&l.expandedCount===l.folderCount,h=l.expandedCount===0,g=a&&c&&`opacity-0`,_;t[3]===g?_=t[4]:(_=X(`flex-row h-12 items-center py-0 px-3`,a?`justify-end`:`justify-between`,a&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,g,a&&`[-webkit-app-region:drag]`),t[3]=g,t[4]=_);let v;t[5]===s?v=t[6]:(v=s&&!a?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:`Files`}):null,t[5]=s,t[6]=v);let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=X(`flex items-center gap-1`,a&&`[&>*]:[-webkit-app-region:no-drag]`),t[7]=y):y=t[7];let b;t[8]===n?b=t[9]:(b=(0,Z.jsx)(XG,{icon:qs,label:`Search`,onClick:n}),t[8]=n,t[9]=b);let x;t[10]!==m||t[11]!==p||t[12]!==h||t[13]!==r?(x=p?(0,Z.jsxs)(Bi,{children:[(0,Z.jsx)(ii,{asChild:!0,children:(0,Z.jsx)(XG,{icon:Ms,label:`Tree View Options`})}),(0,Z.jsxs)(ba,{align:`end`,children:[m?null:(0,Z.jsxs)(Ei,{onSelect:()=>r?.expandAll(),children:[(0,Z.jsx)(sc,{"aria-hidden":`true`}),`Expand All`]}),h?null:(0,Z.jsxs)(Ei,{onSelect:()=>r?.collapseAll(),children:[(0,Z.jsx)(ys,{"aria-hidden":`true`}),`Collapse All`]})]})]}):null,t[10]=m,t[11]=p,t[12]=h,t[13]=r,t[14]=x):x=t[14];let S;t[15]===r?S=t[16]:(S=(0,Z.jsx)(XG,{icon:$s,label:`New File`,onClick:()=>r?.startCreating(`file`,``)}),t[15]=r,t[16]=S);let C;t[17]===r?C=t[18]:(C=(0,Z.jsx)(XG,{icon:gs,label:`New from template`,onClick:()=>r?.startCreatingFromTemplate(``)}),t[17]=r,t[18]=C);let w;t[19]===r?w=t[20]:(w=(0,Z.jsx)(XG,{icon:xs,label:`New Folder`,onClick:()=>r?.startCreating(`folder`,``)}),t[19]=r,t[20]=w);let T;t[21]!==C||t[22]!==w||t[23]!==b||t[24]!==x||t[25]!==S?(T=(0,Z.jsxs)(`div`,{className:y,children:[b,x,S,C,w]}),t[21]=C,t[22]=w,t[23]=b,t[24]=x,t[25]=S,t[26]=T):T=t[26];let E;t[27]!==T||t[28]!==_||t[29]!==v?(E=(0,Z.jsxs)(dM,{className:_,children:[v,T]}),t[27]=T,t[28]=_,t[29]=v,t[30]=E):E=t[30];let D;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(pM,{children:(0,Z.jsx)(SG,{ref:i})}),t[31]=D):D=t[31];let O,k;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsxs)(fM,{className:`px-0`,children:[typeof window<`u`&&window.okDesktop?(0,Z.jsx)(mM,{children:(0,Z.jsx)(hM,{children:(0,Z.jsx)(WG,{bridge:window.okDesktop})})}):null,(0,Z.jsx)(qG,{})]}),k=(0,Z.jsx)(lM,{enableToggle:!1}),t[32]=O,t[33]=k):(O=t[32],k=t[33]);let A;return t[34]===E?A=t[35]:(A=(0,Z.jsxs)(sM,{variant:`inset`,children:[E,D,O,k]}),t[34]=E,t[35]=A),A}function QG(){let e=(0,$.c)(17),t=Lt(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=Pe(),l;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(l={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c},e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=(0,Q.useRef)(l),d;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(d=()=>{u.current={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}},e[6]=o,e[7]=s,e[8]=a,e[9]=c,e[10]=i,e[11]=d):d=e[11],(0,Q.useEffect)(d);let f,m;return e[12]!==n||e[13]!==t||e[14]!==r?(f=()=>{if(n===null)return;let e=new O,i=new Te({url:n,name:$t,document:e,onStateless:e=>{let{payload:t}=e;I(t,{onServerInfo:e=>{u.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&u.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{u.current.onBranchSwitched(e.branch)},onDiskAck:e=>{u.current.observeDiskAck(e.docName,e.sv)},onDerivedView:iK,onConfigValidationRejected:rK,onConfigIgnoreNestedError:nK,onUnknown:tK})},onClose:eK,onDisconnect:$G}),a=sr(e=>{(e.includes(`files`)||e.includes(`backlinks`))&&(t.invalidateQueries({queryKey:[`backlinks`]}),t.invalidateQueries({queryKey:[`forward-links`]})),(e.includes(`files`)||e.includes(`graph`))&&(t.invalidateQueries({queryKey:[`orphans`]}),t.invalidateQueries({queryKey:[`hubs`]}))}),o=p(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{zn([`files`,`backlinks`,`graph`]),o()});let s=new Set,c=()=>{if(i.awareness)for(let[e,t]of i.awareness.getStates().entries())s.has(e)||t.user?.type===`agent`&&(s.add(e),console.warn(`[agent-presence] observed stale AwarenessUser.type === 'agent' from clientID ${e} — probably a stale bundled client`))};return i.awareness?.on(`change`,c),r(i),()=>{a(),i.awareness?.off(`change`,c),r(null),i.destroy(),e.destroy()}},m=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=f,e[16]=m):(f=e[15],m=e[16]),(0,Q.useEffect)(f,m),null}function $G(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function eK(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function tK(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function nK(e){ua(e)}function rK(e){pa(e)}function iK(e){zn([e.ch])}var aK=`#install-claude-desktop`;function oK(e){return e===`#settings`||e===aK}function sK(e,t){return`${[...e].sort().join(`\0`)}\u0001${[...t].sort().join(`\0`)}`}function cK(){let e=(0,$.c)(18),{clearTarget:t,syncOpenTabsWithKnownTargets:n,tabSessionLoaded:r}=Pe(),{openTargetTransition:i}=Ge(),{folderPaths:a,loading:o,pages:s}=hr(),c=(0,Q.useRef)(null),l;e[0]!==a||e[1]!==s?(l=sK(s,a),e[0]=a,e[1]=s,e[2]=l):l=e[2];let u=l,d,f;e[3]!==a||e[4]!==o||e[5]!==s||e[6]!==n||e[7]!==r||e[8]!==u?(d=()=>{o||!r||c.current===u||(c.current=u,n({pages:s,folderPaths:a}))},f=[a,o,s,n,r,u],e[3]=a,e[4]=o,e[5]=s,e[6]=n,e[7]=r,e[8]=u,e[9]=d,e[10]=f):(d=e[9],f=e[10]),(0,Q.useEffect)(d,f);let p,m;return e[11]!==t||e[12]!==a||e[13]!==o||e[14]!==i||e[15]!==s?(p=()=>{e();function e(){if(oK(window.location.hash))return;let e=gr(window.location.hash);if(e){let t=Tr(e.split(`.`).pop()??``);W(`ok/nav/hash-change`,{docName:null,kind:`asset`}),i({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let n=rr(window.location.hash);if(!n){W(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(o){W(`ok/nav/hash-change`,{docName:n,kind:`deferred-loading`});return}let r=Xn(n,{pages:s,folderPaths:a});if(r.kind===`missing`&&/\/+$/.test(n.trim())){W(`ok/nav/hash-change`,{docName:n,kind:`deferred-missing-folder`});return}W(`ok/nav/hash-change`,{docName:n,kind:r.kind}),i(r)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},m=[t,a,o,i,s],e[11]=t,e[12]=a,e[13]=o,e[14]=i,e[15]=s,e[16]=p,e[17]=m):(p=e[16],m=e[17]),(0,Q.useEffect)(p,m),null}function lK(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(typeof window<`u`&&window.location.hash===aK),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=function(){window.location.hash===aK&&n(!0)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(e){if(n(e),!e&&window.location.hash===aK){let{pathname:e,search:t}=window.location;window.history.replaceState(null,``,`${e}${t}`)}},e[2]=a):a=e[2];let o=a,s;return e[3]===t?s=e[4]:(s=(0,Z.jsx)(sa,{open:t,onOpenChange:o}),e[3]=t,e[4]=s),s}function uK(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(dK,t),null}function dK(){let e=function(e){let t=e.target;Mp({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=jp))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function fK(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=Pe(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:Bn(t),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o=a,s,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=function(e){let t=e.target;bf({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},c=[],e[3]=s,e[4]=c):(s=e[3],c=e[4]),(0,Q.useEffect)(s,c);let l;return e[5]!==r||e[6]!==o?(l=(0,Z.jsx)(Sf,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function pK(){let e=(0,$.c)(13),t=typeof window<`u`?window.okDesktop??null:null,[n,r]=(0,Q.useState)(!1),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(ch,{}),e[0]=i):i=e[0];let a,o,s,c,l,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(QG,{}),o=(0,Z.jsx)(cK,{}),s=(0,Z.jsx)(fK,{}),c=(0,Z.jsx)(uK,{}),l=(0,Z.jsx)(lK,{}),u=(0,Z.jsx)(yu,{}),e[1]=a,e[2]=o,e[3]=s,e[4]=c,e[5]=l,e[6]=u):(a=e[1],o=e[2],s=e[3],c=e[4],l=e[5],u=e[6]);let d;e[7]===n?d=e[8]:(d=(0,Z.jsx)(th,{bridge:t,open:n,onOpenChange:r}),e[7]=n,e[8]=d);let f;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(YG,{onOpenSearch:()=>r(!0)}),e[9]=f):f=e[9];let p;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(iM,{className:`h-screen overflow-hidden`,children:[f,(0,Z.jsx)(uM,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(WN,{})})]}),e[10]=p):p=e[10];let m;return e[11]===d?m=e[12]:(m=(0,Z.jsx)(K,{name:`app`,children:(0,Z.jsx)(Ze,{children:(0,Z.jsxs)(wi,{children:[i,(0,Z.jsxs)(ar,{children:[a,o,s,c,l,u,d,p]})]})})}),e[11]=d,e[12]=m),m}No(),typeof window<`u`&&window.okDesktop?.config.apiOrigin&&Ou({apiOrigin:window.okDesktop.config.apiOrigin}),Ku()&&Qu(),Td(),typeof window<`u`&&ju({bridge:window.okDesktop}),typeof window<`u`&&Va({bridge:window.okDesktop}),typeof window<`u`&&oo({bridge:window.okDesktop}),typeof window<`u`&&Nu({bridge:window.okDesktop});var mK=new Ho({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),hK=document.getElementById(`root`);if(!hK)throw Error(`Root element not found`);var gK=typeof window<`u`&&window.okDesktop?.config.mode===`navigator`;(0,Qo.createRoot)(hK).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(At,{client:mK,children:(0,Z.jsxs)(bn,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(Xa,{children:gK&&window.okDesktop?(0,Z.jsx)(Cu,{bridge:window.okDesktop}):(0,Z.jsx)(pK,{})}),(0,Z.jsx)(Du,{richColors:!0,closeButton:!0})]})})}));
|