@tempoxyz/id 0.0.0-pr-349.sha-e0d3dfc → 0.0.0-pr-357.sha-e757593
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/README.md +0 -3
- package/dist/app/server/assets/Grant-D_tun0mF.js.map +1 -1
- package/dist/app/server/index.js +4 -4
- package/dist/app/server/index.js.map +1 -1
- package/dist/cli/Cli.d.ts +1 -8
- package/dist/cli/Cli.d.ts.map +1 -1
- package/dist/cli/Cli.js +6 -9
- package/dist/cli/Cli.js.map +1 -1
- package/dist/cli/Session.d.ts +1 -1
- package/dist/cli/Session.d.ts.map +1 -1
- package/dist/cli/Session.js +1 -1
- package/dist/cli/Session.js.map +1 -1
- package/dist/cli/bin.js +4 -23
- package/dist/cli/bin.js.map +1 -1
- package/dist/client/Actions.d.ts +1 -2
- package/dist/client/Actions.d.ts.map +1 -1
- package/dist/client/Actions.js +0 -1
- package/dist/client/Actions.js.map +1 -1
- package/dist/client/Auth.d.ts +1 -1
- package/dist/client/Auth.d.ts.map +1 -1
- package/dist/client/Auth.js.map +1 -1
- package/dist/client/Authorization.d.ts +8 -4
- package/dist/client/Authorization.d.ts.map +1 -1
- package/dist/client/Authorization.js +1 -1
- package/dist/client/Authorization.js.map +1 -1
- package/dist/client/actions/email.d.ts +1 -1
- package/dist/client/actions/email.d.ts.map +1 -1
- package/dist/client/actions/passkey.d.ts +1 -1
- package/dist/client/actions/passkey.d.ts.map +1 -1
- package/dist/client/actions/redirect.d.ts +1 -1
- package/dist/client/actions/redirect.d.ts.map +1 -1
- package/dist/client/internal/api.d.ts +1 -1
- package/dist/client/internal/api.d.ts.map +1 -1
- package/dist/client/internal/api.js +1 -1
- package/dist/client/internal/api.js.map +1 -1
- package/dist/client/viem/Actions.d.ts +3 -3
- package/dist/client/viem/Actions.d.ts.map +1 -1
- package/dist/client/viem/Actions.js +4 -4
- package/dist/client/viem/Actions.js.map +1 -1
- package/dist/client/viem/Decorator.d.ts +2 -2
- package/dist/client/viem/internal/client.d.ts +3 -3
- package/dist/client/viem/internal/client.d.ts.map +1 -1
- package/dist/client/viem/internal/client.js +2 -2
- package/dist/client/viem/internal/client.js.map +1 -1
- package/dist/client.d.ts +0 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +0 -1
- package/dist/client.js.map +1 -1
- package/dist/internal/Apps.d.ts +1 -2
- package/dist/internal/Apps.d.ts.map +1 -1
- package/dist/internal/Apps.js +5 -10
- package/dist/internal/Apps.js.map +1 -1
- package/dist/internal/ErrorResponse.d.ts +0 -20
- package/dist/internal/ErrorResponse.d.ts.map +1 -1
- package/dist/internal/ErrorResponse.js +0 -35
- package/dist/internal/ErrorResponse.js.map +1 -1
- package/dist/internal/RequestId.d.ts +1 -7
- package/dist/internal/RequestId.d.ts.map +1 -1
- package/dist/internal/RequestId.js.map +1 -1
- package/dist/internal/Timing.d.ts +1 -4
- package/dist/internal/Timing.d.ts.map +1 -1
- package/dist/internal/Timing.js.map +1 -1
- package/package.json +1 -7
- package/src/cli/Cli.ts +5 -13
- package/src/cli/Session.ts +2 -2
- package/src/cli/bin.ts +4 -26
- package/src/client/Actions.ts +1 -2
- package/src/client/Auth.ts +0 -4
- package/src/client/Authorization.ts +8 -4
- package/src/client/actions/email.ts +1 -1
- package/src/client/actions/passkey.ts +1 -1
- package/src/client/actions/redirect.ts +1 -1
- package/src/client/internal/api.ts +2 -2
- package/src/client/viem/Actions.ts +5 -5
- package/src/client/viem/Decorator.ts +2 -2
- package/src/client/viem/internal/client.ts +5 -5
- package/src/client.ts +0 -1
- package/src/internal/Apps.ts +4 -17
- package/src/internal/ErrorResponse.ts +0 -41
- package/src/internal/OpenApi.ts +7 -57
- package/src/internal/RequestId.ts +2 -8
- package/src/internal/Timing.ts +1 -4
- package/src/types/app.d.ts +0 -14
- package/dist/Admin.d.ts +0 -79
- package/dist/Admin.d.ts.map +0 -1
- package/dist/Admin.js +0 -93
- package/dist/Admin.js.map +0 -1
- package/dist/admin/Env.d.ts +0 -68
- package/dist/admin/Env.d.ts.map +0 -1
- package/dist/admin/Env.js +0 -2
- package/dist/admin/Env.js.map +0 -1
- package/dist/admin/app/client/.assetsignore +0 -2
- package/dist/admin/app/client/assets/Client-BrjXsLWn.js +0 -2
- package/dist/admin/app/client/assets/Client-DdghQm8N.css +0 -1
- package/dist/admin/app/client/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist/admin/app/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/dist/admin/app/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/dist/admin/app/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/dist/admin/app/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/dist/admin/app/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/dist/admin/app/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/dist/admin/app/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/dist/admin/app/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/dist/admin/app/client/assets/___dev-EY7r7Loc.css +0 -1
- package/dist/admin/app/client/assets/___dev.sign-in-ClQvgAau.js +0 -1
- package/dist/admin/app/client/assets/index-Cbo1RPkb.css +0 -1
- package/dist/admin/app/client/assets/index-DAKRgvN1.js +0 -13
- package/dist/admin/app/client/assets/reset-co-CHrff.css +0 -1
- package/dist/admin/app/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
- package/dist/admin/app/client/assets/routes-BEUY7mCO.css +0 -1
- package/dist/admin/app/client/assets/routes-DM0o3oBQ.js +0 -1
- package/dist/admin/app/client/assets/shadowDom-DMRd3g4s.js +0 -1
- package/dist/admin/app/server/.vite/manifest.json +0 -359
- package/dist/admin/app/server/assets/Client-D4wNQeJd.js +0 -3
- package/dist/admin/app/server/assets/Client-D4wNQeJd.js.map +0 -1
- package/dist/admin/app/server/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist/admin/app/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/dist/admin/app/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/dist/admin/app/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/dist/admin/app/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/dist/admin/app/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/dist/admin/app/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/dist/admin/app/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/dist/admin/app/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/dist/admin/app/server/assets/___dev-EY7r7Loc.css +0 -1
- package/dist/admin/app/server/assets/___dev.sign-in-DUf_NQPU.js +0 -2
- package/dist/admin/app/server/assets/___dev.sign-in-DUf_NQPU.js.map +0 -1
- package/dist/admin/app/server/assets/_tanstack-start-manifest_v-C8ysuxtN.js +0 -1
- package/dist/admin/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +0 -2
- package/dist/admin/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +0 -1
- package/dist/admin/app/server/assets/async-local-storage-DUe1175v.js +0 -2
- package/dist/admin/app/server/assets/async-local-storage-DUe1175v.js.map +0 -1
- package/dist/admin/app/server/assets/convert-BIC8n32x.js +0 -2
- package/dist/admin/app/server/assets/convert-BIC8n32x.js.map +0 -1
- package/dist/admin/app/server/assets/cookie-BOmgOR30.js +0 -2
- package/dist/admin/app/server/assets/cookie-BOmgOR30.js.map +0 -1
- package/dist/admin/app/server/assets/cookie-DdghQm8N.css +0 -1
- package/dist/admin/app/server/assets/default-u_dwuiYb-D6RfpcBr.js +0 -2
- package/dist/admin/app/server/assets/default-u_dwuiYb-D6RfpcBr.js.map +0 -1
- package/dist/admin/app/server/assets/effect-QlVUlMFu-Bs0PyUhN.js +0 -2
- package/dist/admin/app/server/assets/effect-QlVUlMFu-Bs0PyUhN.js.map +0 -1
- package/dist/admin/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +0 -2
- package/dist/admin/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +0 -1
- package/dist/admin/app/server/assets/esm-C6SW--yt.js +0 -4
- package/dist/admin/app/server/assets/esm-C6SW--yt.js.map +0 -1
- package/dist/admin/app/server/assets/index-CLddUTqr-ComTZ4bq.js +0 -2
- package/dist/admin/app/server/assets/index-CLddUTqr-ComTZ4bq.js.map +0 -1
- package/dist/admin/app/server/assets/index-DZEfthgZ-BxnrPO8Q.js +0 -2
- package/dist/admin/app/server/assets/index-DZEfthgZ-BxnrPO8Q.js.map +0 -1
- package/dist/admin/app/server/assets/reset-co-CHrff.css +0 -1
- package/dist/admin/app/server/assets/rolldown-runtime-BWaJ3C7D.js +0 -1
- package/dist/admin/app/server/assets/router-Cbo1RPkb.css +0 -1
- package/dist/admin/app/server/assets/router-Dqhrc0PX.js +0 -2
- package/dist/admin/app/server/assets/router-Dqhrc0PX.js.map +0 -1
- package/dist/admin/app/server/assets/routes-BEUY7mCO.css +0 -1
- package/dist/admin/app/server/assets/routes-CxbX5JNu.js +0 -2
- package/dist/admin/app/server/assets/routes-CxbX5JNu.js.map +0 -1
- package/dist/admin/app/server/assets/server-tS2GlQUk.js +0 -77
- package/dist/admin/app/server/assets/server-tS2GlQUk.js.map +0 -1
- package/dist/admin/app/server/assets/shadowDom-CvS1DzWo.js +0 -2
- package/dist/admin/app/server/assets/shadowDom-CvS1DzWo.js.map +0 -1
- package/dist/admin/app/server/assets/standard-json-DY77efq0.js +0 -2
- package/dist/admin/app/server/assets/standard-json-DY77efq0.js.map +0 -1
- package/dist/admin/app/server/assets/standard-json-ig2t0wRt.js +0 -2
- package/dist/admin/app/server/assets/standard-json-ig2t0wRt.js.map +0 -1
- package/dist/admin/app/server/assets/standard-json-t-LNckA6.js +0 -2
- package/dist/admin/app/server/assets/standard-json-t-LNckA6.js.map +0 -1
- package/dist/admin/app/server/assets/standard-openapi-CONmVRl8.js +0 -2
- package/dist/admin/app/server/assets/standard-openapi-CONmVRl8.js.map +0 -1
- package/dist/admin/app/server/assets/start-C63VetBp.js +0 -2
- package/dist/admin/app/server/assets/start-C63VetBp.js.map +0 -1
- package/dist/admin/app/server/assets/sury-CWZTCd75-DP9TvBrs.js +0 -2
- package/dist/admin/app/server/assets/sury-CWZTCd75-DP9TvBrs.js.map +0 -1
- package/dist/admin/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +0 -2
- package/dist/admin/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +0 -1
- package/dist/admin/app/server/assets/valibot--1zFm7rT-BKGsXNQL.js +0 -2
- package/dist/admin/app/server/assets/valibot--1zFm7rT-BKGsXNQL.js.map +0 -1
- package/dist/admin/app/server/assets/valibot-D_HTw1Gn-BNmO9Liy.js +0 -2
- package/dist/admin/app/server/assets/valibot-D_HTw1Gn-BNmO9Liy.js.map +0 -1
- package/dist/admin/app/server/assets/worker-entry-DcGlpZzO.js +0 -93
- package/dist/admin/app/server/assets/worker-entry-DcGlpZzO.js.map +0 -1
- package/dist/admin/app/server/assets/zod-Bwrt9trS-DuX8BREF.js +0 -2
- package/dist/admin/app/server/assets/zod-Bwrt9trS-DuX8BREF.js.map +0 -1
- package/dist/admin/app/server/assets/zod-DSgpEGAE-BF9ADewr.js +0 -2
- package/dist/admin/app/server/assets/zod-DSgpEGAE-BF9ADewr.js.map +0 -1
- package/dist/admin/app/server/index.js +0 -1
- package/dist/admin/app/server/wrangler.json +0 -1
- package/dist/admin/dev/Session.d.ts +0 -135
- package/dist/admin/dev/Session.d.ts.map +0 -1
- package/dist/admin/dev/Session.js +0 -160
- package/dist/admin/dev/Session.js.map +0 -1
- package/dist/admin/index.d.ts +0 -15
- package/dist/admin/index.d.ts.map +0 -1
- package/dist/admin/index.js +0 -15
- package/dist/admin/index.js.map +0 -1
- package/dist/cli/AdminApi.d.ts +0 -46
- package/dist/cli/AdminApi.d.ts.map +0 -1
- package/dist/cli/AdminApi.js +0 -82
- package/dist/cli/AdminApi.js.map +0 -1
- package/dist/client/Admin.d.ts +0 -71
- package/dist/client/Admin.d.ts.map +0 -1
- package/dist/client/Admin.js +0 -29
- package/dist/client/Admin.js.map +0 -1
- package/dist/client/actions/admin/apps.d.ts +0 -142
- package/dist/client/actions/admin/apps.d.ts.map +0 -1
- package/dist/client/actions/admin/apps.js +0 -133
- package/dist/client/actions/admin/apps.js.map +0 -1
- package/dist/client/actions/admin.d.ts +0 -6
- package/dist/client/actions/admin.d.ts.map +0 -1
- package/dist/client/actions/admin.js +0 -6
- package/dist/client/actions/admin.js.map +0 -1
- package/src/Admin.ts +0 -184
- package/src/admin/Api.ts +0 -253
- package/src/admin/Env.ts +0 -73
- package/src/admin/app/.void/env.d.ts +0 -17
- package/src/admin/app/.void/preview-deploy-config.json +0 -1
- package/src/admin/app/.void/tanstack-start-trigger-wrapper.ts +0 -12
- package/src/admin/app/.void/tsconfig.json +0 -5
- package/src/admin/app/.void-wrangler.jsonc +0 -1
- package/src/admin/app/components/CodeInput.tsx +0 -153
- package/src/admin/app/dist/client/.assetsignore +0 -2
- package/src/admin/app/dist/client/assets/Client-BrjXsLWn.js +0 -2
- package/src/admin/app/dist/client/assets/Client-DdghQm8N.css +0 -1
- package/src/admin/app/dist/client/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/src/admin/app/dist/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/src/admin/app/dist/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/src/admin/app/dist/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/src/admin/app/dist/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/src/admin/app/dist/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/src/admin/app/dist/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/src/admin/app/dist/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/src/admin/app/dist/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/src/admin/app/dist/client/assets/___dev-EY7r7Loc.css +0 -1
- package/src/admin/app/dist/client/assets/___dev.sign-in-ClQvgAau.js +0 -1
- package/src/admin/app/dist/client/assets/index-Cbo1RPkb.css +0 -1
- package/src/admin/app/dist/client/assets/index-DAKRgvN1.js +0 -13
- package/src/admin/app/dist/client/assets/reset-co-CHrff.css +0 -1
- package/src/admin/app/dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
- package/src/admin/app/dist/client/assets/routes-BEUY7mCO.css +0 -1
- package/src/admin/app/dist/client/assets/routes-DM0o3oBQ.js +0 -1
- package/src/admin/app/dist/client/assets/shadowDom-DMRd3g4s.js +0 -1
- package/src/admin/app/dist/server/.vite/manifest.json +0 -359
- package/src/admin/app/dist/server/assets/Client-D4wNQeJd.js +0 -3
- package/src/admin/app/dist/server/assets/Client-D4wNQeJd.js.map +0 -1
- package/src/admin/app/dist/server/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/src/admin/app/dist/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/src/admin/app/dist/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/src/admin/app/dist/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/src/admin/app/dist/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/src/admin/app/dist/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/src/admin/app/dist/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/src/admin/app/dist/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/src/admin/app/dist/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/src/admin/app/dist/server/assets/___dev-EY7r7Loc.css +0 -1
- package/src/admin/app/dist/server/assets/___dev.sign-in-DUf_NQPU.js +0 -2
- package/src/admin/app/dist/server/assets/___dev.sign-in-DUf_NQPU.js.map +0 -1
- package/src/admin/app/dist/server/assets/_tanstack-start-manifest_v-C8ysuxtN.js +0 -1
- package/src/admin/app/dist/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +0 -2
- package/src/admin/app/dist/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +0 -1
- package/src/admin/app/dist/server/assets/async-local-storage-DUe1175v.js +0 -2
- package/src/admin/app/dist/server/assets/async-local-storage-DUe1175v.js.map +0 -1
- package/src/admin/app/dist/server/assets/convert-BIC8n32x.js +0 -2
- package/src/admin/app/dist/server/assets/convert-BIC8n32x.js.map +0 -1
- package/src/admin/app/dist/server/assets/cookie-BOmgOR30.js +0 -2
- package/src/admin/app/dist/server/assets/cookie-BOmgOR30.js.map +0 -1
- package/src/admin/app/dist/server/assets/cookie-DdghQm8N.css +0 -1
- package/src/admin/app/dist/server/assets/default-u_dwuiYb-D6RfpcBr.js +0 -2
- package/src/admin/app/dist/server/assets/default-u_dwuiYb-D6RfpcBr.js.map +0 -1
- package/src/admin/app/dist/server/assets/effect-QlVUlMFu-Bs0PyUhN.js +0 -2
- package/src/admin/app/dist/server/assets/effect-QlVUlMFu-Bs0PyUhN.js.map +0 -1
- package/src/admin/app/dist/server/assets/empty-plugin-adapters-BaGcmrjC.js +0 -2
- package/src/admin/app/dist/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +0 -1
- package/src/admin/app/dist/server/assets/esm-C6SW--yt.js +0 -4
- package/src/admin/app/dist/server/assets/esm-C6SW--yt.js.map +0 -1
- package/src/admin/app/dist/server/assets/index-CLddUTqr-ComTZ4bq.js +0 -2
- package/src/admin/app/dist/server/assets/index-CLddUTqr-ComTZ4bq.js.map +0 -1
- package/src/admin/app/dist/server/assets/index-DZEfthgZ-BxnrPO8Q.js +0 -2
- package/src/admin/app/dist/server/assets/index-DZEfthgZ-BxnrPO8Q.js.map +0 -1
- package/src/admin/app/dist/server/assets/reset-co-CHrff.css +0 -1
- package/src/admin/app/dist/server/assets/rolldown-runtime-BWaJ3C7D.js +0 -1
- package/src/admin/app/dist/server/assets/router-Cbo1RPkb.css +0 -1
- package/src/admin/app/dist/server/assets/router-Dqhrc0PX.js +0 -2
- package/src/admin/app/dist/server/assets/router-Dqhrc0PX.js.map +0 -1
- package/src/admin/app/dist/server/assets/routes-BEUY7mCO.css +0 -1
- package/src/admin/app/dist/server/assets/routes-CxbX5JNu.js +0 -2
- package/src/admin/app/dist/server/assets/routes-CxbX5JNu.js.map +0 -1
- package/src/admin/app/dist/server/assets/server-tS2GlQUk.js +0 -77
- package/src/admin/app/dist/server/assets/server-tS2GlQUk.js.map +0 -1
- package/src/admin/app/dist/server/assets/shadowDom-CvS1DzWo.js +0 -2
- package/src/admin/app/dist/server/assets/shadowDom-CvS1DzWo.js.map +0 -1
- package/src/admin/app/dist/server/assets/standard-json-DY77efq0.js +0 -2
- package/src/admin/app/dist/server/assets/standard-json-DY77efq0.js.map +0 -1
- package/src/admin/app/dist/server/assets/standard-json-ig2t0wRt.js +0 -2
- package/src/admin/app/dist/server/assets/standard-json-ig2t0wRt.js.map +0 -1
- package/src/admin/app/dist/server/assets/standard-json-t-LNckA6.js +0 -2
- package/src/admin/app/dist/server/assets/standard-json-t-LNckA6.js.map +0 -1
- package/src/admin/app/dist/server/assets/standard-openapi-CONmVRl8.js +0 -2
- package/src/admin/app/dist/server/assets/standard-openapi-CONmVRl8.js.map +0 -1
- package/src/admin/app/dist/server/assets/start-C63VetBp.js +0 -2
- package/src/admin/app/dist/server/assets/start-C63VetBp.js.map +0 -1
- package/src/admin/app/dist/server/assets/sury-CWZTCd75-DP9TvBrs.js +0 -2
- package/src/admin/app/dist/server/assets/sury-CWZTCd75-DP9TvBrs.js.map +0 -1
- package/src/admin/app/dist/server/assets/typebox-Dei93FPO-D_lCVdAz.js +0 -2
- package/src/admin/app/dist/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +0 -1
- package/src/admin/app/dist/server/assets/valibot--1zFm7rT-BKGsXNQL.js +0 -2
- package/src/admin/app/dist/server/assets/valibot--1zFm7rT-BKGsXNQL.js.map +0 -1
- package/src/admin/app/dist/server/assets/valibot-D_HTw1Gn-BNmO9Liy.js +0 -2
- package/src/admin/app/dist/server/assets/valibot-D_HTw1Gn-BNmO9Liy.js.map +0 -1
- package/src/admin/app/dist/server/assets/worker-entry-DcGlpZzO.js +0 -93
- package/src/admin/app/dist/server/assets/worker-entry-DcGlpZzO.js.map +0 -1
- package/src/admin/app/dist/server/assets/zod-Bwrt9trS-DuX8BREF.js +0 -2
- package/src/admin/app/dist/server/assets/zod-Bwrt9trS-DuX8BREF.js.map +0 -1
- package/src/admin/app/dist/server/assets/zod-DSgpEGAE-BF9ADewr.js +0 -2
- package/src/admin/app/dist/server/assets/zod-DSgpEGAE-BF9ADewr.js.map +0 -1
- package/src/admin/app/dist/server/index.js +0 -1
- package/src/admin/app/dist/server/wrangler.json +0 -1
- package/src/admin/app/env.ts +0 -11
- package/src/admin/app/lib/Client.ts +0 -38
- package/src/admin/app/package.json +0 -8
- package/src/admin/app/routeTree.gen.ts +0 -86
- package/src/admin/app/router.tsx +0 -19
- package/src/admin/app/routes/[_]dev.sign-in.tsx +0 -93
- package/src/admin/app/routes/__root.tsx +0 -97
- package/src/admin/app/routes/index.tsx +0 -20
- package/src/admin/app/screens/Dashboard.tsx +0 -84
- package/src/admin/app/screens/dev/SignIn.tsx +0 -213
- package/src/admin/app/server.ts +0 -129
- package/src/admin/app/tsconfig.json +0 -7
- package/src/admin/app/vite.config.ts +0 -52
- package/src/admin/app/void.config.ts +0 -17
- package/src/admin/app/zyzz.config.ts +0 -25
- package/src/admin/apps.ts +0 -472
- package/src/admin/dev/Session.ts +0 -332
- package/src/admin/dev/signIn.ts +0 -381
- package/src/admin/index.ts +0 -14
- package/src/admin/session.ts +0 -60
- package/src/cli/AdminApi.ts +0 -134
- package/src/client/Admin.ts +0 -76
- package/src/client/actions/admin/apps.ts +0 -257
- package/src/client/actions/admin.ts +0 -5
- package/src/internal/AdminApps.ts +0 -64
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes-CxbX5JNu.js","names":["REASONS.triggerPress","_formatErrorMessage","startingStyle","endingStyle","TransitionStatusDataAttributes.startingStyle","TransitionStatusDataAttributes.endingStyle","open","closed","startingStyle","TransitionStatusDataAttributes.startingStyle","endingStyle","TransitionStatusDataAttributes.endingStyle","CollapsiblePanelDataAttributes.open","CollapsiblePanelDataAttributes.closed","triggerOpenStateMapping","CollapsibleTriggerDataAttributes.panelOpen","TransitionStatusDataAttributes.startingStyle","CollapsiblePanelDataAttributes.startingStyle","REASONS.none","ownerWindow","ownerWindow","platform.engine.webkit","platform.os.ios","open","closed","startingStyle","TransitionStatusDataAttributes.startingStyle","endingStyle","TransitionStatusDataAttributes.endingStyle","CommonTriggerDataAttributes.popupOpen","CommonTriggerDataAttributes.pressed","CommonPopupDataAttributes.open","CommonPopupDataAttributes.closed","CommonPopupDataAttributes.anchorHidden","platform.screenReader.voiceOver","platform.engine.webkit","getComputedStyle","getComputedStyle","useId","ownerWindow","REASONS.focusOut","platform.engine.webkit","REASONS.triggerPress","outsidePress","REASONS.triggerPress","escapeKey","REASONS.escapeKey","platform.engine.webkit","getComputedStyle","REASONS.outsidePress","_formatErrorMessage","REASONS.imperativeAction","useId","REASONS.none","useSyncExternalStore","useSyncExternalStoreWithSelector","selectors","useSyncExternalStore","_formatErrorMessage","REASONS.imperativeAction","_formatErrorMessage","open","CommonPopupDataAttributes.open","closed","CommonPopupDataAttributes.closed","startingStyle","CommonPopupDataAttributes.startingStyle","endingStyle","CommonPopupDataAttributes.endingStyle","nestedDialogOpen","DialogPopupDataAttributes.nestedDialogOpen","platform.os.ios","_formatErrorMessage","REASONS.imperativeAction","open","CommonPopupDataAttributes.open","closed","CommonPopupDataAttributes.closed","startingStyle","CommonPopupDataAttributes.startingStyle","endingStyle","CommonPopupDataAttributes.endingStyle","DrawerBackdropCssVars.swipeProgress","DrawerPopupCssVars.swipeStrength","CommonPopupDataAttributes.open","CommonPopupDataAttributes.closed","CommonPopupDataAttributes.startingStyle","CommonPopupDataAttributes.endingStyle","_formatErrorMessage","DrawerPopupCssVars.swipeMovementX","DrawerPopupCssVars.swipeMovementY","DrawerPopupCssVars.snapPointOffset","DrawerBackdropCssVars.swipeProgress","DrawerPopupCssVars.swipeStrength","stateAttributesMapping","DrawerPopupDataAttributes.expanded","DrawerPopupDataAttributes.nestedDrawerOpen","DrawerPopupDataAttributes.nestedDrawerSwiping","DrawerPopupDataAttributes.swipeDirection","DrawerPopupDataAttributes.swiping","swipeStrength","frontmostHeight","DrawerPopupCssVars.nestedDrawers","DrawerPopupCssVars.height","DrawerPopupCssVars.frontmostHeight","platform.os.android","ownerWindow","REASONS.closeWatcher","closeWatcher","getComputedStyle","ownerWindow","DrawerPopupDataAttributes.swipeDismiss","TransitionStatusDataAttributes.endingStyle","swipeProgress","DrawerBackdropCssVars.swipeProgress","DrawerPopupCssVars.height","swipe","DrawerPopupCssVars.swipeMovementX","DrawerPopupCssVars.swipeMovementY","REASONS.swipe","DialogViewportDataAttributes.nestedDialogOpen","DrawerPopupDataAttributes.swiping","swiping","ownerWindow","createContext","useSyncExternalStore","use","_jsx","styles","useState","BaseUi.Drawer.createHandle","BaseUi.Drawer.Root","_jsxs","BaseUi.Drawer.Portal","BaseUi.Drawer.Backdrop","BaseUi.Drawer.Viewport","BaseUi.Drawer.Popup","BaseUi.Drawer.Trigger","_jsx","styles","baseMapping","triggerOpenStateMapping","CollapsiblePanelCssVars.collapsiblePanelHeight","CollapsiblePanelCssVars.collapsiblePanelWidth","createContext","useId","useState","_jsx","styles","use","BaseUi.Collapsible.Root","BaseUi.Collapsible.Panel","_jsxs","BaseUi.Collapsible.Trigger","_jsxs","_jsx","_jsxs","_jsx","GridIcon","Dashboard","Route","SplitComponent","useLoaderData","component","__toESM","require_jsx_runtime","require_react","useStableCallback","isReactVersionAtLeast","useIsoLayoutEffect","EMPTY_OBJECT","create","resolveStyle","formatErrorMessage","isNode","clamp","useRenderElement","getNodeName","getParentNode","isLastTraversableNode","isHTMLElement","useRefWithInit","NOOP","useButton","isElement","useRender","getWindow","visuallyHidden","getComputedStyle$1","isOverflowElement","useMergedRefs","mergeProps","isShadowRoot","require_shim","require_with_selector","require_react_dom","swipe","imperativeAction","useBaseUiId","useId$1","useForcedRerendering","triggerPress","createChangeEventDetails","none","useControlled","focusOut","useTimeout","isClickLikeEvent","closeWatcher","isVirtualClick","android","apple","Timeout","useValueAsRef","getTarget","outsidePress","isVirtualPointerEvent","lowerUserAgent","closest","isMouseLikePointerType","ios","contains","isReactEvent","activeElement","stopEvent","ownerDocument","escapeKey","useOnMount","Route","EMPTY","scheduler","currentCallbacks","currentCallbacksCount","i","timestamp","id","fn","index","AnimationFrame","useAnimationFrame","timeout","import_react","useTransitionStatus","transitionStatus","setTransitionStatus","open","enableIdleState","mounted","setMounted","animateInitialOpen","deferEndingState","frame","useCollapsibleRoot","openParam","parameters","setOpen","defaultOpen","defaultPanelId","registeredPanelId","setPanelIdState","panelId","handleTrigger","nextOpen","eventDetails","event","onOpenChange","disabled","CollapsibleRootContext","useCollapsibleRootContext","context","startingStyle$5","endingStyle$5","STARTING_HOOK","ENDING_HOOK","transitionStatusMapping","value","open$4","closed$4","startingStyle$4","panelOpen","PANEL_OPEN_HOOK","PANEL_CLOSED_HOOK","triggerOpenStateMapping$1","collapsibleOpenStateMapping","addEventListener","target","type","listener","options","resolveRef","maybeRef","getFiniteAnimations","element","timing","animation","import_react_dom","pendingCallbacks","flushBeforePaint","callbacks","callback","useAnimationsFinished","elementOrRef","resolvedElement","done","batch","signal","fnToExecute","exec","waitForStartingStyleRemoved","startingStyleAttribute","attributeObserver","useOpenChangeComplete","onCompleteParam","onComplete","runOnceAnimationsFinish","ref","enabled","abortController","EMPTY_DIMENSIONS","useCollapsiblePanel","idParam","panelRef","animationTypeRef","dimensions","setDimensionsUnwrapped","lastMeasuredDimensionsRef","shouldSkipNextOpenRef","shouldPreventMountAnimationRef","shouldPreventActivityResumeAnimationRef","forcePanelIdle","setForcePanelIdle","pendingTemporaryStyleRestoreRef","mergedPanelRef","externalRef","latestOpenRef","runOnceCloseAnimationsFinish","hidden","panelTransitionStatus","shouldPreventOpenAnimation","renderedDimensions","shouldPersistHiddenTransitionStyles","hiddenUntilFound","setDimensions","shouldCacheMeasurement","nextDimensions","restorePendingTemporaryStyle","setPendingTemporaryStyleRestore","restore","markActivityResumeAnimationSuppressed","panel","animationType","getAnimationType","getDimensions","skipNextOpen","restoreLayoutStyles","resetLayoutStyles","restoreTransitionDuration","setTemporaryStyle","restoreAnimationName","restoreAnimationDuration","endingStyleFrame","handleComplete","revealDecisionTimeout","revertRevealFrame","scheduleRevealRevert","revertSkippedMotion","restoreStartingStyle","cleanupBeforeMatchListener","hadStartingStyle","shouldRender","keepMounted","panelStyles","hasAnimation","name","hasSuppressedMountAnimation","hasNonZeroDuration","hasTransition","part","previousValue","property","previousPriority","originalLayoutStyles","key","webkit","voiceOver","originalHtmlStyles","originalBodyStyles","originalHtmlScrollBehavior","getViewportScroller","html","body","isPageScrollLocked","win","hasInsetScrollbars","doc","referenceElement","supportsStableScrollbarGutter","scrollContainer","originalScrollContainerOverflowY","originalHtmlStyleGutter","before","after","preventScrollOverlayScrollbars","elementToLock","originalElementToLockStyles","preventScrollInsetScrollbars","scrollTop","scrollLeft","updateGutterOnly","resizeFrame","lockScroll","htmlStyles","bodyStyles","scrollbarGutterValue","isScrollableY","isScrollableX","hasConstantOverflowY","hasConstantOverflowX","scrollbarWidth","scrollbarHeight","marginY","marginX","cleanup","handleResize","unsubscribeResize","SCROLL_LOCKER","observer","hasOverlayScrollbars","useScrollLock","FOCUSABLE_ATTRIBUTE","open$3","closed$3","anchorHidden","TRIGGER_HOOK","POPUP_OPEN_HOOK","POPUP_CLOSED_HOOK","ANCHOR_HIDDEN_HOOK","triggerOpenStateMapping","popupStateMapping","popupTransitionStateMapping","isEventTargetWithin","node","eventAgain","isRootElement","isTypeableElement","isTypeableCombobox","getFloatingFocusElement","floatingElement","mergeCleanups","cleanups","import_jsx_runtime","FocusGuard","role","setRole","restProps","props","isHiddenByStyles","styles","isElementVisible","CANDIDATE_SELECTOR","getParentElement","assignedSlot","rootNode","getDetailsSummary","child","details","isWithinOpenDetailsSummary","summary","isFocusableCandidate","nodeName","isFocusableElement","current","isAncestor","isSlot","isVisibleInTabbableTree","getTabIndex","tabIndex","getNamedRadioInput","input","isTabbableRadio","checkedRadio","candidates","radio","candidate","getComposedChildren","container","assignedElements","appendCandidates","list","appendMatchingElements","selector","isTabbable","focusable","tabbable","getTabbableIn","len","active","dir","getNextTabbable","getPreviousTabbable","isOutsideEvent","containerElement","relatedTarget","disableFocusInside","enableFocusInside","elements","tabindex","getNodeChildren","nodes","onlyOpenChildren","getNodeAncestors","allAncestors","currentParentId","currentNode","createAttribute","rafId","enqueueFocus","shouldFocus","el","sync","currentRafId","markerName","ariaHiddenCounterMap","uncontrolledElementsSet","markerCounterMap","lockCount","unwrapHost","correctElements","targets","parent","correctedTarget","x","buildKeepSet","keep","collectOutsideElements","outside","walk","keepElements","root","applyAttributeToOthers","avoidElements","uncorrectedAvoidElements","markerTargets","mark","hiddenElements","markedElements","ariaHidden","ariaLiveElements","controlElements","attr","alreadyHidden","counterValue","markerValue","markOthers","CLICK_TRIGGER_IDENTIFIER","BASE_UI_SWIPE_IGNORE_ATTRIBUTE","BASE_UI_SWIPE_IGNORE_SELECTOR","ownerVisuallyHidden","PortalContext","usePortalContext","useFloatingPortalNode","containerProp","uniqueId","parentPortalNode","setContainerElement","portalNode","setPortalNode","setPortalNodeRef","containerRef","resolvedContainer","portalElement","componentProps","elementProps","portalSubtree","FloatingPortal","portalNodeId","forwardedRef","beforeOutsideRef","afterOutsideRef","beforeInsideRef","afterInsideRef","focusManagerState","setFocusManagerState","focusInsideDisabledRef","modal","shouldRenderGuards","onFocus","portalContextValue","portalOwnerRole","children","createEventEmitter","map","data","FloatingNodeContext","FloatingTreeContext","useFloatingParentNodeId","useFloatingTree","contextTree","externalTree","getEventType","lastInteractionType","LIST_LIMIT","previouslyFocusedElements","clearDisconnectedPreviouslyFocusedElements","entry","addPreviouslyFocusedElement","getPreviouslyFocusedElement","getFirstTabbableElement","handleTabIndex","floatingFocusElement","tabbableContent","dataTabIndex","FloatingFocusManager","store","domReference","floating","getNodeId","dataRef","ignoreInitialFocus","initialFocus","isUntrappedTypeableCombobox","initialFocusRef","returnFocusRef","returnFocus","explicitReturnFocusRef","explicitReturnFocus","openInteractionTypeRef","openInteractionType","openRef","tree","portalContext","preventReturnFocusRef","isPointerDownRef","pointerDownOutsideRef","lastFocusedTabbableRef","closeTypeRef","lastInteractionTypeRef","beforeGuardRef","afterGuardRef","mergedBeforeGuardRef","beforeContentFocusGuardRef","mergedAfterGuardRef","blurTimeout","pointerDownTimeout","restoreFocusFrame","isInsidePortal","getTabbableContent","getResolvedInsideElements","getInsideElements","onKeyDown","clearPointerDownOutside","onPointerDown","insideElements","pointerTargetInside","closeOnFocusOut","handlePointerDown","handleFocusIn","handleFocusOutside","currentTarget","nodeId","triggers","isRelatedFocusGuard","previousFocusableElement","nextFocusableElement","movedToUnrelatedNode","trigger","restoreFocus","prevTabbable","nodeToFocus","markInsideReactTree","domReferenceElement","portalNodes","rootAncestorComboboxDomReference","ariaHiddenCleanup","markerCleanup","previouslyFocusedElement","initialFocusValueOrFn","resolvedInitialFocus","focusableElements","getDefaultFocusElement","elToFocus","hadFocusInside","openEvent","openedByVirtualPress","currentActiveElement","pendingReturnFocusRef","elementFocusedBeforeOpen","preferPreviousFocus","onOpenChangeLocal","isPreventScrollSupported","events","getReturnElement","returnFocusValueOrFn","resolvedReturnFocusValue","closeType","referenceReturnElement","previousReturnElement","defaultReturnElement","activeEl","isFocusInsideFloatingTree","returnElement","job","tabbableReturnElement","hasExplicitReturnFocus","focusOptions","els","useClick","eventOption","pointerTypeRef","touchOpenTimeout","reference","setOpenWithTouchDelay","reason","nativeEvent","pointerType","touchOpenDelay","getNextOpen","hasClickedOnInactiveTrigger","toggle","stickIfOpen","isClickLikeOpenEvent","ignoreMouse","openEventType","isTypeable","eventCurrentTarget","alwaysFalse","normalizeProp","normalizable","useDismiss","escapeKey$1","outsidePressProp","outsidePressFn","outsidePress$1","outsidePressEnabled","getOutsidePressEventProp","outsidePressEvent","escapeKeyBubbles","outsidePressBubbles","bubbles","pressStartedInsideRef","pressStartPreventedRef","suppressNextOutsideClickRef","sawPressWhileOpenRef","isComposingRef","currentPointerTypeRef","touchStateRef","cancelDismissOnEndTimeout","clearInsideReactTreeTimeout","compositionTimeout","clearInsideReactTree","hasBlockingChild","bubbleKey","isEventWithinOwnElements","closeOnReferencePress","referencePress","closeOnEscapeKeyDown","native","markPressStartedInsideReactTree","markInsidePressStartPrevented","handleOpenChange","preventedPressSuppressionTimeout","handleCompositionStart","handleCompositionEnd","suppressImmediateOutsideClickAfterPreventedStart","resetPressStartState","getOutsidePressEvent","computedType","outsidePressEventValue","resolved","shouldIgnoreEvent","computedOutsidePressEvent","isEventWithinFloatingTree","targetIsInsideChildren","closeOnPressOutside","inertSelector","targetRoot","markers","targetRootAncestor","nextParent","marker","lastTraversableNode","style","scrollRe","canScrollX","canScrollY","isRTL","pressedVerticalScrollbar","pressedHorizontalScrollbar","handleTouchStart","touch","addTargetEventListenerOnce","unsubscribe","handleTouchStartCapture","closeOnPressOutsideCapture","targetEvent","handlePressEndCapture","pressStartedInsideDefaultPrevented","handleTouchMove","deltaX","deltaY","distance","handleTouchMoveCapture","handleTouchEnd","handleTouchEndCapture","BasePopupHandle","fallbackStore","componentName","throwOnMissingTrigger","newStore","attachedStore","triggerElement","triggerId","useSyncedFloatingRootContext","popupStore","treatPopupAsFloatingElement","floatingId","valuesToSync","nested","useUnmountAfterClose","setPreventUnmountOnCloseParam","setPreventUnmountOnClose","preventUnmountingOnClose","preventUnmountOnClose","mountedRef","pendingUnmountRef","rerender","unmount","onUnmount","forceUnmount","FOCUSABLE_POPUP_PROPS","usePopupRootStore","createStore","PopupHandleAttachment","handle","syncTriggerCount","triggerCount","useTriggerRegistration","registrationRef","registration","registeredStore","createPopupOpenState","state","activeTriggerId","activeTriggerElement","useTriggerDataForwarding","isMountedByThisTrigger","baseRegisterTrigger","applyTriggerData","changes","stateUpdates","registerTrigger","triggerElementRef","useImplicitActiveTrigger","resolvedActiveTriggerIdRef","reactiveTriggerCount","reactiveActiveTriggerElement","currentActiveTriggerId","lostActiveTriggerId","iteratorResult","implicitTriggerId","implicitTriggerElement","closeOnActiveTriggerUnmount","useOpenStateTransitions","usePopupInteractionProps","statePart","usePopupRootSync","PopupTriggerMap","registered","predicate","hooks","currentInstance","getInstance","register","hook","fastComponent","FastComponent","instance","createInstance","result","fastComponentRef","import_shim","import_with_selector","useStoreImplementation","useStoreFast","useStoreLegacy","useStore","a1","a2","a3","useStoreR19","getSelection","didChange","stores","unsubscribes","onStoreChange","Store","newState","currentTick","ReactStore","selectors","dependencies","isControlled","controlled","stableFunction","selectFn","prevValue","nextValue","nextState","oldValue","selectors$1","FloatingRootStore","initialState","syncOnly","newOpen","createInitialPopupStoreState","activeTriggerIdSelector","openSelector","popupIdSelector","triggerOwnsOpenPopup","triggerOwnsOpenPopupOrIsOnlyTrigger","popupStoreSelectors","isActive","usePopupHandleStore","subscribe","getSnapshot","DialogInteractions","disablePointerDismissal","popupElement","floatingRootContext","ownNestedOpenDialogs","setOwnNestedOpenDialogs","ownNestedOpenDrawers","setOwnNestedOpenDrawers","isTopmost","dismiss","internalBackdrop","backdrop","dialogCount","drawerCount","parentContext","isDrawer","DialogRootContext","useDialogRootContext","optional","NullStore","DialogStore","triggerElements","createInitialState","createInitialContext","createNullDialogStore","useRenderDialogRoot","openProp","disablePointerDismissalProp","modalProp","triggerIdProp","defaultTriggerIdProp","mode","isAlertDialog","parentStore","rootState","floatingNested","onOpenChangeComplete","payload","actionsRef","shouldRenderInteractions","DialogPortalContext","useDialogPortalContext","COMPOSITE_KEYS","nestedDialogOpen$1","dialogStateAttributesMapping","inertValue","InternalBackdrop","otherProps","clipPath","cutout","rect","DialogPortal","portalProps","useEnhancedClickHandler","lastClickInteractionTypeRef","handler","useOpenMethodTriggerProps","setOpenMethod","interactionType","onClick","DialogTrigger","idProp","dialogRootStore","thisTriggerId","floatingContext","isOpenedByThisTrigger","popupId","nativeButton","click","interactionTypeProps","rootTriggerProps","buttonRef","getButtonProps","DialogViewport","nestedOpenDialogCount","setViewportElement","DialogHandle","nestedDialogOpen","nestedDrawers","height","frontmostHeight","swipeMovementX","swipeMovementY","snapPointOffset","swipeStrength","swipeProgress","DrawerBackdrop","forceRender","DRAWER_CONTENT_ATTRIBUTE","DrawerProviderContext","useDrawerProviderContext","expanded","nestedDrawerOpen","nestedDrawerSwiping","swipeDismiss","swipeDirection","swiping","DrawerRootContext","useDrawerRootContext","drawerRootContext","getSnapPointSwipeMovement","nextOffset","baseOffset","movementValue","resolveSnapPointValue","viewportHeight","snapPoint","trimmed","rootFontSize","closestSnapPointIndex","closestIndex","closestDistance","values","useDrawerSnapPoints","viewportElement","setViewportHeight","setRootFontSize","measureViewportHeight","fontSize","resizeObserver","resolvedSnapPoints","snapPoints","popupHeight","maxHeight","resolvedHeight","clampedHeight","point","deduped","seenHeights","activeSnapPoint","exactMatch","DrawerViewportContext","useDrawerViewportContext","drawerSwipeVarsRegistered","removeCSSVariableInheritance","stateAttributesMapping$1","DrawerPopup","popupRef","frontmostHeight$1","descriptionElementId","rootPopupProps","nestedOpenDrawerCount","openMethod","titleElementId","swipeStrength$1","setPopupHeight","popupHeightRef","measureHeight","offsetHeight","hasNestedDrawer","oldHeight","onPopupHeightChange","nextHeight","syncNestedSwipeProgress","progress","nestedSwipeProgressStore","notifyParentFrontmostHeight","notifyParentHasNestedDrawer","setPopupElement","nestedSwiping","popupHeightCssVarValue","shouldApplySnapPoints","snapPointOffsetValue","activeSnapPointOffset","dragStyles","finalFocus","DrawerPortal","_DrawerProviderReport","_DrawerProviderReport2","DrawerRoot","snapPointProp","parentDrawerRootContext","notifyParentSwipeProgressChange","notifyParentSwipingChange","setFrontmostHeight","setHasNestedDrawer","setNestedSwiping","createNestedSwipeProgressStore","resolvedDefaultSnapPoint","defaultSnapPoint","isSnapPointControlled","setActiveSnapPointUnwrapped","isNestedDrawerOpenRef","swipeAreaActiveRef","setActiveSnapPoint","resolvedEventDetails","onSnapPointChange","nextSnapPoint","resolvedActiveSnapPoint","onNestedFrontmostHeightChange","onNestedDrawerPresenceChange","present","onNestedSwipeProgressChange","onNestedSwipingChange","contextValue","snapToSequentialPoints","dialog","DrawerProviderReporter","listeners","nextProgress","providerContext","setDrawerOpen","removeDrawer","CloseWatcherCtor","handleCancel","closeWatcher$1","overflowY","allowOverflowIntent","overflowX","isScrollable","axis","findScrollableAncestor","findScrollableTouchTarget","getElementAtPoint","y","getElementTransform","transform","computedStyle","translateX","translateY","scale","matrix","DEFAULT_SWIPE_THRESHOLD","REVERSE_CANCEL_THRESHOLD","MIN_VELOCITY_DURATION_MS","MIN_RELEASE_VELOCITY_DURATION_MS","MAX_RELEASE_VELOCITY_AGE_MS","MIN_VELOCITY_SAMPLE_DISTANCE","DEFAULT_IGNORE_SELECTOR","getDisplacement","direction","getValidTimeStamp","timeStamp","getDragTransform","dragOffset","hasPrimaryMouseButton","buttons","safelyChangePointerCapture","pointerCaptureMethod","method","pointerId","error","useSwipeDismiss","swipeThresholdProp","ignoreSelector","primaryDirection","directions","swipeThresholdDefault","allowLeft","allowRight","allowUp","allowDown","hasHorizontal","hasVertical","scrollAxis","currentSwipeDirection","setCurrentSwipeDirection","isSwiping","setIsSwiping","dragDismissed","setDragDismissed","dragStartPosRef","dragOffsetRef","lastMovePosRef","initialTransformRef","intendedSwipeDirectionRef","maxSwipeDisplacementRef","cancelledSwipeRef","swipeCancelBaselineRef","isFirstPointerMoveRef","pendingSwipeRef","pendingSwipeStartPosRef","swipeFromScrollableRef","sawPrimaryButtonsOnMoveRef","elementSizeRef","swipeProgressRef","swipeThresholdRef","swipeThresholdFunctionRef","swipeStartTimeRef","lastDragSampleRef","hasStationarySampleRef","lastDragVelocityRef","lastProgressDetailsRef","isSwipingRef","dragStyleSnapshotRef","setSwiping","nextSwiping","onSwipingChange","resolveSwipeThreshold","elementRef","thresholdFunction","updateSwipeProgress","progressChanged","detailsChanged","lastDetails","onProgress","syncDragStyles","trackDrag","dragStyleSnapshot","initialTransform","movementCssVars","recordDragSample","lastSample","stationary","offset","skipSample","durationMs","reset","getPrimaryPointerPosition","isTouchLikeEvent","getTargetAtPoint","position","findGestureScrollableTouchTarget","scrollTarget","startSwipeAtPosition","touchLike","scrollableTarget","ignoreScrollableTarget","startOptions","ignoreSelectorWhenTouch","ignoreScrollableAncestors","onSwipeStart","resetPendingSwipeState","clearPendingSwipeStartState","cancelSwipeInteraction","resolvedInitialTransform","onCancel","applyDirectionalDamping","exponent","dampAxis","allowNegative","delta","allowPositive","canSwipeFromScrollEdgeOnPendingMove","canSwipeOnAxis","scrollOffset","allowTowardStart","maxScrollOffset","allowTowardEnd","handleStart","startPos","canStart","handleMoveCore","boundaryElement","moveTime","clientX","clientY","movementX","movement","movementY","cancelDeltaY","cancelDeltaX","currentDisplacement","dampedDelta","newOffsetX","newOffsetY","previousOffset","offsetChanged","dragDeltaX","dragDeltaY","progressDetails","progressDirection","size","progressDisplacement","handleEnd","resolvedDragOffset","releaseDeltaX","releaseDeltaY","startTime","endTime","velocityDurationMs","velocityX","velocityY","releaseVelocityX","releaseVelocityY","ageMs","sampleDurationMs","deltaFromLastSampleX","deltaFromLastSampleY","sampleVelocityX","sampleVelocityY","releaseDecision","onRelease","hasReleaseDecision","shouldClose","dismissDirection","onDismiss","handleMove","currentPos","endAfterMove","hasPrimaryButton","pendingStartPos","ignoreScrollableOnStart","canSwipeFromEdge","previousPos","moveNative","getDragStyles","DrawerTrigger","DrawerVirtualKeyboardContext","useDrawerVirtualKeyboardContext","MIN_SWIPE_THRESHOLD","FAST_SWIPE_VELOCITY","SNAP_VELOCITY_THRESHOLD","SNAP_VELOCITY_MULTIPLIER","MAX_SNAP_VELOCITY","MIN_SWIPE_RELEASE_VELOCITY","MAX_SWIPE_RELEASE_VELOCITY","MIN_SWIPE_RELEASE_DURATION_MS","MAX_SWIPE_RELEASE_DURATION_MS","MIN_SWIPE_RELEASE_SCALAR","AXIS_LOCK_SLOP","AXIS_LOCK_BIAS","DRAWER_CONTENT_SELECTOR","AXIS_SWIPE_IGNORE_SELECTORS","DrawerViewport","backdropRef","popupElementState","visualStateStore","isVerticalScrollAxis","crossScrollAxis","swipeRelease","setSwipeRelease","pendingSwipeCloseSnapPointRef","resetSwipeRef","controlledDismissFrame","swipingRef","nestedSwipeActiveRef","lastPointerTypeRef","ignoreNextTouchStartFromPenRef","ignoreTouchSwipeRef","touchScrollStateRef","virtualKeyboard","snapPointRange","offsets","a","b","minOffset","snapPointProgress","swipeDirections","setSwipeDismissed","dismissed","clearSwipeRelease","finishNestedSwipe","applySwipeProgress","shouldTrackProgress","swipeProgress$1","resolvedProgress","nestedSwipeProgress","notifyParent","backdropElement","showProgress","resolveSwipeRelease","getBaseSwipeSize","translationAlongDirection","remainingDistance","releaseVelocity","directionalVelocity","clampedVelocity","updateNestedSwipeActive","swipe$1","selection","anchorElement","focusElement","setBackdropSwipingAttribute","getBaseSwipeThreshold","touchState","elementAtPoint","shouldIgnoreSwipeForTextSelection","hasSnapPoints","releasePopupElement","startSwipeRelease","resolvedDirection","directionalDelta","dragDelta","dragDirection","releaseDirectionalVelocity","fallbackDirectionalVelocity","resolvedDirectionalVelocity","velocityDirection","currentOffset","dragTargetOffset","velocityOffset","targetOffset","snapPointEventDetails","settleInPlace","settleOnSnapPoint","closeFromSnapPoints","fallbackSnapPoint","orderedSnapPoints","first","second","orderedOffsets","currentIndex","targetSnapPoint","shouldAdvance","effectiveTargetOffset","adjacentIndex","adjacentPoint","closestSnapPoint","dismissEventDetails","pendingSnapPoint","savedEvent","swipePointerProps","swipeTouchProps","moveSwipeNative","resetSwipe","rootElement","resolvedRootElement","processTouchMove","drawerAxisDelta","shouldYieldTouchMove","hasScrollableContentOnAxis","canSwipeFromScrollEdge","canSwipeFromScrollEdgeOnMove","handleNativeTouchMove","updateTouchScrollPosition","currentBackdrop","swipeProviderValue","resetTouchSwipeState","ignoreSwipe","resetTouchTrackingState","handlePointerEnd","isSwipeIgnoredTarget","isDrawerContentTarget","isReactTouchEventOnRangeInput","eventTarget","hasCrossAxisGestureTarget","allowSwipe","isAtSwipeStartEdge","swiping$1","isRangeInput","isTextSelectionControl","hasExpandedSelectionWithinTarget","selectionStart","selectionEnd","isEventOnRangeInput","pathTarget","drawerAxisGestureDelta","crossAxisGestureDelta","absDrawerAxisGestureDelta","absCrossAxisGestureDelta","getScrollMetrics","max","dismissFromStartEdge","shouldDismissFromStartEdge","DrawerHandle","createDrawerHandle","compactQuery","useCompact","query","notify","useShell","AppShell","Header","attributes","styles$3","Main","Root","uncontrolled","setUncontrolled","setContainer","next","Sidebar","shell","compact","sidebar","SidebarBody","SidebarFooter","SidebarHeader","Title","Trigger","external","vars","inline","className","\"align\"","ChevronRight","Inline","styles$2","\"gap\"","\"justify\"","\"wrap\"","collapsibleStateAttributesMapping","CollapsibleRoot","onOpenChangeProp","collapsible","stateAttributesMapping","CollapsibleTrigger","contextDisabled","collapsiblePanelHeight","collapsiblePanelWidth","CollapsiblePanel","hiddenUntilFoundProp","keepMountedProp","registeredId","currentId","panelState","resolvedStyle","width","groupContext","SidebarMenu","Group","labelled","setLabelled","styles$1","GroupLabel","group","Item","Submenu","SubmenuPanel","SubmenuTrigger","\"active\"","\"size\"","Grid","LogOut","Dashboard","TempoWordmark","links","SplitComponent"],"sources":["../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useAnimationFrame.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useTransitionStatus.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelDataAttributes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/trigger/CollapsibleTriggerDataAttributes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/collapsibleOpenStateMapping.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/addEventListener.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/resolveRef.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/getFiniteAnimations.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/panel/useCollapsiblePanel.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/platform/engine.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/platform/screen-reader.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useScrollLock.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popupStateMapping.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/mergeCleanups.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/FocusGuard.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/enqueueFocus.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/markOthers.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/constants.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/popupHandle.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/fastHooks.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/store/useStore.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/store/Store.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/store/ReactStore.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/store.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/useDialogRoot.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/NullStore.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/store/DialogStore.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/composite.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopupDataAttributes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/utils/stateAttributesMapping.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/inertValue.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/InternalBackdrop.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/portal/DialogPortal.mjs","../../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/trigger/DialogTrigger.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/viewport/DialogViewport.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/store/DialogHandle.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/viewport/DialogViewportDataAttributes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/popup/DrawerPopupCssVars.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/backdrop/DrawerBackdropCssVars.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/backdrop/DrawerBackdrop.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/content/drawerContentAttribute.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/provider/DrawerProviderContext.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/popup/DrawerPopupDataAttributes.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/root/DrawerRootContext.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/root/useDrawerSnapPoints.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/viewport/DrawerViewportContext.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/popup/DrawerPopup.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/portal/DrawerPortal.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/root/DrawerRoot.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/scrollable.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/getElementAtPoint.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/getElementTransform.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/useSwipeDismiss.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/trigger/DrawerTrigger.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/viewport/DrawerViewport.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/drawer/handle.mjs","../../../../../../node_modules/.pnpm/@tempoxyz+ds@0.2.6_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react-native@0.86_f564df10a26f3190a3aaf6288ad1f3d1/node_modules/@tempoxyz/ds/dist/web/components/AppShell.js","../../../../../../node_modules/.pnpm/@tempoxyz+ds@0.2.6_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react-native@0.86_f564df10a26f3190a3aaf6288ad1f3d1/node_modules/@tempoxyz/ds/dist/web/icons/ChevronRight.js","../../../../../../node_modules/.pnpm/@tempoxyz+ds@0.2.6_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react-native@0.86_f564df10a26f3190a3aaf6288ad1f3d1/node_modules/@tempoxyz/ds/dist/web/components/Inline.js","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/root/stateAttributesMapping.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/root/CollapsibleRoot.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/trigger/CollapsibleTrigger.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelCssVars.mjs","../../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanel.mjs","../../../../../../node_modules/.pnpm/@tempoxyz+ds@0.2.6_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react-native@0.86_f564df10a26f3190a3aaf6288ad1f3d1/node_modules/@tempoxyz/ds/dist/web/components/SidebarMenu.js","../../../../../../node_modules/.pnpm/@tempoxyz+ds@0.2.6_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react-native@0.86_f564df10a26f3190a3aaf6288ad1f3d1/node_modules/@tempoxyz/ds/dist/web/icons/Grid.js","../../../../../../node_modules/.pnpm/@tempoxyz+ds@0.2.6_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react-native@0.86_f564df10a26f3190a3aaf6288ad1f3d1/node_modules/@tempoxyz/ds/dist/web/icons/LogOut.js","../../../screens/Dashboard.tsx","../../../routes/index.tsx?tsr-split=component"],"sourcesContent":["'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\n/** Unlike `setTimeout`, rAF doesn't guarantee a positive integer return value, so we can't have\n * a monomorphic `uint` type with `0` meaning empty.\n * See warning note at:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value */\nconst EMPTY = null;\nlet LAST_RAF = globalThis.requestAnimationFrame;\nclass Scheduler {\n /* This implementation uses an array as a backing data-structure for frame callbacks.\n * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it\n * never calls the native `cancelAnimationFrame` if there are no frames left. This can\n * be much more efficient if there is a call pattern that alterns as\n * \"request-cancel-request-cancel-…\".\n * But in the case of \"request-request-…-cancel-cancel-…\", it leaves the final animation\n * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */\n\n callbacks = [];\n callbacksCount = 0;\n nextId = 1;\n startId = 1;\n isScheduled = false;\n tick = timestamp => {\n this.isScheduled = false;\n const currentCallbacks = this.callbacks;\n const currentCallbacksCount = this.callbacksCount;\n\n // Update these before iterating, callbacks could call `requestAnimationFrame` again.\n this.callbacks = [];\n this.callbacksCount = 0;\n this.startId = this.nextId;\n if (currentCallbacksCount > 0) {\n for (let i = 0; i < currentCallbacks.length; i += 1) {\n currentCallbacks[i]?.(timestamp);\n }\n }\n };\n request(fn) {\n const id = this.nextId;\n this.nextId += 1;\n this.callbacks.push(fn);\n this.callbacksCount += 1;\n\n /* In a test environment with fake timers, a fake `requestAnimationFrame` can be called\n * but there's no guarantee that the animation frame will actually run before the fake\n * timers are teared, which leaves `isScheduled` set, but won't run our `tick()`. */\n const didRAFChange = process.env.NODE_ENV !== 'production' && LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);\n if (!this.isScheduled || didRAFChange) {\n requestAnimationFrame(this.tick);\n this.isScheduled = true;\n }\n return id;\n }\n cancel(id) {\n const index = id - this.startId;\n if (index < 0 || index >= this.callbacks.length) {\n return;\n }\n if (this.callbacks[index] === null) {\n return;\n }\n this.callbacks[index] = null;\n this.callbacksCount -= 1;\n }\n}\nlet scheduler = new Scheduler();\n\n/**\n * Replaces the shared scheduler and drops all pending animation frame callbacks.\n *\n * For test environments only. The scheduler is process-global, so a callback scheduled in one test\n * but never run (e.g. requested under fake timers that were torn down before the frame fired) would\n * otherwise survive into a later test and run there against stale state. Call between tests to drop\n * such leftovers.\n */\nexport function resetAnimationFrameScheduler() {\n const previous = scheduler;\n scheduler = new Scheduler();\n // Continue the id sequence so `cancel()` calls from `AnimationFrame` instances created before the\n // reset cannot cancel callbacks scheduled after it.\n scheduler.nextId = previous.nextId;\n scheduler.startId = previous.nextId;\n // A frame requested before the reset may still be pending and holds the previous scheduler's\n // `tick`; empty its queue in place so that frame runs nothing when it eventually fires.\n previous.callbacks = [];\n previous.callbacksCount = 0;\n}\nexport class AnimationFrame {\n static create() {\n return new AnimationFrame();\n }\n static request(fn) {\n return scheduler.request(fn);\n }\n static cancel(id) {\n return scheduler.cancel(id);\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n request(fn) {\n this.cancel();\n this.currentId = scheduler.request(() => {\n this.currentId = EMPTY;\n fn();\n });\n }\n cancel = () => {\n if (this.currentId !== EMPTY) {\n scheduler.cancel(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.cancel;\n };\n}\n\n/**\n * A `requestAnimationFrame` with automatic cleanup and guard.\n */\nexport function useAnimationFrame() {\n const timeout = useRefWithInit(AnimationFrame.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\n/**\n * Provides a status string for CSS animations.\n * @param open - a boolean that determines if the element is open.\n * @param enableIdleState - a boolean that enables the `'idle'` state between `'starting'` and `'ending'`\n * @param deferEndingState - a boolean that delays the `'ending'` state by a frame\n * @param animateInitialOpen - a boolean that makes an element which mounts already open still go\n * through `'starting'`. Off by default so content that was open on the first render (a\n * `defaultOpen` popup on page load, SSR'd markup) doesn't animate in.\n */\nexport function useTransitionStatus(open, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {\n const [transitionStatus, setTransitionStatus] = React.useState(open && enableIdleState ? 'idle' : undefined);\n // Starting at `false` while open lets the `open && !mounted` branch below run on the first\n // render, which is what produces the `'starting'` phase. React re-renders before committing, so\n // the element is still mounted in the same pass.\n const [mounted, setMounted] = React.useState(open && !animateInitialOpen);\n if (open && !mounted) {\n setMounted(true);\n setTransitionStatus('starting');\n }\n if (!open && mounted && transitionStatus !== 'ending' && !deferEndingState) {\n setTransitionStatus('ending');\n }\n if (!open && !mounted && transitionStatus === 'ending') {\n setTransitionStatus(undefined);\n }\n useIsoLayoutEffect(() => {\n if (!open && mounted && transitionStatus !== 'ending' && deferEndingState) {\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('ending');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }\n return undefined;\n }, [open, mounted, transitionStatus, deferEndingState]);\n useIsoLayoutEffect(() => {\n // Nothing to clear when the element mounted open or reopened after its exit settled.\n if (!open || enableIdleState || transitionStatus === undefined) {\n return undefined;\n }\n const frame = AnimationFrame.request(() => {\n // Avoid `flushSync` here due to Firefox.\n // See https://github.com/mui/base-ui/pull/3424\n setTransitionStatus(undefined);\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open, transitionStatus]);\n useIsoLayoutEffect(() => {\n if (!open || !enableIdleState) {\n return undefined;\n }\n if (open && mounted && transitionStatus !== 'idle') {\n setTransitionStatus('starting');\n }\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('idle');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open, mounted, transitionStatus]);\n return {\n mounted,\n setMounted,\n transitionStatus\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nexport function useCollapsibleRoot(parameters) {\n const {\n open: openParam,\n defaultOpen = false,\n onOpenChange,\n disabled\n } = parameters;\n const [open, setOpen] = useControlled({\n controlled: openParam,\n default: defaultOpen,\n name: 'Collapsible',\n state: 'open'\n });\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open, true, true);\n const defaultPanelId = useBaseUiId();\n // `undefined` uses the initial generated fallback; `null` means the panel unmounted.\n const [registeredPanelId, setPanelIdState] = React.useState();\n const panelId = registeredPanelId === null ? undefined : registeredPanelId ?? defaultPanelId;\n const handleTrigger = useStableCallback(event => {\n const nextOpen = !open;\n const eventDetails = createChangeEventDetails(REASONS.triggerPress, event.nativeEvent);\n onOpenChange(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpen(nextOpen);\n });\n return React.useMemo(() => ({\n defaultPanelId,\n disabled,\n handleTrigger,\n mounted,\n open,\n panelId,\n setMounted,\n setOpen,\n setPanelIdState,\n transitionStatus\n }), [defaultPanelId, disabled, handleTrigger, mounted, open, panelId, setMounted, setOpen, setPanelIdState, transitionStatus]);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CollapsibleRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CollapsibleRootContext.displayName = \"CollapsibleRootContext\";\nexport function useCollapsibleRootContext() {\n const context = React.useContext(CollapsibleRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.' : _formatErrorMessage(15));\n }\n return context;\n}","/**\n * Present when the component begins animating in.\n */\nexport const startingStyle = 'data-starting-style';\n\n/**\n * Present when the component is animating out.\n */\nexport const endingStyle = 'data-ending-style';","import * as TransitionStatusDataAttributes from \"./TransitionStatusDataAttributes.mjs\";\nexport { TransitionStatusDataAttributes };\nconst STARTING_HOOK = {\n [TransitionStatusDataAttributes.startingStyle]: ''\n};\nconst ENDING_HOOK = {\n [TransitionStatusDataAttributes.endingStyle]: ''\n};\nexport const transitionStatusMapping = {\n transitionStatus(value) {\n if (value === 'starting') {\n return STARTING_HOOK;\n }\n if (value === 'ending') {\n return ENDING_HOOK;\n }\n return null;\n }\n};","import { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Present when the collapsible panel is open.\n */\nexport const open = 'data-open';\n/**\n * Present when the collapsible panel is closed.\n */\nexport const closed = 'data-closed';\n/**\n * Present when the panel begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n/**\n * Present when the panel is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;","/**\n * Present when the collapsible panel is open.\n */\nexport const panelOpen = 'data-panel-open';","import * as CollapsiblePanelDataAttributes from \"../collapsible/panel/CollapsiblePanelDataAttributes.mjs\";\nimport * as CollapsibleTriggerDataAttributes from \"../collapsible/trigger/CollapsibleTriggerDataAttributes.mjs\";\nconst PANEL_OPEN_HOOK = {\n [CollapsiblePanelDataAttributes.open]: ''\n};\nconst PANEL_CLOSED_HOOK = {\n [CollapsiblePanelDataAttributes.closed]: ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return {\n [CollapsibleTriggerDataAttributes.panelOpen]: ''\n };\n }\n return null;\n }\n};\nexport const collapsibleOpenStateMapping = {\n open(value) {\n if (value) {\n return PANEL_OPEN_HOOK;\n }\n return PANEL_CLOSED_HOOK;\n }\n};","/**\n * Adds an event listener and returns a cleanup function to remove it.\n */\n\nexport function addEventListener(target, type, listener, options) {\n target.addEventListener(type, listener, options);\n return () => {\n target.removeEventListener(type, listener, options);\n };\n}","/**\n * If the provided argument is a ref object, returns its `current` value.\n * Otherwise, returns the argument itself.\n */\nexport function resolveRef(maybeRef) {\n if (maybeRef == null) {\n return maybeRef;\n }\n return 'current' in maybeRef ? maybeRef.current : maybeRef;\n}","/**\n * Excludes infinite animations, whose finished promises never resolve while they run.\n */\nexport function getFiniteAnimations(element, options) {\n return element.getAnimations(options).filter(animation => {\n const timing = animation.effect?.getTiming();\n return timing?.duration !== Infinity && timing?.iterations !== Infinity;\n });\n}","'use client';\n\nimport * as ReactDOM from 'react-dom';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { resolveRef } from \"../utils/resolveRef.mjs\";\nimport { getFiniteAnimations } from \"../utils/getFiniteAnimations.mjs\";\nimport * as TransitionStatusDataAttributes from \"./TransitionStatusDataAttributes.mjs\";\nlet pendingCallbacks = null;\n\n/**\n * Runs the callback in a synchronous flush before the browser paints, so that the\n * browser doesn't paint an intermediate frame: https://github.com/mui/base-ui/issues/979\n * Callbacks that become ready within the same microtask checkpoint (e.g. multiple elements\n * whose animations finish together) are batched into a single commit:\n * https://github.com/mui/base-ui/issues/5481\n */\nfunction flushBeforePaint(fn) {\n if (!pendingCallbacks) {\n const callbacks = [];\n pendingCallbacks = callbacks;\n queueMicrotask(() => {\n pendingCallbacks = null;\n ReactDOM.flushSync(() => {\n for (const callback of callbacks) {\n callback();\n }\n });\n });\n }\n pendingCallbacks.push(fn);\n}\n\n/**\n * Executes a function once all animations have finished on the provided element.\n * If an animation is canceled, waits for any replacement animations before executing.\n * @param elementOrRef - The element to watch for animations.\n * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.\n * @param batch - Whether completions ready in the same microtask may be coalesced into a single\n * commit. A batched callback runs before earlier callbacks' React updates have committed, so only\n * opt in when the callback doesn't read state that another completion can change.\n * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback\n */\nexport function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {\n const frame = useAnimationFrame();\n return useStableCallback((fnToExecute,\n /**\n * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that\n * can be used to abort `fnToExecute` before all the animations have finished.\n * @default null\n */\n signal = null) => {\n frame.cancel();\n const element = resolveRef(elementOrRef);\n if (element == null) {\n return;\n }\n const resolvedElement = element;\n const done = () => {\n if (!batch) {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n // Each callback gets its own commit so that later completions observe the React\n // updates caused by earlier ones.\n ReactDOM.flushSync(fnToExecute);\n return;\n }\n flushBeforePaint(() => {\n // Re-check at flush time: the signal may abort between queueing and the flush.\n if (!signal?.aborted) {\n fnToExecute();\n }\n });\n };\n if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {\n fnToExecute();\n return;\n }\n function exec() {\n // Discard fulfilled Animation values so unfinished animations cannot retain their targets.\n Promise.all(getFiniteAnimations(resolvedElement).map(animation => animation.finished.then(NOOP))).then(() => {\n if (!signal?.aborted) {\n done();\n }\n }, () => {\n if (signal?.aborted) {\n return;\n }\n const currentAnimations = getFiniteAnimations(resolvedElement);\n if (currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {\n // Sometimes animations can be aborted because a property they depend on changes while the animation plays.\n // In such cases, we need to re-check if any new animations have started.\n exec();\n return;\n }\n done();\n });\n }\n if (waitForStartingStyleRemoved) {\n const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;\n\n // If `[data-starting-style]` isn't present, fall back to waiting one more frame\n // to give \"open\" animations a chance to be registered.\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n frame.request(exec);\n return;\n }\n\n // Wait for `[data-starting-style]` to have been removed.\n const attributeObserver = new MutationObserver(() => {\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n attributeObserver.disconnect();\n exec();\n }\n });\n attributeObserver.observe(resolvedElement, {\n attributes: true,\n attributeFilter: [startingStyleAttribute]\n });\n signal?.addEventListener('abort', () => attributeObserver.disconnect(), {\n once: true\n });\n return;\n }\n frame.request(exec);\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useAnimationsFinished } from \"./useAnimationsFinished.mjs\";\n\n/**\n * Calls the provided function when the CSS open/close animation or transition completes.\n */\nexport function useOpenChangeComplete(parameters) {\n const {\n enabled = true,\n open,\n ref,\n batch = false,\n onComplete: onCompleteParam\n } = parameters;\n const onComplete = useStableCallback(onCompleteParam);\n const runOnceAnimationsFinish = useAnimationsFinished(ref, open, batch);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n const abortController = new AbortController();\n runOnceAnimationsFinish(onComplete, abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [enabled, open, onComplete, runOnceAnimationsFinish]);\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { warn } from '@base-ui/utils/warn';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useAnimationsFinished } from \"../../internals/useAnimationsFinished.mjs\";\nimport * as CollapsiblePanelDataAttributes from \"./CollapsiblePanelDataAttributes.mjs\";\nconst EMPTY_DIMENSIONS = {\n height: undefined,\n width: undefined\n};\nexport function useCollapsiblePanel(parameters) {\n const {\n externalRef,\n hiddenUntilFound,\n id: idParam,\n keepMounted,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setOpen,\n transitionStatus\n } = parameters;\n const panelRef = React.useRef(null);\n const animationTypeRef = React.useRef(null);\n const [dimensions, setDimensionsUnwrapped] = React.useState(EMPTY_DIMENSIONS);\n const lastMeasuredDimensionsRef = React.useRef(EMPTY_DIMENSIONS);\n // `beforematch` should reveal the matched content immediately, so the next\n // open cycle skips author-defined motion once and then returns to normal.\n const shouldSkipNextOpenRef = React.useRef(false);\n // Keyframe mount animations on initially open panels cause a visible layout\n // shift during the server-rendered first paint, so suppress that first open\n // lifecycle until the panel has been closed once.\n const shouldPreventMountAnimationRef = React.useRef(open);\n // React.Activity tears down Effects while preserving state, so revealing an\n // already-open panel would otherwise replay its CSS keyframe open animation.\n const shouldPreventActivityResumeAnimationRef = React.useRef(false);\n // Some open paths intentionally bypass motion, but the shared root transition\n // status still advances asynchronously. Override the panel to idle so its data\n // attributes and dimension cleanup reflect the immediate open state.\n const [forcePanelIdle, setForcePanelIdle] = React.useState(false);\n const pendingTemporaryStyleRestoreRef = React.useRef(null);\n const mergedPanelRef = useMergedRefs(externalRef, panelRef);\n const latestOpenRef = useValueAsRef(open);\n // Only used to handle panel close\n const runOnceCloseAnimationsFinish = useAnimationsFinished(panelRef);\n const hidden = !open && !mounted;\n const panelTransitionStatus = forcePanelIdle ? 'idle' : transitionStatus;\n const shouldPreventOpenAnimation = open && (\n // These 2 refs are safe to read in render, they are only written from committed\n // layout/effect paths and gate one-shot motion suppression for the next open\n // lifecycle. They intentionally expose the last committed motion snapshot.\n shouldPreventMountAnimationRef.current || shouldPreventActivityResumeAnimationRef.current);\n const renderedDimensions = !open && mounted &&\n // These 2 refs are also safe to read in render, both hold the last committed\n // animation mode and measurement. This fallback only restores a previously\n // measured pixel size after the live dimensions state has been reset back to `auto`.\n animationTypeRef.current === 'css-animation' && dimensions.height === undefined && dimensions.width === undefined ? lastMeasuredDimensionsRef.current : dimensions;\n const shouldPersistHiddenTransitionStyles = hiddenUntilFound && hidden && animationTypeRef.current !== 'css-animation';\n\n // Most measured dimensions are reused later when CSS keyframe closes need a\n // pixel size after the rendered dimensions have been reset back to `auto`.\n // Passing `false` is only for clearing the current dimensions state.\n const setDimensions = useStableCallback((nextDimensions, shouldCacheMeasurement = true) => {\n if (shouldCacheMeasurement) {\n lastMeasuredDimensionsRef.current = nextDimensions;\n }\n setDimensionsUnwrapped(nextDimensions);\n });\n const restorePendingTemporaryStyle = useStableCallback(() => {\n pendingTemporaryStyleRestoreRef.current?.();\n pendingTemporaryStyleRestoreRef.current = null;\n });\n const setPendingTemporaryStyleRestore = useStableCallback(restore => {\n restorePendingTemporaryStyle();\n pendingTemporaryStyleRestoreRef.current = () => {\n pendingTemporaryStyleRestoreRef.current = null;\n restore();\n };\n });\n\n // React.Activity unmounts Effects while preserving component state. If that\n // teardown happens while an already-open keyframe panel is visible, remember\n // to suppress the replayed open animation on the next committed reveal.\n const markActivityResumeAnimationSuppressed = useStableCallback(() => {\n if (open && mounted && animationTypeRef.current === 'css-animation') {\n shouldPreventActivityResumeAnimationRef.current = true;\n }\n });\n useIsoLayoutEffect(() => {\n // `forcePanelIdle` is only a temporary override for open paths that skip\n // motion. Keep it active while the shared root still reports `starting`,\n // then drop it once the root transition state catches up.\n if (!forcePanelIdle || transitionStatus === 'starting') {\n return;\n }\n setForcePanelIdle(false);\n }, [forcePanelIdle, transitionStatus]);\n React.useEffect(() => {\n return () => {\n markActivityResumeAnimationSuppressed();\n restorePendingTemporaryStyle();\n };\n }, [markActivityResumeAnimationSuppressed, restorePendingTemporaryStyle]);\n useIsoLayoutEffect(() => {\n // A render function can remove the panel on close. Clear one-shot open animation\n // suppression even without an element, so the next open animates normally.\n if (!open) {\n shouldPreventMountAnimationRef.current = false;\n shouldPreventActivityResumeAnimationRef.current = false;\n }\n const panel = panelRef.current;\n if (!panel) {\n return undefined;\n }\n\n // `beforematch` can temporarily force a `0s` motion duration so the matched\n // content reveals immediately. Restore the authored duration before detecting\n // the next close animation type, otherwise that first close is misread as\n // \"no motion\" and the close transition or keyframe gets skipped.\n if (!open && pendingTemporaryStyleRestoreRef.current) {\n restorePendingTemporaryStyle();\n }\n const animationType = getAnimationType(panel, shouldPreventOpenAnimation);\n animationTypeRef.current = animationType;\n\n // Initially open keyframe panels skip their first paint animation to avoid\n // layout shift, but we still need to cache the expanded size so the first\n // close animation can start from pixels instead of `auto`.\n if (open && transitionStatus === 'idle' && shouldPreventMountAnimationRef.current && animationType === 'css-animation') {\n lastMeasuredDimensionsRef.current = getDimensions(panel);\n return undefined;\n }\n\n // Handle the opening pass: measure the expanded size and, when necessary,\n // neutralize author-defined motion so the panel can open immediately.\n if (open && transitionStatus === 'starting') {\n // `beforematch` opens should reveal the panel immediately so find-in-page\n // does not wait for the author-defined transition or animation to finish.\n const skipNextOpen = shouldSkipNextOpenRef.current;\n shouldSkipNextOpenRef.current = false;\n if (animationType === 'none') {\n setDimensions(getDimensions(panel));\n setForcePanelIdle(true);\n return undefined;\n }\n if (animationType === 'css-transition') {\n const restoreLayoutStyles = resetLayoutStyles(panel);\n setDimensions(getDimensions(panel));\n if (!skipNextOpen) {\n return restoreLayoutStyles;\n }\n const restoreTransitionDuration = setTemporaryStyle(panel, 'transition-duration', '0s');\n setPendingTemporaryStyleRestore(restoreTransitionDuration);\n setForcePanelIdle(true);\n return restoreLayoutStyles;\n }\n setDimensions(getDimensions(panel));\n const restoreAnimationName = setTemporaryStyle(panel, 'animation-name', 'none');\n if (!skipNextOpen) {\n restoreAnimationName();\n return undefined;\n }\n const restoreAnimationDuration = setTemporaryStyle(panel, 'animation-duration', '0s');\n restoreAnimationName();\n setPendingTemporaryStyleRestore(restoreAnimationDuration);\n setForcePanelIdle(true);\n return undefined;\n }\n\n // Capture the current size as soon as close is requested, before the\n // deferred ending phase applies closed styles. This keeps close transitions\n // starting from a measured pixel value, including interrupted opens.\n if (!open && mounted && (transitionStatus === 'idle' || transitionStatus === 'starting')) {\n if (animationType === 'none') {\n setDimensions(EMPTY_DIMENSIONS, false);\n setMounted(false);\n return undefined;\n }\n setDimensions(getDimensions(panel));\n return undefined;\n }\n if (transitionStatus !== 'ending') {\n return undefined;\n }\n\n // Reachable when `transitionStatus` already flipped to `ending` before this effect ran, so\n // the close branch above was skipped. Without motion there is nothing to wait for, so unmount\n // here instead of deferring to the animation-finished path below.\n if (animationType === 'none') {\n setMounted(false);\n return undefined;\n }\n const nextDimensions = getDimensions(panel);\n const hasMeasuredSize = nextDimensions.height > 0 || nextDimensions.width > 0;\n if (!hasMeasuredSize) {\n setMounted(false);\n return undefined;\n }\n setDimensions(nextDimensions);\n if (animationType === 'css-animation') {\n const restoreAnimationName = setTemporaryStyle(panel, 'animation-name', 'none');\n restoreAnimationName();\n }\n return undefined;\n }, [mounted, open, restorePendingTemporaryStyle, setDimensions, setMounted, setPendingTemporaryStyleRestore, shouldPreventOpenAnimation, transitionStatus]);\n useOpenChangeComplete({\n enabled: open && mounted && panelTransitionStatus === 'idle',\n open: true,\n ref: panelRef,\n onComplete() {\n // `useOpenChangeComplete` only aborts from its effect cleanup, which React runs in the\n // post-paint passive flush. An animation's `finished` microtask can resolve after the render\n // that set `open` to `false` but before that cleanup, so re-check the latest value here.\n // Clearing the measured size in that window would make the close transition start from\n // `height: 0` instead of the expanded pixel height.\n if (!open) {\n return;\n }\n setDimensions(EMPTY_DIMENSIONS, false);\n }\n });\n\n // Closing panels need extra sequencing beyond `useOpenChangeComplete`.\n // This passive effect runs after the `ending` render has committed, so\n // `[data-ending-style]` is already present. Chrome can still register the\n // exit transition one frame later when an Accordion closes one item while\n // opening another, so wait one frame before watching animations.\n // See https://github.com/mui/base-ui/issues/3099\n React.useEffect(() => {\n if (open || !mounted || panelTransitionStatus !== 'ending') {\n return undefined;\n }\n const panel = panelRef.current;\n if (!panel) {\n // A render function can drop the panel element while it closes. There is nothing left\n // to animate, so finish closing instead of staying in the ending phase.\n setMounted(false);\n setDimensions(EMPTY_DIMENSIONS, false);\n return undefined;\n }\n const abortController = new AbortController();\n let endingStyleFrame = -1;\n function handleComplete() {\n // Same post-paint race as the `useOpenChangeComplete` callback above, except `open` is\n // captured by this effect's closure and always `false` here, so read the latest value from\n // a ref. Unmounting a panel that has already reopened would drop it from the DOM.\n if (latestOpenRef.current) {\n return;\n }\n setMounted(false);\n setDimensions(EMPTY_DIMENSIONS, false);\n }\n endingStyleFrame = AnimationFrame.request(() => {\n runOnceCloseAnimationsFinish(handleComplete, abortController.signal);\n });\n return () => {\n AnimationFrame.cancel(endingStyleFrame);\n abortController.abort();\n };\n }, [latestOpenRef, mounted, open, panelTransitionStatus, runOnceCloseAnimationsFinish, setDimensions, setMounted]);\n useIsoLayoutEffect(() => {\n const panel = panelRef.current;\n if (!panel || !hiddenUntilFound || !hidden) {\n return;\n }\n\n // React only supports a boolean for the `hidden` attribute and forces\n // legit string values to booleans so we have to force it back in the DOM\n // when necessary: https://github.com/react/react/issues/24740\n panel.setAttribute('hidden', 'until-found');\n }, [hidden, hiddenUntilFound]);\n React.useEffect(function registerBeforeMatchListener() {\n const panel = panelRef.current;\n if (!panel) {\n return undefined;\n }\n const revealDecisionTimeout = Timeout.create();\n let revertRevealFrame = -1;\n\n // Reverting must wait until the browser has measured the match, and React\n // cannot do it: it keeps rendering the same `hidden` and `data-starting-style`\n // props while the panel stays closed, so it never rewrites attributes that were\n // changed behind its back (the browser removes `hidden` as part of the reveal).\n //\n // Whether the open arrived is decided in a task, not a frame: `setOpen` has\n // already scheduled React's own task by the time the timeout is queued, so the\n // decision drains after the commit even when a busy main thread delays both,\n // whereas a rendering update could preempt the still-queued commit and make an\n // animation frame read a stale value. When the consumer ignores the open, no\n // commit is ever scheduled and the decision holds. The DOM revert then runs\n // in a frame so it stays atomic with respect to paint.\n const scheduleRevealRevert = (revertSkippedMotion, restoreStartingStyle) => {\n revealDecisionTimeout.start(0, () => {\n if (latestOpenRef.current) {\n return;\n }\n revertRevealFrame = AnimationFrame.request(() => {\n if (latestOpenRef.current) {\n return;\n }\n if (revertSkippedMotion) {\n // The open never happened, so the next one is an ordinary open that\n // should keep its author-defined motion.\n shouldSkipNextOpenRef.current = false;\n }\n if (restoreStartingStyle) {\n panel.setAttribute(CollapsiblePanelDataAttributes.startingStyle, '');\n }\n panel.setAttribute('hidden', 'until-found');\n });\n });\n };\n\n // Declared as a `const` after the null check so `panel` stays narrowed: the\n // handler must touch the same element the listener is attached to.\n const handleBeforeMatch = event => {\n const eventDetails = createChangeEventDetails(REASONS.none, event);\n onOpenChange(true, eventDetails);\n if (eventDetails.isCanceled) {\n // A canceled reveal means the panel must stay hidden, so undo the\n // browser's removal of `hidden` and keep the content searchable.\n scheduleRevealRevert(false, false);\n return;\n }\n shouldSkipNextOpenRef.current = true;\n\n // The browser removes `hidden` and measures the match in the same task that\n // dispatches this event, while the React state update below only lands in a\n // later one. Panels kept collapsed by persisted starting styles would still\n // be zero-sized at that point and the match highlight is dropped, so drop\n // those styles synchronously here.\n const hadStartingStyle = panel.hasAttribute(CollapsiblePanelDataAttributes.startingStyle);\n panel.removeAttribute(CollapsiblePanelDataAttributes.startingStyle);\n setOpen(true);\n\n // A controlled panel whose `onOpenChange` is ignored never receives the open\n // state, so return it to the fully closed state once the browser has measured.\n scheduleRevealRevert(true, hadStartingStyle);\n };\n const cleanupBeforeMatchListener = addEventListener(panel, 'beforematch', handleBeforeMatch);\n return () => {\n revealDecisionTimeout.clear();\n AnimationFrame.cancel(revertRevealFrame);\n cleanupBeforeMatchListener();\n };\n }, [latestOpenRef, onOpenChange, setOpen]);\n const shouldRender = keepMounted || hiddenUntilFound || mounted || open;\n return {\n height: renderedDimensions.height,\n props: {\n ...(shouldPersistHiddenTransitionStyles ? {\n [CollapsiblePanelDataAttributes.startingStyle]: ''\n } : undefined),\n hidden,\n id: idParam\n },\n ref: mergedPanelRef,\n shouldPreventOpenAnimation,\n shouldRender,\n transitionStatus: panelTransitionStatus,\n width: renderedDimensions.width\n };\n}\nfunction getDimensions(element) {\n return {\n height: element.scrollHeight,\n width: element.scrollWidth\n };\n}\nfunction getAnimationType(element, hasSuppressedMountAnimation) {\n const panelStyles = ownerWindow(element).getComputedStyle(element);\n const hasAnimation = (panelStyles.animationName.split(',').map(name => name.trim()).some(name => name !== '' && name !== 'none') || hasSuppressedMountAnimation) && hasNonZeroDuration(panelStyles.animationDuration);\n const hasTransition = hasNonZeroDuration(panelStyles.transitionDuration);\n if (hasAnimation && hasTransition) {\n /* istanbul ignore else -- `process.env.NODE_ENV` is a build-time constant under test */\n if (process.env.NODE_ENV !== 'production') {\n warn('CSS transitions and CSS animations both detected on Collapsible or Accordion panel.', 'Only one of either animation type should be used.');\n }\n return 'css-transition';\n }\n if (hasTransition) {\n return 'css-transition';\n }\n if (hasAnimation) {\n return 'css-animation';\n }\n return 'none';\n}\nfunction hasNonZeroDuration(value) {\n return value.split(',').map(part => part.trim()).some(part => part !== '' && Number.parseFloat(part) > 0);\n}\n\n/**\n * Temporarily overrides an inline style property and returns a cleanup that\n * restores the previous inline value and priority.\n * @param element - The element whose inline style should be updated.\n * @param property - The CSS property name to override.\n * @param value - The temporary value to assign.\n * @returns A cleanup function that restores the original inline style state.\n */\nfunction setTemporaryStyle(element, property, value) {\n const previousValue = element.style.getPropertyValue(property);\n const previousPriority = element.style.getPropertyPriority(property);\n element.style.setProperty(property, value);\n return () => {\n if (previousValue === '') {\n element.style.removeProperty(property);\n return;\n }\n element.style.setProperty(property, previousValue, previousPriority);\n };\n}\n\n/**\n * Temporarily resets inline alignment styles that can distort scroll-based\n * size measurements, then restores them on the next animation frame.\n * @param element - The panel element being measured.\n * @returns A cleanup function that cancels the scheduled restore and reapplies\n * the original inline layout styles immediately.\n */\nfunction resetLayoutStyles(element) {\n const originalLayoutStyles = {\n 'justify-content': element.style.justifyContent,\n 'align-items': element.style.alignItems,\n 'align-content': element.style.alignContent,\n 'justify-items': element.style.justifyItems\n };\n Object.keys(originalLayoutStyles).forEach(key => {\n element.style.setProperty(key, 'initial', 'important');\n });\n function restoreLayoutStyles() {\n Object.entries(originalLayoutStyles).forEach(([key, value]) => {\n if (value === '') {\n element.style.removeProperty(key);\n return;\n }\n element.style.setProperty(key, value);\n });\n }\n const frame = AnimationFrame.request(restoreLayoutStyles);\n return () => {\n AnimationFrame.cancel(frame);\n restoreLayoutStyles();\n };\n}","import { lowerUserAgent } from \"./shared.mjs\";\n\n// WebKit (Safari, all iOS browsers, GNOME Web). Distinguished from Blink by\n// the legacy `-webkit-backdrop-filter` name — Blink forked from WebKit in 2013\n// and only ships the unprefixed `backdrop-filter`.\n/** WebKit: Safari, all iOS browsers, GNOME Web. Excludes Blink. */\nexport const webkit = typeof CSS !== 'undefined' && !!CSS.supports?.('-webkit-backdrop-filter:none');\n\n// Anchored to `!webkit` so engines are mutually exclusive by construction.\n// Firefox-on-iOS uses WebKit (its UA marker is `FxiOS/`, not `Firefox/`); the\n// `!webkit` prefix also defends against future iOS-browser UA changes that\n// might inject `Firefox` into a WebKit-based UA.\n/** Gecko: Firefox. */\nexport const gecko = !webkit && lowerUserAgent.includes('firefox');\n\n// All Chromium-based browsers ship `Chrome/` or `Chromium/` in their UA — both\n// share the `chrom` prefix, so a single substring check covers Chrome, Edge,\n// Opera, Brave, etc. Chrome-on-iOS uses `CriOS/` and stays WebKit. The positive\n// UA check also makes this SSR-safe — an empty UA matches nothing.\n/** Blink: Chrome, Edge, Opera, Brave, and other Chromium-based browsers. */\nexport const blink = !webkit && lowerUserAgent.includes('chrom');","import { apple } from \"./os.mjs\";\n\n// Whether a screen reader is *actually* running cannot be detected. These flags\n// identify platforms where a specific screen reader could be active. VoiceOver\n// is the system screen reader on Apple platforms and works with every browser\n// there, so the flag is purely an OS check; engine-specific quirks (e.g. the\n// NSAccessibility virtual-cursor focus path) should be gated at the call site.\n/**\n * The user *may* be using VoiceOver — actual activation is not detectable.\n * True on any Apple platform (macOS, iOS, iPadOS).\n */\nexport const voiceOver = apple;","'use client';\n\nimport { isOverflowElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from \"./addEventListener.mjs\";\nimport { platform } from \"./platform/index.mjs\";\nimport { ownerDocument, ownerWindow } from \"./owner.mjs\";\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { Timeout } from \"./useTimeout.mjs\";\nimport { AnimationFrame } from \"./useAnimationFrame.mjs\";\nlet originalHtmlStyles = {};\nlet originalBodyStyles = {};\nlet originalHtmlScrollBehavior = '';\n\n// The viewport's overflow comes from <html> when it establishes its own scroll container, and\n// propagates from <body> otherwise. An `overflow` style on the other element doesn't lock the page.\nfunction getViewportScroller(html, body) {\n return isOverflowElement(html) ? html : body;\n}\nfunction isPageScrollLocked(win, html, body) {\n return /hidden|clip/.test(win.getComputedStyle(getViewportScroller(html, body)).overflowY);\n}\nfunction hasInsetScrollbars(referenceElement) {\n if (typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const win = ownerWindow(doc);\n return win.innerWidth - doc.documentElement.clientWidth > 0;\n}\nfunction supportsStableScrollbarGutter(referenceElement) {\n const supported = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('scrollbar-gutter', 'stable');\n if (!supported || typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const scrollContainer = getViewportScroller(html, body);\n const originalScrollContainerOverflowY = scrollContainer.style.overflowY;\n const originalHtmlStyleGutter = html.style.scrollbarGutter;\n html.style.scrollbarGutter = 'stable';\n scrollContainer.style.overflowY = 'scroll';\n const before = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = 'hidden';\n const after = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = originalScrollContainerOverflowY;\n html.style.scrollbarGutter = originalHtmlStyleGutter;\n return before === after;\n}\nfunction preventScrollOverlayScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n\n // If an `overflow` style is present on <html>, we need to lock it, because a lock on <body>\n // won't have any effect.\n // But if <body> has an `overflow` style (like `overflow-x: hidden`), we need to lock it\n // instead, as sticky elements shift otherwise.\n const elementToLock = getViewportScroller(html, body);\n const originalElementToLockStyles = {\n overflowY: elementToLock.style.overflowY,\n overflowX: elementToLock.style.overflowX\n };\n Object.assign(elementToLock.style, {\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n return () => {\n Object.assign(elementToLock.style, originalElementToLockStyles);\n };\n}\nfunction preventScrollInsetScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n let scrollTop = 0;\n let scrollLeft = 0;\n let updateGutterOnly = false;\n const resizeFrame = AnimationFrame.create();\n\n // Pinch-zoom in Safari causes a shift. Just don't lock scroll if there's any pinch-zoom.\n if (platform.engine.webkit && (win.visualViewport?.scale ?? 1) !== 1) {\n return () => {};\n }\n function lockScroll() {\n /* DOM reads: */\n\n const htmlStyles = win.getComputedStyle(html);\n const bodyStyles = win.getComputedStyle(body);\n const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || '';\n const hasBothEdges = htmlScrollbarGutterValue.includes('both-edges');\n const scrollbarGutterValue = hasBothEdges ? 'stable both-edges' : 'stable';\n scrollTop = html.scrollTop;\n scrollLeft = html.scrollLeft;\n originalHtmlStyles = {\n scrollbarGutter: html.style.scrollbarGutter,\n overflowY: html.style.overflowY,\n overflowX: html.style.overflowX\n };\n originalHtmlScrollBehavior = html.style.scrollBehavior;\n originalBodyStyles = {\n position: body.style.position,\n height: body.style.height,\n width: body.style.width,\n boxSizing: body.style.boxSizing,\n overflowY: body.style.overflowY,\n overflowX: body.style.overflowX,\n scrollBehavior: body.style.scrollBehavior\n };\n const isScrollableY = html.scrollHeight > html.clientHeight;\n const isScrollableX = html.scrollWidth > html.clientWidth;\n const hasConstantOverflowY = htmlStyles.overflowY === 'scroll' || bodyStyles.overflowY === 'scroll';\n const hasConstantOverflowX = htmlStyles.overflowX === 'scroll' || bodyStyles.overflowX === 'scroll';\n\n // Values can be negative in Firefox\n const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);\n const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);\n\n // Avoid shift due to the default <body> margin. This does cause elements to be clipped\n // with whitespace. Warn if <body> has margins?\n const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);\n const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);\n const elementToLock = getViewportScroller(html, body);\n updateGutterOnly = supportsStableScrollbarGutter(referenceElement);\n\n /*\n * DOM writes:\n * Do not read the DOM past this point!\n */\n\n if (updateGutterOnly) {\n html.style.scrollbarGutter = scrollbarGutterValue;\n elementToLock.style.overflowY = 'hidden';\n elementToLock.style.overflowX = 'hidden';\n return;\n }\n Object.assign(html.style, {\n scrollbarGutter: scrollbarGutterValue,\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n if (isScrollableY || hasConstantOverflowY) {\n html.style.overflowY = 'scroll';\n }\n if (isScrollableX || hasConstantOverflowX) {\n html.style.overflowX = 'scroll';\n }\n Object.assign(body.style, {\n position: 'relative',\n height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : '100dvh',\n width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : '100vw',\n boxSizing: 'border-box',\n // Assign the longhands that `cleanup` restores, so nothing is left behind.\n overflowY: 'hidden',\n overflowX: 'hidden',\n scrollBehavior: 'unset'\n });\n body.scrollTop = scrollTop;\n body.scrollLeft = scrollLeft;\n html.setAttribute('data-base-ui-scroll-locked', '');\n html.style.scrollBehavior = 'unset';\n }\n function cleanup() {\n Object.assign(html.style, originalHtmlStyles);\n Object.assign(body.style, originalBodyStyles);\n if (!updateGutterOnly) {\n html.scrollTop = scrollTop;\n html.scrollLeft = scrollLeft;\n html.removeAttribute('data-base-ui-scroll-locked');\n html.style.scrollBehavior = originalHtmlScrollBehavior;\n }\n }\n function handleResize() {\n cleanup();\n resizeFrame.request(lockScroll);\n }\n lockScroll();\n const unsubscribeResize = addEventListener(win, 'resize', handleResize);\n return () => {\n resizeFrame.cancel();\n cleanup();\n // Sometimes this cleanup can run after test teardown because it is called\n // in a `setTimeout(fn, 0)`. Guard the returned cleanup to avoid calling\n // `removeEventListener` when it is no longer available in tests.\n if (typeof win.removeEventListener === 'function') {\n unsubscribeResize();\n }\n };\n}\nclass ScrollLocker {\n lockCount = 0;\n restore = null;\n timeoutLock = Timeout.create();\n timeoutUnlock = Timeout.create();\n acquire(referenceElement) {\n this.lockCount += 1;\n if (this.lockCount === 1 && this.restore === null) {\n this.timeoutLock.start(0, () => this.lock(referenceElement));\n }\n return this.release;\n }\n release = () => {\n this.lockCount -= 1;\n if (this.lockCount === 0 && this.restore) {\n this.timeoutUnlock.start(0, this.unlock);\n }\n };\n unlock = () => {\n if (this.lockCount === 0 && this.restore) {\n this.restore?.();\n this.restore = null;\n }\n };\n lock(referenceElement) {\n if (this.lockCount === 0 || this.restore !== null) {\n return;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n\n // The page is already locked, either by the site author or by a non-Base UI overlay that\n // hasn't cleaned up yet. Leave it alone and wait for the lock to clear before taking over,\n // otherwise we'd snapshot the locked state and restore it after our own lock is released.\n if (isPageScrollLocked(win, html, body)) {\n const observer = new win.MutationObserver(() => {\n if (isPageScrollLocked(win, html, body)) {\n return;\n }\n observer.disconnect();\n this.restore = null;\n this.lock(referenceElement);\n });\n\n // Watch every attribute: locks are applied through inline styles, classes, or attributes\n // paired with a stylesheet (`data-scroll-locked` in react-remove-scroll, for example).\n const options = {\n attributes: true\n };\n observer.observe(html, options);\n observer.observe(body, options);\n this.restore = () => observer.disconnect();\n return;\n }\n const hasOverlayScrollbars = platform.os.ios || !hasInsetScrollbars(referenceElement);\n\n // On iOS, scroll locking does not work if the navbar is collapsed. Due to numerous\n // side effects and bugs that arise on iOS, it must be researched extensively before\n // being enabled to ensure it doesn't cause the following issues:\n // - Textboxes must scroll into view when focused, nor cause a glitchy scroll animation.\n // - The navbar must not force itself into view and cause layout shift.\n // - Scroll containers must not flicker upon closing a popup when it has an exit animation.\n this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);\n }\n}\nconst SCROLL_LOCKER = new ScrollLocker();\n\n/**\n * Locks the scroll of the document when enabled.\n *\n * @param enabled - Whether to enable the scroll lock.\n * @param referenceElement - Element to use as a reference for lock calculations.\n */\nexport function useScrollLock(enabled = true, referenceElement = null) {\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return undefined;\n }\n return SCROLL_LOCKER.acquire(referenceElement);\n }, [enabled, referenceElement]);\n}","export const FOCUSABLE_ATTRIBUTE = 'data-base-ui-focusable';\nexport const ACTIVE_KEY = 'active';\nexport const SELECTED_KEY = 'selected';\nexport const TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';","import * as TransitionStatusDataAttributes from \"../internals/TransitionStatusDataAttributes.mjs\";\n\n/**\n * Present when the popup is open.\n */\nexport const open = 'data-open';\n\n/**\n * Present when the popup is closed.\n */\nexport const closed = 'data-closed';\n\n/**\n * Present when the popup begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n\n/**\n * Present when the popup is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;\n\n/**\n * Present when the anchor is hidden.\n */\nexport const anchorHidden = 'data-anchor-hidden';\n\n/**\n * Indicates which side the popup is positioned relative to the trigger.\n * @type { 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'}\n */\nexport const side = 'data-side';\n\n/**\n * Indicates how the popup is aligned relative to specified side.\n * @type {'start' | 'center' | 'end'}\n */\nexport const align = 'data-align';","/**\n * Present when the popup is open.\n */\nexport const popupOpen = 'data-popup-open';\n\n/**\n * Present when a pressable trigger is pressed.\n */\nexport const pressed = 'data-pressed';","import { transitionStatusMapping } from \"../internals/stateAttributesMapping.mjs\";\nimport * as CommonPopupDataAttributes from \"./CommonPopupDataAttributes.mjs\";\nimport * as CommonTriggerDataAttributes from \"./CommonTriggerDataAttributes.mjs\";\nexport { CommonPopupDataAttributes, CommonTriggerDataAttributes };\nconst TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: ''\n};\nconst PRESSABLE_TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: '',\n [CommonTriggerDataAttributes.pressed]: ''\n};\nconst POPUP_OPEN_HOOK = {\n [CommonPopupDataAttributes.open]: ''\n};\nconst POPUP_CLOSED_HOOK = {\n [CommonPopupDataAttributes.closed]: ''\n};\nconst ANCHOR_HIDDEN_HOOK = {\n [CommonPopupDataAttributes.anchorHidden]: ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const pressableTriggerOpenStateMapping = {\n open(value) {\n if (value) {\n return PRESSABLE_TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const popupStateMapping = {\n open(value) {\n if (value) {\n return POPUP_OPEN_HOOK;\n }\n return POPUP_CLOSED_HOOK;\n },\n anchorHidden(value) {\n if (value) {\n return ANCHOR_HIDDEN_HOOK;\n }\n return null;\n }\n};\nexport const popupTransitionStateMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};","import { isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { activeElement, closest, contains, getTarget } from '@base-ui/utils/shadowDom';\nimport { FOCUSABLE_ATTRIBUTE, TYPEABLE_SELECTOR } from \"./constants.mjs\";\nimport * as TooltipTriggerDataAttributes from \"../../tooltip/trigger/TooltipTriggerDataAttributes.mjs\";\nexport { activeElement, closest, contains, getTarget };\nexport function isTargetInsideEnabledTrigger(target, triggerElements) {\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n if (triggerElements.hasElement(targetElement)) {\n return !targetElement.hasAttribute(TooltipTriggerDataAttributes.triggerDisabled);\n }\n for (const [, trigger] of triggerElements.entries()) {\n if (contains(trigger, targetElement)) {\n return !trigger.hasAttribute(TooltipTriggerDataAttributes.triggerDisabled);\n }\n }\n return false;\n}\nexport function isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const eventAgain = event;\n return eventAgain.target != null && node.contains(eventAgain.target);\n}\nexport function isRootElement(element) {\n return element.matches('html,body');\n}\nexport function isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nexport function isInteractiveElement(element) {\n return closest(element, `button,a[href],[role=\"button\"],select,[tabindex]:not([tabindex=\"-1\"]),${TYPEABLE_SELECTOR}`) != null;\n}\nexport function isTypeableCombobox(element) {\n if (!element) {\n return false;\n }\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\nexport function matchesFocusVisible(element) {\n // We don't want to block focus from working with `visibleOnly`\n // (JSDOM doesn't match `:focus-visible` when the element has `:focus`)\n if (!element || platform.env.jsdom) {\n return true;\n }\n try {\n return element.matches(':focus-visible');\n } catch (_e) {\n return true;\n }\n}\nexport function getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;\n}","/**\n * Combines multiple cleanup functions into a single cleanup function.\n */\nexport function mergeCleanups(...cleanups) {\n return () => {\n for (let i = 0; i < cleanups.length; i += 1) {\n const cleanup = cleanups[i];\n if (cleanup) {\n cleanup();\n }\n }\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { platform } from '@base-ui/utils/platform';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n useIsoLayoutEffect(() => {\n // Unlike NVDA and JAWS, VoiceOver's virtual cursor triggers `onFocus` as\n // it moves — but only on focusable/role-button elements through WebKit's\n // NSAccessibility path. Setting `role=\"button\"` lets the focus trap catch\n // the cursor.\n if (platform.screenReader.voiceOver && platform.engine.webkit) {\n setRole('button');\n }\n }, []);\n const restProps = {\n tabIndex: 0,\n // Role is only for VoiceOver\n role\n };\n return /*#__PURE__*/_jsx(\"span\", {\n ...props,\n ref: ref,\n style: visuallyHidden,\n \"aria-hidden\": role ? undefined : true,\n ...restProps,\n \"data-base-ui-focus-guard\": \"\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") FocusGuard.displayName = \"FocusGuard\";","import { floor } from '@floating-ui/utils';\nimport { getComputedStyle } from '@floating-ui/utils/dom';\nimport { stopEvent } from \"./event.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"./constants.mjs\";\nimport { closest } from \"./element.mjs\";\nexport function isDifferentGridRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nexport function isIndexOutOfListBounds(list, index) {\n return index < 0 || index >= list.length;\n}\nexport function getMinListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n disabledIndices\n });\n}\nexport function getMaxListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\n/**\n * The index one arrow step moves the highlight to from `currentIndex`, or `-1` when the step\n * leaves the list. `wrapped` reports a jump from one end of the list to the other.\n */\nexport function getNextListIndex(list, currentIndex, options) {\n const {\n decrement,\n loopFocus,\n allowEscape,\n disabledIndices,\n minIndex,\n maxIndex\n } = options;\n const step = () => findNonDisabledListIndex(list, {\n startingIndex: currentIndex,\n decrement,\n disabledIndices\n });\n let index;\n let wrapped = false;\n if (!loopFocus) {\n index = decrement ? Math.max(minIndex, step()) : Math.min(maxIndex, step());\n } else if (decrement ? currentIndex <= minIndex : currentIndex >= maxIndex) {\n // Escaping is only possible from inside the list: from outside it, a step enters at the far\n // end.\n const outside = decrement ? -1 : list.length;\n if (allowEscape && currentIndex !== outside) {\n index = -1;\n } else {\n index = decrement ? maxIndex : minIndex;\n wrapped = true;\n }\n } else {\n index = step();\n }\n return {\n index: isIndexOutOfListBounds(list, index) ? -1 : index,\n wrapped\n };\n}\nexport function findNonDisabledListIndex(list, {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n} = {}) {\n let index = startingIndex;\n do {\n index += decrement ? -amount : amount;\n } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));\n return index;\n}\nexport function getGridNavigatedIndex(list, {\n event,\n orientation,\n loopFocus,\n onLoop,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex,\n stopEvent: stop = false\n}) {\n let nextIndex = prevIndex;\n let verticalDirection;\n if (event.key === ARROW_UP) {\n verticalDirection = 'up';\n } else if (event.key === ARROW_DOWN) {\n verticalDirection = 'down';\n }\n if (verticalDirection) {\n // -------------------------------------------------------------------------\n // Detect row structure only when handling vertical navigation. This keeps\n // the non-vertical key paths free from row inference work.\n // -------------------------------------------------------------------------\n const rows = [];\n const rowIndexMap = [];\n let hasRoleRow = false;\n let visibleItemCount = 0;\n {\n let currentRowEl = null;\n let currentRowIndex = -1;\n list.forEach((el, idx) => {\n if (el == null) {\n return;\n }\n visibleItemCount += 1;\n const rowEl = closest(el, '[role=\"row\"]');\n if (rowEl) {\n hasRoleRow = true;\n }\n if (rowEl !== currentRowEl || currentRowIndex === -1) {\n currentRowEl = rowEl;\n currentRowIndex += 1;\n rows[currentRowIndex] = [];\n }\n rows[currentRowIndex].push(idx);\n rowIndexMap[idx] = currentRowIndex;\n });\n }\n let hasDomRows = false;\n let inferredDomCols = 0;\n if (hasRoleRow) {\n for (const row of rows) {\n const rowLength = row.length;\n if (rowLength > inferredDomCols) {\n inferredDomCols = rowLength;\n }\n if (rowLength !== cols) {\n hasDomRows = true;\n }\n }\n }\n const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length;\n const verticalCols = inferredDomCols || cols;\n const navigateVertically = direction => {\n if (!hasDomRows || prevIndex === -1) {\n return undefined;\n }\n const currentRow = rowIndexMap[prevIndex];\n if (currentRow == null) {\n return undefined;\n }\n const colInRow = rows[currentRow].indexOf(prevIndex);\n const step = direction === 'up' ? -1 : 1;\n for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) {\n if (nextRow < 0 || nextRow >= rows.length) {\n if (!loopFocus || hasVirtualizedGaps) {\n return undefined;\n }\n nextRow = nextRow < 0 ? rows.length - 1 : 0;\n if (onLoop) {\n const clampedCol = Math.min(colInRow, rows[nextRow].length - 1);\n const targetItemIndex = rows[nextRow][clampedCol] ?? rows[nextRow][0];\n const returnedItemIndex = onLoop(event, prevIndex, targetItemIndex);\n nextRow = rowIndexMap[returnedItemIndex] ?? nextRow;\n }\n }\n const targetRow = rows[nextRow];\n for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {\n const candidate = targetRow[col];\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n const navigateVerticallyWithInferredRows = direction => {\n if (!hasVirtualizedGaps || prevIndex === -1) {\n return undefined;\n }\n const colInRow = prevIndex % verticalCols;\n const rowStep = direction === 'up' ? -verticalCols : verticalCols;\n const lastRowStart = maxIndex - maxIndex % verticalCols;\n const rowCount = floor(maxIndex / verticalCols) + 1;\n for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) {\n if (rowStart < 0 || rowStart > maxIndex) {\n if (!loopFocus) {\n return undefined;\n }\n rowStart = rowStart < 0 ? lastRowStart : 0;\n }\n const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);\n for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) {\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n if (stop) {\n stopEvent(event);\n }\n const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);\n if (verticalCandidate !== undefined) {\n nextIndex = verticalCandidate;\n } else if (prevIndex === -1) {\n nextIndex = verticalDirection === 'up' ? maxIndex : minIndex;\n } else {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n amount: verticalCols,\n decrement: verticalDirection === 'up',\n disabledIndices\n });\n if (loopFocus) {\n if (verticalDirection === 'up' && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {\n const col = prevIndex % verticalCols;\n const maxCol = maxIndex % verticalCols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n nextIndex = maxIndex;\n } else {\n nextIndex = maxCol > col ? offset : offset - verticalCols;\n }\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (verticalDirection === 'down' && prevIndex + verticalCols > maxIndex) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex % verticalCols - verticalCols,\n amount: verticalCols,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n }\n }\n if (isIndexOutOfListBounds(list, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = floor(prevIndex / cols);\n if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== cols - 1) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== 0) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n decrement: true,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n const lastRow = floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfListBounds(list, nextIndex)) {\n if (loopFocus && lastRow) {\n nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n } else {\n nextIndex = prevIndex;\n }\n }\n }\n return nextIndex;\n}\n\n/** For each cell index, gets the item index that occupies that cell */\nexport function createGridCellMap(sizes, cols, dense) {\n const cellMap = [];\n let startIndex = 0;\n sizes.forEach(({\n width,\n height\n }, index) => {\n if (width > cols) {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);\n }\n }\n let itemPlaced = false;\n if (dense) {\n startIndex = 0;\n }\n while (!itemPlaced) {\n const targetCells = [];\n for (let i = 0; i < width; i += 1) {\n for (let j = 0; j < height; j += 1) {\n targetCells.push(startIndex + i + j * cols);\n }\n }\n if (startIndex % cols + width <= cols && targetCells.every(cell => cellMap[cell] == null)) {\n targetCells.forEach(cell => {\n cellMap[cell] = index;\n });\n itemPlaced = true;\n } else {\n startIndex += 1;\n }\n }\n });\n\n // convert into a non-sparse array\n return [...cellMap];\n}\n\n/** Gets cell index of an item's corner or -1 when index is -1. */\nexport function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {\n if (index === -1) {\n return -1;\n }\n const firstCellIndex = cellMap.indexOf(index);\n const sizeItem = sizes[index];\n switch (corner) {\n case 'tl':\n return firstCellIndex;\n case 'tr':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + sizeItem.width - 1;\n case 'bl':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + (sizeItem.height - 1) * cols;\n case 'br':\n return cellMap.lastIndexOf(index);\n default:\n return -1;\n }\n}\n\n/** Gets all cell indices that correspond to the specified indices */\nexport function getGridCellIndices(indices, cellMap) {\n return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);\n}\nexport function isListIndexDisabled(list, index, disabledIndices) {\n const isExplicitlyDisabled = typeof disabledIndices === 'function' ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;\n if (isExplicitlyDisabled) {\n return true;\n }\n const element = list[index];\n if (!element) {\n return false;\n }\n if (!isElementVisible(element)) {\n return true;\n }\n\n // A natively disabled element can never receive focus, so it must always be\n // skipped, even when `disabledIndices` marks it as enabled. Only\n // `aria-disabled` items can be focusable-while-disabled.\n if (element.matches(':disabled')) {\n return true;\n }\n return !disabledIndices && (element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true');\n}\nexport function isHiddenByStyles(styles) {\n return styles.visibility === 'hidden' || styles.visibility === 'collapse';\n}\nexport function isElementVisible(element, styles = element ? getComputedStyle(element) : null) {\n if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {\n return false;\n }\n if (typeof element.checkVisibility === 'function') {\n return element.checkVisibility();\n }\n return styles.display !== 'none' && styles.display !== 'contents';\n}","import { getComputedStyle, getNodeName, isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { activeElement, contains } from \"./element.mjs\";\nimport { isElementVisible } from \"./composite.mjs\";\nconst CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]';\nfunction getParentElement(element) {\n const assignedSlot = element.assignedSlot;\n if (assignedSlot) {\n return assignedSlot;\n }\n if (element.parentElement) {\n return element.parentElement;\n }\n const rootNode = element.getRootNode();\n return isShadowRoot(rootNode) ? rootNode.host : null;\n}\nfunction getDetailsSummary(details) {\n for (const child of Array.from(details.children)) {\n if (getNodeName(child) === 'summary') {\n return child;\n }\n }\n return null;\n}\nfunction isWithinOpenDetailsSummary(element, details) {\n const summary = getDetailsSummary(details);\n return !!summary && (element === summary || contains(summary, element));\n}\nfunction isFocusableCandidate(element) {\n const nodeName = element ? getNodeName(element) : '';\n return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== 'summary' || element.parentElement != null && getNodeName(element.parentElement) === 'details' && getDetailsSummary(element.parentElement) === element) && (nodeName !== 'details' || getDetailsSummary(element) == null) && (nodeName !== 'input' || element.type !== 'hidden');\n}\nfunction isFocusableElement(element) {\n if (!isFocusableCandidate(element) || !element.isConnected || element.matches(':disabled')) {\n return false;\n }\n for (let current = element; current; current = getParentElement(current)) {\n const isAncestor = current !== element;\n const isSlot = getNodeName(current) === 'slot';\n if (current.hasAttribute('inert')) {\n return false;\n }\n if (isAncestor && getNodeName(current) === 'details' && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute('hidden') || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {\n return false;\n }\n }\n return true;\n}\nfunction isVisibleInTabbableTree(element, isAncestor) {\n const styles = getComputedStyle(element);\n if (!isAncestor) {\n return isElementVisible(element, styles);\n }\n return styles.display !== 'none';\n}\nfunction getTabIndex(element) {\n const tabIndex = element.tabIndex;\n if (tabIndex < 0) {\n const nodeName = getNodeName(element);\n if (nodeName === 'details' || nodeName === 'audio' || nodeName === 'video' || isHTMLElement(element) && element.isContentEditable) {\n return 0;\n }\n }\n return tabIndex;\n}\nfunction getNamedRadioInput(element) {\n if (getNodeName(element) !== 'input') {\n return null;\n }\n const input = element;\n return input.type === 'radio' && input.name !== '' ? input : null;\n}\nfunction isTabbableRadio(element, candidates) {\n const input = getNamedRadioInput(element);\n if (!input) {\n return true;\n }\n const checkedRadio = candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form && radio.checked;\n });\n if (checkedRadio) {\n return checkedRadio === input;\n }\n return candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form;\n }) === input;\n}\nfunction getComposedChildren(container) {\n if (isHTMLElement(container) && getNodeName(container) === 'slot') {\n const assignedElements = container.assignedElements({\n flatten: true\n });\n if (assignedElements.length > 0) {\n return assignedElements;\n }\n }\n if (isHTMLElement(container) && container.shadowRoot) {\n return Array.from(container.shadowRoot.children);\n }\n return Array.from(container.children);\n}\nfunction appendCandidates(container, list) {\n getComposedChildren(container).forEach(child => {\n if (isFocusableCandidate(child)) {\n list.push(child);\n }\n appendCandidates(child, list);\n });\n}\nfunction appendMatchingElements(container, selector, list) {\n getComposedChildren(container).forEach(child => {\n if (isHTMLElement(child) && child.matches(selector)) {\n list.push(child);\n }\n appendMatchingElements(child, selector, list);\n });\n}\nexport function isTabbable(element) {\n return isFocusableElement(element) && getTabIndex(element) >= 0;\n}\nexport function focusable(container) {\n const candidates = [];\n appendCandidates(container, candidates);\n return candidates.filter(isFocusableElement);\n}\nexport function tabbable(container) {\n const candidates = focusable(container);\n return candidates.filter(element => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));\n}\nfunction getTabbableIn(container, dir) {\n const list = tabbable(container);\n const len = list.length;\n if (len === 0) {\n return undefined;\n }\n const active = activeElement(ownerDocument(container));\n const index = list.indexOf(active);\n // eslint-disable-next-line no-nested-ternary\n const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;\n return list[nextIndex];\n}\nexport function getNextTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;\n}\nexport function getPreviousTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;\n}\nexport function getTabbableNearElement(referenceElement, direction, exclude) {\n if (!referenceElement) {\n return null;\n }\n\n // Keep the anchor's composed-tree position separate from the focusable radio candidates.\n const list = [];\n appendCandidates(ownerDocument(referenceElement).body, list);\n const index = list.indexOf(referenceElement);\n if (index === -1) {\n return null;\n }\n const candidates = list.filter(isFocusableElement);\n for (let offset = 1; offset < list.length; offset += 1) {\n const element = list[(index + direction * offset + list.length) % list.length];\n if (!contains(exclude, element) && isTabbable(element) && isTabbableRadio(element, candidates)) {\n return element;\n }\n }\n return list[index];\n}\nexport function isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nexport function disableFocusInside(container) {\n const tabbableElements = tabbable(container);\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nexport function enableFocusInside(container) {\n const elements = [];\n appendMatchingElements(container, '[data-tabindex]', elements);\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}","/* eslint-disable @typescript-eslint/no-loop-func */\n\nexport function getNodeChildren(nodes, id, onlyOpenChildren = true) {\n const directChildren = nodes.filter(node => node.parentId === id);\n return directChildren.flatMap(child => [...(!onlyOpenChildren || child.context?.open ? [child] : []), ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);\n}\nexport function getNodeAncestors(nodes, id) {\n let allAncestors = [];\n let currentParentId = nodes.find(node => node.id === id)?.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode?.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}","export function createAttribute(name) {\n return `data-base-ui-${name}`;\n}","import { NOOP } from '@base-ui/utils/empty';\nlet rafId = 0;\nexport function enqueueFocus(el, options = {}) {\n const {\n preventScroll = false,\n sync = false,\n shouldFocus\n } = options;\n cancelAnimationFrame(rafId);\n function exec() {\n if (shouldFocus && !shouldFocus()) {\n return;\n }\n el?.focus({\n preventScroll\n });\n }\n if (sync) {\n exec();\n return NOOP;\n }\n const currentRafId = requestAnimationFrame(exec);\n rafId = currentRafId;\n return () => {\n if (rafId === currentRafId) {\n cancelAnimationFrame(currentRafId);\n rafId = 0;\n }\n };\n}","// Modified to add conditional `aria-hidden` support:\n// https://github.com/theKashey/aria-hidden/blob/9220c8f4a4fd35f63bee5510a9f41a37264382d4/src/index.ts\nimport { getNodeName, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nconst markerName = 'data-base-ui-inert';\nlet ariaHiddenCounterMap = new WeakMap();\nlet uncontrolledElementsSet = new WeakSet();\nlet markerCounterMap = new WeakMap();\nlet lockCount = 0;\nfunction unwrapHost(node) {\n if (!node) {\n return null;\n }\n return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);\n}\nconst correctElements = (parent, targets) => targets.map(target => {\n if (parent.contains(target)) {\n return target;\n }\n const correctedTarget = unwrapHost(target);\n if (parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n return null;\n}).filter(x => x != null);\nconst buildKeepSet = targets => {\n const keep = new Set();\n targets.forEach(target => {\n let node = target;\n while (node && !keep.has(node)) {\n keep.add(node);\n node = node.parentNode;\n }\n });\n return keep;\n};\nconst collectOutsideElements = (root, keepElements, stopElements) => {\n const outside = [];\n const walk = parent => {\n if (!parent || stopElements.has(parent)) {\n return;\n }\n Array.from(parent.children).forEach(node => {\n if (getNodeName(node) === 'script') {\n return;\n }\n if (keepElements.has(node)) {\n walk(node);\n } else {\n outside.push(node);\n }\n });\n };\n walk(root);\n return outside;\n};\nfunction applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, {\n mark = true\n}) {\n const avoidElements = correctElements(body, uncorrectedAvoidElements);\n const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)) : [];\n const hiddenElements = [];\n const markedElements = [];\n if (ariaHidden) {\n const ariaLiveElements = correctElements(body, Array.from(body.querySelectorAll('[aria-live]')));\n const controlElements = avoidElements.concat(ariaLiveElements);\n const controlTargets = collectOutsideElements(body, buildKeepSet(controlElements), new Set(controlElements));\n controlTargets.forEach(node => {\n const attr = node.getAttribute('aria-hidden');\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (ariaHiddenCounterMap.get(node) || 0) + 1;\n ariaHiddenCounterMap.set(node, counterValue);\n hiddenElements.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledElementsSet.add(node);\n }\n if (!alreadyHidden) {\n node.setAttribute('aria-hidden', 'true');\n }\n });\n }\n if (mark) {\n markerTargets.forEach(node => {\n const markerValue = (markerCounterMap.get(node) || 0) + 1;\n markerCounterMap.set(node, markerValue);\n markedElements.push(node);\n if (markerValue === 1) {\n node.setAttribute(markerName, '');\n }\n });\n }\n lockCount += 1;\n return () => {\n hiddenElements.forEach(element => {\n const counterValue = (ariaHiddenCounterMap.get(element) || 0) - 1;\n ariaHiddenCounterMap.set(element, counterValue);\n if (!counterValue) {\n if (!uncontrolledElementsSet.has(element)) {\n element.removeAttribute('aria-hidden');\n }\n uncontrolledElementsSet.delete(element);\n }\n });\n if (mark) {\n markedElements.forEach(element => {\n const markerValue = (markerCounterMap.get(element) || 0) - 1;\n markerCounterMap.set(element, markerValue);\n if (!markerValue) {\n element.removeAttribute(markerName);\n }\n });\n }\n lockCount -= 1;\n if (!lockCount) {\n ariaHiddenCounterMap = new WeakMap();\n uncontrolledElementsSet = new WeakSet();\n markerCounterMap = new WeakMap();\n }\n };\n}\nexport function markOthers(avoidElements, options = {}) {\n const {\n ariaHidden = false,\n mark = true\n } = options;\n const body = ownerDocument(avoidElements[0]).body;\n return applyAttributeToOthers(avoidElements, body, ariaHidden, {\n mark\n });\n}","export const TYPEAHEAD_RESET_MS = 500;\nexport const PATIENT_CLICK_THRESHOLD = 500;\nexport const DISABLED_TRANSITIONS_STYLE = {\n style: {\n transition: 'none'\n }\n};\nexport const CLICK_TRIGGER_IDENTIFIER = 'data-base-ui-click-trigger';\nexport const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = 'data-base-ui-swipe-ignore';\nexport const LEGACY_SWIPE_IGNORE_ATTRIBUTE = 'data-swipe-ignore';\nexport const BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;\nexport const LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;\n\n/**\n * Used for dropdowns that usually strictly prefer top/bottom placements and\n * use `var(--available-height)` to limit their height.\n */\nexport const DROPDOWN_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'none'\n};\n\n/**\n * Used by regular popups that usually aren't scrollable and are allowed to\n * freely flip to any axis of placement.\n */\nexport const POPUP_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'end'\n};\n\n/**\n * Special visually hidden styles for the aria-owns owner element to ensure owned element\n * accessibility in iOS/Safari/VoiceControl.\n * The owner element is an empty span, so most of the common visually hidden styles are not needed.\n * @see https://github.com/floating-ui/floating-ui/issues/3403\n */\nexport const ownerVisuallyHidden = {\n clipPath: 'inset(50%)',\n position: 'fixed',\n top: 0,\n left: 0\n};","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isNode } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { enableFocusInside, disableFocusInside, getPreviousTabbable, getNextTabbable, isOutsideEvent } from \"../utils/tabbable.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ownerVisuallyHidden } from \"../../internals/constants.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") PortalContext.displayName = \"PortalContext\";\nexport const usePortalContext = () => React.useContext(PortalContext);\nconst attr = createAttribute('portal');\nexport function useFloatingPortalNode(props = {}) {\n const {\n ref,\n container: containerProp,\n componentProps = EMPTY_OBJECT,\n elementProps\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const parentPortalNode = portalContext?.portalNode;\n const [containerElement, setContainerElement] = React.useState(null);\n const [portalNode, setPortalNode] = React.useState(null);\n const setPortalNodeRef = useStableCallback(node => {\n if (node !== null) {\n // the useIsoLayoutEffect below watching containerProp / parentPortalNode\n // sets setPortalNode(null) when the container becomes null or changes.\n // So even though the ref callback now ignores null, the portal node still gets cleared.\n setPortalNode(node);\n }\n });\n const containerRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n // Wait for the container to be resolved if explicitly `null`.\n if (containerProp === null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;\n if (resolvedContainer == null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n if (containerRef.current !== resolvedContainer) {\n containerRef.current = resolvedContainer;\n setPortalNode(null);\n setContainerElement(resolvedContainer);\n }\n }, [containerProp, parentPortalNode]);\n const portalElement = useRenderElement('div', componentProps, {\n ref: [ref, setPortalNodeRef],\n props: [{\n id: uniqueId,\n [attr]: ''\n }, elementProps]\n });\n\n // This `createPortal` call injects `portalElement` into the `container`.\n // Another call inside `FloatingPortal`/`FloatingPortalLite` then injects the children into `portalElement`.\n const portalSubtree = containerElement && portalElement ? /*#__PURE__*/ReactDOM.createPortal(portalElement, containerElement) : null;\n return {\n node: portalNode,\n // `id` and `render` props can override or remove the generated ID. Use the exact\n // rendered value so `aria-owns` never points at an ID absent from the DOM.\n nodeId: /*#__PURE__*/React.isValidElement(portalElement) ? portalElement.props.id : undefined,\n subtree: portalSubtree\n };\n}\n\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n * @internal\n */\nexport const FloatingPortal = /*#__PURE__*/React.forwardRef(function FloatingPortal(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n container,\n portalOwnerRole,\n ...elementProps\n } = componentProps;\n const {\n node: portalNode,\n nodeId: portalNodeId,\n subtree: portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const focusInsideDisabledRef = React.useRef(false);\n const modal = focusManagerState?.modal;\n const open = focusManagerState?.open;\n const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || modal) {\n return undefined;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && event.relatedTarget && isOutsideEvent(event)) {\n if (event.type === 'focusin') {\n if (focusInsideDisabledRef.current) {\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }\n } else {\n disableFocusInside(portalNode);\n focusInsideDisabledRef.current = true;\n }\n }\n }\n\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n return mergeCleanups(addEventListener(portalNode, 'focusin', onFocus, true), addEventListener(portalNode, 'focusout', onFocus, true));\n }, [portalNode, modal]);\n useIsoLayoutEffect(() => {\n if (!portalNode || open !== true || !focusInsideDisabledRef.current) {\n return;\n }\n\n // Restore tabbability before the focus manager's queued focus-on-open step runs.\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }, [open, portalNode]);\n const portalContextValue = React.useMemo(() => ({\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [portalNode]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, /*#__PURE__*/_jsxs(PortalContext.Provider, {\n value: portalContextValue,\n children: [shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n beforeInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(\"span\", {\n role: portalOwnerRole,\n \"aria-owns\": portalNodeId,\n style: ownerVisuallyHidden\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n afterInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n if (focusManagerState?.closeOnFocusOut) {\n focusManagerState?.onOpenChange(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n }\n }\n }\n })]\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortal.displayName = \"FloatingPortal\";","export function createEventEmitter() {\n const map = new Map();\n return {\n emit(event, data) {\n map.get(event)?.forEach(listener => listener(data));\n },\n on(event, listener) {\n if (!map.has(event)) {\n map.set(event, new Set());\n }\n map.get(event).add(listener);\n },\n off(event, listener) {\n map.get(event)?.delete(listener);\n }\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FloatingTreeStore } from \"./FloatingTreeStore.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") FloatingNodeContext.displayName = \"FloatingNodeContext\";\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nif (process.env.NODE_ENV !== \"production\") FloatingTreeContext.displayName = \"FloatingTreeContext\";\nexport const useFloatingParentNodeId = () => React.useContext(FloatingNodeContext)?.id || null;\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nexport const useFloatingTree = externalTree => {\n const contextTree = React.useContext(FloatingTreeContext);\n return externalTree ?? contextTree;\n};\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nexport function useFloatingNodeId(externalTree) {\n const id = useId();\n const tree = useFloatingTree(externalTree);\n const parentId = useFloatingParentNodeId();\n useIsoLayoutEffect(() => {\n if (!id) {\n return undefined;\n }\n const node = {\n id,\n parentId\n };\n tree?.addNode(node);\n return () => {\n tree?.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/_jsx(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId]),\n children: children\n });\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingTree(props) {\n const {\n children,\n externalTree\n } = props;\n const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;\n return /*#__PURE__*/_jsx(FloatingTreeContext.Provider, {\n value: tree,\n children: children\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { getNodeName, isHTMLElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { platform } from '@base-ui/utils/platform';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { activeElement, closest, contains, getTarget, isTypeableCombobox, getFloatingFocusElement, isTypeableElement } from \"../utils/element.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\nimport { tabbable, focusable, isOutsideEvent, isTabbable, getNextTabbable, getPreviousTabbable } from \"../utils/tabbable.mjs\";\nimport { getNodeAncestors, getNodeChildren } from \"../utils/nodes.mjs\";\nimport { isElementVisible } from \"../utils/composite.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { markOthers } from \"../utils/markOthers.mjs\";\nimport { usePortalContext } from \"./FloatingPortal.mjs\";\nimport { useFloatingTree } from \"./FloatingTree.mjs\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../internals/constants.mjs\";\nimport { resolveRef } from \"../../utils/resolveRef.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction getEventType(event, lastInteractionType) {\n const win = ownerWindow(getTarget(event));\n if (event instanceof win.KeyboardEvent) {\n return 'keyboard';\n }\n if (event instanceof win.FocusEvent) {\n // Focus events can be caused by a preceding pointer interaction (e.g., focusout on outside press).\n // Prefer the last known pointer type if provided, else treat as keyboard.\n return lastInteractionType || 'keyboard';\n }\n if ('pointerType' in event) {\n // A trusted click without a pointerType is keyboard/AT; only synthesized\n // clicks (e.g. a test harness) pair an empty pointerType with a click count.\n return event.pointerType || (isVirtualClick(event) ? 'keyboard' : lastInteractionType || 'mouse');\n }\n if ('touches' in event) {\n return 'touch';\n }\n if (event instanceof win.MouseEvent) {\n // onClick events may not contain pointer events, and will fall through to here\n return lastInteractionType || (event.detail === 0 ? 'keyboard' : 'mouse');\n }\n return '';\n}\nconst LIST_LIMIT = 20;\nlet previouslyFocusedElements = [];\nfunction clearDisconnectedPreviouslyFocusedElements() {\n previouslyFocusedElements = previouslyFocusedElements.filter(entry => {\n return entry.deref()?.isConnected;\n });\n}\nfunction addPreviouslyFocusedElement(element) {\n clearDisconnectedPreviouslyFocusedElements();\n if (element && getNodeName(element) !== 'body') {\n previouslyFocusedElements.push(new WeakRef(element));\n if (previouslyFocusedElements.length > LIST_LIMIT) {\n previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);\n }\n }\n}\nfunction getPreviouslyFocusedElement() {\n clearDisconnectedPreviouslyFocusedElements();\n return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();\n}\nfunction getFirstTabbableElement(container) {\n if (!container) {\n return null;\n }\n if (isTabbable(container)) {\n return container;\n }\n return tabbable(container)[0] || container;\n}\nfunction handleTabIndex(floatingFocusElement) {\n if (floatingFocusElement.hasAttribute('tabindex') && !floatingFocusElement.hasAttribute('data-tabindex')) {\n return;\n }\n if (!floatingFocusElement.getAttribute('role')?.includes('dialog')) {\n return;\n }\n const focusableElements = focusable(floatingFocusElement);\n const tabbableContent = focusableElements.filter(element => {\n const dataTabIndex = element.getAttribute('data-tabindex') || '';\n return isTabbable(element) || element.hasAttribute('data-tabindex') && !dataTabIndex.startsWith('-');\n });\n const tabIndex = floatingFocusElement.getAttribute('tabindex');\n if (tabbableContent.length === 0) {\n if (tabIndex !== '0') {\n floatingFocusElement.setAttribute('tabindex', '0');\n // Mark our own write so the externally-managed early-return above doesn't\n // mistake it for a user-authored `tabindex` and freeze management.\n floatingFocusElement.setAttribute('data-tabindex', '0');\n }\n } else if (tabIndex !== '-1' || floatingFocusElement.hasAttribute('data-tabindex') && floatingFocusElement.getAttribute('data-tabindex') !== '-1') {\n floatingFocusElement.setAttribute('tabindex', '-1');\n floatingFocusElement.setAttribute('data-tabindex', '-1');\n }\n}\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n * @internal\n */\nexport function FloatingFocusManager(props) {\n const {\n context: store,\n children,\n disabled = false,\n initialFocus = true,\n returnFocus = true,\n explicitReturnFocus,\n restoreFocus = false,\n modal = true,\n closeOnFocusOut = true,\n openInteractionType = '',\n nextFocusableElement,\n previousFocusableElement,\n beforeContentFocusGuardRef,\n externalTree,\n getInsideElements\n } = props;\n const open = store.useState('open');\n const domReference = store.useState('domReferenceElement');\n const floating = store.useState('floatingElement');\n const {\n events,\n dataRef\n } = store.context;\n const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);\n const ignoreInitialFocus = initialFocus === false;\n // A typeable combobox reference (e.g. input/textarea) with `initialFocus={false}`\n // has different focus semantics: focus is not trapped inside the floating element,\n // so in the modal case the guards are not rendered, but `aria-hidden` is still\n // applied to the outside nodes.\n const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;\n const initialFocusRef = useValueAsRef(initialFocus);\n const returnFocusRef = useValueAsRef(returnFocus);\n // Read through a ref so a mid-open change can't re-run the return-focus effect, whose cleanup\n // would move focus while the floating element is still open.\n const explicitReturnFocusRef = useValueAsRef(explicitReturnFocus);\n const openInteractionTypeRef = useValueAsRef(openInteractionType);\n const openRef = useValueAsRef(open);\n const tree = useFloatingTree(externalTree);\n const portalContext = usePortalContext();\n const preventReturnFocusRef = React.useRef(false);\n const isPointerDownRef = React.useRef(false);\n const pointerDownOutsideRef = React.useRef(false);\n const lastFocusedTabbableRef = React.useRef(null);\n const closeTypeRef = React.useRef('');\n const lastInteractionTypeRef = React.useRef('');\n const beforeGuardRef = React.useRef(null);\n const afterGuardRef = React.useRef(null);\n const mergedBeforeGuardRef = useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);\n const mergedAfterGuardRef = useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);\n const blurTimeout = useTimeout();\n const pointerDownTimeout = useTimeout();\n const restoreFocusFrame = useAnimationFrame();\n const isInsidePortal = portalContext != null;\n const floatingFocusElement = getFloatingFocusElement(floating);\n const getTabbableContent = useStableCallback((container = floatingFocusElement) => {\n return container ? tabbable(container) : [];\n });\n const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter(element => element != null) ?? []);\n\n // Prevent Tab from escaping the modal when there are no tabbable elements.\n React.useEffect(() => {\n if (disabled || !modal) {\n return undefined;\n }\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {\n stopEvent(event);\n }\n }\n }\n const doc = ownerDocument(floatingFocusElement);\n return addEventListener(doc, 'keydown', onKeyDown);\n }, [disabled, floatingFocusElement, modal, isUntrappedTypeableCombobox, getTabbableContent]);\n\n // Track pointer/keyboard interactions to disambiguate focus and outside presses.\n React.useEffect(() => {\n if (disabled || !open) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n function clearPointerDownOutside() {\n pointerDownOutsideRef.current = false;\n }\n function onPointerDown(event) {\n const target = getTarget(event);\n const insideElements = getResolvedInsideElements();\n const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target) || insideElements.some(element => element === target || contains(element, target));\n pointerDownOutsideRef.current = !pointerTargetInside;\n lastInteractionTypeRef.current = event.pointerType || 'keyboard';\n if (closest(target, `[${CLICK_TRIGGER_IDENTIFIER}]`)) {\n isPointerDownRef.current = true;\n // Reset on the next tick so a single click on a click-trigger doesn't\n // permanently suppress focus-out closing for the lifetime of the instance.\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n }\n function onKeyDown() {\n lastInteractionTypeRef.current = 'keyboard';\n }\n return mergeCleanups(addEventListener(doc, 'pointerdown', onPointerDown, true), addEventListener(doc, 'pointerup', clearPointerDownOutside, true), addEventListener(doc, 'pointercancel', clearPointerDownOutside, true), addEventListener(doc, 'keydown', onKeyDown, true),\n // Avoid a stale `true` leaking into the next open (e.g. keep-mounted popups)\n // if the popup dismissed between pointerdown and pointerup.\n clearPointerDownOutside);\n }, [disabled, floating, domReference, floatingFocusElement, open, portalContext, pointerDownTimeout, getResolvedInsideElements]);\n\n // Close on focus out and restore focus within the floating tree when needed.\n React.useEffect(() => {\n if (disabled || !closeOnFocusOut) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusIn(event) {\n const target = getTarget(event);\n if (isTabbable(target)) {\n lastFocusedTabbableRef.current = target;\n }\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n const currentTarget = event.currentTarget;\n const target = getTarget(event);\n\n // When focus is lost to the body (e.g. on a backdrop press), record the element that\n // had focus so a confirmation dialog opened while the body is focused can return focus\n // to it. Scoped to `modal` to avoid non-modal popups polluting the shared stack.\n if (modal && relatedTarget == null && target != null && contains(floating, target)) {\n addPreviouslyFocusedElement(target);\n }\n queueMicrotask(() => {\n const nodeId = getNodeId();\n const triggers = store.context.triggerElements;\n const insideElements = getResolvedInsideElements();\n const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute('focus-guard')) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement)].includes(relatedTarget);\n const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some(element => element === relatedTarget || contains(element, relatedTarget)) || triggers.hasMatchingElement(trigger => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find(node => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find(node => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));\n if (currentTarget === domReference && floatingFocusElement) {\n handleTabIndex(floatingFocusElement);\n }\n\n // Restore focus to the previously focused tabbable element to prevent\n // focus from being lost outside the floating tree.\n if (restoreFocus && currentTarget !== domReference && !isElementVisible(target) && activeElement(doc) === doc.body) {\n // Let `FloatingPortal` effect knows that focus is still inside the\n // floating tree.\n if (isHTMLElement(floatingFocusElement)) {\n floatingFocusElement.focus();\n // If explicitly requested to restore focus to the popup container, do not search\n // for the next/previous tabbable element.\n if (restoreFocus === 'popup') {\n // If the focused element is removed on pointerdown, the browser\n // tries to move focus to it right after the `.focus()` call above,\n // but because it's removed in the same tick, focus is lost instead.\n // Re-focusing asynchronously (next frame) wins that race.\n restoreFocusFrame.request(() => {\n floatingFocusElement.focus();\n });\n return;\n }\n }\n const tabbableContent = getTabbableContent();\n const prevTabbable = lastFocusedTabbableRef.current;\n const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;\n if (isHTMLElement(nodeToFocus)) {\n nodeToFocus.focus();\n }\n }\n\n // https://github.com/floating-ui/floating-ui/issues/3060\n if (dataRef.current.insideReactTree) {\n dataRef.current.insideReactTree = false;\n return;\n }\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && (\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n // For an \"untrapped\" typeable combobox (input role=combobox with\n // initialFocus=false), re-opening the popup and tabbing out should still close it even\n // when the previously focused element (e.g. the next tabbable outside the popup) is\n // focused again. Otherwise, the popup remains open on the second Tab sequence:\n // click input -> Tab (closes) -> click input -> Tab.\n // Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.\n isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {\n preventReturnFocusRef.current = true;\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event));\n }\n });\n }\n function markInsideReactTree() {\n if (pointerDownOutsideRef.current) {\n return;\n }\n dataRef.current.insideReactTree = true;\n blurTimeout.start(0, () => {\n dataRef.current.insideReactTree = false;\n });\n }\n const domReferenceElement = isHTMLElement(domReference) ? domReference : null;\n if (!floating && !domReferenceElement) {\n return undefined;\n }\n return mergeCleanups(domReferenceElement && addEventListener(domReferenceElement, 'focusout', handleFocusOutside), domReferenceElement && addEventListener(domReferenceElement, 'pointerdown', handlePointerDown), floating && addEventListener(floating, 'focusin', handleFocusIn), floating && addEventListener(floating, 'focusout', handleFocusOutside), floating && portalContext && addEventListener(floating, 'focusout', markInsideReactTree, true));\n }, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Hide everything outside the floating tree from assistive tech while open.\n React.useEffect(() => {\n if (disabled || !floating || !open) {\n return undefined;\n }\n\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute('portal')}]`) || []);\n const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];\n const rootAncestorComboboxDomReference = ancestors.find(node => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;\n const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];\n const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);\n const ariaHiddenCleanup = markOthers(insideElements, {\n ariaHidden: modal || isUntrappedTypeableCombobox,\n mark: false\n });\n const markerInsideElements = [floating, ...portalNodes].filter(x => x != null);\n const markerCleanup = markOthers(markerInsideElements);\n return () => {\n markerCleanup();\n ariaHiddenCleanup();\n };\n }, [open, disabled, domReference, floating, modal, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Focus the initial element when the floating element opens.\n useIsoLayoutEffect(() => {\n if (!open || disabled || !isHTMLElement(floatingFocusElement)) {\n return;\n }\n closeTypeRef.current = '';\n lastInteractionTypeRef.current = '';\n const doc = ownerDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n\n // Wait for any layout effect state setters to execute to set `tabIndex`.\n queueMicrotask(() => {\n const initialFocusValueOrFn = initialFocusRef.current;\n const resolvedInitialFocus = typeof initialFocusValueOrFn === 'function' ? initialFocusValueOrFn(openInteractionTypeRef.current || '') : initialFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedInitialFocus === undefined || resolvedInitialFocus === false) {\n return;\n }\n const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);\n if (focusAlreadyInsideFloatingEl) {\n return;\n }\n let focusableElements = null;\n const getDefaultFocusElement = () => {\n if (focusableElements == null) {\n focusableElements = getTabbableContent(floatingFocusElement);\n }\n return focusableElements[0] || floatingFocusElement;\n };\n let elToFocus;\n if (resolvedInitialFocus === true || resolvedInitialFocus === null) {\n elToFocus = getDefaultFocusElement();\n } else {\n elToFocus = resolveRef(resolvedInitialFocus);\n }\n elToFocus = elToFocus || getDefaultFocusElement();\n const hadFocusInside = contains(floatingFocusElement, activeElement(doc));\n\n // Screen readers re-sync focus to their cursor right after a synthesized press. A focus\n // that lands a frame later reads as a stray move and gets pulled back to the reference.\n const openEvent = dataRef.current.openEvent;\n const openedByVirtualPress = openEvent?.type === 'mousedown' && isVirtualClick(openEvent);\n\n // enqueueFocus returns a rAF-cancel function; we intentionally don't cancel this focus.\n void enqueueFocus(elToFocus, {\n sync: openedByVirtualPress,\n preventScroll: elToFocus === floatingFocusElement,\n shouldFocus() {\n // If the floating element has closed before this runs — e.g. tabbing out of a\n // kept-mounted popup — don't pull focus back onto the initial element after it has\n // legitimately moved elsewhere.\n if (!openRef.current) {\n return false;\n }\n if (hadFocusInside) {\n return true;\n }\n const currentActiveElement = activeElement(doc);\n const focusMovedInside = currentActiveElement !== elToFocus && contains(floatingFocusElement, currentActiveElement);\n return !focusMovedInside;\n }\n });\n });\n }, [disabled, open, floatingFocusElement, getTabbableContent, initialFocusRef, openInteractionTypeRef, openRef, dataRef]);\n\n // A return-focus queued by the effect cleanup. If the effect re-arms in the same commit, a\n // dependency changed while the popup stayed open, so the cleanup was not a close.\n const pendingReturnFocusRef = React.useRef(null);\n\n // Track return focus targets and restore focus on unmount/close.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n pendingReturnFocusRef.current = null;\n return undefined;\n }\n if (pendingReturnFocusRef.current) {\n pendingReturnFocusRef.current.cancelled = true;\n pendingReturnFocusRef.current = null;\n }\n const doc = ownerDocument(floatingFocusElement);\n const elementFocusedBeforeOpen = activeElement(doc);\n // Only an explicit `null` interaction type represents a programmatic open.\n // `undefined` is normalized to `''` by the prop default, so it never reaches\n // here as nullish and is intentionally not treated as programmatic.\n const preferPreviousFocus = openInteractionTypeRef.current == null;\n addPreviouslyFocusedElement(elementFocusedBeforeOpen);\n function onOpenChangeLocal(details) {\n if (!details.open) {\n closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);\n }\n\n // Focus guards transfer focus themselves; other close handlers may still need return focus.\n if (details.reason === REASONS.focusOut && details.triggerElement?.hasAttribute(createAttribute('focus-guard')) || details.reason === REASONS.triggerHover && details.nativeEvent.type === 'mouseleave') {\n preventReturnFocusRef.current = true;\n }\n if (details.reason !== REASONS.outsidePress) {\n return;\n }\n if (details.nested) {\n preventReturnFocusRef.current = false;\n } else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) {\n preventReturnFocusRef.current = false;\n } else {\n // On outside press, only return focus to the reference when the browser supports the\n // `focus({ preventScroll })` option; without it, restoring focus scrolls the page.\n // Chrome on Android and Samsung Internet still don't support `preventScroll`\n // (https://issues.chromium.org/issues/41453122), so the runtime check keeps return\n // focus disabled there to avoid the scroll jump.\n let isPreventScrollSupported = false;\n ownerDocument(floatingFocusElement).createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n if (isPreventScrollSupported) {\n preventReturnFocusRef.current = false;\n } else {\n preventReturnFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChangeLocal);\n function getReturnElement(closeType) {\n const returnFocusValueOrFn = returnFocusRef.current;\n let resolvedReturnFocusValue = typeof returnFocusValueOrFn === 'function' ? returnFocusValueOrFn(closeType) : returnFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedReturnFocusValue === undefined || resolvedReturnFocusValue === false) {\n return null;\n }\n if (resolvedReturnFocusValue === null) {\n resolvedReturnFocusValue = true;\n }\n const referenceReturnElement = domReference?.isConnected ? domReference : null;\n const previousReturnElement = elementFocusedBeforeOpen?.isConnected && getNodeName(elementFocusedBeforeOpen) !== 'body' ? elementFocusedBeforeOpen : null;\n let defaultReturnElement = preferPreviousFocus ? previousReturnElement || referenceReturnElement : referenceReturnElement || previousReturnElement;\n if (!defaultReturnElement) {\n defaultReturnElement = getPreviouslyFocusedElement() || null;\n }\n if (typeof resolvedReturnFocusValue === 'boolean') {\n return defaultReturnElement;\n }\n return resolveRef(resolvedReturnFocusValue) || defaultReturnElement || null;\n }\n return () => {\n events.off('openchange', onOpenChangeLocal);\n const activeEl = activeElement(doc);\n const insideElements = getResolvedInsideElements();\n const isFocusInsideFloatingTree = contains(floating, activeEl) || insideElements.some(element => element === activeEl || contains(element, activeEl)) || tree && getNodeChildren(tree.nodesRef.current, getNodeId(), false).some(node => contains(node.context?.elements.floating, activeEl));\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const returnFocusValueOrFn = returnFocusRef.current;\n const closeType = closeTypeRef.current;\n const returnElement = getReturnElement(closeType);\n const job = {\n cancelled: false\n };\n pendingReturnFocusRef.current = job;\n queueMicrotask(() => {\n if (pendingReturnFocusRef.current === job) {\n pendingReturnFocusRef.current = null;\n }\n // `returnElement` if it is tabbable, otherwise its first tabbable child,\n // otherwise `returnElement` itself (which may not be tabbable at all).\n const tabbableReturnElement = getFirstTabbableElement(returnElement);\n // Read in the cleanup on purpose: the latest `explicitReturnFocus` decides.\n const hasExplicitReturnFocus =\n // eslint-disable-next-line react-hooks/exhaustive-deps\n explicitReturnFocusRef.current ?? typeof returnFocusValueOrFn !== 'boolean';\n if (!job.cancelled && returnFocusValueOrFn && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && (\n // If the focus moved somewhere else after mount, avoid returning focus\n // since it likely entered a different element which should be\n // respected: https://github.com/floating-ui/floating-ui/issues/2607\n !hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {\n const focusOptions = {\n preventScroll: true\n };\n if (closeType === 'keyboard') {\n focusOptions.focusVisible = true;\n }\n tabbableReturnElement.focus(focusOptions);\n }\n\n // A cancelled return must also clear suppression before the next close.\n preventReturnFocusRef.current = false;\n });\n };\n }, [disabled, floating, floatingFocusElement, returnFocusRef, explicitReturnFocusRef, openInteractionTypeRef, events, tree, domReference, getNodeId, getResolvedInsideElements]);\n\n // Safari may randomly scroll to the bottom of the page if an input inside a popup has focus\n // when the popup unmounts from the DOM.\n // By blurring it before the popup unmounts, we can prevent this behavior.\n useIsoLayoutEffect(() => {\n if (!platform.engine.webkit || open || !floating) {\n return;\n }\n const activeEl = activeElement(ownerDocument(floating));\n if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {\n return;\n }\n if (contains(floating, activeEl)) {\n activeEl.blur();\n }\n }, [open, floating]);\n\n // Synchronize the focus manager state (modal, closeOnFocusOut, open, etc.) to the\n // FloatingPortal context, which uses it to decide whether to render its own guards.\n useIsoLayoutEffect(() => {\n if (disabled || !portalContext) {\n return undefined;\n }\n portalContext.setFocusManagerState({\n modal,\n closeOnFocusOut,\n open,\n onOpenChange: store.setOpen,\n domReference\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [disabled, portalContext, modal, open, store, closeOnFocusOut, domReference]);\n\n // Keep the floating element tabIndex in sync and clear stale focus records.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n return undefined;\n }\n handleTabIndex(floatingFocusElement);\n return () => {\n queueMicrotask(clearDisconnectedPreviouslyFocusedElements);\n };\n }, [disabled, floatingFocusElement]);\n const shouldRenderGuards = !disabled && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedBeforeGuardRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableContent();\n // enqueueFocus returns a rAF-cancel function we don't need here.\n void enqueueFocus(els[els.length - 1]);\n } else if (portalContext?.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n } else {\n resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();\n }\n }\n }\n }), children, shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedAfterGuardRef,\n onFocus: event => {\n if (modal) {\n // enqueueFocus returns a rAF-cancel function we don't need here.\n void enqueueFocus(getTabbableContent()[0]);\n } else if (portalContext?.portalNode) {\n if (closeOnFocusOut) {\n preventReturnFocusRef.current = true;\n }\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n } else {\n resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();\n }\n }\n }\n })]\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getTarget, isTypeableElement } from \"../utils/element.mjs\";\nimport { isMouseLikePointerType, isVirtualPointerEvent } from \"../utils/event.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nexport function useClick(store, props = {}) {\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n stickIfOpen = true,\n touchOpenDelay = 0,\n reason = REASONS.triggerPress\n } = props;\n const dataRef = store.context.dataRef;\n const pointerTypeRef = React.useRef(undefined);\n const frame = useAnimationFrame();\n const touchOpenTimeout = useTimeout();\n const reference = React.useMemo(() => {\n function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {\n const details = createChangeEventDetails(reason, nativeEvent, target);\n if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {\n touchOpenTimeout.start(touchOpenDelay, () => {\n store.setOpen(true, details);\n });\n } else {\n store.setOpen(nextOpen, details);\n }\n }\n function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {\n const openEvent = dataRef.current.openEvent;\n const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== currentTarget;\n if (open && hasClickedOnInactiveTrigger) {\n // Moving between triggers should always open the newly active one.\n return true;\n }\n if (!open) {\n // A closed popup should open on the next press.\n return true;\n }\n if (!toggle) {\n // Non-toggle mode never closes on a repeated trigger press.\n return true;\n }\n if (openEvent && (typeof stickIfOpen === 'function' ? stickIfOpen() : stickIfOpen)) {\n // Preserve hover/focus-opened popups until the matching click-like event closes them.\n return !isClickLikeOpenEvent(openEvent.type);\n }\n\n // Otherwise, a repeated click toggles the popup closed.\n return false;\n }\n return {\n onPointerDown(event) {\n // Screen reader activations (Android TalkBack, desktop screen readers) report a\n // mouse-like `pointerType`, but `ignoreMouse` must not drop them: hover logic cannot\n // open for a virtual press since there is no real pointer movement to wait for.\n // Virtual `touch` presses (iOS VoiceOver) keep their type so `touchOpenDelay` applies.\n pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? 'virtual' : event.pointerType;\n },\n onMouseDown(event) {\n const pointerType = pointerTypeRef.current;\n const nativeEvent = event.nativeEvent;\n const open = store.select('open');\n\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0 || eventOption === 'click' || isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const nextOpen = getNextOpen(open, event.currentTarget, openEventType => openEventType === 'click' || openEventType === 'mousedown');\n\n // Animations sometimes won't run on a typeable element if using a rAF.\n // Focus is always set on these elements. For touch, we may delay opening.\n // A screen reader press opens synchronously, so the popup's focus lands before the reader\n // re-syncs focus to its cursor, which would otherwise read as a stray move.\n const target = getTarget(nativeEvent);\n const isTypeable = isTypeableElement(target);\n if (isTypeable || pointerType === 'virtual') {\n // A virtual press may target a descendant of the trigger; the trigger is what opened.\n setOpenWithTouchDelay(nextOpen, nativeEvent, isTypeable ? target : event.currentTarget, pointerType);\n return;\n }\n\n // Capture the currentTarget before the rAF.\n // as React sets it to null after the event handler completes.\n const eventCurrentTarget = event.currentTarget;\n\n // Wait until focus is set on the element. This is an alternative to\n // `event.preventDefault()` to avoid :focus-visible from appearing when using a pointer.\n frame.request(() => {\n setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);\n });\n },\n onClick(event) {\n if (eventOption === 'mousedown-only') {\n return;\n }\n const pointerType = pointerTypeRef.current;\n if (eventOption === 'mousedown' && pointerType) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const open = store.select('open');\n const nextOpen = getNextOpen(open, event.currentTarget, openEventType => openEventType === 'click' || openEventType === 'mousedown' || openEventType === 'keydown' || openEventType === 'keyup');\n setOpenWithTouchDelay(nextOpen, event.nativeEvent, event.currentTarget, pointerType);\n },\n onKeyDown() {\n pointerTypeRef.current = undefined;\n }\n };\n }, [dataRef, eventOption, ignoreMouse, reason, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay]);\n return React.useMemo(() => enabled ? {\n reference\n } : EMPTY_OBJECT, [enabled, reference]);\n}","'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { Timeout, useTimeout } from '@base-ui/utils/useTimeout';\nimport { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isShadowRoot } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { contains, getTarget, isEventTargetWithin, isRootElement } from \"../utils/element.mjs\";\nimport { isReactEvent, isVirtualClick } from \"../utils/event.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nfunction alwaysFalse() {\n return false;\n}\nexport function normalizeProp(normalizable) {\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : normalizable?.escapeKey ?? false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : normalizable?.outsidePress ?? true\n };\n}\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nexport function useDismiss(store, props = {}) {\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: outsidePressProp = true,\n outsidePressEvent = 'sloppy',\n referencePress = alwaysFalse,\n bubbles,\n externalTree\n } = props;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const {\n dataRef,\n events\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);\n const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;\n const outsidePressEnabled = outsidePress !== false;\n const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const pressStartedInsideRef = React.useRef(false);\n const pressStartPreventedRef = React.useRef(false);\n // Ignore only the very next outside click after dragging from inside to outside.\n const suppressNextOutsideClickRef = React.useRef(false);\n // A click whose press began before the floating element opened is the tail of that\n // gesture (e.g. the drag-release that opened it), not a new outside press.\n const sawPressWhileOpenRef = React.useRef(false);\n const isComposingRef = React.useRef(false);\n const currentPointerTypeRef = React.useRef('');\n const touchStateRef = React.useRef(null);\n const cancelDismissOnEndTimeout = useTimeout();\n const clearInsideReactTreeTimeout = useTimeout();\n // Outlives effect re-runs so a pending reset can't leave `isComposingRef` stuck.\n const compositionTimeout = useTimeout();\n const clearInsideReactTree = useStableCallback(() => {\n clearInsideReactTreeTimeout.clear();\n dataRef.current.insideReactTree = false;\n });\n const hasBlockingChild = useStableCallback(bubbleKey => {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n return children.some(child => child.context?.open && !child.context.dataRef.current[bubbleKey]);\n });\n const isEventWithinOwnElements = useStableCallback(event => {\n return isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'));\n });\n const closeOnReferencePress = useStableCallback(event => {\n if (!referencePress()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n });\n const closeOnEscapeKeyDown = useStableCallback(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n const native = isReactEvent(event) ? event.nativeEvent : event;\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element. The ref covers Safari, which fires\n // `compositionend` before `keydown`; `isComposing` covers compositions that began while closed.\n if (isComposingRef.current || native.isComposing) {\n return;\n }\n if (!escapeKeyBubbles && hasBlockingChild('__escapeKeyBubbles')) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.escapeKey, native);\n store.setOpen(false, eventDetails);\n if (!eventDetails.isCanceled) {\n event.preventDefault();\n }\n if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n });\n const markInsideReactTree = useStableCallback(() => {\n dataRef.current.insideReactTree = true;\n clearInsideReactTreeTimeout.start(0, clearInsideReactTree);\n });\n const markPressStartedInsideReactTree = useStableCallback(event => {\n if (!open || !enabled || event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n\n // Only treat presses that start within the floating DOM subtree as inside.\n // This avoids suppressing parent dismissal when interacting with nested portals.\n if (!contains(store.select('floatingElement'), target)) {\n return;\n }\n if (!pressStartedInsideRef.current) {\n pressStartedInsideRef.current = true;\n pressStartPreventedRef.current = false;\n }\n });\n const markInsidePressStartPrevented = useStableCallback(event => {\n if (!open || !enabled) {\n return;\n }\n if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n return;\n }\n if (pressStartedInsideRef.current) {\n pressStartPreventedRef.current = true;\n }\n });\n\n // A same-batch close+reopen never renders `open === false`, so only `openchange` can\n // observe that session boundary. The effect below covers controlled flips.\n React.useEffect(() => {\n function handleOpenChange(details) {\n // Only the closing half ends the session: `setOpen(true)` on an already-open\n // element (hovering an inactive trigger) must not drop a press mid-gesture.\n if (!details.open) {\n sawPressWhileOpenRef.current = false;\n }\n }\n events.on('openchange', handleOpenChange);\n return () => {\n events.off('openchange', handleOpenChange);\n };\n }, [events]);\n\n // Not cleared in the listener effect's cleanup, which can run mid-press when a dependency\n // changes. In a closed shadow root, the marker is the only inside-press signal.\n React.useEffect(() => clearInsideReactTree, [clearInsideReactTree]);\n React.useEffect(() => {\n if (!open || !enabled) {\n // Reset in the effect body, not the cleanup, which also runs when a dependency\n // changes mid-gesture.\n if (!open) {\n sawPressWhileOpenRef.current = false;\n isComposingRef.current = false;\n currentPointerTypeRef.current = '';\n touchStateRef.current = null;\n }\n return clearInsideReactTree;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n const preventedPressSuppressionTimeout = new Timeout();\n const doc = ownerDocument(floatingElement);\n function handleCompositionStart() {\n compositionTimeout.clear();\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`. Set it here too, since closing\n // resets it while a composition can continue into the next open session.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n isComposingRef.current = true;\n compositionTimeout.start(\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n platform.engine.webkit ? 5 : 0, () => {\n isComposingRef.current = false;\n });\n }\n function suppressImmediateOutsideClickAfterPreventedStart() {\n suppressNextOutsideClickRef.current = true;\n // Firefox can emit the synthetic outside click in a later task after\n // pointer lock exit, so microtask clearing is too early here.\n preventedPressSuppressionTimeout.start(0, () => {\n suppressNextOutsideClickRef.current = false;\n });\n }\n function resetPressStartState() {\n pressStartedInsideRef.current = false;\n pressStartPreventedRef.current = false;\n }\n function getOutsidePressEvent() {\n const type = currentPointerTypeRef.current;\n const computedType = type === 'pen' || !type ? 'mouse' : type;\n const outsidePressEventValue = getOutsidePressEventProp();\n const resolved = typeof outsidePressEventValue === 'function' ? outsidePressEventValue() : outsidePressEventValue;\n if (typeof resolved === 'string') {\n return resolved;\n }\n return resolved[computedType];\n }\n function shouldIgnoreEvent(event) {\n const computedOutsidePressEvent = getOutsidePressEvent();\n return computedOutsidePressEvent === 'intentional' && event.type !== 'click' || computedOutsidePressEvent === 'sloppy' && event.type === 'click';\n }\n function isEventWithinFloatingTree(event) {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some(node => isEventTargetWithin(event, node.context?.elements.floating));\n return isEventWithinOwnElements(event) || targetIsInsideChildren;\n }\n function closeOnPressOutside(event) {\n if (shouldIgnoreEvent(event)) {\n // A new press began outside the floating element and its trigger. Clear any\n // leftover drag-out suppression so this press's eventual click can dismiss.\n if (event.type !== 'click' && !isEventWithinOwnElements(event)) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n }\n clearInsideReactTree();\n return;\n }\n if (dataRef.current.insideReactTree) {\n clearInsideReactTree();\n return;\n }\n const target = getTarget(event);\n const inertSelector = `[${createAttribute('inert')}]`;\n const targetRoot = isElement(target) ? target.getRootNode() : null;\n const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));\n const triggers = store.context.triggerElements;\n\n // If another trigger is clicked, don't close the floating element.\n if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {\n return;\n }\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, store.select('floatingElement')) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n markers.every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n // Skip for touch events: scrollbars don't receive touch events on most platforms\n if (isHTMLElement(target) && !('touches' in event)) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // Only `click` events reach this point in intentional mode.\n if (getOutsidePressEvent() === 'intentional') {\n // Press-less clicks (keyboard, assistive technology, `element.click()`) report no\n // click count; `isVirtualClick` also catches the ones that do.\n if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) {\n return;\n }\n\n // A press that starts inside and ends outside gets one suppressed\n // outside click. Run this after inside-target checks so inside clicks\n // don't consume the one-shot suppression.\n if (suppressNextOutsideClickRef.current) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n return;\n }\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n if (hasBlockingChild('__outsidePressBubbles')) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.outsidePress, event));\n clearInsideReactTree();\n }\n function handlePointerDown(event) {\n if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n closeOnPressOutside(event);\n }\n function handleTouchStart(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (touch) {\n touchStateRef.current = {\n startTime: Date.now(),\n startX: touch.clientX,\n startY: touch.clientY,\n dismissOnTouchEnd: false,\n dismissOnMouseDown: true\n };\n cancelDismissOnEndTimeout.start(1000, () => {\n if (touchStateRef.current) {\n touchStateRef.current.dismissOnTouchEnd = false;\n touchStateRef.current.dismissOnMouseDown = false;\n }\n });\n }\n }\n function addTargetEventListenerOnce(event, listener) {\n const target = getTarget(event);\n if (!target) {\n return;\n }\n const unsubscribe = addEventListener(target, event.type, () => {\n listener(event);\n unsubscribe();\n });\n }\n function handleTouchStartCapture(event) {\n currentPointerTypeRef.current = 'touch';\n addTargetEventListenerOnce(event, handleTouchStart);\n }\n function closeOnPressOutsideCapture(event) {\n cancelDismissOnEndTimeout.clear();\n\n // Only `pointerdown` marks a press; `mousedown` is its compatibility event, and\n // counting it would misattribute a gesture that started before open.\n if (event.type === 'pointerdown') {\n // Only a primary press can produce a `click`.\n if (event.button === 0) {\n sawPressWhileOpenRef.current = true;\n }\n currentPointerTypeRef.current = event.pointerType;\n }\n if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {\n return;\n }\n addTargetEventListenerOnce(event, targetEvent => {\n if (targetEvent.type === 'pointerdown') {\n handlePointerDown(targetEvent);\n } else {\n closeOnPressOutside(targetEvent);\n }\n });\n }\n function handlePressEndCapture(event) {\n // A cancelled gesture produces no click. Not cleared on `pointerup`: the click\n // fires after it and must still find the press.\n if (event.type === 'pointercancel') {\n sawPressWhileOpenRef.current = false;\n }\n if (!pressStartedInsideRef.current) {\n return;\n }\n const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;\n resetPressStartState();\n if (getOutsidePressEvent() !== 'intentional') {\n return;\n }\n if (event.type === 'pointercancel') {\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n }\n return;\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // If pointerdown was prevented, no click may be generated for that\n // interaction. However, Firefox may still emit an immediate click after\n // pointerup (e.g. NumberField scrub with pointer lock), so suppress for\n // one tick to absorb that synthetic click only.\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n return;\n }\n\n // Avoid suppressing when outsidePress explicitly ignores this target.\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = true;\n clearInsideReactTree();\n }\n function handleTouchMove(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);\n const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (distance > 5) {\n touchStateRef.current.dismissOnTouchEnd = true;\n }\n if (distance > 10) {\n closeOnPressOutside(event);\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n }\n function handleTouchMoveCapture(event) {\n addTargetEventListenerOnce(event, handleTouchMove);\n }\n function handleTouchEnd(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n if (touchStateRef.current.dismissOnTouchEnd) {\n closeOnPressOutside(event);\n }\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n function handleTouchEndCapture(event) {\n addTargetEventListenerOnce(event, handleTouchEnd);\n }\n const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, {\n capture: true,\n passive: true\n }), addEventListener(doc, 'touchmove', handleTouchMoveCapture, {\n capture: true,\n passive: true\n }), addEventListener(doc, 'touchend', handleTouchEndCapture, {\n capture: true,\n passive: true\n })));\n return () => {\n unsubscribe();\n preventedPressSuppressionTimeout.clear();\n resetPressStartState();\n suppressNextOutsideClickRef.current = false;\n };\n }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout, compositionTimeout]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onPointerDown: closeOnReferencePress,\n onClick: closeOnReferencePress\n }), [closeOnEscapeKeyDown, closeOnReferencePress]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n // `onMouseDown` may be blocked if `event.preventDefault()` is called in\n // `onPointerDown`, such as with <NumberField.ScrubArea>.\n // See https://github.com/mui/base-ui/pull/3379\n onPointerDown: markInsidePressStartPrevented,\n onMouseDown: markInsidePressStartPrevented,\n onClickCapture: markInsideReactTree,\n onMouseDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onPointerDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onMouseUpCapture: markInsideReactTree,\n onTouchEndCapture: markInsideReactTree,\n onTouchMoveCapture: markInsideReactTree\n }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n trigger: reference\n } : {}, [enabled, reference, floating]);\n}","import _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * Minimal store contract exposed by popup handles to detached triggers.\n *\n * Detached triggers read `store` during render and subscribe to be notified when the handle switches\n * between its fallback store and a root's live store.\n *\n * @template HandleStore Store shape exposed to detached triggers.\n */\n\n/**\n * Store shape holding a trigger registry, required by `BasePopupHandle.openByTrigger` to resolve a\n * trigger element by id on both the attached root's store and the fallback store.\n */\n\n/**\n * Store shape required by `BasePopupHandle.openByTrigger`/`closePopup` to drive open/close state.\n * Only the root-owned `Store` needs this — the `HandleStore` view exposed to detached triggers may\n * omit `setOpen` entirely (as Dialog and PreviewCard's do) since it is never called while detached.\n */\n\n/**\n * Shared implementation for popup handles that coordinate detached triggers with a mounted root.\n *\n * Subclasses provide the component-specific imperative methods, while this base class owns the\n * fallback store, root store attachment stack, subscriber notifications, and development warning for\n * overlapping roots.\n *\n * @template HandleStore Store shape exposed to detached triggers.\n * @template Store Root-owned store attached by the component root.\n */\nexport class BasePopupHandle {\n /**\n * Stores of every root currently using this handle, in attach order. A handle is meant to be used\n * by a single mounted root, but roots can transiently overlap (e.g. during an animated route\n * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of\n * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.\n */\n attachedStores = [];\n\n /**\n * Store of the root that currently controls the handle: the most recently attached one still\n * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.\n */\n attachedStoreValue = null;\n\n /**\n * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.\n */\n storeListeners = new Set();\n\n /**\n * Creates a handle backed by the store used while no root is attached.\n *\n * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,\n * so they can render and register without a mounted root. Triggers register into whichever store\n * `store` currently resolves to, so while detached they live in this store's trigger map and\n * migrate themselves to the root's store (and back) as it attaches/detaches.\n * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces\n * `MenuHandle.open()` in warning text.\n * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is\n * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,\n * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.\n */\n constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {\n this.fallbackStore = fallbackStore;\n this.componentName = componentName;\n this.throwOnMissingTrigger = throwOnMissingTrigger;\n }\n get attachedStore() {\n return this.attachedStoreValue;\n }\n\n /**\n * Store that detached triggers read from: the attached root's store, or an inert fallback store\n * used while no root is attached.\n * @internal\n */\n get store() {\n return this.attachedStoreValue ?? this.fallbackStore;\n }\n\n /**\n * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on\n * the handle during render because a handle can be shared by concurrent server-rendered requests.\n * @internal\n */\n get serverStore() {\n return this.fallbackStore;\n }\n\n /**\n * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind\n * when a root attaches or detaches. Returns a function that removes the listener.\n * @internal\n */\n subscribeStore(listener) {\n this.storeListeners.add(listener);\n return () => {\n this.storeListeners.delete(listener);\n };\n }\n\n /**\n * Points the handle at a root's store and notifies subscribers so detached triggers re-render and\n * re-register into it (their registration effect migrates them when the store pointer changes).\n * Returns a cleanup function that detaches the store again.\n * @internal\n */\n attachStore(newStore) {\n this.attachedStores.push(newStore);\n this.setActiveStore(newStore);\n if (process.env.NODE_ENV !== 'production') {\n if (this.attachedStores.length > 1) {\n // More than one root is attached at once. This is usually a transient overlap during an\n // animated route transition, where the outgoing root unmounts shortly after the incoming\n // one mounts. Defer the check by a frame and only warn if the overlap is still present once\n // the transition has settled (more than one root stayed mounted), so a clean handoff doesn't\n // warn regardless of the exact unmount timing.\n // The warning frame only exists in development; it is created lazily so it never appears on\n // instances in production (like `controlledValues` in `ReactStore`).\n const dev = this;\n (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {\n if (this.attachedStores.length > 1) {\n console.warn('Base UI: A handle is attached to more than one mounted root at the same time. ' + 'The most recently mounted root takes over and the previous one stops being controlled by the handle. ' + 'A handle should be used by a single root that stays mounted for the lifetime of the handle.');\n }\n });\n }\n }\n return () => {\n const index = this.attachedStores.lastIndexOf(newStore);\n if (index !== -1) {\n this.attachedStores.splice(index, 1);\n }\n // Restore control to the most recently attached root that is still mounted (or detach fully if\n // none remain). Clearing unconditionally would leave a still-mounted older root uncontrollable\n // when a newer overlapping root detaches first (e.g. a canceled route transition).\n this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);\n };\n }\n\n /**\n * Sets the store that currently controls the handle and notifies subscribers when it changes, so\n * detached triggers re-render and migrate their registration to the new store.\n */\n setActiveStore(store) {\n if (this.attachedStoreValue !== store) {\n this.attachedStoreValue = store;\n this.storeListeners.forEach(listener => {\n listener();\n });\n }\n }\n\n /**\n * Opens the attached root's store and associates it with the trigger with the given id, or a\n * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public\n * `open()` method, which only narrows the parameter type.\n *\n * When a trigger id is given but no matching trigger is registered, anchored popups throw (see\n * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n *\n * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open\n * without associating any trigger.\n */\n openByTrigger(triggerId) {\n const attachedStore = this.attachedStore;\n if (attachedStore === null) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. ` + 'The call was ignored; mount a root with this handle before opening it imperatively.');\n }\n return;\n }\n\n // Registered triggers normally live in the active root's store. During the commit in which a\n // root attaches, a still-mounted detached trigger has not re-registered into that store yet (it\n // migrates on its next render): it is still registered wherever it lived before — the fallback\n // store when this is the first root to attach, or a previously attached root's store during a\n // transient overlap (e.g. an animated route transition). Search the whole attachment stack\n // (newest first) and the fallback map so an imperative open-by-id called in that commit (e.g.\n // from a layout effect) still resolves the trigger instead of treating it as missing.\n let triggerElement;\n if (triggerId) {\n for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {\n triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);\n }\n triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);\n }\n if (triggerId && !triggerElement) {\n if (this.throwOnMissingTrigger) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id \"${triggerId}\", ` + 'but no matching trigger is registered with this handle. ' + 'An anchored popup cannot open without a trigger to anchor to. ' + `Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its \"handle\" prop.` : _formatErrorMessage(99, this.componentName, triggerId, this.componentName));\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id \"${triggerId}\". ` + 'The popup will open, but the trigger will not be associated with it.');\n }\n }\n attachedStore.setOpen(true, createChangeEventDetails(REASONS.imperativeAction, undefined, triggerElement));\n }\n\n /**\n * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)\n * while no root is attached. Shared by every concrete handle's public `close()` method.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n */\n closePopup() {\n const attachedStore = this.attachedStore;\n if (attachedStore === null) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. ` + 'The call was ignored.');\n }\n return;\n }\n attachedStore.setOpen(false, createChangeEventDetails(REASONS.imperativeAction));\n }\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { isElement } from '@floating-ui/utils/dom';\n\n/**\n * Narrowed to the store members this hook uses so consumers do not need to provide\n * unrelated store capabilities.\n */\n\n/**\n * Keeps the provided FloatingRootStore in sync with the provided PopupStore.\n */\nexport function useSyncedFloatingRootContext(options) {\n const {\n popupStore,\n treatPopupAsFloatingElement = false,\n floatingRootContext: store,\n floatingId,\n nested,\n onOpenChange\n } = options;\n const open = popupStore.useState('open');\n const referenceElement = popupStore.useState('activeTriggerElement');\n const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? 'popupElement' : 'positionerElement');\n const handleOpenChange = onOpenChange;\n popupStore.useSyncedValue('floatingId', floatingId);\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId,\n referenceElement,\n floatingElement\n };\n if (isElement(referenceElement)) {\n valuesToSync.domReferenceElement = referenceElement;\n }\n if (store.state.positionReference === store.state.referenceElement) {\n valuesToSync.positionReference = referenceElement;\n }\n store.update(valuesToSync);\n }, [open, floatingId, referenceElement, floatingElement, store]);\n\n // Keep non-reactive context values fresh for interactions that call `store.setOpen`.\n store.context.onOpenChange = handleOpenChange;\n store.context.nested = nested;\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useForcedRerendering } from '@base-ui/utils/useForcedRerendering';\nimport { useTransitionStatus } from \"./useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"./useOpenChangeComplete.mjs\";\n/**\n * Keeps a popup mounted through its closing animation and unmounts it once the animation\n * finishes, unless the close cycle opted out through `preventUnmountOnClose`.\n * Store-agnostic: hosts sync `mounted` and `transitionStatus` wherever they need them.\n *\n * @returns `forceUnmount` unmounts the popup immediately. It is a no-op once the popup is already\n * unmounted, so calling it after the automatic unmount doesn't repeat the completion callback,\n * and a call while the popup is open only takes effect if a close commits in the same batch.\n */\nexport function useUnmountAfterClose(parameters) {\n const {\n open,\n ref,\n preventUnmountOnClose,\n setPreventUnmountOnClose: setPreventUnmountOnCloseParam,\n onUnmount,\n animateInitialOpen\n } = parameters;\n const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam);\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open, false, false, animateInitialOpen);\n\n // Opening starts a new close cycle. Derive during render so the close-completion hook below\n // reads the value on the same pass, and clear the stored value so it doesn't leak into the next\n // close. The effect only runs when `open` changes, so an opt-out recorded while a controlled\n // close is still pending (for example in a transition) is not cleared by the render that still\n // sees `open`.\n const preventUnmountingOnClose = open ? false : preventUnmountOnClose;\n useIsoLayoutEffect(() => {\n if (open) {\n setPreventUnmountOnClose(false);\n }\n }, [open, setPreventUnmountOnClose]);\n\n // Mirrors `mounted` synchronously so repeated `forceUnmount()` calls in one batch complete\n // closing once. Resynced on every commit: `setMounted(false)` while open re-mounts on the next\n // render without changing the committed `mounted`, so a `[mounted]` dependency would leave the\n // mirror stale and block every later unmount.\n const mountedRef = React.useRef(mounted);\n const pendingUnmountRef = React.useRef(false);\n const rerender = useForcedRerendering();\n const unmount = () => {\n mountedRef.current = false;\n setMounted(false);\n onUnmount();\n };\n useIsoLayoutEffect(() => {\n mountedRef.current = mounted;\n if (pendingUnmountRef.current) {\n pendingUnmountRef.current = false;\n if (!open && mounted) {\n unmount();\n }\n }\n });\n const forceUnmount = useStableCallback(() => {\n if (!mountedRef.current) {\n return;\n }\n if (open) {\n // The rendered `open` can't tell a stale exit-animation callback after a quick reopen from a\n // close batched with this call (`close(); unmount()`). Decide once the batch commits: unmount\n // if the popup closed, otherwise drop the call rather than run the host's unmount cleanup and\n // the close completion against a live popup.\n pendingUnmountRef.current = true;\n rerender();\n return;\n }\n unmount();\n });\n useOpenChangeComplete({\n enabled: mounted && !open && !preventUnmountingOnClose,\n open,\n ref,\n onComplete() {\n if (!open) {\n forceUnmount();\n }\n }\n });\n return {\n mounted,\n transitionStatus,\n preventUnmountingOnClose,\n forceUnmount\n };\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useId } from '@base-ui/utils/useId';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FOCUSABLE_ATTRIBUTE } from \"../../floating-ui-react/utils/constants.mjs\";\nimport { useFloatingParentNodeId } from \"../../floating-ui-react/components/FloatingTree.mjs\";\nimport { useSyncedFloatingRootContext } from \"../../floating-ui-react/hooks/useSyncedFloatingRootContext.mjs\";\nimport { useUnmountAfterClose } from \"../../internals/useUnmountAfterClose.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nexport const FOCUSABLE_POPUP_PROPS = {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n};\n\n/**\n * Returns the default `initialFocus` resolver for a popup. When opened by touch it focuses the\n * popup element itself to prevent the virtual keyboard from opening (required for Android\n * specifically; iOS handles this automatically). Otherwise it falls back to the default behavior.\n */\nexport function createDefaultInitialFocus(popupRef) {\n return interactionType => interactionType === 'touch' ? popupRef.current : true;\n}\n\n/**\n * The subset of a popup handle that a Root needs to bind its store to. Both the real handle classes\n * and any test double satisfy it.\n */\n\n/**\n * Creates and owns a popup store on behalf of a Root part. The store is created exactly once, with\n * controlled props and root state synced separately after creation. Sets up the synced floating\n * root context and returns the store.\n *\n * @param createStore Factory that builds the store. Called exactly once, receiving the floating id\n * and whether the popup is nested inside another floating element, both resolved on the first render.\n * @param treatPopupAsFloatingElement Whether the popup element is passed to Floating UI as the\n * floating element instead of the default positioner.\n */\nexport function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) {\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n const store = useRefWithInit(() => createStore(floatingId, nested)).current;\n useSyncedFloatingRootContext({\n popupStore: store,\n treatPopupAsFloatingElement,\n floatingRootContext: store.state.floatingRootContext,\n floatingId,\n nested,\n onOpenChange: store.setOpen\n });\n return store;\n}\n\n/**\n * Attaches a Root's store to a handle for this component's committed lifetime. Popup Roots render\n * it before their interactions and user children so its layout effect runs before descendant layout\n * effects. This lets descendants call the handle during the Root's initial commit without attaching\n * during render, which would leak suspended or abandoned stores. Store subscribers are notified by\n * `attachStore` in this ordinary layout phase, where React permits synchronous updates.\n *\n * Popup Roots must render this component only when a handle is present so handle-less Roots avoid\n * mounting an extra fiber and layout effect.\n */\nexport function PopupHandleAttachment({\n handle,\n store\n}) {\n useIsoLayoutEffect(() => {\n return handle.attachStore(store);\n }, [handle, store]);\n return null;\n}\nfunction syncTriggerCount(store) {\n const triggerCount = store.context.triggerElements.size;\n if (store.select('open') && store.state.triggerCount !== triggerCount) {\n store.set('triggerCount', triggerCount);\n }\n}\n\n/**\n * Returns a stable callback ref that registers/unregisters the trigger element in the store.\n *\n * Stable so a downstream ref merger that retains the callback it was first given still reaches the\n * trigger's current store. The registration is tracked as a `(store, id, element)` triple, so\n * unregistering targets the store the element was actually registered in.\n *\n * Since the callback never changes, the caller must re-run it from a layout effect keyed on\n * `[store, id]` to migrate an already-registered element. That effect is also what registers the\n * element in the first place when `id` only resolves after the first commit (React 17's `useId`\n * fallback), because the register call made while the id is still `undefined` does nothing.\n *\n * @param id Id of the trigger.\n * @param store The Store instance where the trigger should be registered.\n */\nexport function useTriggerRegistration(id, store) {\n const registrationRef = React.useRef(null);\n return useStableCallback(element => {\n const registration = registrationRef.current;\n if (registration !== null) {\n if (registration.element === element && registration.store === store && registration.id === id) {\n // Already registered where it belongs, so the caller's migration effect is free on mount.\n return;\n }\n registrationRef.current = null;\n const registeredStore = registration.store;\n if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {\n registeredStore.context.triggerElements.delete(registration.id);\n syncTriggerCount(registeredStore);\n }\n }\n if (element !== null && id !== undefined) {\n registrationRef.current = {\n store,\n id,\n element\n };\n store.context.triggerElements.add(id, element);\n syncTriggerCount(store);\n }\n });\n}\nexport function createPopupOpenState(state, open, trigger, preventUnmountOnClose = false) {\n let preventUnmountingOnClose = state.preventUnmountingOnClose;\n if (open) {\n // Opening starts a new close cycle, so clear any previous request to keep the popup mounted.\n preventUnmountingOnClose = false;\n } else if (preventUnmountOnClose) {\n preventUnmountingOnClose = true;\n }\n const triggerId = trigger?.id ?? null;\n let activeTriggerId = state.activeTriggerId;\n let activeTriggerElement = state.activeTriggerElement;\n\n // If a popup is closing, the `trigger` may be undefined.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n if (triggerId || open) {\n activeTriggerId = triggerId;\n activeTriggerElement = trigger ?? null;\n }\n return {\n open,\n preventUnmountingOnClose,\n activeTriggerId,\n activeTriggerElement,\n // An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not\n // be reassociated with a lone registered trigger later on. Controlled and default opens never\n // pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a\n // controlled root may decline it and stay open, so the Root clears the flag only once the\n // popup is effectively closed.\n openedWithoutTrigger: open ? trigger == null : state.openedWithoutTrigger\n };\n}\nexport function attachPreventUnmountOnClose(eventDetails) {\n let preventUnmountOnClose = false;\n eventDetails.preventUnmountOnClose = () => {\n preventUnmountOnClose = true;\n };\n return () => preventUnmountOnClose;\n}\n\n/**\n * Runs the shared open-change sequence for a popup store: notifies `onOpenChange`,\n * honors cancellation, dispatches the floating root change, maps the reason to an\n * `instantType`, and commits the state update (synchronously for hover so\n * `getAnimations()` observes it). Stores supply their own differences via\n * `extraState` (e.g. the last change reason) and `onBeforeDispatch` (e.g. updating\n * inline-rect coordinates).\n */\nexport function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {\n const reason = eventDetails.reason;\n const isHover = reason === REASONS.triggerHover;\n const isFocusOpen = nextOpen && reason === REASONS.triggerFocus;\n const isDismissClose = !nextOpen && (reason === REASONS.triggerPress || reason === REASONS.escapeKey);\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);\n store.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n options.onBeforeDispatch?.();\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());\n const updatedState = {\n ...options.extraState,\n ...popupOpenState\n };\n if (isFocusOpen) {\n updatedState.instantType = 'focus';\n } else if (isDismissClose) {\n updatedState.instantType = 'dismiss';\n } else if (isHover) {\n updatedState.instantType = undefined;\n }\n store.update(updatedState);\n };\n if (isHover) {\n // Flush synchronously for hover so `node.getAnimations()` sees the new state.\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n}\n\n/**\n * Sets up trigger data forwarding to the store.\n *\n * @param triggerId Id of the trigger.\n * @param triggerElementRef Ref for the trigger DOM element.\n * @param store The Store instance managing the popup state.\n * @param stateUpdates An object with state updates to apply when the trigger is active.\n */\nexport function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {\n const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);\n const baseRegisterTrigger = useTriggerRegistration(triggerId, store);\n\n // Applies trigger-owned state (active-trigger ownership and payload) when the trigger registers.\n // Stable so payload/`stateUpdates` changes do not change the ref identity (which would needlessly\n // churn registration); it reads the latest closure values when invoked.\n const applyTriggerData = useStableCallback(element => {\n const open = store.select('open');\n const activeTriggerId = store.select('activeTriggerId');\n if (activeTriggerId === triggerId) {\n const changes = {\n activeTriggerElement: element,\n ...(open ? stateUpdates : null)\n };\n store.update(changes);\n return;\n }\n if (activeTriggerId == null && open && !store.state.openedWithoutTrigger) {\n // If a popup is already open, a detached trigger can mount before any active trigger\n // has been established. Claim the first registered trigger so trigger-owned focus\n // management and ARIA relationships work. A popup opened deliberately without a trigger\n // stays unassociated so the trigger's `payload` does not replace the programmatic one.\n const changes = {\n activeTriggerId: triggerId ?? null,\n activeTriggerElement: element,\n ...stateUpdates\n };\n store.update(changes);\n }\n });\n\n // Stable, so the merged ref on the rendered element keeps its identity for the trigger's whole\n // lifetime.\n const registerTrigger = useStableCallback(element => {\n baseRegisterTrigger(element);\n if (element) {\n applyTriggerData(element);\n }\n });\n\n // A stable ref does not re-fire on a store or id change, so migrate here instead: unregister from\n // the previous store, then register the element the trigger still renders into the current one.\n useIsoLayoutEffect(() => {\n registerTrigger(triggerElementRef.current);\n return () => registerTrigger(null);\n }, [registerTrigger, triggerElementRef, store, triggerId]);\n useIsoLayoutEffect(() => {\n if (isMountedByThisTrigger) {\n const changes = {\n activeTriggerElement: triggerElementRef.current,\n ...stateUpdates\n };\n store.update(changes);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);\n return {\n registerTrigger,\n isMountedByThisTrigger\n };\n}\n/**\n * Keeps trigger registration state synchronized while the popup is open.\n *\n * When a popup opens without an explicit trigger id and exactly one trigger is registered, that\n * trigger is claimed as the active trigger, unless the open request deliberately carried no trigger\n * (`openedWithoutTrigger`). When the active trigger id is still registered but its\n * element changed, the active element is refreshed. When the active trigger id is missing from the\n * registry but the same element is still registered under a different id (e.g. the rendered trigger\n * carries its own DOM `id` that differs from Base UI's internal trigger id), the active id is\n * reassociated to the registered id instead of being treated as lost. When the active trigger\n * unregisters, the default path preserves existing ownership so non-closing popup families do not\n * silently claim a different trigger while staying open.\n *\n * If `closeOnActiveTriggerUnmount` is enabled, unregistering a previously resolved active trigger\n * requests a close after a microtask so a same-tick replacement trigger with the same id can\n * register first. An active trigger id that has not matched a registered trigger yet is treated as\n * pending and does not request a close.\n *\n * This should be called on the Root part.\n *\n * @param store The Store instance managing the popup state.\n * @param options Options for active trigger unmount behavior.\n */\nexport function useImplicitActiveTrigger(store, options = {}) {\n const {\n closeOnActiveTriggerUnmount = false\n } = options;\n // Distinguishes a trigger that unmounted from a new active trigger that has not hydrated yet.\n const resolvedActiveTriggerIdRef = React.useRef(null);\n const open = store.useState('open');\n const reactiveTriggerCount = store.useState('triggerCount');\n // Subscribe to the active trigger id so the reconciliation below reruns when ownership moves to\n // another trigger while the popup stays open (e.g. a focus/hover handoff between triggers).\n const activeTriggerId = store.useState('activeTriggerId');\n // Subscribe to the active trigger element so the reconciliation reruns when a pending active\n // trigger registers in a commit where the trigger count nets out unchanged (registration\n // forwards the element to the store when the registering trigger matches the active id).\n // Without this, the id would never be marked resolved and a later genuine unmount would be\n // misclassified as pending, disabling `closeOnActiveTriggerUnmount`.\n const reactiveActiveTriggerElement = store.useState('activeTriggerElement');\n useIsoLayoutEffect(() => {\n if (!open) {\n resolvedActiveTriggerIdRef.current = null;\n if (store.state.triggerCount !== 0) {\n store.set('triggerCount', 0);\n }\n // The flag is cleared only here, once the popup is effectively closed: a controlled root may\n // decline a close request and stay open, and a controlled close never reaches\n // `createPopupOpenState` at all.\n if (store.state.openedWithoutTrigger) {\n store.set('openedWithoutTrigger', false);\n }\n return;\n }\n const triggerCount = store.context.triggerElements.size;\n const stateUpdates = {};\n if (store.state.triggerCount !== triggerCount) {\n stateUpdates.triggerCount = triggerCount;\n }\n const currentActiveTriggerId = store.select('activeTriggerId');\n let lostActiveTriggerId = null;\n if (currentActiveTriggerId) {\n const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId);\n if (!activeTriggerElement) {\n for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) {\n if (triggerElement === store.state.activeTriggerElement) {\n stateUpdates.activeTriggerId = triggerId;\n stateUpdates.activeTriggerElement = triggerElement;\n resolvedActiveTriggerIdRef.current = triggerId;\n break;\n }\n }\n if (stateUpdates.activeTriggerId === undefined) {\n if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {\n lostActiveTriggerId = currentActiveTriggerId;\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = currentActiveTriggerId;\n if (activeTriggerElement !== store.state.activeTriggerElement) {\n stateUpdates.activeTriggerElement = activeTriggerElement;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n if (!lostActiveTriggerId && !currentActiveTriggerId && !store.state.openedWithoutTrigger && triggerCount === 1) {\n const iteratorResult = store.context.triggerElements.entries().next();\n if (!iteratorResult.done) {\n const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;\n stateUpdates.activeTriggerId = implicitTriggerId;\n stateUpdates.activeTriggerElement = implicitTriggerElement;\n resolvedActiveTriggerIdRef.current = implicitTriggerId;\n }\n }\n if (stateUpdates.triggerCount !== undefined || stateUpdates.activeTriggerId !== undefined || stateUpdates.activeTriggerElement !== undefined) {\n store.update(stateUpdates);\n }\n if (lostActiveTriggerId) {\n if (closeOnActiveTriggerUnmount) {\n // Defer so a same-tick replacement trigger with the same id can register first.\n queueMicrotask(() => {\n if (store.select('open') && store.select('activeTriggerId') === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {\n const eventDetails = createChangeEventDetails(REASONS.none);\n store.setOpen(false, eventDetails);\n // If closing is canceled, keep the previous active trigger ownership for the\n // still-open popup instead of claiming another trigger implicitly.\n if (!eventDetails.isCanceled) {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null\n });\n }\n }\n });\n }\n }\n }, [open, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);\n}\n\n/**\n * Manages the mounted state of the popup.\n * Sets up the transition status listeners and handles unmounting when needed.\n * Updates the `mounted`, `transitionStatus`, and `preventUnmountingOnClose` states in the store.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n * @param onUnmount Optional callback to be called when the popup is unmounted.\n * @param animateInitialOpen Whether a popup that mounts already open should still play its enter\n * transition. Defaults to `false`, so content that was open on the first render (a `defaultOpen`\n * popup on page load, SSR'd markup) appears without animating. Opt in for popups whose subtree\n * only mounts in response to something the user did, such as a submenu inside a menu popup.\n *\n * @returns A function to forcibly unmount the popup. It is a no-op once the popup is already\n * unmounted, so calling it after the automatic unmount doesn't repeat the completion callback.\n */\nexport function useOpenStateTransitions(open, store, onUnmount, animateInitialOpen) {\n const {\n mounted,\n transitionStatus,\n forceUnmount\n } = useUnmountAfterClose({\n open,\n ref: store.context.popupRef,\n preventUnmountOnClose: store.useState('preventUnmountingOnClose'),\n setPreventUnmountOnClose: preventUnmountOnClose => store.set('preventUnmountingOnClose', preventUnmountOnClose),\n animateInitialOpen,\n onUnmount() {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null,\n mounted: false,\n preventUnmountingOnClose: false\n });\n onUnmount?.();\n store.context.onOpenChangeComplete?.(false);\n }\n });\n\n // Seed the Root-owned store before parts subscribe, matching the hook's initial mounted state.\n // Otherwise, an initially open Root looks like a reopen until the layout effect syncs the store.\n useRefWithInit(() => {\n store.set('mounted', mounted);\n return null;\n });\n store.useSyncedValues({\n mounted,\n transitionStatus\n });\n return {\n forceUnmount,\n transitionStatus\n };\n}\nexport function usePopupInteractionProps(store, statePart) {\n store.useSyncedValues(statePart);\n useIsoLayoutEffect(() => () => {\n store.update({\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n });\n }, [store]);\n}\nexport function usePopupRootSync(store, open) {\n useIsoLayoutEffect(() => {\n if (!open && store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [open, store]);\n useIsoLayoutEffect(() => () => {\n if (store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [store]);\n}","/**\n * Development-only reverse index of element to registered id, keyed by the owning map.\n *\n * Registration would otherwise have to scan every entry to detect an element claimed by two ids,\n * making the mount of many triggers sharing one handle quadratic. Kept module-scoped, lazily\n * initialized, and read only from `process.env.NODE_ENV` guards so production builds drop it along\n * with the checks.\n */\nlet devElementIdsByMap;\nfunction getDevElementIds(map) {\n devElementIdsByMap ??= new WeakMap();\n let elementIds = devElementIdsByMap.get(map);\n if (!elementIds) {\n elementIds = new WeakMap();\n devElementIdsByMap.set(map, elementIds);\n }\n return elementIds;\n}\n\n/**\n * Data structure to keep track of popup trigger elements by their IDs.\n *\n * Element lookups iterate the id map rather than maintaining a parallel Set. Registration is O(1),\n * while `hasElement` and `hasMatchingElement` are linear in the number of triggers.\n */\nexport class PopupTriggerMap {\n idMap = new Map();\n\n /**\n * Adds a trigger element with the given ID.\n *\n * Note: The provided element is assumed to not be registered under multiple IDs.\n */\n add(id, element) {\n if (process.env.NODE_ENV !== 'production') {\n const elementIds = getDevElementIds(this);\n const existingId = elementIds.get(element);\n if (existingId !== undefined && existingId !== id) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error('Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.');\n }\n\n // Reusing an id for a different element evicts the previous one, so it must lose its claim\n // on the id or a later registration under a different id would be reported as a duplicate.\n const previousElement = this.idMap.get(id);\n if (previousElement !== undefined && previousElement !== element) {\n elementIds.delete(previousElement);\n }\n elementIds.set(element, id);\n }\n this.idMap.set(id, element);\n }\n\n /**\n * Removes the trigger element with the given ID.\n */\n delete(id) {\n if (process.env.NODE_ENV !== 'production') {\n const element = this.idMap.get(id);\n if (element !== undefined) {\n devElementIdsByMap?.get(this)?.delete(element);\n }\n }\n this.idMap.delete(id);\n }\n\n /**\n * Whether the given element is registered as a trigger.\n */\n hasElement(element) {\n for (const registered of this.idMap.values()) {\n if (registered === element) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Whether there is a registered trigger element matching the given predicate.\n */\n hasMatchingElement(predicate) {\n for (const element of this.idMap.values()) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns the trigger element associated with the given ID, or undefined if no such element exists.\n */\n getById(id) {\n return this.idMap.get(id);\n }\n\n /**\n * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].\n */\n entries() {\n return this.idMap.entries();\n }\n\n /**\n * Returns an iterable of all registered trigger elements.\n */\n elements() {\n return this.idMap.values();\n }\n\n /**\n * Returns the number of registered trigger elements.\n */\n get size() {\n return this.idMap.size;\n }\n}","import * as React from 'react';\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst hooks = [];\nlet currentInstance = undefined;\nexport function getInstance() {\n return currentInstance;\n}\nexport function setInstance(instance) {\n currentInstance = instance;\n}\nexport function register(hook) {\n hooks.push(hook);\n}\n\n/**\n * Wraps a component function to enable performance optimizations for internal hooks.\n *\n * **Performance Optimization:**\n * Components wrapped with `fastComponent` have access to a shared \"instance\" context that enables\n * specialized hook implementations to batch operations and reduce overhead. The wrapper creates a\n * stable instance object that persists across renders, sets it as the current context, calls\n * registered hooks before and after rendering, then clears the context. The primary benefit is\n * with `useStore`, where multiple store subscriptions within the same component are collapsed into\n * a single `useSyncExternalStore` subscription per store, significantly reducing re-render overhead.\n * This optimization is only active on React 19+; on earlier versions `useStore` falls back to a\n * separate subscription per call.\n *\n * **Requirements:**\n * - The component function should follow standard React component patterns\n * - `useStore` calls must keep a stable order and count across renders, as batched hooks are\n * matched by call index\n * - Do not rely on the instance context outside of specialized hooks\n *\n * @param fn - The component function to wrap\n * @returns A wrapped component with the same signature as the input function\n *\n * @example\n * ```tsx\n * // Wrapping a component to enable optimized useStore batching\n * export const TooltipRoot = fastComponent(function TooltipRoot(props) {\n * // These useStore calls share a single subscription\n * const open = useStore(store, (state) => state.open);\n * const disabled = useStore(store, (state) => state.disabled);\n * const value = useStore(store, (state) => state.value);\n * // ...\n * });\n * ```\n */\nexport function fastComponent(fn) {\n const FastComponent = (props, forwardedRef) => {\n const instance = useRefWithInit(createInstance).current;\n let result;\n try {\n currentInstance = instance;\n for (const hook of hooks) {\n hook.before(instance);\n }\n result = fn(props, forwardedRef);\n for (const hook of hooks) {\n hook.after(instance);\n }\n instance.didInitialize = true;\n } finally {\n currentInstance = undefined;\n }\n return result;\n };\n FastComponent.displayName = fn.displayName || fn.name;\n return FastComponent;\n}\n\n/**\n * Wraps a component function with ref forwarding to enable performance optimizations for internal hooks.\n *\n * This is a convenience wrapper that combines `fastComponent` with `React.forwardRef`, enabling\n * both performance optimizations and proper ref forwarding. See `fastComponent` for details on\n * the performance benefits.\n *\n * @param fn - The component function that accepts props and a forwarded ref\n * @returns A wrapped component with ref forwarding enabled\n *\n * @example\n * ```tsx\n * // Wrapping a component with ref forwarding and optimized hooks\n * export const TooltipTrigger = fastComponentRef(function TooltipTrigger(\n * props,\n * forwardedRef\n * ) {\n * const store = useContext(TooltipContext);\n * const open = useStore(store, (state) => state.open);\n * // ... component logic with ref\n * return <button ref={forwardedRef} {...props} />;\n * });\n * ```\n */\nexport function fastComponentRef(fn) {\n return /*#__PURE__*/React.forwardRef(fastComponent(fn));\n}\nfunction createInstance() {\n return {\n didInitialize: false\n };\n}","import * as React from 'react';\n/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.\n * More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isReactVersionAtLeast } from \"../reactVersion.mjs\";\nimport { register, getInstance } from \"../fastHooks.mjs\";\n/* Some tests fail in R18 with the raw useSyncExternalStore. It may be possible to make it work\n * but for now we only enable it for R19+. */\nconst canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);\nconst useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;\nexport function useStore(store, selector, a1, a2, a3) {\n return useStoreImplementation(store, selector, a1, a2, a3);\n}\nfunction useStoreR19(store, selector, a1, a2, a3) {\n const getSelection = React.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);\n return useSyncExternalStore(store.subscribe, getSelection, getSelection);\n}\nregister({\n before(instance) {\n instance.syncIndex = 0;\n if (!instance.didInitialize) {\n instance.syncTick = 1;\n instance.syncHooks = [];\n instance.didChangeStore = true;\n instance.getSnapshot = () => {\n let didChange = false;\n for (let i = 0; i < instance.syncHooks.length; i += 1) {\n const hook = instance.syncHooks[i];\n const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);\n if (!Object.is(hook.value, value)) {\n didChange = true;\n hook.value = value;\n }\n }\n if (didChange) {\n instance.syncTick += 1;\n }\n return instance.syncTick;\n };\n }\n },\n after(instance) {\n if (instance.syncHooks.length > 0) {\n if (instance.didChangeStore) {\n instance.didChangeStore = false;\n instance.subscribe = onStoreChange => {\n const stores = new Set();\n for (const hook of instance.syncHooks) {\n stores.add(hook.store);\n }\n const unsubscribes = [];\n for (const store of stores) {\n unsubscribes.push(store.subscribe(onStoreChange));\n }\n return () => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe();\n }\n };\n };\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);\n }\n }\n});\nfunction useStoreFast(store, selector, a1, a2, a3) {\n const instance = getInstance();\n if (!instance) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreR19(store, selector, a1, a2, a3);\n }\n const index = instance.syncIndex;\n instance.syncIndex += 1;\n let hook;\n if (!instance.didInitialize) {\n hook = {\n store,\n selector,\n a1,\n a2,\n a3,\n value: selector(store.getSnapshot(), a1, a2, a3)\n };\n instance.syncHooks.push(hook);\n } else {\n hook = instance.syncHooks[index];\n if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {\n if (hook.store !== store) {\n instance.didChangeStore = true;\n }\n hook.store = store;\n hook.selector = selector;\n hook.a1 = a1;\n hook.a2 = a2;\n hook.a3 = a3;\n hook.value = selector(store.getSnapshot(), a1, a2, a3);\n }\n }\n return hook.value;\n}\nfunction useStoreLegacy(store, selector, a1, a2, a3) {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, state => selector(state, a1, a2, a3));\n}","import { useStore } from \"./useStore.mjs\";\n/**\n * A data store implementation that allows subscribing to state changes and updating the state.\n * It uses an observer pattern to notify subscribers when the state changes.\n */\nexport class Store {\n /**\n * Creates a store with the given initial state, constructing the class it is called on.\n * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that\n * class but degrades the inferred instance type to `Store`; use `new` there instead.\n */\n static create(state) {\n return new this(state);\n }\n\n /**\n * The current state of the store.\n * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.\n * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).\n * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.\n *\n * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.\n */\n\n // Internal state to handle recursive `setState()` calls\n\n constructor(state) {\n this.state = state;\n this.listeners = new Set();\n this.updateTick = 0;\n }\n\n /**\n * Registers a listener that will be called whenever the store's state changes.\n *\n * @param fn The listener function to be called on state changes.\n * @returns A function to unsubscribe the listener.\n */\n subscribe = fn => {\n this.listeners.add(fn);\n return () => {\n this.listeners.delete(fn);\n };\n };\n\n /**\n * Returns the current state of the store.\n */\n getSnapshot = () => {\n return this.state;\n };\n\n /**\n * Updates the entire store's state and notifies all registered listeners.\n *\n * @param newState The new state to set for the store.\n */\n setState(newState) {\n if (this.state === newState) {\n return;\n }\n this.state = newState;\n this.updateTick += 1;\n const currentTick = this.updateTick;\n for (const listener of this.listeners) {\n if (currentTick !== this.updateTick) {\n // If the tick has changed, a recursive `setState` call has been made,\n // and it has already notified all listeners.\n return;\n }\n listener(newState);\n }\n }\n\n /**\n * Merges the provided changes into the current state and notifies listeners if there are changes.\n * Each value must match its state key. Pass an exact known subset rather than a broad\n * `Partial<State>`, which may contain `undefined` for required state fields.\n *\n * @param changes An object containing the changes to apply to the current state.\n */\n update(changes) {\n for (const key in changes) {\n if (!Object.is(this.state[key], changes[key])) {\n this.setState({\n ...this.state,\n ...changes\n });\n return;\n }\n }\n }\n\n /**\n * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.\n *\n * @param key The key in the store's state to update.\n * @param value The new value to set for the specified key.\n */\n set(key, value) {\n if (!Object.is(this.state[key], value)) {\n this.setState({\n ...this.state,\n [key]: value\n });\n }\n }\n\n /**\n * Gives the state a new reference and updates all registered listeners.\n */\n notifyAll() {\n const newState = {\n ...this.state\n };\n this.setState(newState);\n }\n use(selector, a1, a2, a3) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(this, selector, a1, a2, a3);\n }\n}","/* False positives - ESLint thinks we're calling a hook from a class component. */\n/* eslint-disable react-hooks/rules-of-hooks */\n'use client';\n\nimport * as React from 'react';\nimport { Store } from \"./Store.mjs\";\nimport { useStore } from \"./useStore.mjs\";\nimport { useStableCallback } from \"../useStableCallback.mjs\";\nimport { useIsoLayoutEffect } from \"../useIsoLayoutEffect.mjs\";\nimport { NOOP } from \"../empty.mjs\";\n\n/**\n * A Store that supports controlled state keys, non-reactive values and provides utility methods for React.\n */\nexport class ReactStore extends Store {\n /**\n * Creates a new ReactStore instance.\n *\n * @param state Initial state of the store.\n * @param context Non-reactive context values.\n * @param selectors Optional selectors for use with `useState`.\n */\n constructor(state, context = {}, selectors) {\n super(state);\n this.context = context;\n this.selectors = selectors;\n }\n\n /**\n * Non-reactive values such as refs, callbacks, etc.\n */\n\n /**\n * Synchronizes a single external value into the store.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValue(key, value) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes a single external value into the store and\n * cleans it up (sets to `undefined`) on unmount.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValueWithCleanup(key, value) {\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n return () => {\n store.set(key, undefined);\n };\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes multiple external values into the store.\n * Each value must match its state key. Pass an exact known subset rather than a broad\n * `Partial<State>`, which may contain `undefined` for required state fields.\n *\n * Note that the while the values in `state` are updated immediately, the values returned\n * by `useState` are updated before the next render (similarly to React's `useState`).\n *\n * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted.\n */\n useSyncedValues(statePart) {\n // eslint-disable-next-line consistent-this\n const store = this;\n if (process.env.NODE_ENV !== 'production') {\n // Check that an object with the same shape is passed on every render\n React.useDebugValue(statePart, p => Object.keys(p));\n const keys = React.useRef(Object.keys(statePart)).current;\n const nextKeys = Object.keys(statePart);\n if (keys.length !== nextKeys.length || keys.some((key, index) => key !== nextKeys[index])) {\n console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');\n }\n }\n const dependencies = Object.values(statePart);\n useIsoLayoutEffect(() => {\n store.update(statePart);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...dependencies]);\n }\n\n /**\n * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`\n * is non-undefined, the store's state at `key` is updated to match `controlled`.\n */\n useControlledProp(key, controlled) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n const isControlled = controlled !== undefined;\n useIsoLayoutEffect(() => {\n if (isControlled && !Object.is(store.state[key], controlled)) {\n // Set the internal state to match the controlled value.\n store.setState({\n ...store.state,\n [key]: controlled\n });\n }\n }, [store, key, controlled, isControlled]);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n const cache = this.controlledValues ??= new Map();\n if (!cache.has(key)) {\n cache.set(key, isControlled);\n }\n const previouslyControlled = cache.get(key);\n if (previouslyControlled !== undefined && previouslyControlled !== isControlled) {\n console.error(`A component is changing the ${previouslyControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${previouslyControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);\n }\n }\n }\n\n /** Gets the current value from the store using a selector with the provided key.\n *\n * @param key Key of the selector to use.\n */\n\n select(key, a1, a2, a3) {\n const selector = this.selectors[key];\n return selector(this.state, a1, a2, a3);\n }\n\n /**\n * Returns a value from the store's state using a selector function.\n * Used to subscribe to specific parts of the state.\n * This methods causes a rerender whenever the selected state changes.\n *\n * @param key Key of the selector to use.\n */\n\n useState(key, a1, a2, a3) {\n React.useDebugValue(key);\n return useStore(this, this.selectors[key], a1, a2, a3);\n }\n\n /**\n * Wraps a function with `useStableCallback` to ensure it has a stable reference\n * and assigns it to the context.\n *\n * @param key Key of the event callback. Must be a function in the context.\n * @param fn Function to assign.\n */\n useContextCallback(key, fn) {\n React.useDebugValue(key);\n const stableFunction = useStableCallback(fn ?? NOOP);\n this.context[key] = stableFunction;\n }\n\n /**\n * Returns a stable setter function for a specific key in the store's state.\n * It's commonly used to pass as a ref callback to React elements.\n *\n * @param key Key of the state to set.\n */\n useStateSetter(key) {\n const ref = React.useRef(undefined);\n if (ref.current === undefined) {\n ref.current = value => {\n this.set(key, value);\n };\n }\n return ref.current;\n }\n\n /**\n * Observes changes derived from the store's selectors and calls the listener when the selected value changes.\n *\n * @param key Key of the selector to observe.\n * @param listener Listener function called when the selector result changes.\n */\n\n observe(selector, listener) {\n let selectFn;\n if (typeof selector === 'function') {\n selectFn = selector;\n } else {\n selectFn = this.selectors[selector];\n }\n let prevValue = selectFn(this.state);\n listener(prevValue, prevValue, this);\n return this.subscribe(nextState => {\n const nextValue = selectFn(nextState);\n if (!Object.is(prevValue, nextValue)) {\n const oldValue = prevValue;\n prevValue = nextValue;\n listener(nextValue, oldValue, this);\n }\n });\n }\n}","import { ReactStore } from '@base-ui/utils/store';\nimport { createEventEmitter } from \"../utils/createEventEmitter.mjs\";\nimport { isClickLikeEvent } from \"../utils.mjs\";\nconst selectors = {\n open: state => state.open,\n transitionStatus: state => state.transitionStatus,\n domReferenceElement: state => state.domReferenceElement,\n referenceElement: state => state.positionReference ?? state.referenceElement,\n floatingElement: state => state.floatingElement,\n floatingId: state => state.floatingId\n};\nexport class FloatingRootStore extends ReactStore {\n constructor(options) {\n const {\n syncOnly,\n nested,\n onOpenChange,\n triggerElements,\n ...initialState\n } = options;\n super({\n ...initialState,\n positionReference: initialState.referenceElement,\n domReferenceElement: initialState.referenceElement\n }, {\n onOpenChange,\n dataRef: {\n current: {}\n },\n events: createEventEmitter(),\n nested,\n triggerElements\n }, selectors);\n this.syncOnly = syncOnly;\n }\n\n /**\n * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.\n */\n syncOpenEvent = (newOpen, event) => {\n if (!newOpen || !this.state.open ||\n // Prevent a pending hover-open from overwriting a click-open event, while allowing\n // click events to upgrade a hover-open.\n event != null && isClickLikeEvent(event)) {\n this.context.dataRef.current.openEvent = newOpen ? event : undefined;\n }\n };\n\n /**\n * Runs the root-owned side effects for an open state change.\n */\n dispatchOpenChange = (newOpen, eventDetails) => {\n this.syncOpenEvent(newOpen, eventDetails.event);\n const details = {\n open: newOpen,\n reason: eventDetails.reason,\n nativeEvent: eventDetails.event,\n nested: this.context.nested,\n triggerElement: eventDetails.trigger\n };\n this.context.events.emit('openchange', details);\n };\n\n /**\n * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.\n *\n * @param newOpen The new open state.\n * @param eventDetails Details about the event that triggered the open state change.\n */\n setOpen = (newOpen, eventDetails) => {\n if (this.syncOnly) {\n this.context.onOpenChange?.(newOpen, eventDetails);\n return;\n }\n this.dispatchOpenChange(newOpen, eventDetails);\n this.context.onOpenChange?.(newOpen, eventDetails);\n };\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingRootStore } from \"../../floating-ui-react/components/FloatingRootStore.mjs\";\n\n/**\n * State common to all popup stores.\n */\n\nexport function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {\n return {\n open: false,\n openProp: undefined,\n mounted: false,\n transitionStatus: undefined,\n floatingRootContext: new FloatingRootStore({\n open: false,\n transitionStatus: undefined,\n floatingElement: null,\n referenceElement: null,\n triggerElements,\n floatingId,\n syncOnly: true,\n nested,\n onOpenChange: undefined\n }),\n floatingId,\n triggerCount: 0,\n preventUnmountingOnClose: false,\n payload: undefined,\n activeTriggerId: null,\n activeTriggerElement: null,\n openedWithoutTrigger: false,\n triggerIdProp: undefined,\n popupElement: null,\n positionerElement: null,\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n };\n}\nconst activeTriggerIdSelector = state => state.triggerIdProp ?? state.activeTriggerId;\nconst openSelector = state => state.openProp ?? state.open;\nconst popupIdSelector = state => {\n const popupId = state.popupElement?.id ?? state.floatingId;\n return popupId || undefined;\n};\nfunction triggerOwnsOpenPopup(state, triggerId) {\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) === triggerId;\n}\nfunction triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {\n if (triggerOwnsOpenPopup(state, triggerId)) {\n return true;\n }\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) == null && !state.openedWithoutTrigger && state.triggerCount === 1;\n}\nexport const popupStoreSelectors = {\n open: openSelector,\n mounted: state => state.mounted,\n // `open` is written synchronously on an open change; `mounted`/`transitionStatus` sync in a\n // layout effect. Match useTransitionStatus so a retained popup does not miss its starting phase.\n transitionStatus: state => openSelector(state) && !state.mounted ? 'starting' : state.transitionStatus,\n floatingRootContext: state => state.floatingRootContext,\n triggerCount: state => state.triggerCount,\n preventUnmountingOnClose: state => state.preventUnmountingOnClose,\n payload: state => state.payload,\n activeTriggerId: activeTriggerIdSelector,\n activeTriggerElement: state => state.mounted ? state.activeTriggerElement : null,\n popupId: popupIdSelector,\n /**\n * Whether the trigger with the given ID was used to open the popup.\n */\n isTriggerActive: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId,\n /**\n * Whether the popup is open and was activated by a trigger with the given ID.\n */\n isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),\n /**\n * Whether the popup is mounted and was activated by a trigger with the given ID.\n */\n isMountedByTrigger: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.mounted,\n triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,\n /**\n * Popup id for the trigger that currently owns the open popup.\n */\n triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : undefined,\n popupProps: state => state.popupProps,\n popupElement: state => state.popupElement,\n positionerElement: state => state.positionerElement\n};\n\n/**\n * Store members a detached handle-backed trigger reads or invokes for trigger registration and data\n * forwarding. `set`/`update` are included only for trigger-count and trigger-data bookkeeping; on a\n * detached (inert) store they are intentionally no-ops, so a write through them is not guaranteed to\n * be durable. Component handle-store views Pick these from their concrete store (preserving its\n * context and selectors) and add any component-specific trigger-invoked members such as `setOpen`.\n */\n\n/**\n * The subset of a popup store that trigger registration and data forwarding rely on. Narrow enough\n * that an inert store can be passed while detached.\n */","'use client';\n\nimport * as React from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { NOOP } from '@base-ui/utils/empty';\n/**\n * Reads the store currently exposed by a popup handle and subscribes to store-pointer changes.\n * Detached triggers use this to follow a handle as a root attaches or detaches: while no root is\n * attached, the handle exposes its fallback store; once a root attaches, subscribers re-render and\n * read from the live root store.\n *\n * Returns `undefined` when no handle is provided so callers can fall back to their root context.\n *\n * @param handle The popup handle to read from, or `undefined` when the trigger is not handle-bound.\n */\nexport function usePopupHandleStore(handle) {\n const subscribe = React.useCallback(listener => {\n if (handle === undefined) {\n return NOOP;\n }\n return handle.subscribeStore(listener);\n }, [handle]);\n const getSnapshot = React.useCallback(() => {\n return handle === undefined ? undefined : handle.store;\n }, [handle]);\n return useSyncExternalStore(subscribe, getSnapshot, () => handle?.serverStore);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { useDismiss } from \"../../floating-ui-react/index.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { usePopupInteractionProps } from \"../../utils/popups/index.mjs\";\nexport function DialogInteractions({\n store,\n parentContext,\n isDrawer\n}) {\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const modal = store.useState('modal');\n const popupElement = store.useState('popupElement');\n const floatingRootContext = store.useState('floatingRootContext');\n const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React.useState(0);\n const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React.useState(0);\n const isTopmost = ownNestedOpenDialogs === 0;\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent() {\n if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {\n return 'intentional';\n }\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n return {\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n };\n },\n outsidePress(event) {\n if (!store.context.outsidePressEnabledRef.current) {\n return false;\n }\n\n // For mouse events, only accept left button (button 0)\n // For touch events, a single touch is equivalent to left button\n if ('button' in event && event.button !== 0) {\n return false;\n }\n if ('touches' in event) {\n // Outside press can be handled on `touchend`, where the lifted point is\n // reported in `changedTouches` and `touches` contains any remaining\n // active points. Treat it as a single-finger tap only when exactly one\n // touch ended and no other fingers are still down.\n if (event.type === 'touchend') {\n if (event.changedTouches.length !== 1 || event.touches.length !== 0) {\n return false;\n }\n } else if (event.touches.length !== 1) {\n return false;\n }\n }\n const target = getTarget(event);\n if (isTopmost && !disablePointerDismissal) {\n // Only close if the click occurred on the dialog's owning backdrop.\n // This supports multiple modal dialogs that aren't nested in the React tree:\n // https://github.com/mui/base-ui/issues/1320\n if (modal) {\n const internalBackdrop = store.context.internalBackdropRef.current;\n const backdrop = store.context.backdropRef.current;\n return internalBackdrop || backdrop ? internalBackdrop === target || backdrop === target || contains(target, popupElement) && !target?.hasAttribute('data-base-ui-portal') : true;\n }\n return true;\n }\n return false;\n },\n escapeKey: isTopmost\n });\n useScrollLock(open && modal === true, popupElement);\n\n // Listen for nested open/close events on this store to maintain the counts.\n // A close notification is an open notification with zeroed counts.\n store.useContextCallback('onNestedDialogOpen', (dialogCount, drawerCount) => {\n // A handle-backed root keeps these interactions mounted while closed. Ignore nested roots that\n // open meanwhile so their counts don't carry into the next open session.\n if (!store.select('open') && !store.select('mounted')) {\n return;\n }\n setOwnNestedOpenDialogs(dialogCount);\n setOwnNestedOpenDrawers(drawerCount);\n });\n useIsoLayoutEffect(() => {\n if (!open && !mounted) {\n setOwnNestedOpenDialogs(0);\n setOwnNestedOpenDrawers(0);\n }\n }, [open, mounted]);\n\n // Notify parent of our open/close state using parent callbacks, if any\n useIsoLayoutEffect(() => {\n if (parentContext?.onNestedDialogOpen) {\n if (open) {\n parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));\n }\n }\n return () => {\n if (parentContext?.onNestedDialogOpen && open) {\n parentContext.onNestedDialogOpen(0, 0);\n }\n };\n }, [isDrawer, open, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);\n usePopupInteractionProps(store, {\n // `enabled` is not passed to `useDismiss`, so its props are always defined,\n // and `trigger` is the same object as `reference`.\n activeTriggerProps: dismiss.reference,\n inactiveTriggerProps: dismiss.trigger,\n // DialogPopup and DrawerPopup spread `FOCUSABLE_POPUP_PROPS` directly, so\n // this only needs to carry the dismiss handlers.\n popupProps: dismiss.floating,\n nestedOpenDialogCount: ownNestedOpenDialogs,\n nestedOpenDrawerCount: ownNestedOpenDrawers\n });\n return null;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogRootContext.displayName = \"DialogRootContext\";\nexport function useDialogRootContext(optional) {\n const store = React.useContext(DialogRootContext);\n if (!optional && store === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.' : _formatErrorMessage(27));\n }\n return store;\n}","import { ReactStore } from '@base-ui/utils/store';\n/**\n * A `ReactStore` whose state never changes.\n *\n * Useful for fallback stores that need to support normal store reads while detached from the\n * component that owns real state. Context values may still contain mutable refs or maps.\n */\nexport class NullStore extends ReactStore {\n // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding\n // `setState` alone would neutralize them today. They are overridden explicitly so the store stays\n // inert even if a future base-class change stops routing a mutator through `setState`.\n setState(_newState) {}\n update(_changes) {}\n set(_key, _value) {}\n notifyAll() {}\n}","import * as React from 'react';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { NullStore } from \"../../utils/NullStore.mjs\";\nimport { createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap, createPopupOpenState } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n modal: state => state.modal,\n nested: state => state.nested,\n nestedOpenDialogCount: state => state.nestedOpenDialogCount,\n nestedOpenDrawerCount: state => state.nestedOpenDrawerCount,\n disablePointerDismissal: state => state.disablePointerDismissal,\n openMethod: state => state.openMethod,\n descriptionElementId: state => state.descriptionElementId,\n titleElementId: state => state.titleElementId,\n viewportElement: state => state.viewportElement,\n role: state => state.role\n};\n\n/**\n * The subset of `DialogStore` that detached handle-backed triggers rely on. Both the real\n * `DialogStore` and the inert fallback store satisfy it, so a trigger can read from whichever\n * store the handle currently exposes.\n */\n\nexport class DialogStore extends ReactStore {\n constructor(initialState, floatingId, nested) {\n const triggerElements = new PopupTriggerMap();\n const state = createInitialState(initialState, triggerElements, floatingId, nested);\n super(state, createInitialContext(triggerElements), selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {\n // When closing the dialog, pass the old trigger to the onOpenChange event\n // so it's not reset too early (potentially causing focus issues in controlled scenarios).\n eventDetails.trigger = this.state.activeTriggerElement ?? undefined;\n }\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n this.update(createPopupOpenState(this.state, nextOpen, eventDetails.trigger));\n };\n}\n\n/**\n * Creates the inert fallback store used by detached handle-backed triggers while no\n * `Dialog.Root` is attached. It preserves a dialog-specific trigger registry in context so\n * detached triggers can register before migrating to the live root store.\n */\nexport function createNullDialogStore() {\n const triggerElements = new PopupTriggerMap();\n return new NullStore(Object.freeze(createInitialState(undefined, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);\n}\nfunction createInitialState(initialState, triggerElements, floatingId, nested = false) {\n const state = {\n ...createInitialPopupStoreState(triggerElements, floatingId, nested),\n modal: true,\n disablePointerDismissal: false,\n viewportElement: null,\n descriptionElementId: undefined,\n titleElementId: undefined,\n openMethod: null,\n nested: false,\n nestedOpenDialogCount: 0,\n nestedOpenDrawerCount: 0,\n role: 'dialog',\n ...initialState\n };\n return state;\n}\nfunction createInitialContext(triggerElements) {\n return {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n outsidePressEnabledRef: {\n current: true\n },\n triggerElements,\n onOpenChange: undefined,\n onOpenChangeComplete: undefined\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { DialogInteractions } from \"./useDialogRoot.mjs\";\nimport { DialogRootContext, useDialogRootContext } from \"./DialogRootContext.mjs\";\nimport { DialogStore } from \"../store/DialogStore.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions, PopupHandleAttachment, usePopupRootStore, usePopupRootSync } from \"../../utils/popups/index.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function useRenderDialogRoot(mode, props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal: disablePointerDismissalProp = false,\n modal: modalProp = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null\n } = props;\n const isDrawer = mode === 'drawer';\n const isAlertDialog = mode === 'alert-dialog';\n const modal = isAlertDialog ? true : modalProp;\n const disablePointerDismissal = isAlertDialog || disablePointerDismissalProp;\n const role = isAlertDialog ? 'alertdialog' : 'dialog';\n const parentStore = useDialogRootContext(true);\n const nested = parentStore != null;\n const rootState = {\n modal,\n disablePointerDismissal,\n nested,\n role\n };\n\n // The store is owned by this Root instance and created exactly once. It is not tied to the handle:\n // the handle attaches to it, so swapping the handle re-attaches rather than recreating state.\n // Default values are only initial values; controlled values and root state are synced after creation.\n // Dialogs pass the popup element to Floating UI as the floating element (`treatPopupAsFloatingElement`).\n const store = usePopupRootStore((floatingId, floatingNested) => new DialogStore({\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp,\n ...rootState\n }, floatingId, floatingNested), true);\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useSyncedValues(rootState);\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const payload = store.useState('payload');\n usePopupRootSync(store, open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: () => store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction))\n }), [forceUnmount, store]);\n\n // Detached triggers share this one Root, so mounting its interactions eagerly is cheap. The\n // trigger props they publish then stay stable, so opening and closing doesn't re-render inactive\n // triggers.\n const shouldRenderInteractions = open || mounted || handle != null;\n return /*#__PURE__*/_jsxs(DialogRootContext.Provider, {\n value: store,\n children: [handle && /*#__PURE__*/_jsx(PopupHandleAttachment, {\n handle: handle,\n store: store\n }), shouldRenderInteractions && /*#__PURE__*/_jsx(DialogInteractions, {\n store: store,\n parentContext: parentStore?.context,\n isDrawer: isDrawer\n }), typeof children === 'function' ? children({\n payload\n }) : children]\n });\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogPortalContext.displayName = \"DialogPortalContext\";\nexport function useDialogPortalContext() {\n const value = React.useContext(DialogPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Portal> is missing.' : _formatErrorMessage(26));\n }\n return value;\n}","import { isHTMLElement } from '@floating-ui/utils/dom';\nexport { stopEvent, isIndexOutOfListBounds, isListIndexDisabled, findNonDisabledListIndex, getMaxListIndex, getMinListIndex } from \"../../floating-ui-react/utils.mjs\";\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const HOME = 'Home';\nexport const END = 'End';\nexport const PAGE_UP = 'PageUp';\nexport const PAGE_DOWN = 'PageDown';\nexport const COMPOSITE_KEYS = new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const SHIFT = 'Shift';\nexport const MODIFIER_KEYS = [SHIFT, 'Control', 'Alt', 'Meta'];\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName === 'INPUT';\n}\nexport function isNativeInput(element) {\n if (isInputElement(element) && element.selectionStart != null) {\n return true;\n }\n if (isHTMLElement(element) && element.tagName === 'TEXTAREA') {\n return true;\n }\n return false;\n}\nexport function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {\n if (!scrollContainer || !element || !element.scrollTo) {\n return;\n }\n let targetX = scrollContainer.scrollLeft;\n let targetY = scrollContainer.scrollTop;\n const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;\n const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;\n if (isOverflowingX && orientation !== 'vertical') {\n const elementOffsetLeft = getOffset(scrollContainer, element, 'left');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (direction === 'ltr') {\n if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n }\n }\n if (direction === 'rtl') {\n if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n }\n }\n }\n if (isOverflowingY && orientation !== 'horizontal') {\n const elementOffsetTop = getOffset(scrollContainer, element, 'top');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {\n // overflow upwards, align top edges\n targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;\n } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {\n // overflow downwards, align bottom edges\n targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;\n }\n }\n scrollContainer.scrollTo({\n left: targetX,\n top: targetY,\n behavior: 'auto'\n });\n}\nfunction getOffset(ancestor, element, side) {\n const propName = side === 'left' ? 'offsetLeft' : 'offsetTop';\n let result = 0;\n while (element.offsetParent) {\n result += element[propName];\n if (element.offsetParent === ancestor) {\n break;\n }\n element = element.offsetParent;\n }\n return result;\n}\nfunction getStyles(element) {\n const styles = getComputedStyle(element);\n return {\n scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,\n scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,\n scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,\n scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,\n scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,\n scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,\n scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,\n scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0\n };\n}","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the dialog is open.\n */\nexport const open = CommonPopupDataAttributes.open;\n/**\n * Present when the dialog is closed.\n */\nexport const closed = CommonPopupDataAttributes.closed;\n/**\n * Present when the dialog begins animating in.\n */\nexport const startingStyle = CommonPopupDataAttributes.startingStyle;\n/**\n * Present when the dialog is animating out.\n */\nexport const endingStyle = CommonPopupDataAttributes.endingStyle;\n/**\n * Present when the dialog is nested within another dialog.\n */\nexport const nested = 'data-nested';\n/**\n * Present when the dialog has other open dialogs nested within it.\n */\nexport const nestedDialogOpen = 'data-nested-dialog-open';","import { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport * as DialogPopupDataAttributes from \"../popup/DialogPopupDataAttributes.mjs\";\n\n/**\n * Shared by `Dialog.Popup` and `Dialog.Viewport`, whose states have the same shape.\n * `nested` is not mapped: unmapped `true` booleans already render as `data-nested`.\n */\nexport const dialogStateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping,\n nestedDialogOpen(value) {\n return value ? {\n [DialogPopupDataAttributes.nestedDialogOpen]: ''\n } : null;\n }\n};","import { isReactVersionAtLeast } from \"./reactVersion.mjs\";\nexport function inertValue(value) {\n if (isReactVersionAtLeast(19)) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}","import * as React from 'react';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const InternalBackdrop = /*#__PURE__*/React.forwardRef(function InternalBackdrop(props, ref) {\n const {\n cutout,\n ...otherProps\n } = props;\n let clipPath;\n if (cutout) {\n const rect = cutout.getBoundingClientRect();\n clipPath = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`;\n }\n return /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n role: \"presentation\"\n // Ensures Floating UI's outside press detection runs, as it considers\n // it an element that existed when the popup rendered.\n ,\n \"data-base-ui-inert\": \"\",\n ...otherProps,\n style: {\n position: 'fixed',\n inset: 0,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n clipPath\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") InternalBackdrop.displayName = \"InternalBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { DialogPortalContext } from \"./DialogPortalContext.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const DialogPortal = /*#__PURE__*/React.forwardRef(function DialogPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useDialogRootContext();\n const mounted = store.useState('mounted');\n const modal = store.useState('modal');\n const open = store.useState('open');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(DialogPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsxs(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps,\n children: [mounted && modal === true && /*#__PURE__*/_jsx(InternalBackdrop, {\n ref: store.context.internalBackdropRef,\n inert: inertValue(!open)\n }), props.children]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPortal.displayName = \"DialogPortal\";","'use client';\n\nimport * as React from 'react';\n/**\n * Provides a cross-browser way to determine the type of the pointer used to click.\n * Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.\n * Additionally, this implementation detects if the click was triggered by the keyboard.\n *\n * @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.\n */\nexport function useEnhancedClickHandler(handler) {\n const lastClickInteractionTypeRef = React.useRef('');\n const handlePointerDown = React.useCallback(event => {\n if (event.defaultPrevented) {\n return;\n }\n lastClickInteractionTypeRef.current = event.pointerType;\n handler(event, event.pointerType);\n }, [handler]);\n const handleClick = React.useCallback(event => {\n // event.detail has the number of clicks performed on the element. 0 means it was triggered by the keyboard.\n if (event.detail === 0) {\n handler(event, 'keyboard');\n return;\n }\n if ('pointerType' in event) {\n // Chrome and Edge correctly use PointerEvent\n handler(event, event.pointerType);\n } else {\n handler(event, lastClickInteractionTypeRef.current);\n }\n lastClickInteractionTypeRef.current = '';\n }, [handler]);\n return {\n onClick: handleClick,\n onPointerDown: handlePointerDown\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useEnhancedClickHandler } from '@base-ui/utils/useEnhancedClickHandler';\nimport { platform } from '@base-ui/utils/platform';\nimport { useValueChanged } from \"../internals/useValueChanged.mjs\";\nexport function useOpenMethodTriggerProps(open, setOpenMethod) {\n const handleTriggerClick = useStableCallback((_, interactionType) => {\n const isOpen = typeof open === 'function' ? open() : open;\n if (!isOpen) {\n setOpenMethod(interactionType || (\n // On iOS Safari, the hitslop around touch targets means tapping outside an element's\n // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`\n // will be \"\" in that case.\n platform.os.ios ? 'touch' : ''));\n }\n });\n const {\n onClick,\n onPointerDown\n } = useEnhancedClickHandler(handleTriggerClick);\n return React.useMemo(() => ({\n onClick,\n onPointerDown\n }), [onClick, onPointerDown]);\n}\n\n/**\n * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.\n *\n * @param open The open state of the component.\n */\nexport function useOpenInteractionType(open) {\n const [openMethod, setOpenMethod] = React.useState(null);\n const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);\n useValueChanged(open, previousOpen => {\n if (previousOpen && !open) {\n setOpenMethod(null);\n }\n });\n return React.useMemo(() => ({\n openMethod,\n triggerProps\n }), [openMethod, triggerProps]);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { fastComponentRef } from '@base-ui/utils/fastHooks';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useButton } from \"../../internals/use-button/useButton.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../internals/constants.mjs\";\nimport { usePopupHandleStore, useTriggerDataForwarding } from \"../../utils/popups/index.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useClick } from \"../../floating-ui-react/index.mjs\";\nimport { useOpenMethodTriggerProps } from \"../../utils/useOpenInteractionType.mjs\";\n\n/**\n * A button that opens the dialog.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogTrigger = fastComponentRef(function DialogTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled = false,\n nativeButton = true,\n id: idProp,\n payload,\n handle,\n ...elementProps\n } = componentProps;\n const dialogRootStore = useDialogRootContext(true);\n const handleStore = usePopupHandleStore(handle);\n const store = handleStore ?? dialogRootStore;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.' : _formatErrorMessage(79));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const floatingContext = store.useState('floatingRootContext');\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const popupId = store.useState('triggerPopupId', thisTriggerId);\n const triggerElementRef = React.useRef(null);\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const click = useClick(floatingContext);\n const interactionTypeProps = useOpenMethodTriggerProps(() => store.select('open'), interactionType => {\n store.set('openMethod', interactionType);\n });\n const state = {\n disabled,\n open: isOpenedByThisTrigger\n };\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n return useRenderElement('button', componentProps, {\n state,\n ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],\n props: [click.reference, rootTriggerProps, interactionTypeProps, {\n [CLICK_TRIGGER_IDENTIFIER]: '',\n id: thisTriggerId,\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpenedByThisTrigger,\n 'aria-controls': popupId\n }, elementProps, getButtonProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogTrigger.displayName = \"DialogTrigger\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A positioning container for the dialog popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogViewport = /*#__PURE__*/React.forwardRef(function DialogViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const keepMounted = useDialogPortalContext();\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const transitionStatus = store.useState('transitionStatus');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const mounted = store.useState('mounted');\n const setViewportElement = store.useStateSetter('viewportElement');\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const shouldRender = keepMounted || mounted;\n return useRenderElement('div', componentProps, {\n enabled: shouldRender,\n state,\n ref: [forwardedRef, setViewportElement],\n stateAttributesMapping: dialogStateAttributesMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined\n },\n children\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogViewport.displayName = \"DialogViewport\";","import { createNullDialogStore } from \"./DialogStore.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { BasePopupHandle } from \"../../utils/popups/popupHandle.mjs\";\n\n/**\n * Controls a Dialog imperatively and associates detached `Dialog.Trigger` components with a\n * `Dialog.Root`. Create one with `Dialog.createHandle()` and pass it to the `handle` prop of the\n * root and of any triggers rendered outside of it.\n *\n * The imperative methods take effect only while a root using this handle is mounted; calls made\n * before a root attaches (or after it unmounts) are ignored.\n */\nexport class DialogHandle extends BasePopupHandle {\n constructor() {\n super(createNullDialogStore(), 'Dialog', false);\n }\n\n /**\n * Opens the dialog, optionally associating it with a trigger.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n *\n * @param triggerId ID of the trigger to associate with the dialog. The trigger must be a matching\n * `Dialog.Trigger` with this handle passed as a prop. Pass `null` to open without associating any trigger.\n */\n open(triggerId) {\n this.openByTrigger(triggerId);\n }\n\n /**\n * Opens the dialog with the given payload, without associating it with any trigger.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n *\n * @param payload Payload to set when opening the dialog. It is exposed to the root's render-prop children.\n */\n openWithPayload(payload) {\n const attachedStore = this.attachedStore;\n if (attachedStore === null) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Base UI: DialogHandle.openWithPayload() was called while no root using this handle is mounted. ' + 'The call and its payload were ignored; mount a root with this handle before opening it imperatively.');\n }\n return;\n }\n attachedStore.set('payload', payload);\n attachedStore.setOpen(true, createChangeEventDetails(REASONS.imperativeAction));\n }\n\n /**\n * Closes the dialog.\n *\n * This method should only be called in an event handler or an effect (not during rendering).\n */\n close() {\n this.closePopup();\n }\n\n /**\n * Whether the dialog is currently open. Returns `false` while no root is attached to the handle.\n */\n get isOpen() {\n return this.attachedStore?.select('open') ?? false;\n }\n}\n\n/**\n * Creates a new handle to connect a Dialog.Root with detached Dialog.Trigger components.\n */\nexport function createDialogHandle() {\n return new DialogHandle();\n}","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the dialog is open.\n */\nexport const open = CommonPopupDataAttributes.open;\n/**\n * Present when the dialog is closed.\n */\nexport const closed = CommonPopupDataAttributes.closed;\n/**\n * Present when the dialog begins animating in.\n */\nexport const startingStyle = CommonPopupDataAttributes.startingStyle;\n/**\n * Present when the dialog is animating out.\n */\nexport const endingStyle = CommonPopupDataAttributes.endingStyle;\n/**\n * Present when the dialog is nested within another dialog.\n */\nexport const nested = 'data-nested';\n/**\n * Present when the dialog has other open dialogs nested within it.\n */\nexport const nestedDialogOpen = 'data-nested-dialog-open';","/**\n * The number of nested drawers that are currently open.\n * @type {number}\n */\nexport const nestedDrawers = '--nested-drawers';\n/**\n * The height of the drawer popup.\n * @type {CSS length}\n */\nexport const height = '--drawer-height';\n/**\n * The height of the frontmost open drawer in the current nested drawer stack.\n * @type {CSS length}\n */\nexport const frontmostHeight = '--drawer-frontmost-height';\n/**\n * The swipe movement on the X axis.\n * @type {CSS length}\n */\nexport const swipeMovementX = '--drawer-swipe-movement-x';\n/**\n * The swipe movement on the Y axis.\n * @type {CSS length}\n */\nexport const swipeMovementY = '--drawer-swipe-movement-y';\n/**\n * The snap point offset used for translating the drawer.\n * @type {CSS length}\n */\nexport const snapPointOffset = '--drawer-snap-point-offset';\n/**\n * A scalar (0.1-1) used to scale the swipe release transition duration in CSS.\n * @type {number}\n */\nexport const swipeStrength = '--drawer-swipe-strength';","/**\n * The swipe progress of the drawer gesture.\n * @type {number}\n */\nexport const swipeProgress = '--drawer-swipe-progress';","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport * as DrawerPopupCssVars from \"../popup/DrawerPopupCssVars.mjs\";\nimport * as DrawerBackdropCssVars from \"./DrawerBackdropCssVars.mjs\";\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerBackdrop = /*#__PURE__*/React.forwardRef(function DrawerBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n [DrawerBackdropCssVars.swipeProgress]: '0',\n [DrawerPopupCssVars.swipeStrength]: '1'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerBackdrop.displayName = \"DrawerBackdrop\";","export const DRAWER_CONTENT_ATTRIBUTE = 'data-drawer-content';","'use client';\n\nimport * as React from 'react';\nexport const DrawerProviderContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerProviderContext.displayName = \"DrawerProviderContext\";\nexport function useDrawerProviderContext() {\n return React.useContext(DrawerProviderContext);\n}","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the drawer is open.\n */\nexport const open = CommonPopupDataAttributes.open;\n/**\n * Present when the drawer is closed.\n */\nexport const closed = CommonPopupDataAttributes.closed;\n/**\n * Present when the drawer begins animating in.\n */\nexport const startingStyle = CommonPopupDataAttributes.startingStyle;\n/**\n * Present when the drawer is animating out.\n */\nexport const endingStyle = CommonPopupDataAttributes.endingStyle;\n/**\n * Present when the drawer is at the expanded (full-height) snap point.\n */\nexport const expanded = 'data-expanded';\n/**\n * Present when a nested drawer is open.\n */\nexport const nestedDrawerOpen = 'data-nested-drawer-open';\n/**\n * Present when a nested drawer is being swiped.\n */\nexport const nestedDrawerSwiping = 'data-nested-drawer-swiping';\n/**\n * Present when the drawer is dismissed by swiping.\n */\nexport const swipeDismiss = 'data-swipe-dismiss';\n/**\n * Indicates the swipe direction.\n * @type {'up' | 'down' | 'left' | 'right'}\n */\nexport const swipeDirection = 'data-swipe-direction';\n/**\n * Present when the drawer is being swiped.\n */\nexport const swiping = 'data-swiping';","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DrawerRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerRootContext.displayName = \"DrawerRootContext\";\nexport function useDrawerRootContext(optional) {\n const drawerRootContext = React.useContext(DrawerRootContext);\n if (optional !== true && drawerRootContext === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.' : _formatErrorMessage(90));\n }\n return drawerRootContext;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useDrawerRootContext } from \"./DrawerRootContext.mjs\";\n/**\n * Resolves the vertical swipe movement for a snap point, applying square-root damping once the drag\n * overshoots the fully-open edge (`nextOffset < 0`) so the popup resists travelling past it.\n */\nexport function getSnapPointSwipeMovement(baseOffset, movementValue) {\n const nextOffset = baseOffset + movementValue;\n if (nextOffset >= 0) {\n return movementValue;\n }\n return -Math.sqrt(-nextOffset) - baseOffset;\n}\nfunction resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {\n if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {\n return null;\n }\n if (typeof snapPoint === 'number') {\n if (!Number.isFinite(snapPoint)) {\n return null;\n }\n if (snapPoint <= 1) {\n return clamp(snapPoint, 0, 1) * viewportHeight;\n }\n return snapPoint;\n }\n const trimmed = snapPoint.trim();\n if (trimmed.endsWith('px')) {\n const value = Number.parseFloat(trimmed);\n return Number.isFinite(value) ? value : null;\n }\n if (trimmed.endsWith('rem')) {\n const value = Number.parseFloat(trimmed);\n return Number.isFinite(value) ? value * rootFontSize : null;\n }\n return null;\n}\n\n/**\n * Returns the index of the value closest to `target`, or `-1` if `values` is empty.\n */\nexport function closestSnapPointIndex(values, target) {\n let closestIndex = -1;\n let closestDistance = Infinity;\n for (let index = 0; index < values.length; index += 1) {\n const distance = Math.abs(values[index] - target);\n if (distance < closestDistance) {\n closestDistance = distance;\n closestIndex = index;\n }\n }\n return closestIndex;\n}\nexport function useDrawerSnapPoints() {\n const store = useDialogRootContext();\n const {\n snapPoints,\n activeSnapPoint,\n setActiveSnapPoint,\n popupHeight\n } = useDrawerRootContext();\n const viewportElement = store.useState('viewportElement');\n const [viewportHeight, setViewportHeight] = React.useState(0);\n const [rootFontSize, setRootFontSize] = React.useState(16);\n const measureViewportHeight = useStableCallback(() => {\n const doc = ownerDocument(viewportElement);\n const html = doc.documentElement;\n setViewportHeight(viewportElement ? viewportElement.offsetHeight : html.clientHeight);\n const fontSize = parseFloat(getComputedStyle(html).fontSize);\n if (Number.isFinite(fontSize)) {\n setRootFontSize(fontSize);\n }\n });\n useIsoLayoutEffect(() => {\n measureViewportHeight();\n if (!viewportElement || typeof ResizeObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(measureViewportHeight);\n resizeObserver.observe(viewportElement);\n return () => {\n resizeObserver.disconnect();\n };\n }, [measureViewportHeight, viewportElement]);\n const resolvedSnapPoints = React.useMemo(() => {\n if (!snapPoints || snapPoints.length === 0 || viewportHeight <= 0 || popupHeight <= 0) {\n return [];\n }\n const maxHeight = Math.min(popupHeight, viewportHeight);\n const resolved = snapPoints.map(value => {\n const resolvedHeight = resolveSnapPointValue(value, viewportHeight, rootFontSize);\n if (resolvedHeight === null) {\n return null;\n }\n const clampedHeight = clamp(resolvedHeight, 0, maxHeight);\n return {\n value,\n height: clampedHeight,\n offset: Math.max(0, popupHeight - clampedHeight)\n };\n }).filter(point => Boolean(point));\n if (resolved.length <= 1) {\n return resolved;\n }\n const deduped = [];\n const seenHeights = [];\n for (let index = resolved.length - 1; index >= 0; index -= 1) {\n const point = resolved[index];\n const isDuplicate = seenHeights.some(height => Math.abs(height - point.height) <= 1);\n if (isDuplicate) {\n continue;\n }\n seenHeights.push(point.height);\n deduped.push(point);\n }\n deduped.reverse();\n return deduped;\n }, [popupHeight, rootFontSize, snapPoints, viewportHeight]);\n const resolvedActiveSnapPoint = React.useMemo(() => {\n if (activeSnapPoint === null) {\n return undefined;\n }\n const exactMatch = resolvedSnapPoints.find(point => Object.is(point.value, activeSnapPoint));\n if (exactMatch) {\n return exactMatch;\n }\n const maxHeight = Math.min(popupHeight, viewportHeight);\n const resolvedHeight = resolveSnapPointValue(activeSnapPoint, viewportHeight, rootFontSize);\n if (resolvedHeight === null) {\n return undefined;\n }\n const clampedHeight = clamp(resolvedHeight, 0, maxHeight);\n return resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map(point => point.height), clampedHeight)];\n }, [activeSnapPoint, popupHeight, resolvedSnapPoints, rootFontSize, viewportHeight]);\n return {\n snapPoints,\n activeSnapPoint,\n setActiveSnapPoint,\n popupHeight,\n viewportHeight,\n resolvedSnapPoints,\n activeSnapPointOffset: resolvedActiveSnapPoint?.offset ?? null\n };\n}","'use client';\n\nimport * as React from 'react';\nexport const DrawerViewportContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") DrawerViewportContext.displayName = \"DrawerViewportContext\";\nexport function useDrawerViewportContext() {\n return React.useContext(DrawerViewportContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport * as DrawerBackdropCssVars from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport * as DrawerPopupCssVars from \"./DrawerPopupCssVars.mjs\";\nimport * as DrawerPopupDataAttributes from \"./DrawerPopupDataAttributes.mjs\";\nimport { useDialogPortalContext } from \"../../dialog/portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { getSnapPointSwipeMovement, useDrawerSnapPoints } from \"../root/useDrawerSnapPoints.mjs\";\nimport { useDrawerViewportContext } from \"../viewport/DrawerViewportContext.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\n\n// Module-level flag to ensure we only register the CSS properties once,\n// regardless of how many Drawer components are mounted.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet drawerSwipeVarsRegistered = false;\n\n/**\n * Removes inheritance of high-frequency drawer swipe CSS variables, which\n * reduces style recalculation cost in complex drawers with deep subtrees.\n * See https://motion.dev/blog/web-animation-performance-tier-list\n * under the \"Improving CSS variable performance\" section.\n */\nfunction removeCSSVariableInheritance() {\n if (drawerSwipeVarsRegistered) {\n return;\n }\n\n // Intentionally keep inheritance disabled on WebKit as well. Safari doesn't support\n // opting descendants back in via `--var: inherit` for custom properties registered\n // with `inherits: false`, but Drawer does not rely on descendant access to these vars\n // (unlike ScrollArea), so we keep the performance optimization enabled.\n if (typeof CSS !== 'undefined' && 'registerProperty' in CSS) {\n [DrawerPopupCssVars.swipeMovementX, DrawerPopupCssVars.swipeMovementY, DrawerPopupCssVars.snapPointOffset].forEach(name => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<length>',\n inherits: false,\n initialValue: '0px'\n });\n } catch {\n /* ignore already-registered */\n }\n });\n [{\n name: DrawerBackdropCssVars.swipeProgress,\n initialValue: '0'\n }, {\n name: DrawerPopupCssVars.swipeStrength,\n initialValue: '1'\n }].forEach(({\n name,\n initialValue\n }) => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<number>',\n inherits: false,\n initialValue\n });\n } catch {\n /* ignore already-registered */\n }\n });\n }\n drawerSwipeVarsRegistered = true;\n}\nconst stateAttributesMapping = {\n ...popupTransitionStateMapping,\n expanded(value) {\n return value ? {\n [DrawerPopupDataAttributes.expanded]: ''\n } : null;\n },\n nestedDrawerOpen(value) {\n return value ? {\n [DrawerPopupDataAttributes.nestedDrawerOpen]: ''\n } : null;\n },\n nestedDrawerSwiping(value) {\n return value ? {\n [DrawerPopupDataAttributes.nestedDrawerSwiping]: ''\n } : null;\n },\n swipeDirection(value) {\n return {\n [DrawerPopupDataAttributes.swipeDirection]: value\n };\n },\n swiping(value) {\n return value ? {\n [DrawerPopupDataAttributes.swiping]: ''\n } : null;\n }\n};\n\n/**\n * A container for the drawer contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerPopup = /*#__PURE__*/React.forwardRef(function DrawerPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const popupRef = store.context.popupRef;\n const {\n swipeDirection,\n frontmostHeight,\n hasNestedDrawer,\n nestedSwiping,\n nestedSwipeProgressStore,\n onPopupHeightChange,\n notifyParentFrontmostHeight,\n notifyParentHasNestedDrawer\n } = useDrawerRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDrawerCount = store.useState('nestedOpenDrawerCount');\n const transitionStatus = store.useState('transitionStatus');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n const popupId = elementProps.id ?? floatingId;\n const swipe = useDrawerViewportContext();\n useDialogPortalContext();\n const {\n snapPoints,\n activeSnapPoint,\n activeSnapPointOffset\n } = useDrawerSnapPoints();\n const nestedDrawerOpen = nestedOpenDrawerCount > 0;\n const swiping = swipe?.swiping ?? false;\n const swipeStrength = swipe?.swipeStrength ?? null;\n const [popupHeight, setPopupHeight] = React.useState(0);\n const popupHeightRef = React.useRef(0);\n\n /* istanbul ignore else -- process.env.NODE_ENV is a build-time constant. */\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (swipe) {\n return;\n }\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the ' + 'viewport disables drawer swipe handling and touch scroll locking. Wrap ' + '<Drawer.Popup> in <Drawer.Viewport>.';\n error(`${message}${ownerStackMessage}`);\n }, [swipe]);\n }\n const measureHeight = useStableCallback(() => {\n const popupElement = popupRef.current;\n if (!popupElement) {\n return;\n }\n const offsetHeight = popupElement.offsetHeight;\n\n // Only skip while the element is still actually stretched beyond its last measured height.\n if (popupHeightRef.current > 0 && frontmostHeight > popupHeightRef.current && offsetHeight > popupHeightRef.current) {\n return;\n }\n const keepHeightWhileNested = popupHeightRef.current > 0 && hasNestedDrawer;\n if (keepHeightWhileNested) {\n const oldHeight = popupHeightRef.current;\n setPopupHeight(oldHeight);\n onPopupHeightChange(oldHeight);\n return;\n }\n const nextHeight = offsetHeight;\n if (nextHeight === popupHeightRef.current) {\n return;\n }\n popupHeightRef.current = nextHeight;\n setPopupHeight(nextHeight);\n onPopupHeightChange(nextHeight);\n });\n useIsoLayoutEffect(() => {\n if (!mounted) {\n popupHeightRef.current = 0;\n setPopupHeight(0);\n onPopupHeightChange(0);\n return undefined;\n }\n const popupElement = popupRef.current;\n if (!popupElement) {\n return undefined;\n }\n removeCSSVariableInheritance();\n measureHeight();\n if (typeof ResizeObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(measureHeight);\n resizeObserver.observe(popupElement);\n return () => {\n resizeObserver.disconnect();\n };\n }, [measureHeight, mounted, nestedDrawerOpen, onPopupHeightChange, popupRef]);\n useIsoLayoutEffect(() => {\n const syncNestedSwipeProgress = () => {\n const popupElement = popupRef.current;\n if (!popupElement) {\n return;\n }\n const progress = nestedSwipeProgressStore.getSnapshot();\n if (progress > 0) {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${progress}`);\n } else {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n }\n };\n syncNestedSwipeProgress();\n const unsubscribe = nestedSwipeProgressStore.subscribe(syncNestedSwipeProgress);\n const popupElement = popupRef.current;\n return () => {\n unsubscribe();\n if (popupElement) {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n }\n };\n }, [nestedSwipeProgressStore, popupRef]);\n useIsoLayoutEffect(() => {\n if (!open) {\n return undefined;\n }\n notifyParentFrontmostHeight?.(frontmostHeight);\n return () => {\n notifyParentFrontmostHeight?.(0);\n };\n }, [frontmostHeight, open, notifyParentFrontmostHeight]);\n useIsoLayoutEffect(() => {\n if (!notifyParentHasNestedDrawer) {\n return undefined;\n }\n const present = open || transitionStatus === 'ending';\n notifyParentHasNestedDrawer(present);\n return () => {\n notifyParentHasNestedDrawer(false);\n };\n }, [notifyParentHasNestedDrawer, open, transitionStatus]);\n useOpenChangeComplete({\n open,\n ref: popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? popupRef : initialFocus;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n expanded: activeSnapPoint === 1,\n nestedDrawerOpen,\n nestedDrawerSwiping: nestedSwiping,\n swipeDirection,\n swiping\n };\n let popupHeightCssVarValue;\n const shouldUseAutoHeight = !hasNestedDrawer && transitionStatus !== 'ending';\n if (popupHeight && !shouldUseAutoHeight) {\n popupHeightCssVarValue = `${popupHeight}px`;\n }\n const shouldApplySnapPoints = snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up');\n let snapPointOffsetValue = null;\n if (shouldApplySnapPoints && activeSnapPointOffset !== null) {\n snapPointOffsetValue = swipeDirection === 'up' ? -activeSnapPointOffset : activeSnapPointOffset;\n }\n let dragStyles = swipe ? swipe.getDragStyles() : EMPTY_OBJECT;\n if (shouldApplySnapPoints && swipeDirection === 'down') {\n const baseOffset = activeSnapPointOffset ?? 0;\n const movementValue = Number.parseFloat(String(dragStyles[DrawerPopupCssVars.swipeMovementY]));\n if (swiping && Number.isFinite(movementValue)) {\n dragStyles = {\n ...dragStyles,\n transform: undefined,\n [DrawerPopupCssVars.swipeMovementY]: `${getSnapPointSwipeMovement(baseOffset, movementValue)}px`\n };\n } else {\n dragStyles = {\n ...dragStyles,\n transform: undefined\n };\n }\n }\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: popupId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n ...dragStyles,\n [DrawerBackdropCssVars.swipeProgress]: '0',\n [DrawerPopupCssVars.nestedDrawers]: nestedOpenDrawerCount,\n [DrawerPopupCssVars.height]: popupHeightCssVarValue,\n [DrawerPopupCssVars.snapPointOffset]: typeof snapPointOffsetValue === 'number' ? `${snapPointOffsetValue}px` : '0px',\n [DrawerPopupCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : undefined,\n [DrawerPopupCssVars.swipeStrength]: typeof swipeStrength === 'number' && Number.isFinite(swipeStrength) && swipeStrength > 0 ? `${swipeStrength}` : '1'\n }\n }, elementProps],\n ref: [forwardedRef, popupRef, setPopupElement],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerPopup.displayName = \"DrawerPopup\";","'use client';\n\nimport { DialogPortal } from \"../../dialog/portal/DialogPortal.mjs\";\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerPortal = DialogPortal;","'use client';\n\nvar _DrawerProviderReport, _DrawerProviderReport2;\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { platform } from '@base-ui/utils/platform';\nimport { DrawerRootContext, useDrawerRootContext } from \"./DrawerRootContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderDialogRoot } from \"../../dialog/root/useRenderDialogRoot.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the drawer.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport function DrawerRoot(props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal = false,\n modal = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n swipeDirection = 'down',\n snapToSequentialPoints = false,\n snapPoints,\n snapPoint: snapPointProp,\n defaultSnapPoint,\n onSnapPointChange\n } = props;\n const parentDrawerRootContext = useDrawerRootContext(true);\n const notifyParentSwipeProgressChange = parentDrawerRootContext?.onNestedSwipeProgressChange;\n const notifyParentFrontmostHeight = parentDrawerRootContext?.onNestedFrontmostHeightChange;\n const notifyParentSwipingChange = parentDrawerRootContext?.onNestedSwipingChange;\n const notifyParentHasNestedDrawer = parentDrawerRootContext?.onNestedDrawerPresenceChange;\n const [popupHeight, setPopupHeight] = React.useState(0);\n const [frontmostHeight, setFrontmostHeight] = React.useState(0);\n const [hasNestedDrawer, setHasNestedDrawer] = React.useState(false);\n const [nestedSwiping, setNestedSwiping] = React.useState(false);\n const [nestedSwipeProgressStore] = React.useState(createNestedSwipeProgressStore);\n const resolvedDefaultSnapPoint = defaultSnapPoint !== undefined ? defaultSnapPoint : snapPoints?.[0] ?? null;\n const isSnapPointControlled = snapPointProp !== undefined;\n const [activeSnapPoint, setActiveSnapPointUnwrapped] = useControlled({\n controlled: snapPointProp,\n default: resolvedDefaultSnapPoint,\n name: 'Drawer',\n state: 'snapPoint'\n });\n const isNestedDrawerOpenRef = React.useRef(false);\n const swipeAreaActiveRef = React.useRef(false);\n const setActiveSnapPoint = useStableCallback((nextSnapPoint, eventDetails) => {\n const resolvedEventDetails = eventDetails ?? createChangeEventDetails(REASONS.none);\n onSnapPointChange?.(nextSnapPoint, resolvedEventDetails);\n if (resolvedEventDetails.isCanceled) {\n return;\n }\n setActiveSnapPointUnwrapped(nextSnapPoint);\n });\n const resolvedActiveSnapPoint = React.useMemo(() => {\n if (isSnapPointControlled) {\n return activeSnapPoint;\n }\n if (!snapPoints || snapPoints.length === 0) {\n return activeSnapPoint;\n }\n if (activeSnapPoint === null || !snapPoints.some(snapPoint => Object.is(snapPoint, activeSnapPoint))) {\n return resolvedDefaultSnapPoint;\n }\n return activeSnapPoint;\n }, [activeSnapPoint, isSnapPointControlled, resolvedDefaultSnapPoint, snapPoints]);\n const onPopupHeightChange = useStableCallback(height => {\n setPopupHeight(height);\n if (!isNestedDrawerOpenRef.current && height > 0) {\n setFrontmostHeight(height);\n }\n });\n const onNestedFrontmostHeightChange = useStableCallback(height => {\n if (height > 0) {\n isNestedDrawerOpenRef.current = true;\n setFrontmostHeight(height);\n return;\n }\n isNestedDrawerOpenRef.current = false;\n if (popupHeight > 0) {\n setFrontmostHeight(popupHeight);\n }\n });\n const onNestedDrawerPresenceChange = useStableCallback(present => {\n setHasNestedDrawer(present);\n });\n const onNestedSwipeProgressChange = useStableCallback(progress => {\n nestedSwipeProgressStore.set(progress);\n notifyParentSwipeProgressChange?.(progress);\n });\n const onNestedSwipingChange = useStableCallback(swiping => {\n setNestedSwiping(swiping);\n notifyParentSwipingChange?.(swiping);\n });\n const handleOpenChange = useStableCallback((nextOpen, eventDetails) => {\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n if (!nextOpen && snapPoints && snapPoints.length > 0) {\n setActiveSnapPoint(resolvedDefaultSnapPoint, createChangeEventDetails(eventDetails.reason, eventDetails.event, eventDetails.trigger));\n }\n });\n const contextValue = React.useMemo(() => ({\n swipeDirection,\n swipeAreaActiveRef,\n snapToSequentialPoints,\n snapPoints,\n activeSnapPoint: resolvedActiveSnapPoint,\n setActiveSnapPoint,\n frontmostHeight,\n popupHeight,\n hasNestedDrawer,\n nestedSwiping,\n nestedSwipeProgressStore,\n onNestedDrawerPresenceChange,\n onPopupHeightChange,\n onNestedFrontmostHeightChange,\n onNestedSwipingChange,\n onNestedSwipeProgressChange,\n notifyParentFrontmostHeight,\n notifyParentSwipingChange,\n notifyParentSwipeProgressChange,\n notifyParentHasNestedDrawer\n }), [resolvedActiveSnapPoint, frontmostHeight, hasNestedDrawer, nestedSwiping, nestedSwipeProgressStore, notifyParentHasNestedDrawer, notifyParentSwipeProgressChange, notifyParentSwipingChange, notifyParentFrontmostHeight, onNestedDrawerPresenceChange, onNestedFrontmostHeightChange, onNestedSwipeProgressChange, onNestedSwipingChange, onPopupHeightChange, popupHeight, setActiveSnapPoint, snapPoints, snapToSequentialPoints, swipeAreaActiveRef, swipeDirection]);\n const resolvedChildren = typeof children === 'function' ? payload => /*#__PURE__*/_jsxs(React.Fragment, {\n children: [_DrawerProviderReport || (_DrawerProviderReport = /*#__PURE__*/_jsx(DrawerProviderReporter, {})), children(payload)]\n }) : /*#__PURE__*/_jsxs(React.Fragment, {\n children: [_DrawerProviderReport2 || (_DrawerProviderReport2 = /*#__PURE__*/_jsx(DrawerProviderReporter, {})), children]\n });\n const dialog = useRenderDialogRoot('drawer', {\n open: openProp,\n defaultOpen,\n onOpenChange: handleOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal,\n modal,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp,\n children: resolvedChildren\n });\n return /*#__PURE__*/_jsx(DrawerRootContext.Provider, {\n value: contextValue,\n children: dialog\n });\n}\nfunction createNestedSwipeProgressStore() {\n let progress = 0;\n const listeners = new Set();\n return {\n getSnapshot: () => progress,\n set(nextProgress) {\n const resolved = Number.isFinite(nextProgress) ? nextProgress : 0;\n if (resolved === progress) {\n return;\n }\n progress = resolved;\n listeners.forEach(listener => {\n listener();\n });\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n }\n };\n}\nfunction DrawerProviderReporter() {\n const providerContext = useDrawerProviderContext();\n const store = useDialogRootContext(false);\n const setDrawerOpen = providerContext?.setDrawerOpen;\n const removeDrawer = providerContext?.removeDrawer;\n const open = store.useState('open');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const popupElement = store.useState('popupElement');\n const isTopmost = nestedOpenDialogCount === 0;\n useIsoLayoutEffect(() => {\n if (!removeDrawer) {\n return undefined;\n }\n return () => {\n removeDrawer(store);\n };\n }, [removeDrawer, store]);\n useIsoLayoutEffect(() => {\n setDrawerOpen?.(store, open);\n }, [open, setDrawerOpen, store]);\n React.useEffect(() => {\n // CloseWatcher enables the Android back gesture (Chromium-only).\n // Keep this Android-only for now to avoid interfering with Escape/nesting semantics on desktop due to `useDismiss`.\n if (!open || !isTopmost || !platform.os.android) {\n return undefined;\n }\n const win = ownerWindow(popupElement);\n const CloseWatcherCtor = win.CloseWatcher;\n if (!CloseWatcherCtor) {\n return undefined;\n }\n function handleCancel(event) {\n if (!store.select('open')) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.closeWatcher, event);\n if (!event.cancelable) {\n // The browser lets only one close request per user activation be prevented; any further\n // request closes the drawer regardless, like a native `<dialog>`.\n eventDetails.cancel = NOOP;\n }\n store.setOpen(false, eventDetails);\n if (eventDetails.isCanceled) {\n // Keeps this watcher active for the next close request.\n event.preventDefault();\n }\n }\n const closeWatcher = new CloseWatcherCtor();\n // The browser destroys the watcher before `close` fires, so the request is handled from\n // `cancel`, where it can still be prevented.\n const unsubscribe = addEventListener(closeWatcher, 'cancel', handleCancel);\n return () => {\n unsubscribe();\n closeWatcher.destroy();\n };\n }, [store, isTopmost, open, popupElement]);\n return null;\n}","import { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode } from '@floating-ui/utils/dom';\nexport function isScrollableY(element, allowOverflowIntent = false) {\n const {\n overflowY\n } = getComputedStyle(element);\n if (overflowY !== 'auto' && overflowY !== 'scroll') {\n return false;\n }\n // When `allowOverflowIntent` is true, a container that overflows only once extra space is\n // added (e.g. drawer keyboard scroll slack) still counts, as long as it has layout size on\n // the axis.\n return allowOverflowIntent ? element.clientHeight > 0 : element.scrollHeight > element.clientHeight;\n}\nexport function isScrollableX(element, allowOverflowIntent = false) {\n const {\n overflowX\n } = getComputedStyle(element);\n if (overflowX !== 'auto' && overflowX !== 'scroll') {\n return false;\n }\n return allowOverflowIntent ? element.clientWidth > 0 : element.scrollWidth > element.clientWidth;\n}\nexport function isScrollable(element, axis, allowOverflowIntent = false) {\n return axis === 'vertical' ? isScrollableY(element, allowOverflowIntent) : isScrollableX(element, allowOverflowIntent);\n}\nexport function findScrollableAncestor(target, root, axis, allowOverflowIntent = false) {\n // `getParentNode` crosses shadow boundaries (and slots), so a target inside a shadow root\n // still walks up to scrollable ancestors in the light DOM. Non-HTML targets (SVG, MathML)\n // can't scroll, but their HTML ancestors can.\n let node = target;\n while (isElement(node) && node !== root && !isLastTraversableNode(node)) {\n if (isHTMLElement(node) && isScrollable(node, axis, allowOverflowIntent)) {\n return node;\n }\n node = getParentNode(node);\n }\n return null;\n}\nexport function findScrollableTouchTarget(target, root, axis = 'vertical', allowOverflowIntent = false) {\n return findScrollableAncestor(target, root, axis, allowOverflowIntent) ?? (isScrollable(root, axis, allowOverflowIntent) ? root : null);\n}","// `Document.elementFromPoint` retargets shadow content to the shadow host, which then fails\n// `contains()` checks against a popup inside that shadow root, so callers pass `getRootNode()`\n// (a document or a shadow root) rather than `ownerDocument()`.\nexport function getElementAtPoint(root, x, y) {\n return typeof root?.elementFromPoint === 'function' ? root.elementFromPoint(x, y) : null;\n}","import { ownerWindow } from '@base-ui/utils/owner';\n\n/**\n * Extracts the 2D translation and scale from the element's computed `transform` matrix.\n * Note that the `translate`, `rotate`, and `scale` longhands are separate properties and\n * are not reflected in the computed `transform` value.\n *\n * Pass `computedStyle` when the caller has already resolved it to avoid a second lookup.\n */\nexport function getElementTransform(element, computedStyle) {\n const transform = (computedStyle ?? ownerWindow(element).getComputedStyle(element)).transform;\n let translateX = 0;\n let translateY = 0;\n let scale = 1;\n if (transform && transform !== 'none') {\n const matrix = transform.match(/matrix(?:3d)?\\(([^)]+)\\)/);\n if (matrix) {\n const values = matrix[1].split(', ').map(parseFloat);\n if (values.length === 6) {\n translateX = values[4];\n translateY = values[5];\n scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);\n } else if (values.length === 16) {\n translateX = values[12];\n translateY = values[13];\n scale = values[0];\n }\n }\n }\n return {\n x: translateX,\n y: translateY,\n scale\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { closest, contains, getTarget } from \"../floating-ui-react/utils.mjs\";\nimport { findScrollableAncestor, findScrollableTouchTarget } from \"./scrollable.mjs\";\nimport { getElementAtPoint } from \"./getElementAtPoint.mjs\";\nimport { getElementTransform } from \"./getElementTransform.mjs\";\nconst DEFAULT_SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst MIN_VELOCITY_DURATION_MS = 50;\n// Under one frame at 240 Hz, so it only damps near-simultaneous samples.\nconst MIN_RELEASE_VELOCITY_DURATION_MS = 4;\nconst MAX_RELEASE_VELOCITY_AGE_MS = 80;\nconst MIN_VELOCITY_SAMPLE_DISTANCE = 1;\nconst DEFAULT_IGNORE_SELECTOR = 'button,a,input,select,textarea,label,[role=\"button\"]';\nexport function getDisplacement(direction, deltaX, deltaY) {\n switch (direction) {\n case 'up':\n return -deltaY;\n case 'down':\n return deltaY;\n case 'left':\n return -deltaX;\n case 'right':\n return deltaX;\n default:\n return 0;\n }\n}\nfunction getValidTimeStamp(timeStamp) {\n return Number.isFinite(timeStamp) && timeStamp > 0 ? timeStamp : null;\n}\nfunction getDragTransform(dragOffset, scale) {\n return `translate3d(${dragOffset.x}px,${dragOffset.y}px,0) scale(${scale})`;\n}\nfunction hasPrimaryMouseButton(buttons) {\n return buttons % 2 === 1;\n}\nfunction safelyChangePointerCapture(element, pointerId, method) {\n const pointerCaptureMethod = element[method];\n if (typeof pointerCaptureMethod !== 'function') {\n return;\n }\n try {\n pointerCaptureMethod.call(element, pointerId);\n } catch (error) {\n if (error && typeof error === 'object' && 'name' in error && error.name === 'NotFoundError') {\n return;\n }\n throw error;\n }\n}\nexport function useSwipeDismiss(options) {\n const {\n enabled,\n directions,\n elementRef,\n movementCssVars,\n canStart,\n ignoreSelectorWhenTouch = true,\n ignoreScrollableAncestors = false,\n swipeThreshold: swipeThresholdProp,\n onDismiss,\n onProgress,\n onCancel,\n onSwipeStart,\n onRelease,\n onSwipingChange,\n trackDrag = true\n } = options;\n const ignoreSelector = DEFAULT_IGNORE_SELECTOR;\n const primaryDirection = directions.length === 1 ? directions[0] : undefined;\n const swipeThresholdDefault = Math.max(0, typeof swipeThresholdProp === 'number' ? swipeThresholdProp : DEFAULT_SWIPE_THRESHOLD);\n const allowLeft = directions.includes('left');\n const allowRight = directions.includes('right');\n const allowUp = directions.includes('up');\n const allowDown = directions.includes('down');\n const hasHorizontal = allowLeft || allowRight;\n const hasVertical = allowUp || allowDown;\n\n // Consumers only pass directions on a single axis.\n const scrollAxis = hasHorizontal ? 'horizontal' : 'vertical';\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [dragDismissed, setDragDismissed] = React.useState(false);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const dragOffsetRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastMovePosRef = React.useRef(null);\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const isFirstPointerMoveRef = React.useRef(false);\n const pendingSwipeRef = React.useRef(false);\n const pendingSwipeStartPosRef = React.useRef(null);\n const swipeFromScrollableRef = React.useRef(false);\n const sawPrimaryButtonsOnMoveRef = React.useRef(false);\n const elementSizeRef = React.useRef({\n width: 0,\n height: 0\n });\n const swipeProgressRef = React.useRef(0);\n const swipeThresholdRef = React.useRef(swipeThresholdDefault);\n const swipeThresholdFunctionRef = React.useRef(null);\n const swipeStartTimeRef = React.useRef(null);\n const lastDragSampleRef = React.useRef(null);\n const hasStationarySampleRef = React.useRef(false);\n const lastDragVelocityRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastProgressDetailsRef = React.useRef(null);\n const isSwipingRef = React.useRef(false);\n const dragStyleSnapshotRef = React.useRef(null);\n const setSwiping = useStableCallback(nextSwiping => {\n if (isSwipingRef.current === nextSwiping) {\n return;\n }\n isSwipingRef.current = nextSwiping;\n setIsSwiping(nextSwiping);\n onSwipingChange?.(nextSwiping);\n });\n function resolveSwipeThreshold(direction) {\n if (!direction) {\n return;\n }\n const element = elementRef.current;\n const thresholdFunction = swipeThresholdFunctionRef.current;\n if (!element || !thresholdFunction) {\n return;\n }\n const value = thresholdFunction({\n element,\n direction\n });\n swipeThresholdRef.current = Math.max(0, value);\n }\n const updateSwipeProgress = useStableCallback((progress, details) => {\n const nextProgress = Number.isFinite(progress) ? clamp(progress, 0, 1) : 0;\n const progressChanged = nextProgress !== swipeProgressRef.current;\n let detailsChanged = false;\n if (details) {\n const lastDetails = lastProgressDetailsRef.current;\n detailsChanged = !lastDetails || lastDetails.deltaX !== details.deltaX || lastDetails.deltaY !== details.deltaY || lastDetails.direction !== details.direction;\n }\n if (!progressChanged && !detailsChanged) {\n return;\n }\n swipeProgressRef.current = nextProgress;\n if (details) {\n lastProgressDetailsRef.current = details;\n } else if (progressChanged) {\n lastProgressDetailsRef.current = null;\n }\n onProgress?.(nextProgress, details);\n });\n const syncDragStyles = useStableCallback(swiping => {\n const element = elementRef.current;\n if (!trackDrag || !element) {\n if (!swiping) {\n dragStyleSnapshotRef.current = null;\n }\n return;\n }\n const style = element.style;\n const dragStyleSnapshot = dragStyleSnapshotRef.current;\n if (swiping) {\n if (!dragStyleSnapshot) {\n dragStyleSnapshotRef.current = [style.transition, style.transform];\n }\n style.transition = 'none';\n } else if (dragStyleSnapshot) {\n [style.transition, style.transform] = dragStyleSnapshot;\n dragStyleSnapshotRef.current = null;\n }\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (swiping) {\n style.transform = getDragTransform(dragOffset, initialTransform.scale);\n }\n style.setProperty(movementCssVars.x, `${deltaX}px`);\n style.setProperty(movementCssVars.y, `${deltaY}px`);\n });\n function recordDragSample(offset, timeStamp) {\n if (timeStamp === null) {\n return;\n }\n const lastSample = lastDragSampleRef.current;\n if (lastSample && timeStamp > lastSample.time) {\n // Some Android devices emit one effectively stationary move immediately before release.\n // Keep the last moving sample and its timestamp. Repeated stationary moves still clear\n // the velocity, and a release after a hold still expires the last moving sample.\n const stationary = Math.abs(offset.x - lastSample.x) < MIN_VELOCITY_SAMPLE_DISTANCE && Math.abs(offset.y - lastSample.y) < MIN_VELOCITY_SAMPLE_DISTANCE;\n const skipSample = stationary && !hasStationarySampleRef.current;\n hasStationarySampleRef.current = stationary;\n if (skipSample) {\n return;\n }\n const durationMs = Math.max(timeStamp - lastSample.time, MIN_RELEASE_VELOCITY_DURATION_MS);\n lastDragVelocityRef.current = {\n x: (offset.x - lastSample.x) / durationMs,\n y: (offset.y - lastSample.y) / durationMs\n };\n }\n lastDragSampleRef.current = {\n x: offset.x,\n y: offset.y,\n time: timeStamp\n };\n }\n const reset = React.useCallback(() => {\n setCurrentSwipeDirection(undefined);\n setSwiping(false);\n setDragDismissed(false);\n updateSwipeProgress(0);\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = null;\n dragStartPosRef.current = {\n x: 0,\n y: 0\n };\n dragOffsetRef.current = {\n x: 0,\n y: 0\n };\n initialTransformRef.current = {\n x: 0,\n y: 0,\n scale: 1\n };\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n cancelledSwipeRef.current = false;\n swipeCancelBaselineRef.current = {\n x: 0,\n y: 0\n };\n isFirstPointerMoveRef.current = false;\n lastMovePosRef.current = null;\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = false;\n elementSizeRef.current = {\n width: 0,\n height: 0\n };\n swipeStartTimeRef.current = null;\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n lastProgressDetailsRef.current = null;\n syncDragStyles(false);\n }, [setSwiping, swipeThresholdDefault, syncDragStyles, updateSwipeProgress]);\n function getPrimaryPointerPosition(event) {\n if ('touches' in event) {\n const touch = event.touches[0];\n return touch ? {\n x: touch.clientX,\n y: touch.clientY\n } : null;\n }\n return {\n x: event.clientX,\n y: event.clientY\n };\n }\n function isTouchLikeEvent(event) {\n if ('touches' in event) {\n return true;\n }\n return event.pointerType === 'touch';\n }\n function getTargetAtPoint(position, nativeEvent) {\n const root = elementRef.current?.getRootNode();\n const elementAtPoint = getElementAtPoint(root, position.x, position.y);\n const target = elementAtPoint ?? getTarget(nativeEvent);\n return target;\n }\n function findGestureScrollableTouchTarget(target, root) {\n // The swiped element is positioned relative to the viewport, so the page scroller must not\n // gate the gesture (a reset like `html, body { height: 100%; overflow: auto }` makes `body`\n // a real scroll container). The drawer viewport's native touchmove handler already ignores it.\n const find = axis => {\n const scrollTarget = findScrollableTouchTarget(target, root, axis);\n const doc = ownerDocument(scrollTarget);\n return scrollTarget === doc.body || scrollTarget === doc.documentElement ? null : scrollTarget;\n };\n return find(scrollAxis);\n }\n function startSwipeAtPosition(event, position, startOptions) {\n swipeFromScrollableRef.current = false;\n const touchLike = isTouchLikeEvent(event);\n const target = getTargetAtPoint(position, event.nativeEvent);\n const doc = ownerDocument(elementRef.current);\n const body = doc.body;\n const scrollableTarget = touchLike && body ? findGestureScrollableTouchTarget(target, body) : null;\n const ignoreScrollableTarget = startOptions?.ignoreScrollableTarget ?? false;\n if (scrollableTarget && !ignoreScrollableTarget) {\n return false;\n }\n swipeFromScrollableRef.current = Boolean(scrollableTarget && ignoreScrollableTarget);\n const isInteractiveElement = closest(target, ignoreSelector);\n if (isInteractiveElement && (!touchLike || ignoreSelectorWhenTouch)) {\n return false;\n }\n const element = elementRef.current;\n if (ignoreScrollableAncestors && element && target) {\n const ignoreAncestors = startOptions?.ignoreScrollableAncestors ?? false;\n if (!ignoreAncestors && findScrollableAncestor(target, element, scrollAxis) != null) {\n return false;\n }\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n dragStartPosRef.current = position;\n swipeStartTimeRef.current = getValidTimeStamp(event.timeStamp);\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n swipeCancelBaselineRef.current = position;\n lastMovePosRef.current = position;\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = typeof swipeThresholdProp === 'function' ? swipeThresholdProp : null;\n if (element) {\n elementSizeRef.current = {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n resolveSwipeThreshold(primaryDirection);\n const transform = getElementTransform(element);\n initialTransformRef.current = transform;\n dragOffsetRef.current = {\n x: transform.x,\n y: transform.y\n };\n recordDragSample({\n x: transform.x,\n y: transform.y\n }, swipeStartTimeRef.current);\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'setPointerCapture');\n }\n }\n onSwipeStart?.(event.nativeEvent);\n setSwiping(true);\n isFirstPointerMoveRef.current = true;\n updateSwipeProgress(0);\n syncDragStyles(true);\n return true;\n }\n function resetPendingSwipeState() {\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n lastMovePosRef.current = null;\n }\n function clearPendingSwipeStartState() {\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n }\n function cancelSwipeInteraction(event) {\n resetPendingSwipeState();\n if (!isSwipingRef.current) {\n return;\n }\n setSwiping(false);\n const resolvedInitialTransform = initialTransformRef.current;\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n sawPrimaryButtonsOnMoveRef.current = false;\n syncDragStyles(false);\n const element = elementRef.current;\n if (element) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n updateSwipeProgress(0, {\n deltaX: 0,\n deltaY: 0,\n direction: undefined\n });\n onCancel?.(event.nativeEvent);\n }\n function applyDirectionalDamping(deltaX, deltaY) {\n const exponent = value => Math.sign(value) * Math.abs(value) ** 0.5;\n const dampAxis = (delta, allowNegative, allowPositive) => {\n if (!allowNegative && delta < 0 || !allowPositive && delta > 0) {\n return exponent(delta);\n }\n return delta;\n };\n const newDeltaX = hasHorizontal ? dampAxis(deltaX, allowLeft, allowRight) : exponent(deltaX);\n const newDeltaY = hasVertical ? dampAxis(deltaY, allowUp, allowDown) : exponent(deltaY);\n return {\n x: newDeltaX,\n y: newDeltaY\n };\n }\n function canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY) {\n // Swiping toward the axis start edge (down/right) is allowed when scrolled to the start;\n // toward the end edge (up/left) when scrolled to the end.\n const canSwipeOnAxis = (delta, scrollOffset, maxScrollOffset, allowTowardStart, allowTowardEnd) => delta > 0 && scrollOffset <= 0 && allowTowardStart || delta < 0 && scrollOffset >= Math.max(0, maxScrollOffset) && allowTowardEnd;\n if (hasVertical && deltaY !== 0) {\n return canSwipeOnAxis(deltaY, scrollTarget.scrollTop, scrollTarget.scrollHeight - scrollTarget.clientHeight, allowDown, allowUp);\n }\n if (hasHorizontal && deltaX !== 0) {\n return canSwipeOnAxis(deltaX, scrollTarget.scrollLeft, scrollTarget.scrollWidth - scrollTarget.clientWidth, allowRight, allowLeft);\n }\n return null;\n }\n const handleStart = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n if (event.defaultPrevented || event.nativeEvent.defaultPrevented) {\n return;\n }\n if (!('touches' in event) && event.button !== 0) {\n return;\n }\n const startPos = getPrimaryPointerPosition(event);\n if (!startPos) {\n return;\n }\n pendingSwipeRef.current = true;\n pendingSwipeStartPosRef.current = startPos;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = !('touches' in event);\n const allowedToStart = canStart ? canStart(startPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (!allowedToStart) {\n return;\n }\n if (startSwipeAtPosition(event, startPos)) {\n clearPendingSwipeStartState();\n }\n });\n function handleMoveCore(event, position, movement) {\n if (!enabled || !isSwipingRef.current) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n if (isTouchLikeEvent(event) && !swipeFromScrollableRef.current) {\n const boundaryElement = event.currentTarget;\n if (findGestureScrollableTouchTarget(target, boundaryElement)) {\n return;\n }\n }\n if (!('touches' in event)) {\n // Prevent text selection on Safari\n event.preventDefault();\n }\n if (isFirstPointerMoveRef.current) {\n isFirstPointerMoveRef.current = false;\n // Reset the drag origin to the first move's position to absorb the gap between the press and\n // the first move event — notably on iOS touch, where the first `touchmove` arrives already\n // offset from the `touchstart` — which would otherwise make the dragged element jump. This\n // only matters when an element follows the pointer; when `trackDrag` is false (e.g. the\n // swipe-area, which only opens the drawer) keep the original press position so a quick flick\n // still registers: on a low-refresh-rate display the whole travel can land in this single\n // first move, and discarding it would drop the gesture.\n if (trackDrag) {\n dragStartPosRef.current = position;\n const moveTime = getValidTimeStamp(event.timeStamp);\n if (moveTime !== null) {\n swipeStartTimeRef.current = moveTime;\n }\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n }\n }\n const clientX = position.x;\n const clientY = position.y;\n const movementX = movement.x;\n const movementY = movement.y;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate) {\n const isAllowed = candidate === 'left' && allowLeft || candidate === 'right' && allowRight || candidate === 'up' && allowUp || candidate === 'down' && allowDown;\n if (isAllowed) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n resolveSwipeThreshold(candidate);\n }\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > swipeThresholdRef.current) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(allowLeft && allowRight) && !(allowUp && allowDown) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n if (hasHorizontal) {\n newOffsetX += dampedDelta.x;\n }\n if (hasVertical) {\n newOffsetY += dampedDelta.y;\n }\n\n // Only rewrite drag styles when the drag offset actually changed. `syncDragStyles` writes the\n // raw (undamped) frozen transform and movement vars, relying on the consumer's `onProgress`\n // to overwrite them with damped styles — but `updateSwipeProgress` dedupes unchanged\n // deltas and skips `onProgress`. A move that doesn't change the offset (e.g. the cursor\n // pinned at a screen edge during an off-screen drag, jittering only on the ignored axis)\n // would otherwise reinstate the raw styles with no correction, jumping the element to the\n // undamped position.\n const previousOffset = dragOffsetRef.current;\n const offsetChanged = newOffsetX !== previousOffset.x || newOffsetY !== previousOffset.y;\n dragOffsetRef.current = {\n x: newOffsetX,\n y: newOffsetY\n };\n if (offsetChanged) {\n syncDragStyles(true);\n }\n recordDragSample({\n x: newOffsetX,\n y: newOffsetY\n }, getValidTimeStamp(event.timeStamp));\n const dragDeltaX = newOffsetX - initialTransformRef.current.x;\n const dragDeltaY = newOffsetY - initialTransformRef.current.y;\n const progressDetails = {\n deltaX: dragDeltaX,\n deltaY: dragDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n let progress = 0;\n const progressDirection = primaryDirection ?? intendedSwipeDirectionRef.current;\n if (progressDirection) {\n const size = progressDirection === 'left' || progressDirection === 'right' ? elementSizeRef.current.width : elementSizeRef.current.height;\n const scale = initialTransformRef.current.scale || 1;\n const progressDisplacement = getDisplacement(progressDirection, dragDeltaX, dragDeltaY);\n if (size > 0 && scale > 0 && progressDisplacement > 0) {\n progress = progressDisplacement / (size * scale);\n }\n }\n updateSwipeProgress(progress, progressDetails);\n }\n const handleEnd = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n const resolvedDragOffset = dragOffsetRef.current;\n const resolvedInitialTransform = initialTransformRef.current;\n const releaseDeltaX = resolvedDragOffset.x - resolvedInitialTransform.x;\n const releaseDeltaY = resolvedDragOffset.y - resolvedInitialTransform.y;\n const progressDetails = {\n deltaX: releaseDeltaX,\n deltaY: releaseDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n if (!isSwipingRef.current) {\n resetPendingSwipeState();\n updateSwipeProgress(0, progressDetails);\n return;\n }\n setSwiping(false);\n resetPendingSwipeState();\n sawPrimaryButtonsOnMoveRef.current = false;\n const element = elementRef.current;\n if (element) {\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n }\n const deltaX = releaseDeltaX;\n const deltaY = releaseDeltaY;\n const startTime = swipeStartTimeRef.current;\n const endTime = getValidTimeStamp(event.timeStamp);\n const durationMs = startTime !== null && endTime !== null && endTime > startTime ? endTime - startTime : 0;\n const velocityDurationMs = durationMs > 0 ? Math.max(durationMs, MIN_VELOCITY_DURATION_MS) : 0;\n const velocityX = velocityDurationMs > 0 ? deltaX / velocityDurationMs : 0;\n const velocityY = velocityDurationMs > 0 ? deltaY / velocityDurationMs : 0;\n let releaseVelocityX = lastDragVelocityRef.current.x;\n let releaseVelocityY = lastDragVelocityRef.current.y;\n const lastSample = lastDragSampleRef.current;\n if (lastSample && endTime !== null && endTime >= lastSample.time) {\n const ageMs = endTime - lastSample.time;\n if (ageMs <= MAX_RELEASE_VELOCITY_AGE_MS) {\n const sampleDurationMs = Math.max(ageMs, MIN_RELEASE_VELOCITY_DURATION_MS);\n const deltaFromLastSampleX = resolvedDragOffset.x - lastSample.x;\n const deltaFromLastSampleY = resolvedDragOffset.y - lastSample.y;\n const sampleVelocityX = deltaFromLastSampleX / sampleDurationMs;\n const sampleVelocityY = deltaFromLastSampleY / sampleDurationMs;\n if (Math.abs(deltaFromLastSampleX) >= MIN_VELOCITY_SAMPLE_DISTANCE) {\n releaseVelocityX = sampleVelocityX;\n }\n if (Math.abs(deltaFromLastSampleY) >= MIN_VELOCITY_SAMPLE_DISTANCE) {\n releaseVelocityY = sampleVelocityY;\n }\n } else {\n releaseVelocityX = 0;\n releaseVelocityY = 0;\n }\n }\n const releaseDecision = onRelease?.({\n event: event.nativeEvent,\n direction: intendedSwipeDirectionRef.current,\n deltaX,\n deltaY,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n });\n const hasReleaseDecision = typeof releaseDecision === 'boolean';\n if (cancelledSwipeRef.current && !hasReleaseDecision) {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n return;\n }\n let shouldClose = false;\n let dismissDirection;\n if (hasReleaseDecision) {\n shouldClose = releaseDecision;\n dismissDirection = intendedSwipeDirectionRef.current ?? primaryDirection;\n } else {\n for (const direction of directions) {\n if (getDisplacement(direction, deltaX, deltaY) > swipeThresholdRef.current) {\n shouldClose = true;\n dismissDirection = direction;\n break;\n }\n }\n }\n if (shouldClose && dismissDirection) {\n setCurrentSwipeDirection(dismissDirection);\n setDragDismissed(true);\n syncDragStyles(false);\n onDismiss?.(event.nativeEvent, {\n direction: dismissDirection\n });\n } else {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n }\n });\n const handleMove = useStableCallback(event => {\n const currentPos = getPrimaryPointerPosition(event);\n if (!currentPos) {\n return;\n }\n let endAfterMove = false;\n if (!('touches' in event)) {\n const hasPrimaryButton = hasPrimaryMouseButton(event.buttons);\n if (hasPrimaryButton) {\n sawPrimaryButtonsOnMoveRef.current = true;\n }\n\n // Cancel the swipe if a non-primary button takes over the interaction.\n // This handles cases where a right-click interrupts dragging.\n if (event.buttons !== 0 && !hasPrimaryButton) {\n cancelSwipeInteraction(event);\n return;\n }\n\n // A `buttons: 0` pointermove means the primary button was already released, so the gesture is\n // over even if no pointerup reached us. On fast trackpad flicks this trailing move is\n // dispatched just before pointerup; treat it as the release (mirroring touchend) instead of\n // cancelling and snapping the element back.\n if (event.buttons === 0 && sawPrimaryButtonsOnMoveRef.current) {\n if (!isSwipingRef.current) {\n // The gesture never activated — discard it.\n handleEnd(event);\n return;\n }\n // This release move can itself carry the threshold-crossing displacement (and the peak\n // release velocity), so let it flow through `handleMoveCore` below to update the drag\n // offset / velocity sample, then commit the release afterwards.\n endAfterMove = true;\n }\n }\n if (!isSwiping && pendingSwipeRef.current) {\n if (!isTouchLikeEvent(event) && (event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n resetPendingSwipeState();\n return;\n }\n const allowedToStart = canStart ? canStart(currentPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (allowedToStart) {\n const pendingStartPos = pendingSwipeStartPosRef.current;\n let ignoreScrollableOnStart = false;\n if (isTouchLikeEvent(event)) {\n const element = elementRef.current;\n if (pendingStartPos && element) {\n const target = getTargetAtPoint(currentPos, event.nativeEvent);\n const doc = ownerDocument(element);\n const body = doc.body;\n const scrollTarget = body ? findGestureScrollableTouchTarget(target, body) : null;\n if (scrollTarget && (contains(element, scrollTarget) || contains(scrollTarget, element))) {\n const deltaX = currentPos.x - pendingStartPos.x;\n const deltaY = currentPos.y - pendingStartPos.y;\n const canSwipeFromEdge = canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY);\n if (canSwipeFromEdge === false) {\n return;\n }\n if (canSwipeFromEdge === true) {\n ignoreScrollableOnStart = true;\n }\n }\n }\n }\n const started = startSwipeAtPosition(event, currentPos, {\n ignoreScrollableTarget: ignoreScrollableOnStart,\n ignoreScrollableAncestors: ignoreScrollableOnStart\n });\n if (started) {\n if (pendingStartPos && ignoreScrollableOnStart) {\n // Preserve displacement between touchstart and the move that activates swipe from\n // a scroll-edge so quick flicks can dismiss.\n clearPendingSwipeStartState();\n dragStartPosRef.current = pendingStartPos;\n swipeCancelBaselineRef.current = pendingStartPos;\n lastMovePosRef.current = pendingStartPos;\n isFirstPointerMoveRef.current = false;\n } else {\n // Start from the current in-bounds position without dropping follow-up move\n // displacement; this avoids jumps when entering from outside the element while\n // keeping swipe tracking responsive on the next move.\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n }\n }\n }\n }\n const previousPos = lastMovePosRef.current;\n const movement = previousPos === null ? {\n x: 0,\n y: 0\n } : {\n x: currentPos.x - previousPos.x,\n y: currentPos.y - previousPos.y\n };\n lastMovePosRef.current = currentPos;\n handleMoveCore(event, currentPos, movement);\n\n // `endAfterMove` is only set in the non-touch branch above; the `'touches'` guard re-narrows the\n // event type for `handleEnd` after the shared move handling has run.\n if (endAfterMove && !('touches' in event)) {\n handleEnd(event);\n }\n });\n\n // Feeds a native touchmove into the swipe pipeline. Used by consumers that claim the gesture\n // in a capture-phase listener and stop it from reaching React's delegated touch handlers.\n const moveNative = useStableCallback((nativeEvent, currentTarget) => {\n handleMove({\n touches: nativeEvent.touches,\n currentTarget,\n nativeEvent,\n defaultPrevented: nativeEvent.defaultPrevented,\n timeStamp: nativeEvent.timeStamp\n });\n });\n const getDragStyles = React.useCallback(() => {\n // Read `isSwipingRef`, not the lagging `isSwiping` state, to match the imperative writer\n // `syncDragStyles`. Otherwise a render that commits before `setSwiping(true)` flushes strips the\n // transform it just wrote, flashing the popup to its resting position for a frame.\n const swiping = isSwipingRef.current;\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (!swiping && deltaX === 0 && deltaY === 0 && !dragDismissed) {\n return {\n [movementCssVars.x]: '0px',\n [movementCssVars.y]: '0px'\n };\n }\n return {\n transition: swiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: swiping ? getDragTransform(dragOffset, initialTransform.scale) : undefined,\n [movementCssVars.x]: `${deltaX}px`,\n [movementCssVars.y]: `${deltaY}px`\n };\n }, [dragDismissed, movementCssVars]);\n const getPointerProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onPointerDown: handleStart,\n onPointerMove: handleMove,\n onPointerUp: handleEnd,\n onPointerCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n const getTouchProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onTouchStart: handleStart,\n onTouchMove: handleMove,\n onTouchEnd: handleEnd,\n onTouchCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n return {\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection,\n dragDismissed,\n getPointerProps,\n getTouchProps,\n moveNative,\n getDragStyles,\n reset\n };\n}","'use client';\n\nimport { DialogTrigger } from \"../../dialog/trigger/DialogTrigger.mjs\";\n/**\n * A button that opens the drawer.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerTrigger = DialogTrigger;","'use client';\n\nimport * as React from 'react';\nexport const DrawerVirtualKeyboardContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerVirtualKeyboardContext.displayName = \"DrawerVirtualKeyboardContext\";\nexport function useDrawerVirtualKeyboardContext() {\n return React.useContext(DrawerVirtualKeyboardContext);\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { DialogViewport } from \"../../dialog/viewport/DialogViewport.mjs\";\nimport * as DialogViewportDataAttributes from \"../../dialog/viewport/DialogViewportDataAttributes.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { closestSnapPointIndex, getSnapPointSwipeMovement, useDrawerSnapPoints } from \"../root/useDrawerSnapPoints.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { getDisplacement, useSwipeDismiss } from \"../../utils/useSwipeDismiss.mjs\";\nimport * as DrawerPopupCssVars from \"../popup/DrawerPopupCssVars.mjs\";\nimport * as DrawerPopupDataAttributes from \"../popup/DrawerPopupDataAttributes.mjs\";\nimport * as DrawerBackdropCssVars from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport { DRAWER_CONTENT_ATTRIBUTE } from \"../content/drawerContentAttribute.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { activeElement, closest, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { DrawerViewportContext } from \"./DrawerViewportContext.mjs\";\nimport { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\nimport { findScrollableTouchTarget } from \"../../utils/scrollable.mjs\";\nimport { BASE_UI_SWIPE_IGNORE_ATTRIBUTE, BASE_UI_SWIPE_IGNORE_SELECTOR } from \"../../internals/constants.mjs\";\nimport { getElementAtPoint } from \"../../utils/getElementAtPoint.mjs\";\nimport { useDrawerVirtualKeyboardContext } from \"../virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst MIN_SWIPE_THRESHOLD = 10;\nconst FAST_SWIPE_VELOCITY = 0.5;\nconst SNAP_VELOCITY_THRESHOLD = 0.5;\nconst SNAP_VELOCITY_MULTIPLIER = 300;\nconst MAX_SNAP_VELOCITY = 4;\nconst MIN_SWIPE_RELEASE_VELOCITY = 0.2;\nconst MAX_SWIPE_RELEASE_VELOCITY = 4;\nconst MIN_SWIPE_RELEASE_DURATION_MS = 80;\nconst MAX_SWIPE_RELEASE_DURATION_MS = 360;\nconst MIN_SWIPE_RELEASE_SCALAR = 0.1;\nconst MAX_SWIPE_RELEASE_SCALAR = 1;\nconst AXIS_LOCK_SLOP = 6;\nconst AXIS_LOCK_BIAS = 2;\nconst DRAWER_CONTENT_SELECTOR = `[${DRAWER_CONTENT_ATTRIBUTE}]`;\nconst AXIS_SWIPE_IGNORE_SELECTORS = {\n horizontal: `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}=\"x\"]`,\n vertical: `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}=\"y\"]`\n};\n/**\n * A positioning container for the drawer popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerViewport = /*#__PURE__*/React.forwardRef(function DrawerViewport(props, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = props;\n const store = useDialogRootContext();\n const popupRef = store.context.popupRef;\n const backdropRef = store.context.backdropRef;\n const {\n swipeDirection,\n notifyParentSwipingChange,\n notifyParentSwipeProgressChange,\n frontmostHeight,\n snapToSequentialPoints,\n swipeAreaActiveRef\n } = useDrawerRootContext();\n const providerContext = useDrawerProviderContext();\n const {\n snapPoints,\n resolvedSnapPoints,\n activeSnapPoint,\n activeSnapPointOffset,\n setActiveSnapPoint,\n popupHeight\n } = useDrawerSnapPoints();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDrawerCount = store.useState('nestedOpenDrawerCount');\n const viewportElement = store.useState('viewportElement');\n const popupElementState = store.useState('popupElement');\n const visualStateStore = providerContext?.visualStateStore;\n const nestedDrawerOpen = nestedOpenDrawerCount > 0;\n const scrollAxis = swipeDirection === 'left' || swipeDirection === 'right' ? 'horizontal' : 'vertical';\n const isVerticalScrollAxis = scrollAxis === 'vertical';\n const crossScrollAxis = isVerticalScrollAxis ? 'horizontal' : 'vertical';\n const [swipeRelease, setSwipeRelease] = React.useState(null);\n const pendingSwipeCloseSnapPointRef = React.useRef(undefined);\n const resetSwipeRef = React.useRef(null);\n const controlledDismissFrame = useAnimationFrame();\n const swipingRef = React.useRef(false);\n const nestedSwipeActiveRef = React.useRef(false);\n const lastPointerTypeRef = React.useRef('');\n const ignoreNextTouchStartFromPenRef = React.useRef(false);\n const ignoreTouchSwipeRef = React.useRef(false);\n const touchScrollStateRef = React.useRef(null);\n const virtualKeyboard = useDrawerVirtualKeyboardContext();\n const snapPointRange = React.useMemo(() => {\n if (!snapPoints || snapPoints.length < 2 || resolvedSnapPoints.length < 2 || swipeDirection !== 'down' && swipeDirection !== 'up') {\n return null;\n }\n const offsets = resolvedSnapPoints.map(point => point.offset).sort((a, b) => a - b);\n const minOffset = offsets[0];\n const nextOffset = offsets[1];\n const range = nextOffset - minOffset;\n return {\n minOffset,\n range\n };\n }, [resolvedSnapPoints, snapPoints, swipeDirection]);\n const snapPointProgress = React.useMemo(() => {\n if (!snapPointRange || activeSnapPointOffset === null) {\n return null;\n }\n return clamp((activeSnapPointOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);\n }, [activeSnapPointOffset, snapPointRange]);\n const swipeDirections = React.useMemo(() => {\n if (snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up')) {\n return swipeDirection === 'down' ? ['down', 'up'] : ['up', 'down'];\n }\n return [swipeDirection];\n }, [snapPoints, swipeDirection]);\n const setSwipeDismissed = useStableCallback(dismissed => {\n popupRef.current?.toggleAttribute(DrawerPopupDataAttributes.swipeDismiss, dismissed);\n backdropRef.current?.toggleAttribute(DrawerPopupDataAttributes.swipeDismiss, dismissed);\n });\n const clearSwipeRelease = useStableCallback(() => {\n setSwipeDismissed(false);\n popupRef.current?.removeAttribute(TransitionStatusDataAttributes.endingStyle);\n setSwipeRelease(null);\n });\n const finishNestedSwipe = useStableCallback(() => {\n if (!nestedSwipeActiveRef.current) {\n return;\n }\n nestedSwipeActiveRef.current = false;\n notifyParentSwipingChange?.(false);\n });\n const applySwipeProgress = useStableCallback((resolvedProgress, shouldTrackProgress, notifyParent) => {\n const isActive = open && !nested && shouldTrackProgress;\n const swipeProgress = isActive ? resolvedProgress : 0;\n const nestedSwipeProgress = open && shouldTrackProgress ? resolvedProgress : 0;\n if (notifyParent && notifyParentSwipeProgressChange) {\n notifyParentSwipeProgressChange(nestedSwipeProgress);\n if (nestedSwipeProgress <= 0) {\n finishNestedSwipe();\n }\n }\n visualStateStore?.set({\n swipeProgress,\n frontmostHeight: swipeProgress > 0 ? frontmostHeight : 0\n });\n const backdropElement = backdropRef.current;\n if (!backdropElement) {\n return;\n }\n const showProgress = isActive && swipeProgress > 0;\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, showProgress ? `${swipeProgress}` : '0');\n if (showProgress && frontmostHeight > 0) {\n backdropElement.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);\n } else {\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n });\n function resolveSwipeRelease(popupElement, direction, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY) {\n const size = getBaseSwipeSize(popupElement, direction);\n if (size <= 0) {\n return null;\n }\n\n // The snap point base offset shifts the popup along the dismiss direction for both\n // `down` (+offset) and `up` (-offset), so it always adds to the directional translation.\n const snapPointBaseOffset = (direction === 'down' || direction === 'up') && snapPoints && snapPoints.length > 0 ? activeSnapPointOffset ?? 0 : 0;\n const translationAlongDirection = snapPointBaseOffset + getDisplacement(direction, deltaX, deltaY);\n const remainingDistance = Math.max(0, size - translationAlongDirection);\n if (remainingDistance <= 0) {\n return null;\n }\n const releaseVelocity = getDisplacement(direction, releaseVelocityX, releaseVelocityY);\n const directionalVelocity = Math.abs(releaseVelocity) > 0 ? releaseVelocity : getDisplacement(direction, velocityX, velocityY);\n if (directionalVelocity <= MIN_SWIPE_RELEASE_VELOCITY) {\n return null;\n }\n const clampedVelocity = clamp(directionalVelocity, MIN_SWIPE_RELEASE_VELOCITY, MAX_SWIPE_RELEASE_VELOCITY);\n // The gesture hook supplies finite deltas and velocities. The guards above keep the remaining\n // distance and divisor positive, so the duration stays within [MIN, MAX] and the resulting\n // scalar within (0, 1].\n const durationMs = clamp(remainingDistance / clampedVelocity, MIN_SWIPE_RELEASE_DURATION_MS, MAX_SWIPE_RELEASE_DURATION_MS);\n const normalizedDuration = (durationMs - MIN_SWIPE_RELEASE_DURATION_MS) / (MAX_SWIPE_RELEASE_DURATION_MS - MIN_SWIPE_RELEASE_DURATION_MS);\n return MIN_SWIPE_RELEASE_SCALAR + normalizedDuration * (MAX_SWIPE_RELEASE_SCALAR - MIN_SWIPE_RELEASE_SCALAR);\n }\n function updateNestedSwipeActive(details) {\n if (nestedSwipeActiveRef.current || !details) {\n return;\n }\n const direction = details.direction ?? swipeDirection;\n const delta = getDisplacement(direction, details.deltaX, details.deltaY);\n if (Math.abs(delta) < MIN_SWIPE_THRESHOLD) {\n return;\n }\n nestedSwipeActiveRef.current = true;\n notifyParentSwipingChange?.(true);\n }\n const swipe = useSwipeDismiss({\n enabled: mounted && !nestedDrawerOpen,\n directions: swipeDirections,\n elementRef: store.context.popupRef,\n ignoreSelectorWhenTouch: false,\n ignoreScrollableAncestors: true,\n movementCssVars: {\n x: DrawerPopupCssVars.swipeMovementX,\n y: DrawerPopupCssVars.swipeMovementY\n },\n onSwipeStart(event) {\n if ('touches' in event || event.pointerType === 'touch') {\n return;\n }\n const popupElement = popupRef.current;\n const doc = ownerDocument(popupElement);\n const selection = doc.getSelection?.();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;\n const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;\n if (!contains(popupElement, anchorElement) && !contains(popupElement, focusElement)) {\n return;\n }\n selection.removeAllRanges();\n },\n onSwipingChange(swiping) {\n swipingRef.current = swiping;\n setBackdropSwipingAttribute(store.context.backdropRef.current, swiping);\n if (!swiping && !notifyParentSwipeProgressChange) {\n finishNestedSwipe();\n }\n },\n swipeThreshold({\n element,\n direction\n }) {\n return getBaseSwipeThreshold(element, direction);\n },\n canStart(position, details) {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n return false;\n }\n const nativeEvent = details.nativeEvent;\n const touchLike = 'touches' in nativeEvent || nativeEvent.pointerType === 'touch';\n const touchState = touchLike ? touchScrollStateRef.current : null;\n const doc = popupElement.ownerDocument;\n const elementAtPoint = getElementAtPoint(popupElement.getRootNode(), position.x, position.y);\n // Activation can be deferred until after a touch that started inside has left the popup.\n if (!touchState?.startedInPopup && !contains(popupElement, elementAtPoint)) {\n return false;\n }\n if (touchLike && shouldIgnoreSwipeForTextSelection(doc, popupElement)) {\n return false;\n }\n\n // Over a cross-axis gesture target, stay pending until the drawer axis wins the gesture.\n // Starting on touchstart would leave the drawer swiping (and settling on release) while the\n // cross-axis target handles the drag.\n if (touchState?.hasCrossAxisGestureTarget && !touchState.drawerAxisAttributed && touchState.allowSwipe !== true) {\n return false;\n }\n return true;\n },\n onProgress(progress, details) {\n const swiping = swipingRef.current;\n if (swiping) {\n updateNestedSwipeActive(details);\n }\n const hasSnapPoints = Boolean(snapPoints && snapPoints.length > 0);\n if (swiping && swipeDirection === 'down' && hasSnapPoints && details) {\n const popupElement = store.context.popupRef.current;\n if (popupElement) {\n popupElement.style.removeProperty('transform');\n popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementY, `${getSnapPointSwipeMovement(activeSnapPointOffset ?? 0, details.deltaY)}px`);\n }\n }\n let resolvedProgress = progress;\n if (snapPointRange && popupHeight > 0) {\n const baseOffset = activeSnapPointOffset ?? snapPointRange.minOffset;\n const offsetToProgress = nextOffset => clamp((nextOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);\n\n // Outside a drag the hook still reports the last drag deltas, both after a release and\n // on a gesture that never started (e.g. a press inside `Drawer.Content`). Recomputing\n // from them would re-apply drag progress to a drawer that rests on its snap point.\n if (swiping && details && Number.isFinite(details.deltaY)) {\n resolvedProgress = offsetToProgress(clamp(baseOffset + details.deltaY, 0, popupHeight));\n } else if (snapPointProgress !== null) {\n resolvedProgress = snapPointProgress;\n }\n }\n\n // A parent drawer follows an active drag only, so drop it back to zero once the drag ends.\n if (!swiping) {\n notifyParentSwipeProgressChange?.(0);\n finishNestedSwipe();\n }\n applySwipeProgress(resolvedProgress, true, swiping);\n },\n onRelease({\n event,\n deltaX,\n deltaY,\n direction,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n }) {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n clearSwipeRelease();\n return undefined;\n }\n const releasePopupElement = popupElement;\n function startSwipeRelease(resolvedDirection) {\n // Start ending transition styles earlier and synchronously to prevent a period where\n // the popup appears stuck on release before the actual closing animation starts.\n finishNestedSwipe();\n setSwipeDismissed(true);\n releasePopupElement.style.removeProperty('transition');\n releasePopupElement.setAttribute(TransitionStatusDataAttributes.endingStyle, '');\n ReactDOM.flushSync(() => {\n setSwipeRelease(resolveSwipeRelease(releasePopupElement, resolvedDirection, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY));\n });\n }\n if (!snapPoints || snapPoints.length === 0) {\n if (!direction) {\n clearSwipeRelease();\n return undefined;\n }\n const directionalDelta = getDisplacement(direction, deltaX, deltaY);\n if (directionalDelta <= 0) {\n clearSwipeRelease();\n return false;\n }\n if (getDisplacement(direction, velocityX, velocityY) >= FAST_SWIPE_VELOCITY) {\n startSwipeRelease(direction);\n return true;\n }\n const shouldClose = directionalDelta > getBaseSwipeThreshold(releasePopupElement, direction);\n if (shouldClose) {\n startSwipeRelease(direction);\n } else {\n clearSwipeRelease();\n }\n return shouldClose;\n }\n if (swipeDirection !== 'down' && swipeDirection !== 'up') {\n clearSwipeRelease();\n return undefined;\n }\n if (!popupHeight) {\n clearSwipeRelease();\n return false;\n }\n if (resolvedSnapPoints.length === 0) {\n clearSwipeRelease();\n return undefined;\n }\n const dragDelta = swipeDirection === 'down' ? deltaY : -deltaY;\n const dragDirection = Math.sign(dragDelta);\n const releaseDirectionalVelocity = swipeDirection === 'down' ? releaseVelocityY : -releaseVelocityY;\n const fallbackDirectionalVelocity = swipeDirection === 'down' ? velocityY : -velocityY;\n let resolvedDirectionalVelocity = releaseDirectionalVelocity;\n if (dragDirection !== 0 && Math.abs(dragDelta) >= MIN_SWIPE_THRESHOLD) {\n const velocityDirection = Math.sign(resolvedDirectionalVelocity);\n if (velocityDirection !== 0 && velocityDirection !== dragDirection) {\n // Ignore touch reversals that would otherwise flip the snap decision.\n resolvedDirectionalVelocity = fallbackDirectionalVelocity;\n }\n }\n const currentOffset = activeSnapPointOffset ?? 0;\n const dragTargetOffset = clamp(currentOffset + dragDelta, 0, popupHeight);\n const velocityOffset = Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD ? clamp(resolvedDirectionalVelocity, -MAX_SNAP_VELOCITY, MAX_SNAP_VELOCITY) * SNAP_VELOCITY_MULTIPLIER : 0;\n const targetOffset = snapToSequentialPoints ? dragTargetOffset : clamp(dragTargetOffset + velocityOffset, 0, popupHeight);\n const snapPointEventDetails = createChangeEventDetails(REASONS.swipe, event);\n const settleInPlace = () => {\n // Reset nested swipe state now: the hook's trailing progress update is deduped\n // when the drag never produced dismissal progress, so it may not fire.\n applySwipeProgress(0, true, true);\n clearSwipeRelease();\n return false;\n };\n const settleOnSnapPoint = snapPoint => {\n setActiveSnapPoint(snapPoint.value, snapPointEventDetails);\n return settleInPlace();\n };\n const closeFromSnapPoints = fallbackSnapPoint => {\n // An unattributed gesture (e.g. a mostly horizontal flick) may settle on a snap\n // point but must not dismiss: `useSwipeDismiss` drops a directionless dismissal,\n // stranding the popup visually closed while `open` stays `true`.\n if (!direction) {\n return settleOnSnapPoint(fallbackSnapPoint);\n }\n setActiveSnapPoint(null, snapPointEventDetails);\n if (snapPointEventDetails.isCanceled) {\n // A canceled null snap point rejects dismissal before exit styles start.\n return settleInPlace();\n }\n pendingSwipeCloseSnapPointRef.current = activeSnapPoint;\n startSwipeRelease(swipeDirection);\n return true;\n };\n if (snapToSequentialPoints) {\n const orderedSnapPoints = [...resolvedSnapPoints].sort((first, second) => first.offset - second.offset);\n const orderedOffsets = orderedSnapPoints.map(point => point.offset);\n const currentIndex = closestSnapPointIndex(orderedOffsets, currentOffset);\n let targetSnapPoint = orderedSnapPoints[closestSnapPointIndex(orderedOffsets, targetOffset)];\n const velocityDirection = Math.sign(resolvedDirectionalVelocity);\n const shouldAdvance = dragDirection !== 0 && velocityDirection !== 0 && velocityDirection === dragDirection && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD;\n let effectiveTargetOffset = targetOffset;\n if (shouldAdvance) {\n const adjacentIndex = clamp(currentIndex + dragDirection, 0, orderedSnapPoints.length - 1);\n if (adjacentIndex !== currentIndex) {\n const adjacentPoint = orderedSnapPoints[adjacentIndex];\n const shouldForceAdjacent = dragDirection > 0 ? targetOffset < adjacentPoint.offset : targetOffset > adjacentPoint.offset;\n if (shouldForceAdjacent) {\n targetSnapPoint = adjacentPoint;\n effectiveTargetOffset = adjacentPoint.offset;\n }\n } else if (dragDirection > 0) {\n return closeFromSnapPoints(targetSnapPoint);\n }\n }\n const closeDistance = Math.abs(effectiveTargetOffset - popupHeight);\n const snapDistance = Math.abs(effectiveTargetOffset - targetSnapPoint.offset);\n if (closeDistance < snapDistance) {\n return closeFromSnapPoints(targetSnapPoint);\n }\n return settleOnSnapPoint(targetSnapPoint);\n }\n const closestSnapPoint = resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map(point => point.offset), targetOffset)];\n if (resolvedDirectionalVelocity >= FAST_SWIPE_VELOCITY && dragDelta > 0) {\n return closeFromSnapPoints(closestSnapPoint);\n }\n const closeDistance = Math.abs(targetOffset - popupHeight);\n if (closeDistance < Math.abs(targetOffset - closestSnapPoint.offset)) {\n return closeFromSnapPoints(closestSnapPoint);\n }\n return settleOnSnapPoint(closestSnapPoint);\n },\n onDismiss(event) {\n visualStateStore?.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n const backdropElement = store.context.backdropRef.current;\n if (backdropElement) {\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n const dismissEventDetails = createChangeEventDetails(REASONS.swipe, event);\n store.setOpen(false, dismissEventDetails);\n if (dismissEventDetails.isCanceled) {\n const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;\n if (pendingSnapPoint !== undefined) {\n setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, event));\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n resetSwipeRef.current?.();\n clearSwipeRelease();\n return;\n }\n\n // In controlled mode, the effective open state may not have changed yet\n // (openProp takes precedence over state.open). Proceed optimistically with the\n // dismiss animation — React's Scheduler flushes before the next rAF, so we can\n // reliably check whether the parent accepted or rejected the close.\n // Note: if onOpenChange is asynchronous (e.g., closes the drawer after a network\n // call), the rAF check will see open === true, revert the animation, and the\n // drawer will close without animation when the parent eventually sets open={false}.\n if (store.select('open')) {\n const savedEvent = event;\n controlledDismissFrame.request(() => {\n if (store.select('open')) {\n // Parent rejected: revert animation and restore snap point.\n const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;\n if (pendingSnapPoint !== undefined) {\n setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, savedEvent));\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n clearSwipeRelease();\n resetSwipeRef.current?.();\n } else {\n // Parent accepted: clean up the ref.\n pendingSwipeCloseSnapPointRef.current = undefined;\n }\n });\n return;\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n setSwipeDismissed(true);\n }\n });\n const swipePointerProps = swipe.getPointerProps();\n const swipeTouchProps = swipe.getTouchProps();\n const {\n moveNative: moveSwipeNative,\n reset: resetSwipe\n } = swipe;\n resetSwipeRef.current = resetSwipe;\n React.useEffect(() => {\n const rootElement = viewportElement ?? popupElementState;\n // A non-passive document listener makes all touch scrolling wait on the main thread.\n if (!rootElement || !open || !mounted) {\n return undefined;\n }\n const resolvedRootElement = rootElement;\n const doc = ownerDocument(resolvedRootElement);\n function processTouchMove(event, touchState, touch) {\n const drawerAxisDelta = isVerticalScrollAxis ? touch.clientY - touchState.lastY : touch.clientX - touchState.lastX;\n\n // Avoid blocking pinch zoom or text selection adjustments on iOS Safari.\n if (event.touches.length === 2) {\n return;\n }\n const allowTouchMove = shouldIgnoreSwipeForTextSelection(doc, resolvedRootElement);\n if (allowTouchMove || nestedDrawerOpen) {\n return;\n }\n if (shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis)) {\n return;\n }\n const scrollTarget = touchState.scrollTarget;\n if (!scrollTarget || scrollTarget === doc.documentElement || scrollTarget === doc.body) {\n if (event.cancelable) {\n event.preventDefault();\n }\n // Claim the gesture before React's delegated touch handlers see it; dispatching the\n // move through React re-rasterizes the popup content on every frame.\n event.stopPropagation();\n moveSwipeNative(event, resolvedRootElement);\n return;\n }\n if (!hasScrollableContentOnAxis(scrollTarget, scrollAxis)) {\n // If the scroll container doesn't overflow on the drawer axis, prevent the window from\n // scrolling instead.\n if (event.cancelable) {\n event.preventDefault();\n }\n event.stopPropagation();\n return;\n }\n if (drawerAxisDelta !== 0) {\n const canSwipeFromScrollEdge = canSwipeFromScrollEdgeOnMove(scrollTarget, scrollAxis, swipeDirection, drawerAxisDelta);\n if (!touchState.allowSwipe) {\n if (event.cancelable && canSwipeFromScrollEdge) {\n touchState.allowSwipe = true;\n event.preventDefault();\n } else {\n touchState.allowSwipe = false;\n }\n } else if (event.cancelable) {\n event.preventDefault();\n }\n }\n if (touchState.allowSwipe === true) {\n event.stopPropagation();\n moveSwipeNative(event, resolvedRootElement);\n }\n }\n function handleNativeTouchMove(event) {\n // The virtual keyboard provider observes the move to tell a tap apart from a drag.\n // It must run even when the swipe gesture below claims the event with\n // `stopPropagation()`, which would otherwise prevent React's delegated handlers\n // (and the provider) from ever seeing the move.\n virtualKeyboard?.onTouchMove(event);\n if (ignoreTouchSwipeRef.current) {\n return;\n }\n const touchState = touchScrollStateRef.current;\n const touch = event.touches[0];\n if (!touch || !touchState) {\n return;\n }\n processTouchMove(event, touchState, touch);\n updateTouchScrollPosition(touchState, touch);\n }\n return addEventListener(doc, 'touchmove', handleNativeTouchMove, {\n passive: false,\n capture: true\n });\n }, [mounted, nestedDrawerOpen, open, popupElementState, isVerticalScrollAxis, scrollAxis, swipeDirection, moveSwipeNative, viewportElement, virtualKeyboard]);\n useIsoLayoutEffect(() => {\n if (!snapPointRange || swipe.swiping) {\n return;\n }\n applySwipeProgress(!open || nested ? 0 : snapPointProgress ?? 0, true, false);\n }, [applySwipeProgress, frontmostHeight, nested, notifyParentSwipeProgressChange, open, snapPointProgress, snapPointRange, swipe.swiping, store, visualStateStore]);\n useIsoLayoutEffect(() => {\n if (!notifyParentSwipeProgressChange) {\n return undefined;\n }\n if (!open) {\n notifyParentSwipeProgressChange(0);\n }\n return () => {\n notifyParentSwipeProgressChange(0);\n };\n }, [notifyParentSwipeProgressChange, open]);\n useIsoLayoutEffect(() => {\n if (open) {\n // Skip `resetSwipe` while `Drawer.SwipeArea` is driving the open: it zeroes the popup's\n // `--swipe-movement-*` (via `syncDragStyles(false)`), flashing it fully open for a frame.\n // `clearSwipeRelease` doesn't touch those vars, so always run it to clear any leftover\n // release state from a prior dismiss (e.g. when the popup is kept mounted).\n if (!swipeAreaActiveRef.current) {\n resetSwipe();\n }\n clearSwipeRelease();\n }\n }, [clearSwipeRelease, open, resetSwipe, swipeAreaActiveRef]);\n useIsoLayoutEffect(() => {\n const backdropElement = backdropRef.current;\n return () => {\n visualStateStore?.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n setBackdropSwipingAttribute(backdropElement, false);\n // `data-swiping` is set on whichever backdrop is current when a swipe starts, which can\n // differ from the captured element if the backdrop mounted late or changed identity.\n // Reading the live ref here is intentional so the current backdrop is cleared too.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const currentBackdrop = backdropRef.current;\n if (currentBackdrop !== backdropElement) {\n setBackdropSwipingAttribute(currentBackdrop, false);\n }\n finishNestedSwipe();\n };\n }, [backdropRef, finishNestedSwipe, visualStateStore]);\n const swipeProviderValue = React.useMemo(() => ({\n swiping: swipe.swiping,\n getDragStyles: swipe.getDragStyles,\n swipeStrength: swipeRelease ?? null,\n setSwipeDismissed\n }), [setSwipeDismissed, swipe.getDragStyles, swipe.swiping, swipeRelease]);\n function resetTouchSwipeState(ignoreSwipe) {\n ignoreTouchSwipeRef.current = ignoreSwipe;\n touchScrollStateRef.current = null;\n }\n function resetTouchTrackingState() {\n resetTouchSwipeState(false);\n lastPointerTypeRef.current = '';\n ignoreNextTouchStartFromPenRef.current = false;\n }\n function handlePointerEnd(event) {\n lastPointerTypeRef.current = '';\n return event.pointerType !== 'touch';\n }\n return /*#__PURE__*/_jsx(DialogViewport, {\n ref: forwardedRef,\n className: className,\n style: style,\n render: render,\n ...mergeProps(elementProps, {\n onPointerDown(event) {\n lastPointerTypeRef.current = event.pointerType;\n ignoreNextTouchStartFromPenRef.current = event.pointerType === 'pen';\n if (!open || !mounted || nestedDrawerOpen) {\n return;\n }\n const elementAtPoint = getElementAtPoint(event.currentTarget.getRootNode(), event.clientX, event.clientY);\n // Pointer drags capture the pointer on press, so they can't wait to see which axis the\n // gesture takes; any `data-base-ui-swipe-ignore` value ignores them.\n if (isSwipeIgnoredTarget(elementAtPoint) || isDrawerContentTarget(elementAtPoint)) {\n return;\n }\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerDown?.(event);\n },\n onPointerMove(event) {\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerMove?.(event);\n },\n onPointerUp(event) {\n if (handlePointerEnd(event)) {\n swipePointerProps.onPointerUp?.(event);\n }\n },\n onPointerCancel(event) {\n if (handlePointerEnd(event)) {\n swipePointerProps.onPointerCancel?.(event);\n }\n },\n onTouchStart(event) {\n const startedFromPenPointerDown = lastPointerTypeRef.current === 'pen' && ignoreNextTouchStartFromPenRef.current;\n if (startedFromPenPointerDown) {\n ignoreNextTouchStartFromPenRef.current = false;\n resetTouchSwipeState(false);\n return;\n }\n if (!open || !mounted || nestedDrawerOpen) {\n resetTouchSwipeState(false);\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n if (isReactTouchEventOnRangeInput(event)) {\n resetTouchSwipeState(false);\n return;\n }\n const rootElement = event.currentTarget;\n const elementAtPoint = getElementAtPoint(rootElement.getRootNode(), touch.clientX, touch.clientY);\n const eventTarget = getTarget(event.nativeEvent);\n const target = isElement(eventTarget) ? eventTarget : rootElement;\n if (!contains(rootElement, target)) {\n resetTouchSwipeState(true);\n return;\n }\n virtualKeyboard?.onTouchStart(event);\n\n // `x`/`y` hand touch drags along that axis to the element. Any value other than the\n // cross-axis one ignores the swipe outright; a cross-axis element is arbitrated like a\n // native cross-axis scroller below.\n if (closest(elementAtPoint, `${BASE_UI_SWIPE_IGNORE_SELECTOR}:not(${AXIS_SWIPE_IGNORE_SELECTORS[crossScrollAxis]})`)) {\n resetTouchSwipeState(true);\n return;\n }\n ignoreTouchSwipeRef.current = false;\n const scrollTarget = findScrollableTouchTarget(target, rootElement, scrollAxis);\n const hasCrossAxisGestureTarget = findScrollableTouchTarget(target, rootElement, crossScrollAxis) != null || closest(elementAtPoint, AXIS_SWIPE_IGNORE_SELECTORS[crossScrollAxis]) != null;\n let allowSwipe = null;\n if (scrollTarget) {\n const canSwipeFromEdge = isAtSwipeStartEdge(scrollTarget, scrollAxis, swipeDirection);\n allowSwipe = canSwipeFromEdge ? null : false;\n }\n touchScrollStateRef.current = {\n startX: touch.clientX,\n startY: touch.clientY,\n lastX: touch.clientX,\n lastY: touch.clientY,\n startedInPopup: contains(popupRef.current, elementAtPoint),\n scrollTarget,\n hasCrossAxisGestureTarget,\n allowSwipe,\n preserveNativeCrossAxisScroll: false,\n drawerAxisAttributed: false\n };\n swipeTouchProps.onTouchStart?.(event);\n },\n onTouchEnd(event) {\n virtualKeyboard?.onTouchEnd(event);\n resetTouchTrackingState();\n swipeTouchProps.onTouchEnd?.(event);\n },\n onTouchCancel(event) {\n virtualKeyboard?.onTouchCancel();\n resetTouchTrackingState();\n swipeTouchProps.onTouchCancel?.(event);\n },\n // Drawer popups use drawer-specific nested state attributes.\n // Suppress DialogViewport's generic nested dialog attribute.\n [DialogViewportDataAttributes.nestedDialogOpen]: undefined\n }),\n children: /*#__PURE__*/_jsx(DrawerViewportContext.Provider, {\n value: swipeProviderValue,\n children: children\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerViewport.displayName = \"DrawerViewport\";\nfunction setBackdropSwipingAttribute(backdropElement, swiping) {\n backdropElement?.toggleAttribute(DrawerPopupDataAttributes.swiping, swiping);\n}\nfunction isSwipeIgnoredTarget(target) {\n return Boolean(closest(target, BASE_UI_SWIPE_IGNORE_SELECTOR));\n}\nfunction isDrawerContentTarget(target) {\n return Boolean(closest(target, DRAWER_CONTENT_SELECTOR));\n}\nfunction getBaseSwipeSize(element, direction) {\n return direction === 'left' || direction === 'right' ? element.offsetWidth : element.offsetHeight;\n}\nfunction getBaseSwipeThreshold(element, direction) {\n return Math.max(getBaseSwipeSize(element, direction) * 0.5, MIN_SWIPE_THRESHOLD);\n}\nfunction isRangeInput(target, win) {\n return target instanceof win.HTMLInputElement && target.type === 'range';\n}\nfunction isTextSelectionControl(target) {\n return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA';\n}\nfunction hasExpandedSelectionWithinTarget(selection, target) {\n const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;\n const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;\n return selection.containsNode(target, true) || contains(target, anchorElement) || contains(target, focusElement);\n}\nfunction shouldIgnoreSwipeForTextSelection(doc, rootElement) {\n const activeEl = activeElement(doc);\n if (activeEl && contains(rootElement, activeEl) && isTextSelectionControl(activeEl)) {\n const {\n selectionStart,\n selectionEnd\n } = activeEl;\n if (selectionStart != null && selectionEnd != null && selectionStart < selectionEnd) {\n return true;\n }\n }\n const selection = doc.getSelection?.();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n return hasExpandedSelectionWithinTarget(selection, rootElement);\n}\nfunction isEventOnRangeInput(event, win) {\n return event.composedPath().some(pathTarget => isRangeInput(pathTarget, win));\n}\nfunction isReactTouchEventOnRangeInput(event) {\n return isEventOnRangeInput(event.nativeEvent, ownerWindow(event.currentTarget));\n}\nfunction updateTouchScrollPosition(touchState, touch) {\n touchState.lastX = touch.clientX;\n touchState.lastY = touch.clientY;\n}\n\n/**\n * Arbitrates a touchmove between the drawer swipe and a cross-axis gesture: a native scroll, or an\n * element marked with the cross-axis `data-base-ui-swipe-ignore` value.\n * Returns `true` when the move must be left alone — either because the cross axis already won the\n * gesture, or because neither axis has passed the slop yet and the gesture cannot be attributed.\n */\nfunction shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis) {\n if (touchState.preserveNativeCrossAxisScroll) {\n return true;\n }\n\n // Attribution happens once per gesture. Re-arbitrating after the drawer axis has won would let\n // the pre-attribution branches below fire mid-drag (the slop is measured from the touch origin,\n // which is never re-baselined), freezing the popup and dropping `preventDefault()`.\n if (touchState.drawerAxisAttributed || touchState.allowSwipe === true || !touchState.hasCrossAxisGestureTarget) {\n return false;\n }\n\n // A non-cancelable touchmove means the browser has already committed the gesture to a native\n // scroll; claiming it for the swipe would drag the popup alongside the scrolling content.\n if (!event.cancelable) {\n touchState.preserveNativeCrossAxisScroll = true;\n return true;\n }\n const drawerAxisGestureDelta = isVerticalScrollAxis ? touch.clientY - touchState.startY : touch.clientX - touchState.startX;\n const crossAxisGestureDelta = isVerticalScrollAxis ? touch.clientX - touchState.startX : touch.clientY - touchState.startY;\n const absDrawerAxisGestureDelta = Math.abs(drawerAxisGestureDelta);\n const absCrossAxisGestureDelta = Math.abs(crossAxisGestureDelta);\n if (absCrossAxisGestureDelta >= AXIS_LOCK_SLOP && absCrossAxisGestureDelta > absDrawerAxisGestureDelta + AXIS_LOCK_BIAS) {\n touchState.preserveNativeCrossAxisScroll = true;\n return true;\n }\n if (absDrawerAxisGestureDelta >= AXIS_LOCK_SLOP) {\n touchState.drawerAxisAttributed = true;\n return false;\n }\n\n // Neither axis has traveled past the slop yet, so the gesture cannot be attributed. Leave the\n // event alone: on iOS, `preventDefault()` on the first cancelable touchmove cancels native\n // scrolling for the entire gesture, which would lock a cross-axis scroll that only passes the\n // slop on a later move.\n return true;\n}\nfunction hasScrollableContentOnAxis(scrollTarget, axis) {\n return getScrollMetrics(scrollTarget, axis).max > 0;\n}\nfunction getScrollMetrics(scrollTarget, axis) {\n if (axis === 'vertical') {\n const max = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);\n return {\n offset: scrollTarget.scrollTop,\n max\n };\n }\n const max = Math.max(0, scrollTarget.scrollWidth - scrollTarget.clientWidth);\n return {\n offset: scrollTarget.scrollLeft,\n max\n };\n}\nfunction isAtSwipeStartEdge(scrollTarget, axis, direction) {\n const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);\n const {\n offset,\n max\n } = getScrollMetrics(scrollTarget, axis);\n return dismissFromStartEdge ? offset <= 0 : offset >= max;\n}\nfunction canSwipeFromScrollEdgeOnMove(scrollTarget, axis, direction, delta) {\n const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);\n const movingTowardDismiss = dismissFromStartEdge ? delta > 0 : delta < 0;\n if (!movingTowardDismiss) {\n return false;\n }\n return isAtSwipeStartEdge(scrollTarget, axis, direction);\n}\nfunction shouldDismissFromStartEdge(direction, axis) {\n return axis === 'vertical' ? direction === 'down' : direction === 'right';\n}","import { DialogHandle } from \"../dialog/store/DialogHandle.mjs\";\n\n/**\n * Controls a Drawer imperatively and associates detached `Drawer.Trigger` components with a\n * `Drawer.Root`. Create one with `Drawer.createHandle()` and pass it to the `handle` prop of the\n * root and of any triggers rendered outside of it.\n *\n * The imperative methods take effect only while a root using this handle is mounted; calls made\n * before a root attaches (or after it unmounts) are ignored.\n */\nexport class DrawerHandle extends DialogHandle {}\n\n/**\n * Creates a new handle to connect a Drawer.Root with detached Drawer.Trigger components.\n */\nexport function createDrawerHandle() {\n return new DrawerHandle();\n}","\nimport { Props as __zyzzProps } from 'zyzz/runtime';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as BaseUi from '@base-ui/react/drawer';\nimport { createContext, use, useState, useSyncExternalStore, } from 'react';\n\nimport { style, variants } from '../zyzz.config.js';\nconst context = createContext(undefined);\nconst compactQuery = '(max-width: 1023px)';\n// The viewport breakpoint is a literal because media queries cannot read CSS variables.\nfunction useCompact() {\n return useSyncExternalStore((notify) => {\n const query = window.matchMedia(compactQuery);\n query.addEventListener('change', notify);\n return () => query.removeEventListener('change', notify);\n }, () => window.matchMedia(compactQuery).matches, () => false);\n}\nfunction useShell() {\n const value = use(context);\n if (!value)\n throw new Error('AppShell parts must render inside AppShell.Root');\n return value;\n}\n/**\n * Application frame with a sticky sidebar beside a content column. `align=\"center\"` centers both\n * on wide viewports, and `align=\"start\"` pins the sidebar left with content filling the rest.\n * Below 1024px the sidebar moves into a drawer that `AppShell.Trigger` opens from the right edge.\n *\n * - Name the `Sidebar` with `aria-label`. It labels the `aside` on wide viewports and the drawer\n * dialog below 1024px.\n * - Keep one `Title` per page, since it renders the page's `h1`.\n * - Keep the navigation order the same on every page, and add a skip link to `Main` when the\n * sidebar holds many links.\n *\n * @example\n * <AppShell.Root>\n * <AppShell.Sidebar aria-label=\"Primary\">{navigation}</AppShell.Sidebar>\n * <AppShell.Main>\n * <AppShell.Header>\n * <AppShell.Title>API Keys</AppShell.Title>\n * <AppShell.Trigger />\n * </AppShell.Header>\n * </AppShell.Main>\n * </AppShell.Root>\n *\n * @see {@link https://base-ui.com/react/components/drawer | Base UI Drawer}\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/ | WAI-ARIA APG Landmark Regions}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/bypass-blocks.html | WCAG 2.2 Bypass Blocks}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/reflow.html | WCAG 2.2 Reflow}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/focus-order.html | WCAG 2.2 Focus Order}\n */\nexport var AppShell;\n(function (AppShell) {\n /** Page header row holding the title, actions and the compact-viewport `Trigger`. */\n function Header(props) {\n const { className, vars, ...attributes } = props;\n return _jsx(\"header\", { ...attributes, ...styles.header({ className, style: props.style, vars }) });\n }\n AppShell.Header = Header;\n /** The `main` landmark, a column up to 1024px wide. `align=\"start\"` lets it fill the row. */\n function Main(props) {\n const { className, vars, ...attributes } = props;\n return _jsx(\"main\", { ...attributes, ...styles.main({ className, style: props.style, vars }) });\n }\n AppShell.Main = Main;\n /**\n * Owns the drawer's open state and renders the frame `div`, which hosts the drawer portal and\n * reflects the state as `data-state=\"open\"` or `\"closed\"`. `Sidebar` and `Trigger` throw outside\n * it. `align` defaults to `center`.\n */\n function Root(props) {\n const { align, className, defaultOpen = false, onOpenChange, open, ref, vars, ...attributes } = props;\n const [handle] = useState(() => BaseUi.Drawer.createHandle());\n const [uncontrolled, setUncontrolled] = useState(defaultOpen);\n const [container, setContainer] = useState(null);\n const current = open ?? uncontrolled;\n return (_jsx(context.Provider, { value: {\n container,\n handle,\n open: current,\n setOpen(next) {\n setUncontrolled(next);\n onOpenChange?.(next);\n },\n }, children: _jsx(\"div\", { ...attributes, ...styles.root({ align, className, style: props.style, vars }), \"data-state\": current ? 'open' : 'closed', ref: (node) => {\n setContainer(node);\n if (typeof ref === 'function')\n ref(node);\n else if (ref)\n ref.current = node;\n } }) }));\n }\n AppShell.Root = Root;\n /**\n * Renders a sticky `aside` from 1024px, `var(--sidebar-width, 16.25rem)` wide. Below that it\n * renders a modal Base UI drawer popup as an `aside` with the dialog role, which takes focus on\n * open, returns it to the trigger on close, and dismisses with Escape, the backdrop or a swipe\n * right. Server rendering always emits the wide layout.\n */\n function Sidebar(props) {\n const { className, vars, ...attributes } = props;\n const shell = useShell();\n const compact = useCompact();\n const sidebar = styles.sidebar({ className, style: props.style, vars });\n if (!compact)\n return _jsx(\"aside\", { ...attributes, ...styles.inline(sidebar) });\n return (_jsx(BaseUi.Drawer.Root, { handle: shell.handle, onOpenChange: shell.setOpen, open: shell.open, swipeDirection: \"right\", children: _jsxs(BaseUi.Drawer.Portal, { container: shell.container, children: [_jsx(BaseUi.Drawer.Backdrop, { ...styles.backdrop() }), _jsx(BaseUi.Drawer.Viewport, { ...styles.viewport(), children: _jsx(BaseUi.Drawer.Popup, { ...attributes, ...styles.drawer(sidebar), render: _jsx(\"aside\", {}) }) })] }) }));\n }\n AppShell.Sidebar = Sidebar;\n /** The scrolling middle of the sidebar, between `SidebarHeader` and `SidebarFooter`. */\n function SidebarBody(props) {\n const { className, vars, ...attributes } = props;\n return _jsx(\"div\", { ...attributes, ...styles.sidebarBody({ className, style: props.style, vars }) });\n }\n AppShell.SidebarBody = SidebarBody;\n function SidebarFooter(props) {\n const { className, vars, ...attributes } = props;\n return (_jsx(\"div\", { ...attributes, ...styles.sidebarFooter({ className, style: props.style, vars }) }));\n }\n AppShell.SidebarFooter = SidebarFooter;\n function SidebarHeader(props) {\n const { className, vars, ...attributes } = props;\n return (_jsx(\"div\", { ...attributes, ...styles.sidebarHeader({ className, style: props.style, vars }) }));\n }\n AppShell.SidebarHeader = SidebarHeader;\n /** The page heading, rendered as an `h1`. */\n function Title(props) {\n const { className, vars, ...attributes } = props;\n return _jsx(\"h1\", { ...attributes, ...styles.title({ className, style: props.style, vars }) });\n }\n AppShell.Title = Title;\n /**\n * Toggles the sidebar drawer from a button fixed to the top-right corner, above the drawer, whose\n * two bars turn into a close mark while it is open. Hidden from 1024px, where the sidebar is\n * always visible. It is named `Open menu` or `Close menu` and exposes `aria-expanded`. Pass\n * `aria-label` to replace the name, or `children` to replace the bars.\n */\n function Trigger(props) {\n const { children, className, vars, ...attributes } = props;\n const shell = useShell();\n return (_jsx(BaseUi.Drawer.Trigger, { \"aria-label\": shell.open ? 'Close menu' : 'Open menu', ...attributes, ...styles.trigger({ className, style: props.style, vars }), handle: shell.handle, children: children ?? (_jsxs(\"span\", { \"aria-hidden\": \"true\", ...styles.bars(), children: [_jsx(\"span\", { ...styles.bar() }), _jsx(\"span\", { ...styles.bar() })] })) }));\n }\n AppShell.Trigger = Trigger;\n})(AppShell || (AppShell = {}));\nconst fadeIn = \"z-kid-tds_2f_web_2f_app_2d_shell_2f_fade_2d_in\";\nconst fadeOut = \"z-kid-tds_2f_web_2f_app_2d_shell_2f_fade_2d_out\";\nvar styles;\n(function (styles) {\n styles.backdrop = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xrJh8e0 z_tds_2f_web-xrJh8e1 z_tds_2f_web-xrJh8e2 z_tds_2f_web-xrJh8e3 z_tds_2f_web-xrJh8e4 z_tds_2f_web-xrJh8e5 z_tds_2f_web-xrJh8e6 z_tds_2f_web-xrJh8e7 z_tds_2f_web-xrJh8e8 z_tds_2f_web-xrJh8e9 z_tds_2f_web-xrJh8ea\"});\n styles.bar = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xrJh8eb z_tds_2f_web-xrJh8ec z_tds_2f_web-xrJh8ed z_tds_2f_web-xrJh8ee z_tds_2f_web-xrJh8ef z_tds_2f_web-xrJh8eg z_tds_2f_web-xrJh8eh z_tds_2f_web-xrJh8ei z_tds_2f_web-xrJh8e6 z_tds_2f_web-xrJh8ej z_tds_2f_web-xrJh8ek z_tds_2f_web-xrJh8el z_tds_2f_web-xrJh8em z_tds_2f_web-xrJh8en z_tds_2f_web-xrJh8eo\"});\n styles.bars = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xrJh8ep z_tds_2f_web-xrJh8eq z_tds_2f_web-xrJh8er z_tds_2f_web-xrJh8es\"});\n styles.drawer = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xrJh8et z_tds_2f_web-xrJh8eu z_tds_2f_web-xrJh8ev z_tds_2f_web-xrJh8ew z_tds_2f_web-xrJh8ex z_tds_2f_web-xrJh8ey z_tds_2f_web-xrJh8ez z_tds_2f_web-xrJh8e10 z_tds_2f_web-xrJh8e11 z_tds_2f_web-xrJh8e6 z_tds_2f_web-xrJh8e12 z_tds_2f_web-xrJh8e13 z_tds_2f_web-xrJh8e14 z_tds_2f_web-xrJh8e15 z_tds_2f_web-xrJh8e16 z_tds_2f_web-xrJh8e17 z_tds_2f_web-xrJh8e18 z_tds_2f_web-xrJh8e19 z_tds_2f_web-xrJh8e1a\"});\n styles.header = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e1b z_tds_2f_web-xrJh8e1c z_tds_2f_web-xrJh8e1d z_tds_2f_web-xrJh8e1e z_tds_2f_web-xrJh8e1f z_tds_2f_web-xrJh8e1g z_tds_2f_web-xrJh8e1h z_tds_2f_web-xrJh8e1i\"+\" \"+external:\"z_tds_2f_web-xrJh8e1b z_tds_2f_web-xrJh8e1c z_tds_2f_web-xrJh8e1d z_tds_2f_web-xrJh8e1e z_tds_2f_web-xrJh8e1f z_tds_2f_web-xrJh8e1g z_tds_2f_web-xrJh8e1h z_tds_2f_web-xrJh8e1i\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.main = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e1j z_tds_2f_web-xrJh8e1d z_tds_2f_web-xrJh8e1k z_tds_2f_web-xrJh8e1l z_tds_2f_web-xrJh8e1g z_tds_2f_web-xrJh8e1m z_tds_2f_web-xrJh8e1n z_tds_2f_web-xrJh8e1o z_tds_2f_web-xrJh8e1p z_tds_2f_web-xrJh8e1q\"+\" \"+external:\"z_tds_2f_web-xrJh8e1j z_tds_2f_web-xrJh8e1d z_tds_2f_web-xrJh8e1k z_tds_2f_web-xrJh8e1l z_tds_2f_web-xrJh8e1g z_tds_2f_web-xrJh8e1m z_tds_2f_web-xrJh8e1n z_tds_2f_web-xrJh8e1o z_tds_2f_web-xrJh8e1p z_tds_2f_web-xrJh8e1q\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.root = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e1r z_tds_2f_web-xrJh8e1s z_tds_2f_web-xrJh8e1t z_tds_2f_web-xrJh8e1u z_tds_2f_web-xrJh8er z_tds_2f_web-xrJh8e1v z_tds_2f_web-xrJh8e1w z_tds_2f_web-xrJh8e1x z_tds_2f_web-xrJh8e1y z_tds_2f_web-xrJh8e1z z_tds_2f_web-xrJh8e20 z_tds_2f_web-xrJh8e21 z_tds_2f_web-xrJh8e22 z_tds_2f_web-xrJh8e23 z_tds_2f_web-xrJh8e24 z_tds_2f_web-xrJh8e25\"+\" \"+external:\"z_tds_2f_web-xrJh8e1r z_tds_2f_web-xrJh8e1s z_tds_2f_web-xrJh8e1t z_tds_2f_web-xrJh8e1u z_tds_2f_web-xrJh8er z_tds_2f_web-xrJh8e1v z_tds_2f_web-xrJh8e1w z_tds_2f_web-xrJh8e1x z_tds_2f_web-xrJh8e1y z_tds_2f_web-xrJh8e1z z_tds_2f_web-xrJh8e20 z_tds_2f_web-xrJh8e21 z_tds_2f_web-xrJh8e22 z_tds_2f_web-xrJh8e23 z_tds_2f_web-xrJh8e24 z_tds_2f_web-xrJh8e25\",result=inline?{className,style:inline}:{className};let value;value=Object.hasOwn(input,\"align\")?input[\"align\"]:void 0;if(value===void 0)value=\"center\";if(value!==null&&value!==void 0)result[\"data-align\"]=String(value);return result});\n styles.sidebar = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e1r z_tds_2f_web-xrJh8e1j z_tds_2f_web-xrJh8e26 z_tds_2f_web-xrJh8e1k z_tds_2f_web-xrJh8e27 z_tds_2f_web-xrJh8e28 z_tds_2f_web-xrJh8e29 z_tds_2f_web-xrJh8e2a z_tds_2f_web-xrJh8e2b\"+\" \"+external:\"z_tds_2f_web-xrJh8e1r z_tds_2f_web-xrJh8e1j z_tds_2f_web-xrJh8e26 z_tds_2f_web-xrJh8e1k z_tds_2f_web-xrJh8e27 z_tds_2f_web-xrJh8e28 z_tds_2f_web-xrJh8e29 z_tds_2f_web-xrJh8e2a z_tds_2f_web-xrJh8e2b\",result=inline?{className,style:inline}:{className};let value;return result});\n // Follows `sidebar`, so its compact `display: none` overrides the sidebar's `display: flex` in\n // server-rendered markup, which always emits the wide layout.\n styles.inline = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xrJh8e2c z_tds_2f_web-xrJh8e2d z_tds_2f_web-xrJh8e2e z_tds_2f_web-xrJh8e2f z_tds_2f_web-xrJh8e2g z_tds_2f_web-xrJh8ey z_tds_2f_web-xrJh8e2h z_tds_2f_web-xrJh8e2i z_tds_2f_web-xrJh8e2j\"});\n styles.sidebarBody = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e2k z_tds_2f_web-xrJh8e2l z_tds_2f_web-xrJh8e28 z_tds_2f_web-xrJh8ey z_tds_2f_web-xrJh8e2m z_tds_2f_web-xrJh8e2n z_tds_2f_web-xrJh8e2o z_tds_2f_web-xrJh8e2p z_tds_2f_web-xrJh8e2q z_tds_2f_web-xrJh8e20 z_tds_2f_web-xrJh8e2r z_tds_2f_web-xrJh8e2s z_tds_2f_web-xrJh8e2t z_tds_2f_web-xrJh8e2u z_tds_2f_web-xrJh8e2v z_tds_2f_web-xrJh8e2w z_tds_2f_web-xrJh8e2x z_tds_2f_web-xrJh8e2y z_tds_2f_web-xrJh8e2z z_tds_2f_web-xrJh8e30 z_tds_2f_web-xrJh8e31 z_tds_2f_web-xrJh8e32 z_tds_2f_web-xrJh8e33 z_tds_2f_web-xrJh8e34 z_tds_2f_web-xrJh8e35 z_tds_2f_web-xrJh8e36 z_tds_2f_web-xrJh8e37 z_tds_2f_web-xrJh8e38 z_tds_2f_web-xrJh8e39\"+\" \"+external:\"z_tds_2f_web-xrJh8e2k z_tds_2f_web-xrJh8e2l z_tds_2f_web-xrJh8e28 z_tds_2f_web-xrJh8ey z_tds_2f_web-xrJh8e2m z_tds_2f_web-xrJh8e2n z_tds_2f_web-xrJh8e2o z_tds_2f_web-xrJh8e2p z_tds_2f_web-xrJh8e2q z_tds_2f_web-xrJh8e20 z_tds_2f_web-xrJh8e2r z_tds_2f_web-xrJh8e2s z_tds_2f_web-xrJh8e2t z_tds_2f_web-xrJh8e2u z_tds_2f_web-xrJh8e2v z_tds_2f_web-xrJh8e2w z_tds_2f_web-xrJh8e2x z_tds_2f_web-xrJh8e2y z_tds_2f_web-xrJh8e2z z_tds_2f_web-xrJh8e30 z_tds_2f_web-xrJh8e31 z_tds_2f_web-xrJh8e32 z_tds_2f_web-xrJh8e33 z_tds_2f_web-xrJh8e34 z_tds_2f_web-xrJh8e35 z_tds_2f_web-xrJh8e36 z_tds_2f_web-xrJh8e37 z_tds_2f_web-xrJh8e38 z_tds_2f_web-xrJh8e39\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.sidebarFooter = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e3a z_tds_2f_web-xrJh8e1k z_tds_2f_web-xrJh8e3b z_tds_2f_web-xrJh8e3c\"+\" \"+external:\"z_tds_2f_web-xrJh8e3a z_tds_2f_web-xrJh8e1k z_tds_2f_web-xrJh8e3b z_tds_2f_web-xrJh8e3c\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.sidebarHeader = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e3b z_tds_2f_web-xrJh8e3d\"+\" \"+external:\"z_tds_2f_web-xrJh8e3b z_tds_2f_web-xrJh8e3d\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.title = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e1s z_tds_2f_web-xrJh8e3e z_tds_2f_web-xrJh8e1g z_tds_2f_web-xrJh8e3f z_tds_2f_web-xrJh8e3g z_tds_2f_web-xrJh8e3h z_tds_2f_web-xrJh8e3i z_tds_2f_web-xrJh8e3j\"+\" \"+external:\"z_tds_2f_web-xrJh8e1s z_tds_2f_web-xrJh8e3e z_tds_2f_web-xrJh8e1g z_tds_2f_web-xrJh8e3f z_tds_2f_web-xrJh8e3g z_tds_2f_web-xrJh8e3h z_tds_2f_web-xrJh8e3i z_tds_2f_web-xrJh8e3j\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.trigger = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-xrJh8e1b z_tds_2f_web-xrJh8e3k z_tds_2f_web-xrJh8e3l z_tds_2f_web-xrJh8ec z_tds_2f_web-xrJh8e3m z_tds_2f_web-xrJh8e3n z_tds_2f_web-xrJh8e3o z_tds_2f_web-xrJh8e1j z_tds_2f_web-xrJh8e1s z_tds_2f_web-xrJh8e3p z_tds_2f_web-xrJh8e3q z_tds_2f_web-xrJh8e3r z_tds_2f_web-xrJh8e3s z_tds_2f_web-xrJh8e3t z_tds_2f_web-xrJh8e3u z_tds_2f_web-xrJh8e3v z_tds_2f_web-xrJh8e3w z_tds_2f_web-xrJh8e3x z_tds_2f_web-xrJh8e3y z_tds_2f_web-xrJh8e3z z_tds_2f_web-xrJh8e40 z_tds_2f_web-xrJh8e41 z_tds_2f_web-xrJh8e42 z_tds_2f_web-xrJh8e43 z_tds_2f_web-xrJh8e44 z_tds_2f_web-xrJh8e45 z_tds_2f_web-xrJh8e46 z_tds_2f_web-xrJh8e47 z_tds_2f_web-xrJh8e48 z_tds_2f_web-xrJh8e49 z_tds_2f_web-xrJh8e4a z_tds_2f_web-xrJh8e4b z_tds_2f_web-xrJh8e4c z_tds_2f_web-xrJh8e4d z_tds_2f_web-xrJh8e4e z_tds_2f_web-xrJh8e4f\"+\" \"+external:\"z_tds_2f_web-xrJh8e1b z_tds_2f_web-xrJh8e3k z_tds_2f_web-xrJh8e3l z_tds_2f_web-xrJh8ec z_tds_2f_web-xrJh8e3m z_tds_2f_web-xrJh8e3n z_tds_2f_web-xrJh8e3o z_tds_2f_web-xrJh8e1j z_tds_2f_web-xrJh8e1s z_tds_2f_web-xrJh8e3p z_tds_2f_web-xrJh8e3q z_tds_2f_web-xrJh8e3r z_tds_2f_web-xrJh8e3s z_tds_2f_web-xrJh8e3t z_tds_2f_web-xrJh8e3u z_tds_2f_web-xrJh8e3v z_tds_2f_web-xrJh8e3w z_tds_2f_web-xrJh8e3x z_tds_2f_web-xrJh8e3y z_tds_2f_web-xrJh8e3z z_tds_2f_web-xrJh8e40 z_tds_2f_web-xrJh8e41 z_tds_2f_web-xrJh8e42 z_tds_2f_web-xrJh8e43 z_tds_2f_web-xrJh8e44 z_tds_2f_web-xrJh8e45 z_tds_2f_web-xrJh8e46 z_tds_2f_web-xrJh8e47 z_tds_2f_web-xrJh8e48 z_tds_2f_web-xrJh8e49 z_tds_2f_web-xrJh8e4a z_tds_2f_web-xrJh8e4b z_tds_2f_web-xrJh8e4c z_tds_2f_web-xrJh8e4d z_tds_2f_web-xrJh8e4e z_tds_2f_web-xrJh8e4f\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.viewport = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-xrJh8e4g z_tds_2f_web-xrJh8e4h z_tds_2f_web-xrJh8e4i z_tds_2f_web-xrJh8e40 z_tds_2f_web-xrJh8e4j\"});\n})(styles || (styles = {}));\n//# sourceMappingURL=AppShell.js.map\nimport './AppShell.css';\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ChevronRight(props) {\n return (_jsx(\"svg\", { width: \"1em\", height: \"1em\", viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", \"aria-hidden\": props['aria-label'] || props['aria-labelledby'] ? undefined : true, role: props['aria-label'] || props['aria-labelledby'] ? 'img' : undefined, ...props, children: _jsx(\"path\", { d: \"M6.1464 3.3135C6.34166 3.11824 6.65816 3.11824 6.85343 3.3135L10.7157 7.1758C11.1706 7.63138 11.1709 8.36981 10.7157 8.82522L6.85334 12.6875C6.6582 12.8824 6.34152 12.8823 6.14631 12.6875C5.95114 12.4923 5.95132 12.1758 6.14631 11.9805L10.0087 8.11819C10.0734 8.05331 10.0731 7.94789 10.0087 7.88284L6.1464 4.02053C5.95117 3.8253 5.95124 3.50877 6.1464 3.3135Z\", fill: \"currentColor\" }) }));\n}\n//# sourceMappingURL=ChevronRight.js.map","import { useRender } from '@base-ui/react/use-render';\nimport { variants } from '../zyzz.config.js';\n/**\n * Lays out children in a horizontal flex row with a spacing-token `gap`. Renders a `div`, and\n * `render` swaps the element.\n *\n * - Set `wrap` when the row can outgrow narrow viewports, so items reflow instead of overflowing.\n * - Keep DOM order matching visual order, so reading and focus order follow the layout.\n *\n * @example\n * <Inline gap=\"12\" justify=\"between\" wrap>\n * <Button>Send</Button>\n * <Button variant=\"secondary\">Receive</Button>\n * </Inline>\n *\n * @see {@link https://base-ui.com/react/utils/use-render | Base UI useRender}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/reflow.html | WCAG 2.2 Reflow}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/meaningful-sequence.html | WCAG 2.2 Meaningful Sequence}\n */\nexport function Inline(props) {\n const { align, className, gap, justify, ref, render, vars, wrap, ...attributes } = props;\n return useRender({\n defaultTagName: 'div',\n props: {\n ...attributes,\n ...styles.inline({ align, className, gap, justify, style: props.style, vars, wrap }),\n },\n ref,\n render,\n });\n}\nvar styles;\n(function (styles) {\n styles.inline = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-UGjdnU0 z_tds_2f_web-UGjdnU1 z_tds_2f_web-UGjdnU2 z_tds_2f_web-UGjdnU3 z_tds_2f_web-UGjdnU4 z_tds_2f_web-UGjdnU5 z_tds_2f_web-UGjdnU6 z_tds_2f_web-UGjdnU7 z_tds_2f_web-UGjdnU8 z_tds_2f_web-UGjdnU9 z_tds_2f_web-UGjdnUa z_tds_2f_web-UGjdnUb z_tds_2f_web-UGjdnUc z_tds_2f_web-UGjdnUd z_tds_2f_web-UGjdnUe z_tds_2f_web-UGjdnUf z_tds_2f_web-UGjdnUg z_tds_2f_web-UGjdnUh z_tds_2f_web-UGjdnUi z_tds_2f_web-UGjdnUj z_tds_2f_web-UGjdnUk z_tds_2f_web-UGjdnUl\"+\" \"+external:\"z_tds_2f_web-UGjdnU0 z_tds_2f_web-UGjdnU1 z_tds_2f_web-UGjdnU2 z_tds_2f_web-UGjdnU3 z_tds_2f_web-UGjdnU4 z_tds_2f_web-UGjdnU5 z_tds_2f_web-UGjdnU6 z_tds_2f_web-UGjdnU7 z_tds_2f_web-UGjdnU8 z_tds_2f_web-UGjdnU9 z_tds_2f_web-UGjdnUa z_tds_2f_web-UGjdnUb z_tds_2f_web-UGjdnUc z_tds_2f_web-UGjdnUd z_tds_2f_web-UGjdnUe z_tds_2f_web-UGjdnUf z_tds_2f_web-UGjdnUg z_tds_2f_web-UGjdnUh z_tds_2f_web-UGjdnUi z_tds_2f_web-UGjdnUj z_tds_2f_web-UGjdnUk z_tds_2f_web-UGjdnUl\",result=inline?{className,style:inline}:{className};let value;value=Object.hasOwn(input,\"align\")?input[\"align\"]:void 0;if(value===void 0)value=\"center\";if(value!==null&&value!==void 0)result[\"data-align\"]=String(value);value=Object.hasOwn(input,\"gap\")?input[\"gap\"]:void 0;if(value===void 0)value=\"8\";if(value!==null&&value!==void 0)result[\"data-gap\"]=String(value);value=Object.hasOwn(input,\"justify\")?input[\"justify\"]:void 0;if(value===void 0)value=\"start\";if(value!==null&&value!==void 0)result[\"data-justify\"]=String(value);value=Object.hasOwn(input,\"wrap\")?input[\"wrap\"]:void 0;if(value===void 0)value=\"false\";if(value!==null&&value!==void 0)result[\"data-wrap\"]=String(value);return result});\n})(styles || (styles = {}));\n//# sourceMappingURL=Inline.js.map\nimport './Inline.css';\n","import { collapsibleOpenStateMapping as baseMapping } from \"../../utils/collapsibleOpenStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nexport const collapsibleStateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useCollapsibleRoot } from \"./useCollapsibleRoot.mjs\";\nimport { CollapsibleRootContext } from \"./CollapsibleRootContext.mjs\";\nimport { collapsibleStateAttributesMapping } from \"./stateAttributesMapping.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the collapsible.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsibleRoot = /*#__PURE__*/React.forwardRef(function CollapsibleRoot(componentProps, forwardedRef) {\n const {\n render,\n className,\n defaultOpen = false,\n disabled = false,\n onOpenChange: onOpenChangeProp,\n open,\n style,\n ...elementProps\n } = componentProps;\n const onOpenChange = useStableCallback(onOpenChangeProp);\n const collapsible = useCollapsibleRoot({\n open,\n defaultOpen,\n onOpenChange,\n disabled\n });\n const state = React.useMemo(() => ({\n open: collapsible.open,\n disabled: collapsible.disabled,\n transitionStatus: collapsible.transitionStatus\n }), [collapsible.open, collapsible.disabled, collapsible.transitionStatus]);\n const contextValue = React.useMemo(() => ({\n ...collapsible,\n onOpenChange,\n state\n }), [collapsible, onOpenChange, state]);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: elementProps,\n stateAttributesMapping: collapsibleStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(CollapsibleRootContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") CollapsibleRoot.displayName = \"CollapsibleRoot\";","'use client';\n\nimport * as React from 'react';\nimport { triggerOpenStateMapping } from \"../../utils/collapsibleOpenStateMapping.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { useCollapsibleRootContext } from \"../root/CollapsibleRootContext.mjs\";\nconst stateAttributesMapping = {\n ...triggerOpenStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A button that opens and closes the collapsible panel.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsibleTrigger = /*#__PURE__*/React.forwardRef(function CollapsibleTrigger(componentProps, forwardedRef) {\n const {\n panelId,\n open,\n handleTrigger,\n state,\n disabled: contextDisabled\n } = useCollapsibleRootContext();\n const {\n className,\n disabled = contextDisabled,\n render,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [{\n 'aria-controls': open ? panelId : undefined,\n 'aria-expanded': open,\n onClick: handleTrigger\n }, elementProps, getButtonProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") CollapsibleTrigger.displayName = \"CollapsibleTrigger\";","/**\n * The collapsible panel's height.\n * @type {number}\n */\nexport const collapsiblePanelHeight = '--collapsible-panel-height';\n/**\n * The collapsible panel's width.\n * @type {number}\n */\nexport const collapsiblePanelWidth = '--collapsible-panel-width';","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { warn } from '@base-ui/utils/warn';\nimport { resolveStyle } from \"../../utils/resolveStyle.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useCollapsibleRootContext } from \"../root/CollapsibleRootContext.mjs\";\nimport { collapsibleStateAttributesMapping } from \"../root/stateAttributesMapping.mjs\";\nimport { useCollapsiblePanel } from \"./useCollapsiblePanel.mjs\";\nimport * as CollapsiblePanelCssVars from \"./CollapsiblePanelCssVars.mjs\";\n/**\n * A panel with the collapsible contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)\n */\nexport const CollapsiblePanel = /*#__PURE__*/React.forwardRef(function CollapsiblePanel(componentProps, forwardedRef) {\n const {\n className,\n hiddenUntilFound: hiddenUntilFoundProp,\n keepMounted: keepMountedProp,\n render,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n\n /* istanbul ignore else -- `process.env.NODE_ENV` is a build-time constant under test */\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (hiddenUntilFoundProp && keepMountedProp === false) {\n warn('The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.');\n }\n }, [hiddenUntilFoundProp, keepMountedProp]);\n }\n const {\n defaultPanelId,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setPanelIdState,\n setOpen,\n state,\n transitionStatus\n } = useCollapsibleRootContext();\n const hiddenUntilFound = hiddenUntilFoundProp ?? false;\n const keepMounted = keepMountedProp ?? false;\n const registeredId = idProp || undefined;\n const id = registeredId ?? defaultPanelId;\n useIsoLayoutEffect(() => {\n setPanelIdState(currentId => registeredId ?? (currentId === null ? undefined : currentId));\n return () => {\n setPanelIdState(currentId => currentId === registeredId ? null : currentId);\n };\n }, [registeredId, setPanelIdState]);\n const {\n height,\n props,\n ref,\n shouldPreventOpenAnimation,\n shouldRender,\n transitionStatus: panelTransitionStatus,\n width\n } = useCollapsiblePanel({\n externalRef: forwardedRef,\n hiddenUntilFound,\n id,\n keepMounted,\n mounted,\n onOpenChange,\n open,\n setMounted,\n setOpen,\n transitionStatus\n });\n const panelState = {\n ...state,\n transitionStatus: panelTransitionStatus\n };\n const resolvedStyle = resolveStyle(style, panelState);\n const element = useRenderElement('div', {\n ...componentProps,\n style: undefined\n }, {\n state: panelState,\n ref,\n props: [props, {\n style: {\n [CollapsiblePanelCssVars.collapsiblePanelHeight]: height === undefined ? 'auto' : `${height}px`,\n [CollapsiblePanelCssVars.collapsiblePanelWidth]: width === undefined ? 'auto' : `${width}px`\n }\n }, elementProps, resolvedStyle ? {\n style: resolvedStyle\n } : undefined,\n // Resolve the public `style` prop so temporary `animationName: 'none'`\n // can still win after user's inline styles have been merged.\n shouldPreventOpenAnimation ? {\n style: {\n animationName: 'none'\n }\n } : undefined],\n stateAttributesMapping: collapsibleStateAttributesMapping\n });\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") CollapsiblePanel.displayName = \"CollapsiblePanel\";","\nimport { Props as __zyzzProps } from 'zyzz/runtime';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as BaseUi from '@base-ui/react/collapsible';\nimport { useRender } from '@base-ui/react/use-render';\nimport { createContext, use, useId, useLayoutEffect, useState, } from 'react';\nimport { ChevronRight } from '../icons/ChevronRight.js';\nimport { style, variants } from '../zyzz.config.js';\nconst groupContext = createContext(undefined);\n/**\n * Vertical navigation of icon and label rows, for sidebars and drawers. It renders a `<nav>`\n * landmark of links, with `aria-current=\"page\"` on the active item. Submenus are Base UI\n * Collapsible disclosures whose triggers are buttons exposing `aria-expanded`.\n *\n * @rules\n * - Use links for site navigation, not menu roles. Use `Menu` for actions.\n * - Mark exactly one item `active` for the current page.\n * - Keep the item order the same on every page.\n * - Keep item labels short enough to fit on one line. Items do not wrap, so shorten a long label.\n *\n * @example\n * <SidebarMenu.Root>\n * <SidebarMenu.Item active href=\"/\">\n * <Grid />\n * Home\n * </SidebarMenu.Item>\n * </SidebarMenu.Root>\n *\n * @see {@link https://base-ui.com/react/components/collapsible | Base UI Collapsible}\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/ | WAI-ARIA APG Disclosure Navigation example}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/navigation_role | MDN navigation role}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/multiple-ways.html | WCAG 2.2 Multiple Ways}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/consistent-navigation.html | WCAG 2.2 Consistent Navigation}\n * @see {@link https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html | WCAG 2.2 Name, Role, Value}\n */\nexport var SidebarMenu;\n(function (SidebarMenu) {\n /**\n * Renders a `group` that names itself after its `GroupLabel` when one renders inside it.\n * Without a label, pass `aria-label`.\n */\n function Group(props) {\n const { className, vars, ...attributes } = props;\n const id = useId();\n const [labelled, setLabelled] = useState(false);\n return (_jsx(groupContext.Provider, { value: { id, setLabelled }, children: _jsx(\"div\", { \"aria-labelledby\": labelled ? id : undefined, role: \"group\", ...attributes, ...styles.group({ className, style: props.style, vars }) }) }));\n }\n SidebarMenu.Group = Group;\n /** Visible heading text for the surrounding `Group`, which it names through `aria-labelledby`. */\n function GroupLabel(props) {\n const { className, vars, ...attributes } = props;\n const group = use(groupContext);\n const setLabelled = group?.setLabelled;\n useLayoutEffect(() => {\n if (!setLabelled)\n return;\n setLabelled(true);\n return () => setLabelled(false);\n }, [setLabelled]);\n return (_jsx(\"div\", { id: group?.id, ...attributes, ...styles.groupLabel({ className, style: props.style, vars }) }));\n }\n SidebarMenu.GroupLabel = GroupLabel;\n /**\n * Renders a link by default. Pass `render` to use a router link. `active` marks the current page\n * with `aria-current=\"page\"`.\n */\n function Item(props) {\n const { active = false, className, ref, render, vars, ...attributes } = props;\n return useRender({\n defaultTagName: 'a',\n props: {\n ...attributes,\n 'aria-current': active ? 'page' : undefined,\n ...styles.item({ active, className, style: props.style, vars }),\n },\n ref,\n render,\n });\n }\n SidebarMenu.Item = Item;\n /**\n * Renders the `<nav>` landmark, labelled `Main` unless you pass `aria-label`. Give each\n * landmark on a page a distinct label. `size` sets 32, 40 or 56px rows, and `small` also uses\n * 16px icons for long menus.\n */\n function Root(props) {\n const { className, size, vars, ...attributes } = props;\n return (_jsx(\"nav\", { \"aria-label\": \"Main\", ...attributes, \"data-sidebar-menu-size\": size ?? 'medium', ...styles.root({ className, size, style: props.style, vars }) }));\n }\n SidebarMenu.Root = Root;\n /**\n * Collapsible set of nested items, toggled by its `SubmenuTrigger`. Pass `open` and\n * `onOpenChange` to control it, or `defaultOpen` to start expanded.\n */\n function Submenu(props) {\n return _jsx(BaseUi.Collapsible.Root, { ...props });\n }\n SidebarMenu.Submenu = Submenu;\n /** Indents its items under the trigger's label and animates their height. */\n function SubmenuPanel(props) {\n const { children, className, vars, ...attributes } = props;\n return (_jsx(BaseUi.Collapsible.Panel, { ...attributes, ...styles.submenuPanel({ className, style: props.style, vars }), children: _jsx(\"div\", { ...styles.submenuContent(), children: children }) }));\n }\n SidebarMenu.SubmenuPanel = SubmenuPanel;\n /**\n * Renders a row-styled button with a right chevron that turns down while the submenu is open.\n * It exposes `aria-expanded` and, while open, `aria-controls` pointing at the panel.\n */\n function SubmenuTrigger(props) {\n const { children, className, vars, ...attributes } = props;\n return (_jsxs(BaseUi.Collapsible.Trigger, { ...attributes, ...styles.item({ className, style: props.style, vars }), children: [children, _jsx(ChevronRight, { ...styles.chevron() })] }));\n }\n SidebarMenu.SubmenuTrigger = SubmenuTrigger;\n})(SidebarMenu || (SidebarMenu = {}));\nvar styles;\n(function (styles) {\n styles.chevron = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-h4TVw80 z_tds_2f_web-h4TVw81 z_tds_2f_web-h4TVw82 z_tds_2f_web-h4TVw83 z_tds_2f_web-h4TVw84 z_tds_2f_web-h4TVw85 z_tds_2f_web-h4TVw86\"});\n styles.group = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-h4TVw87 z_tds_2f_web-h4TVw88 z_tds_2f_web-h4TVw89 z_tds_2f_web-h4TVw8a z_tds_2f_web-h4TVw8b z_tds_2f_web-h4TVw8c z_tds_2f_web-h4TVw8d z_tds_2f_web-h4TVw8e z_tds_2f_web-h4TVw8f z_tds_2f_web-h4TVw8g\"+\" \"+external:\"z_tds_2f_web-h4TVw87 z_tds_2f_web-h4TVw88 z_tds_2f_web-h4TVw89 z_tds_2f_web-h4TVw8a z_tds_2f_web-h4TVw8b z_tds_2f_web-h4TVw8c z_tds_2f_web-h4TVw8d z_tds_2f_web-h4TVw8e z_tds_2f_web-h4TVw8f z_tds_2f_web-h4TVw8g\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.groupLabel = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-h4TVw8h z_tds_2f_web-h4TVw8i z_tds_2f_web-h4TVw8j z_tds_2f_web-h4TVw8k z_tds_2f_web-h4TVw8l z_tds_2f_web-h4TVw8m z_tds_2f_web-h4TVw8n z_tds_2f_web-h4TVw8o z_tds_2f_web-h4TVw8p\"+\" \"+external:\"z_tds_2f_web-h4TVw8h z_tds_2f_web-h4TVw8i z_tds_2f_web-h4TVw8j z_tds_2f_web-h4TVw8k z_tds_2f_web-h4TVw8l z_tds_2f_web-h4TVw8m z_tds_2f_web-h4TVw8n z_tds_2f_web-h4TVw8o z_tds_2f_web-h4TVw8p\",result=inline?{className,style:inline}:{className};let value;return result});\n styles.item = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-h4TVw8q z_tds_2f_web-h4TVw8r z_tds_2f_web-h4TVw8s z_tds_2f_web-h4TVw8t z_tds_2f_web-h4TVw8u z_tds_2f_web-h4TVw8v z_tds_2f_web-h4TVw8w z_tds_2f_web-h4TVw8x z_tds_2f_web-h4TVw8y z_tds_2f_web-h4TVw87 z_tds_2f_web-h4TVw8z z_tds_2f_web-h4TVw810 z_tds_2f_web-h4TVw811 z_tds_2f_web-h4TVw812 z_tds_2f_web-h4TVw813 z_tds_2f_web-h4TVw814 z_tds_2f_web-h4TVw815 z_tds_2f_web-h4TVw816 z_tds_2f_web-h4TVw817 z_tds_2f_web-h4TVw818 z_tds_2f_web-h4TVw819 z_tds_2f_web-h4TVw81a z_tds_2f_web-h4TVw81b z_tds_2f_web-h4TVw81c z_tds_2f_web-h4TVw81d z_tds_2f_web-h4TVw81e z_tds_2f_web-h4TVw81f z_tds_2f_web-h4TVw81g z_tds_2f_web-h4TVw81h z_tds_2f_web-h4TVw81i z_tds_2f_web-h4TVw81j z_tds_2f_web-h4TVw81k z_tds_2f_web-h4TVw81l z_tds_2f_web-h4TVw81m z_tds_2f_web-h4TVw81n z_tds_2f_web-h4TVw81o z_tds_2f_web-h4TVw81p z_tds_2f_web-h4TVw81q z_tds_2f_web-h4TVw81r z_tds_2f_web-h4TVw81s z_tds_2f_web-h4TVw81t z_tds_2f_web-h4TVw81u z_tds_2f_web-h4TVw81v z_tds_2f_web-h4TVw81w z_tds_2f_web-h4TVw81x z_tds_2f_web-h4TVw81y z_tds_2f_web-h4TVw81z z_tds_2f_web-h4TVw820 z_tds_2f_web-h4TVw821 z_tds_2f_web-h4TVw822 z_tds_2f_web-h4TVw823 z_tds_2f_web-h4TVw824 z_tds_2f_web-h4TVw825 z_tds_2f_web-h4TVw826 z_tds_2f_web-h4TVw827 z_tds_2f_web-h4TVw828 z_tds_2f_web-h4TVw829 z_tds_2f_web-h4TVw82a z_tds_2f_web-h4TVw82b\"+\" \"+external:\"z_tds_2f_web-h4TVw8q z_tds_2f_web-h4TVw8r z_tds_2f_web-h4TVw8s z_tds_2f_web-h4TVw8t z_tds_2f_web-h4TVw8u z_tds_2f_web-h4TVw8v z_tds_2f_web-h4TVw8w z_tds_2f_web-h4TVw8x z_tds_2f_web-h4TVw8y z_tds_2f_web-h4TVw87 z_tds_2f_web-h4TVw8z z_tds_2f_web-h4TVw810 z_tds_2f_web-h4TVw811 z_tds_2f_web-h4TVw812 z_tds_2f_web-h4TVw813 z_tds_2f_web-h4TVw814 z_tds_2f_web-h4TVw815 z_tds_2f_web-h4TVw816 z_tds_2f_web-h4TVw817 z_tds_2f_web-h4TVw818 z_tds_2f_web-h4TVw819 z_tds_2f_web-h4TVw81a z_tds_2f_web-h4TVw81b z_tds_2f_web-h4TVw81c z_tds_2f_web-h4TVw81d z_tds_2f_web-h4TVw81e z_tds_2f_web-h4TVw81f z_tds_2f_web-h4TVw81g z_tds_2f_web-h4TVw81h z_tds_2f_web-h4TVw81i z_tds_2f_web-h4TVw81j z_tds_2f_web-h4TVw81k z_tds_2f_web-h4TVw81l z_tds_2f_web-h4TVw81m z_tds_2f_web-h4TVw81n z_tds_2f_web-h4TVw81o z_tds_2f_web-h4TVw81p z_tds_2f_web-h4TVw81q z_tds_2f_web-h4TVw81r z_tds_2f_web-h4TVw81s z_tds_2f_web-h4TVw81t z_tds_2f_web-h4TVw81u z_tds_2f_web-h4TVw81v z_tds_2f_web-h4TVw81w z_tds_2f_web-h4TVw81x z_tds_2f_web-h4TVw81y z_tds_2f_web-h4TVw81z z_tds_2f_web-h4TVw820 z_tds_2f_web-h4TVw821 z_tds_2f_web-h4TVw822 z_tds_2f_web-h4TVw823 z_tds_2f_web-h4TVw824 z_tds_2f_web-h4TVw825 z_tds_2f_web-h4TVw826 z_tds_2f_web-h4TVw827 z_tds_2f_web-h4TVw828 z_tds_2f_web-h4TVw829 z_tds_2f_web-h4TVw82a z_tds_2f_web-h4TVw82b\",result=inline?{className,style:inline}:{className};let value;value=Object.hasOwn(input,\"active\")?input[\"active\"]:void 0;if(value===void 0)value=\"false\";if(value!==null&&value!==void 0)result[\"data-active\"]=String(value);return result});\n styles.root = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-h4TVw87 z_tds_2f_web-h4TVw88 z_tds_2f_web-h4TVw811 z_tds_2f_web-h4TVw82c z_tds_2f_web-h4TVw82d\"+\" \"+external:\"z_tds_2f_web-h4TVw87 z_tds_2f_web-h4TVw88 z_tds_2f_web-h4TVw811 z_tds_2f_web-h4TVw82c z_tds_2f_web-h4TVw82d\",result=inline?{className,style:inline}:{className};let value;value=Object.hasOwn(input,\"size\")?input[\"size\"]:void 0;if(value===void 0)value=\"medium\";if(value!==null&&value!==void 0)result[\"data-size\"]=String(value);return result});\n styles.submenuContent = /*#__PURE__*/__zyzzProps.create({className:\"z_tds_2f_web-h4TVw87 z_tds_2f_web-h4TVw88 z_tds_2f_web-h4TVw82e z_tds_2f_web-h4TVw82f z_tds_2f_web-h4TVw82g z_tds_2f_web-h4TVw82h z_tds_2f_web-h4TVw82i z_tds_2f_web-h4TVw82j\"});\n styles.submenuPanel = ((input={})=>{const external=input.className,style=input.style,vars=input.vars,inline=vars?{...vars,...style}:style,className=external?\"z_tds_2f_web-h4TVw82k z_tds_2f_web-h4TVw82l z_tds_2f_web-h4TVw82m z_tds_2f_web-h4TVw82n z_tds_2f_web-h4TVw82o z_tds_2f_web-h4TVw82p z_tds_2f_web-h4TVw82q z_tds_2f_web-h4TVw82r z_tds_2f_web-h4TVw82s\"+\" \"+external:\"z_tds_2f_web-h4TVw82k z_tds_2f_web-h4TVw82l z_tds_2f_web-h4TVw82m z_tds_2f_web-h4TVw82n z_tds_2f_web-h4TVw82o z_tds_2f_web-h4TVw82p z_tds_2f_web-h4TVw82q z_tds_2f_web-h4TVw82r z_tds_2f_web-h4TVw82s\",result=inline?{className,style:inline}:{className};let value;return result});\n})(styles || (styles = {}));\n//# sourceMappingURL=SidebarMenu.js.map\nimport './SidebarMenu.css';\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function Grid(props) {\n return (_jsxs(\"svg\", { width: \"1em\", height: \"1em\", viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", \"aria-hidden\": props['aria-label'] || props['aria-labelledby'] ? undefined : true, role: props['aria-label'] || props['aria-labelledby'] ? 'img' : undefined, ...props, children: [_jsx(\"path\", { d: \"M3.16699 11.667C3.81117 11.6672 4.33301 12.1897 4.33301 12.834C4.33257 13.4778 3.81089 13.9998 3.16699 14C2.52294 14 2.00044 13.478 2 12.834C2 12.1896 2.52267 11.667 3.16699 11.667Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M8.00098 11.667C8.64494 11.6674 9.16699 12.1899 9.16699 12.834C9.16655 13.4777 8.64467 13.9996 8.00098 14C7.35691 14 6.83442 13.478 6.83398 12.834C6.83398 12.1896 7.35663 11.667 8.00098 11.667Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M12.834 11.667C13.478 11.6674 14 12.1899 14 12.834C13.9996 13.4777 13.4777 13.9996 12.834 14C12.1899 14 11.6674 13.478 11.667 12.834C11.667 12.1896 12.1896 11.667 12.834 11.667Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M3.16699 6.83398C3.81117 6.83416 4.33301 7.35674 4.33301 8.00098C4.33257 8.64484 3.81089 9.16682 3.16699 9.16699C2.52294 9.16699 2.00044 8.64495 2 8.00098C2 7.35663 2.52267 6.83398 3.16699 6.83398Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M8.00098 6.83398C8.64494 6.83442 9.16699 7.35691 9.16699 8.00098C9.16655 8.64467 8.64467 9.16655 8.00098 9.16699C7.35691 9.16699 6.83442 8.64494 6.83398 8.00098C6.83398 7.35663 7.35663 6.83398 8.00098 6.83398Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M12.834 6.83398C13.478 6.83442 14 7.35691 14 8.00098C13.9996 8.64467 13.4777 9.16655 12.834 9.16699C12.1899 9.16699 11.6674 8.64494 11.667 8.00098C11.667 7.35663 12.1896 6.83398 12.834 6.83398Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M3.16699 2C3.81117 2.00018 4.33301 2.52277 4.33301 3.16699C4.33283 3.81106 3.81106 4.33283 3.16699 4.33301C2.52277 4.33301 2.00018 3.81117 2 3.16699C2 2.52266 2.52266 2 3.16699 2Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M8.00098 2C8.64495 2.00044 9.16699 2.52294 9.16699 3.16699C9.16682 3.81089 8.64484 4.33257 8.00098 4.33301C7.35674 4.33301 6.83416 3.81117 6.83398 3.16699C6.83398 2.52267 7.35663 2 8.00098 2Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M12.834 2C13.478 2.00044 14 2.52294 14 3.16699C13.9998 3.81089 13.4778 4.33257 12.834 4.33301C12.1897 4.33301 11.6672 3.81117 11.667 3.16699C11.667 2.52267 12.1896 2 12.834 2Z\", fill: \"currentColor\" })] }));\n}\n//# sourceMappingURL=Grid.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function LogOut(props) {\n return (_jsxs(\"svg\", { width: \"1em\", height: \"1em\", viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", \"aria-hidden\": props['aria-label'] || props['aria-labelledby'] ? undefined : true, role: props['aria-label'] || props['aria-labelledby'] ? 'img' : undefined, ...props, children: [_jsx(\"path\", { d: \"M7.5 2C7.77614 2 8 2.22386 8 2.5C8 2.77614 7.77614 3 7.5 3H3.16699C3.07495 3 3 3.07495 3 3.16699V12.833C3 12.9251 3.07494 13 3.16699 13H7.5C7.77614 13 8 13.2239 8 13.5C8 13.7761 7.77614 14 7.5 14H3.16699C2.52267 14 2 13.4774 2 12.833V3.16699C2 2.52266 2.52266 2 3.16699 2H7.5Z\", fill: \"currentColor\" }), _jsx(\"path\", { d: \"M10.1465 4.64648C10.3417 4.45122 10.6583 4.45122 10.8535 4.64648L13.8535 7.64648C14.0487 7.84175 14.0488 8.15827 13.8535 8.35352L10.8535 11.3535C10.6583 11.5488 10.3417 11.5487 10.1465 11.3535C9.95122 11.1583 9.95122 10.8417 10.1465 10.6465L12.293 8.5H6C5.72386 8.5 5.5 8.27614 5.5 8C5.5 7.72386 5.72386 7.5 6 7.5H12.293L10.1465 5.35352C9.95122 5.15825 9.95122 4.84175 10.1465 4.64648Z\", fill: \"currentColor\" })] }));\n}\n//# sourceMappingURL=LogOut.js.map","/** The dashboard screen: the admin app's shell, with the sign-out, and an empty page. @module */\nimport { AppShell, Inline, SidebarMenu } from '@tempoxyz/ds'\nimport { Grid as GridIcon, LogOut } from '@tempoxyz/ds/icons'\nimport type { ReactNode } from 'react'\nimport { style } from '../zyzz.config.js'\n\n/** The dashboard screen. */\nexport function Dashboard(props: Dashboard.Props): ReactNode {\n const { links } = props\n\n return (\n <AppShell.Root align=\"start\">\n <AppShell.Sidebar aria-label=\"Admin\">\n <AppShell.SidebarHeader>\n <Inline {...styles.brand()} align=\"center\" gap=\"8\">\n <TempoWordmark />\n <span {...styles.product()}>ID Admin</span>\n </Inline>\n </AppShell.SidebarHeader>\n <AppShell.SidebarBody>\n <SidebarMenu.Root>\n <SidebarMenu.Item active href={links.home}>\n <GridIcon />\n Home\n </SidebarMenu.Item>\n </SidebarMenu.Root>\n </AppShell.SidebarBody>\n <AppShell.SidebarFooter>\n <SidebarMenu.Root>\n <SidebarMenu.Item href={links.signOut}>\n <LogOut />\n Sign out\n </SidebarMenu.Item>\n </SidebarMenu.Root>\n </AppShell.SidebarFooter>\n </AppShell.Sidebar>\n <AppShell.Main>\n <AppShell.Header>\n <AppShell.Trigger />\n </AppShell.Header>\n </AppShell.Main>\n </AppShell.Root>\n )\n}\n\nexport declare namespace Dashboard {\n type Props = {\n /** The sidebar's links. */\n links: {\n /** The dashboard itself. */\n home: string\n /** The sign-out of the host's sign-in. */\n signOut: string\n }\n }\n}\n\n/** Tempo's wordmark in `currentColor`, as in the headers of Tempo's other consoles. */\nfunction TempoWordmark(): ReactNode {\n return (\n <svg\n {...styles.wordmark()}\n aria-label=\"Tempo\"\n fill=\"none\"\n role=\"img\"\n viewBox=\"0 0 107 24\"\n >\n <path\n d=\"M7.903 23.516h-6.28L7.445 5.593H0L1.624.34h20.739l-1.624 5.253h-7.046zM31.273 23.516H16.385L23.859.34h14.827l-1.409 4.419h-8.608l-1.562 4.975h8.332l-1.41 4.357h-8.362l-1.562 5.006h8.546zM38.011 23.516h-4.993L40.523.34h8.333l-.276 12.484L56.698.34h9.129l-7.475 23.176h-6.25l5.055-15.852-10.384 15.852h-3.707l.153-15.914zM72.856 4.635l-2.42 7.478h.674q2.297 0 3.829-1.081Q76.47 9.919 76.93 7.88q.398-1.761-.429-2.503-.826-.742-2.757-.742zm-6.066 18.88h-6.28L67.985.34h7.628q2.634 0 4.534.865 1.93.835 2.818 2.41.919 1.546.612 3.616-.398 2.72-2.082 4.79-1.686 2.07-4.381 3.213-2.665 1.113-5.974 1.113h-2.052zM98.546 22.033q-3.124 1.854-6.648 1.854h-.06q-3.126 0-5.27-1.39-2.114-1.422-3.033-3.833-.888-2.41-.428-5.284a16.3 16.3 0 0 1 2.665-6.674q2.082-3.06 5.207-4.883T97.658 0h.06q3.248 0 5.362 1.39 2.144 1.392 2.971 3.801.858 2.38.368 5.346-.582 3.492-2.665 6.582a16.3 16.3 0 0 1-5.208 4.914m-8.67-3.987q.828 1.576 2.88 1.576h.061q1.686 0 3.125-1.267 1.47-1.297 2.481-3.46 1.042-2.164 1.532-4.821.46-2.595-.368-4.172-.826-1.607-2.849-1.607h-.06q-1.563 0-3.034 1.298-1.44 1.298-2.511 3.492a18.8 18.8 0 0 0-1.563 4.759q-.49 2.595.307 4.202\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nnamespace styles {\n // The sidebar menu's items pad their icons by 12, so the wordmark starts in line with them.\n export const brand = style({ paddingInlineStart: '12' })\n\n export const product = style({ color: 'gray.900', typography: 'label.14' })\n\n // The wordmark keeps its aspect ratio at the height of the label beside it.\n export const wordmark = style({ height: '16', width: 'auto !custom' })\n}\n","/** The dashboard: a placeholder, with the sign-out of the host's sign-in. @module */\nimport { createFileRoute } from '@tanstack/react-router'\nimport { parseResponse } from 'hono/client'\nimport * as Client from '../lib/Client.js'\nimport { Dashboard } from '../screens/Dashboard.js'\n\nexport const Route = createFileRoute('/')({\n component: () => <Dashboard {...Route.useLoaderData()} />,\n /** Returns the sidebar's links, with the sign-out of the deployment's sign-in. */\n loader: async (): Promise<Dashboard.Props> => {\n const session = await parseResponse(Client.create().i.session.$get())\n return {\n links: {\n home: '/',\n // A preview signs in with an emailed code, and the admin host through Cloudflare Access.\n signOut: session.login ? '/_dev/logout' : '/cdn-cgi/access/logout',\n },\n }\n },\n})\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67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